Linux NFS development
 help / color / mirror / Atom feed
* odd TRACE_DEFINE_ENUM behavior
@ 2018-01-04 16:13 Chuck Lever
  2018-01-04 18:08 ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: Chuck Lever @ 2018-01-04 16:13 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linux NFS Mailing List

Hi Steven-

In commit 8224b2734ab1 ("NFS: Add static NFS I/O tracepoints") I added
nfs_show_stable to symbolically display the value of the NFS WRITE stable
field. However, I couldn't get the thing to work with the already-defined
enums in linux/nfs.h, and had to resort to coding numeric constants:

799 /*
800  * XXX: I tried using NFS_UNSTABLE and friends in this table, but they
801  * all evaluate to 0 for some reason, even if I include linux/nfs.h.
802  */
803 #define nfs_show_stable(stable) \
804         __print_symbolic(stable, \
805                         { 0, " (UNSTABLE)" }, \
806                         { 1, " (DATA_SYNC)" }, \
807                         { 2, " (FILE_SYNC)" })

If I code this macro the way the others are written, ie:

TRACE_DEFINE_ENUM(NFS_UNSTABLE);
TRACE_DEFINE_ENUM(NFS_DATA_SYNC);
TRACE_DEFINE_ENUM(NFS_FILE_SYNC);

#define nfs_show_stable(stable) \
	__print_symbolic(stable, \
			{ NFS_UNSTABLE, " (UNSTABLE)" }, \
			{ NFS_DATA_SYNC, " (DATA_SYNC)" }, \
			{ NFS_FILE_SYNC, " (FILE_SYNC)" })

When the field contains 0 it displays "(UNSTABLE)", and when the field
contains a non-zero value the displayed symbol is blank.

More recently I observed a similar issue when adding static trace points
in net/sunrpc/xprtrdma/ , and with existing __print_symbolic call sites
in sunrpc.ko.

There is no file /sys/kernel/debug/tracing/enum_map on my system.

Am I missing something?


--
Chuck Lever




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

end of thread, other threads:[~2018-01-18 19:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-04 16:13 odd TRACE_DEFINE_ENUM behavior Chuck Lever
2018-01-04 18:08 ` Steven Rostedt
2018-01-04 19:10   ` Chuck Lever
2018-01-04 19:36     ` Steven Rostedt
2018-01-04 19:39       ` Chuck Lever
2018-01-04 20:05         ` Chuck Lever
2018-01-09 22:35       ` Chuck Lever
2018-01-17 21:13         ` Chuck Lever
2018-01-18  3:01           ` Steven Rostedt
2018-01-18 19:29             ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox