aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2018-01-18 14:55:01 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2018-01-18 15:01:22 -0500
commit06e1902456f3d0e45c3e64b75124339d67c83e5b (patch)
treea20c7df4af2f0459b17031d5071c0de825c07abc
parent7ff4cff637aa0bd2abbd81f53b2a6206c50afd95 (diff)
nfs: Use proper enum definitions for nfs_show_stable
Commit 8224b2734ab1 ("NFS: Add static NFS I/O tracepoints") had a hack to work around some odd behavior observed with __print_symbolic. I couldn't ever get it to display NFS_FILE_SYNC when using TRACE_DEFINE_ENUM macros to set up the enum values. I tracked down the actual bug that forced me to add the workaround. That issue will be addressed soon, so replace the hack with a proper implementation. Fixes: 8224b2734ab1 ("NFS: Add static NFS I/O tracepoints") Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r--fs/nfs/nfstrace.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/nfs/nfstrace.h b/fs/nfs/nfstrace.h
index 093290c42d7c..c6dbd48896a1 100644
--- a/fs/nfs/nfstrace.h
+++ b/fs/nfs/nfstrace.h
@@ -796,15 +796,15 @@ TRACE_EVENT(nfs_readpage_done,
796 ) 796 )
797); 797);
798 798
799/* 799TRACE_DEFINE_ENUM(NFS_UNSTABLE);
800 * XXX: I tried using NFS_UNSTABLE and friends in this table, but they 800TRACE_DEFINE_ENUM(NFS_DATA_SYNC);
801 * all evaluate to 0 for some reason, even if I include linux/nfs.h. 801TRACE_DEFINE_ENUM(NFS_FILE_SYNC);
802 */ 802
803#define nfs_show_stable(stable) \ 803#define nfs_show_stable(stable) \
804 __print_symbolic(stable, \ 804 __print_symbolic(stable, \
805 { 0, " (UNSTABLE)" }, \ 805 { NFS_UNSTABLE, "UNSTABLE" }, \
806 { 1, " (DATA_SYNC)" }, \ 806 { NFS_DATA_SYNC, "DATA_SYNC" }, \
807 { 2, " (FILE_SYNC)" }) 807 { NFS_FILE_SYNC, "FILE_SYNC" })
808 808
809TRACE_EVENT(nfs_initiate_write, 809TRACE_EVENT(nfs_initiate_write,
810 TP_PROTO( 810 TP_PROTO(
@@ -837,12 +837,12 @@ TRACE_EVENT(nfs_initiate_write,
837 837
838 TP_printk( 838 TP_printk(
839 "fileid=%02x:%02x:%llu fhandle=0x%08x " 839 "fileid=%02x:%02x:%llu fhandle=0x%08x "
840 "offset=%lld count=%lu stable=%d%s", 840 "offset=%lld count=%lu stable=%s",
841 MAJOR(__entry->dev), MINOR(__entry->dev), 841 MAJOR(__entry->dev), MINOR(__entry->dev),
842 (unsigned long long)__entry->fileid, 842 (unsigned long long)__entry->fileid,
843 __entry->fhandle, 843 __entry->fhandle,
844 __entry->offset, __entry->count, 844 __entry->offset, __entry->count,
845 __entry->stable, nfs_show_stable(__entry->stable) 845 nfs_show_stable(__entry->stable)
846 ) 846 )
847); 847);
848 848
@@ -881,13 +881,13 @@ TRACE_EVENT(nfs_writeback_done,
881 881
882 TP_printk( 882 TP_printk(
883 "fileid=%02x:%02x:%llu fhandle=0x%08x " 883 "fileid=%02x:%02x:%llu fhandle=0x%08x "
884 "offset=%lld status=%d stable=%d%s " 884 "offset=%lld status=%d stable=%s "
885 "verifier 0x%016llx", 885 "verifier 0x%016llx",
886 MAJOR(__entry->dev), MINOR(__entry->dev), 886 MAJOR(__entry->dev), MINOR(__entry->dev),
887 (unsigned long long)__entry->fileid, 887 (unsigned long long)__entry->fileid,
888 __entry->fhandle, 888 __entry->fhandle,
889 __entry->offset, __entry->status, 889 __entry->offset, __entry->status,
890 __entry->stable, nfs_show_stable(__entry->stable), 890 nfs_show_stable(__entry->stable),
891 __entry->verifier 891 __entry->verifier
892 ) 892 )
893); 893);