diff mbox series

lockd: fix tracepoint status name definitions when CONFIG_LOCKD_V4 isn't defined

Message ID 20230310153238.77446-1-jlayton@kernel.org (mailing list archive)
State New, archived
Headers show
Series lockd: fix tracepoint status name definitions when CONFIG_LOCKD_V4 isn't defined | expand

Commit Message

Jeff Layton March 10, 2023, 3:32 p.m. UTC
There is probably a better way to do this that doesn't repeat anything.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202303071503.shUSoIpC-lkp@intel.com/
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/lockd/trace.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

Chuck, I'm fine if you want to just fold this into the original
tracepoint patch too. Also, let me know if you see a way to express this
better.

Comments

Chuck Lever March 10, 2023, 3:41 p.m. UTC | #1
> On Mar 10, 2023, at 10:32 AM, Jeff Layton <jlayton@kernel.org> wrote:
> 
> There is probably a better way to do this that doesn't repeat anything.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/oe-kbuild-all/202303071503.shUSoIpC-lkp@intel.com/
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> fs/lockd/trace.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
> 
> Chuck, I'm fine if you want to just fold this into the original
> tracepoint patch too. Also, let me know if you see a way to express this
> better.

Interesting, I have the lockd tracepoint patch in nfsd-next, and
haven't heard a peep from the bots.

I'll fold something in.


> diff --git a/fs/lockd/trace.h b/fs/lockd/trace.h
> index 3e84e3efaf22..11f1381b566c 100644
> --- a/fs/lockd/trace.h
> +++ b/fs/lockd/trace.h
> @@ -10,6 +10,7 @@
> #include <linux/nfs.h>
> #include <linux/lockd/lockd.h>

Btw, here I think TRACE_DEFINE_ENUMs will be needed. I can confirm
that, and add if necessary.


> +#ifdef CONFIG_LOCKD_V4
> #define show_nlm_status(val)							\
> 	__print_symbolic(val,							\
> 		{ NLM_LCK_GRANTED,		"LCK_GRANTED" },		\
> @@ -22,6 +23,15 @@
> 		{ NLM_STALE_FH,			"STALE_FH" },			\
> 		{ NLM_FBIG,			"FBIG" },			\
> 		{ NLM_FAILED,			"FAILED" })
> +#else
> +#define show_nlm_status(val)							\
> +	__print_symbolic(val,							\
> +		{ NLM_LCK_GRANTED,		"LCK_GRANTED" },		\
> +		{ NLM_LCK_DENIED,		"LCK_DENIED" },			\
> +		{ NLM_LCK_DENIED_NOLOCKS,	"LCK_DENIED_NOLOCKS" },		\
> +		{ NLM_LCK_BLOCKED,		"LCK_BLOCKED" },		\
> +		{ NLM_LCK_DENIED_GRACE_PERIOD,	"LCK_DENIED_GRACE_PERIOD" })
> +#endif
> 
> DECLARE_EVENT_CLASS(nlmclnt_lock_event,
> 		TP_PROTO(
> -- 
> 2.39.2
> 

--
Chuck Lever
diff mbox series

Patch

diff --git a/fs/lockd/trace.h b/fs/lockd/trace.h
index 3e84e3efaf22..11f1381b566c 100644
--- a/fs/lockd/trace.h
+++ b/fs/lockd/trace.h
@@ -10,6 +10,7 @@ 
 #include <linux/nfs.h>
 #include <linux/lockd/lockd.h>
 
+#ifdef CONFIG_LOCKD_V4
 #define show_nlm_status(val)							\
 	__print_symbolic(val,							\
 		{ NLM_LCK_GRANTED,		"LCK_GRANTED" },		\
@@ -22,6 +23,15 @@ 
 		{ NLM_STALE_FH,			"STALE_FH" },			\
 		{ NLM_FBIG,			"FBIG" },			\
 		{ NLM_FAILED,			"FAILED" })
+#else
+#define show_nlm_status(val)							\
+	__print_symbolic(val,							\
+		{ NLM_LCK_GRANTED,		"LCK_GRANTED" },		\
+		{ NLM_LCK_DENIED,		"LCK_DENIED" },			\
+		{ NLM_LCK_DENIED_NOLOCKS,	"LCK_DENIED_NOLOCKS" },		\
+		{ NLM_LCK_BLOCKED,		"LCK_BLOCKED" },		\
+		{ NLM_LCK_DENIED_GRACE_PERIOD,	"LCK_DENIED_GRACE_PERIOD" })
+#endif
 
 DECLARE_EVENT_CLASS(nlmclnt_lock_event,
 		TP_PROTO(