linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nfs-utils PATCH] Allow gssd and svcgssd to set the libtirpc debug level
@ 2015-09-29 15:36 Scott Mayhew
  2015-11-04 21:48 ` Steve Dickson
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Mayhew @ 2015-09-29 15:36 UTC (permalink / raw)
  To: steved; +Cc: linux-nfs

The interface for controlling the debug level in libtirpc was added
over a year ago, but nothing's taking advantage of it.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 aclocal/libtirpc.m4  | 6 ++++++
 utils/gssd/gssd.c    | 7 +++++++
 utils/gssd/svcgssd.c | 7 +++++++
 3 files changed, 20 insertions(+)

diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
index b7de636..27368ff 100644
--- a/aclocal/libtirpc.m4
+++ b/aclocal/libtirpc.m4
@@ -20,6 +20,12 @@ AC_DEFUN([AC_LIBTIRPC], [
                                     [Define to 1 if your rpcsec library provides authgss_free_private_data])],,
                          [${LIBS}])])
 
+     AS_IF([test -n "${LIBTIRPC}"],
+           [AC_CHECK_LIB([tirpc], [libtirpc_set_debug],
+                         [AC_DEFINE([HAVE_LIBTIRPC_SET_DEBUG], [1],
+                                    [Define to 1 if your tirpc library provides libtirpc_set_debug])],,
+                         [${LIBS}])])
+
   AC_SUBST([AM_CPPFLAGS])
   AC_SUBST(LIBTIRPC)
 
diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
index e480349..078e558 100644
--- a/utils/gssd/gssd.c
+++ b/utils/gssd/gssd.c
@@ -869,6 +869,13 @@ main(int argc, char *argv[])
 	if (verbosity && rpc_verbosity == 0)
 		rpc_verbosity = verbosity;
 	authgss_set_debug_level(rpc_verbosity);
+#elif HAVE_LIBTIRPC_SET_DEBUG
+	/*
+	 * Only set the libtirpc debug level if explicitly requested via -r...
+	 * gssd is chatty enough as it is.
+	 */
+	if (rpc_verbosity > 0)
+		libtirpc_set_debug(progname, rpc_verbosity, fg);
 #else
         if (rpc_verbosity > 0)
 		printerr(0, "Warning: rpcsec_gss library does not "
diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c
index f1b4347..0fe7c6d 100644
--- a/utils/gssd/svcgssd.c
+++ b/utils/gssd/svcgssd.c
@@ -135,6 +135,13 @@ main(int argc, char *argv[])
 	if (verbosity && rpc_verbosity == 0)
 		rpc_verbosity = verbosity;
 	authgss_set_debug_level(rpc_verbosity);
+#elif HAVE_LIBTIRPC_SET_DEBUG
+        /*
+	 * Only set the libtirpc debug level if explicitly requested via -r...
+	 * svcgssd is chatty enough as it is.
+	 */
+        if (rpc_verbosity > 0)
+                libtirpc_set_debug(progname, rpc_verbosity, fg);
 #else
 	if (rpc_verbosity > 0)
 		printerr(0, "Warning: rpcsec_gss library does not "
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [nfs-utils PATCH] Allow gssd and svcgssd to set the libtirpc debug level
  2015-09-29 15:36 [nfs-utils PATCH] Allow gssd and svcgssd to set the libtirpc debug level Scott Mayhew
@ 2015-11-04 21:48 ` Steve Dickson
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2015-11-04 21:48 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: linux-nfs



On 09/29/2015 11:36 AM, Scott Mayhew wrote:
> The interface for controlling the debug level in libtirpc was added
> over a year ago, but nothing's taking advantage of it.
> 
> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Committed.. after fixing a warning...

steved.

> ---
>  aclocal/libtirpc.m4  | 6 ++++++
>  utils/gssd/gssd.c    | 7 +++++++
>  utils/gssd/svcgssd.c | 7 +++++++
>  3 files changed, 20 insertions(+)
> 
> diff --git a/aclocal/libtirpc.m4 b/aclocal/libtirpc.m4
> index b7de636..27368ff 100644
> --- a/aclocal/libtirpc.m4
> +++ b/aclocal/libtirpc.m4
> @@ -20,6 +20,12 @@ AC_DEFUN([AC_LIBTIRPC], [
>                                      [Define to 1 if your rpcsec library provides authgss_free_private_data])],,
>                           [${LIBS}])])
>  
> +     AS_IF([test -n "${LIBTIRPC}"],
> +           [AC_CHECK_LIB([tirpc], [libtirpc_set_debug],
> +                         [AC_DEFINE([HAVE_LIBTIRPC_SET_DEBUG], [1],
> +                                    [Define to 1 if your tirpc library provides libtirpc_set_debug])],,
> +                         [${LIBS}])])
> +
>    AC_SUBST([AM_CPPFLAGS])
>    AC_SUBST(LIBTIRPC)
>  
> diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
> index e480349..078e558 100644
> --- a/utils/gssd/gssd.c
> +++ b/utils/gssd/gssd.c
> @@ -869,6 +869,13 @@ main(int argc, char *argv[])
>  	if (verbosity && rpc_verbosity == 0)
>  		rpc_verbosity = verbosity;
>  	authgss_set_debug_level(rpc_verbosity);
> +#elif HAVE_LIBTIRPC_SET_DEBUG
> +	/*
> +	 * Only set the libtirpc debug level if explicitly requested via -r...
> +	 * gssd is chatty enough as it is.
> +	 */
> +	if (rpc_verbosity > 0)
> +		libtirpc_set_debug(progname, rpc_verbosity, fg);
>  #else
>          if (rpc_verbosity > 0)
>  		printerr(0, "Warning: rpcsec_gss library does not "
> diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c
> index f1b4347..0fe7c6d 100644
> --- a/utils/gssd/svcgssd.c
> +++ b/utils/gssd/svcgssd.c
> @@ -135,6 +135,13 @@ main(int argc, char *argv[])
>  	if (verbosity && rpc_verbosity == 0)
>  		rpc_verbosity = verbosity;
>  	authgss_set_debug_level(rpc_verbosity);
> +#elif HAVE_LIBTIRPC_SET_DEBUG
> +        /*
> +	 * Only set the libtirpc debug level if explicitly requested via -r...
> +	 * svcgssd is chatty enough as it is.
> +	 */
> +        if (rpc_verbosity > 0)
> +                libtirpc_set_debug(progname, rpc_verbosity, fg);
>  #else
>  	if (rpc_verbosity > 0)
>  		printerr(0, "Warning: rpcsec_gss library does not "
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-04 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-29 15:36 [nfs-utils PATCH] Allow gssd and svcgssd to set the libtirpc debug level Scott Mayhew
2015-11-04 21:48 ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).