diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-13 11:34:01 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-22 08:58:25 -0400 |
commit | 1f2d30b5338f1adaac249707ae49f1c675049cfc (patch) | |
tree | 555e65b82ab63749d19bf05d552262146094e1ab /fs/nfs/nfs4trace.h | |
parent | ca8acf8d84029b395ade8d4562dae2108bb00c17 (diff) | |
download | linux-1f2d30b5338f1adaac249707ae49f1c675049cfc.tar.gz linux-1f2d30b5338f1adaac249707ae49f1c675049cfc.tar.bz2 linux-1f2d30b5338f1adaac249707ae49f1c675049cfc.zip |
NFSv4: Add tracepoints for debugging the idmapper
Add tracepoints to help debug uid/gid mappings to username/group.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4trace.h')
-rw-r--r-- | fs/nfs/nfs4trace.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index 900f233ee4dc..f58edcf418bf 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -627,6 +627,52 @@ DEFINE_NFS4_INODE_EVENT(nfs4_set_security_label); DEFINE_NFS4_INODE_EVENT(nfs4_recall_delegation); DEFINE_NFS4_INODE_EVENT(nfs4_delegreturn); +DECLARE_EVENT_CLASS(nfs4_idmap_event, + TP_PROTO( + const char *name, + int len, + u32 id, + int error + ), + + TP_ARGS(name, len, id, error), + + TP_STRUCT__entry( + __field(int, error) + __field(u32, id) + __dynamic_array(char, name, len > 0 ? len + 1 : 1) + ), + + TP_fast_assign( + if (len < 0) + len = 0; + __entry->error = error < 0 ? error : 0; + __entry->id = id; + memcpy(__get_dynamic_array(name), name, len); + ((char *)__get_dynamic_array(name))[len] = 0; + ), + + TP_printk( + "error=%d id=%u name=%s", + __entry->error, + __entry->id, + __get_str(name) + ) +); +#define DEFINE_NFS4_IDMAP_EVENT(name) \ + DEFINE_EVENT(nfs4_idmap_event, name, \ + TP_PROTO( \ + const char *name, \ + int len, \ + u32 id, \ + int error \ + ), \ + TP_ARGS(name, len, id, error)) +DEFINE_NFS4_IDMAP_EVENT(nfs4_map_name_to_uid); +DEFINE_NFS4_IDMAP_EVENT(nfs4_map_group_to_gid); +DEFINE_NFS4_IDMAP_EVENT(nfs4_map_uid_to_name); +DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group); + #endif /* _TRACE_NFS4_H */ #undef TRACE_INCLUDE_PATH |