aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4trace.h
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-12 16:35:20 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-22 08:58:22 -0400
commitd1b748a5e71106481015e36ce327747b075bcbdc (patch)
treea2f27548947f369ebd60afcb0a57b52bae1863d0 /fs/nfs/nfs4trace.h
parent42113a75399353d87baf63956ab8f450958f1c8f (diff)
NFSv4: Add tracepoints for debugging file locking
Set up basic tracepoints for debugging NFSv4 file lock/unlock Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4trace.h')
-rw-r--r--fs/nfs/nfs4trace.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
index a558dc9c7c52..3f124dbcd60a 100644
--- a/fs/nfs/nfs4trace.h
+++ b/fs/nfs/nfs4trace.h
@@ -336,6 +336,81 @@ TRACE_EVENT(nfs4_close,
336 ) 336 )
337); 337);
338 338
339#define show_lock_cmd(type) \
340 __print_symbolic((int)type, \
341 { F_GETLK, "GETLK" }, \
342 { F_SETLK, "SETLK" }, \
343 { F_SETLKW, "SETLKW" })
344#define show_lock_type(type) \
345 __print_symbolic((int)type, \
346 { F_RDLCK, "RDLCK" }, \
347 { F_WRLCK, "WRLCK" }, \
348 { F_UNLCK, "UNLCK" })
349
350DECLARE_EVENT_CLASS(nfs4_lock_event,
351 TP_PROTO(
352 const struct file_lock *request,
353 const struct nfs4_state *state,
354 int cmd,
355 int error
356 ),
357
358 TP_ARGS(request, state, cmd, error),
359
360 TP_STRUCT__entry(
361 __field(int, error)
362 __field(int, cmd)
363 __field(char, type)
364 __field(loff_t, start)
365 __field(loff_t, end)
366 __field(dev_t, dev)
367 __field(u32, fhandle)
368 __field(u64, fileid)
369 ),
370
371 TP_fast_assign(
372 const struct inode *inode = state->inode;
373
374 __entry->error = error;
375 __entry->cmd = cmd;
376 __entry->type = request->fl_type;
377 __entry->start = request->fl_start;
378 __entry->end = request->fl_end;
379 __entry->dev = inode->i_sb->s_dev;
380 __entry->fileid = NFS_FILEID(inode);
381 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
382 ),
383
384 TP_printk(
385 "error=%d (%s) cmd=%s:%s range=%lld:%lld "
386 "fileid=%02x:%02x:%llu fhandle=0x%08x",
387 __entry->error,
388 show_nfsv4_errors(__entry->error),
389 show_lock_cmd(__entry->cmd),
390 show_lock_type(__entry->type),
391 (long long)__entry->start,
392 (long long)__entry->end,
393 MAJOR(__entry->dev), MINOR(__entry->dev),
394 (unsigned long long)__entry->fileid,
395 __entry->fhandle
396 )
397);
398
399#define DEFINE_NFS4_LOCK_EVENT(name) \
400 DEFINE_EVENT(nfs4_lock_event, name, \
401 TP_PROTO( \
402 const struct file_lock *request, \
403 const struct nfs4_state *state, \
404 int cmd, \
405 int error \
406 ), \
407 TP_ARGS(request, state, cmd, error))
408DEFINE_NFS4_LOCK_EVENT(nfs4_get_lock);
409DEFINE_NFS4_LOCK_EVENT(nfs4_set_lock);
410DEFINE_NFS4_LOCK_EVENT(nfs4_lock_reclaim);
411DEFINE_NFS4_LOCK_EVENT(nfs4_lock_expired);
412DEFINE_NFS4_LOCK_EVENT(nfs4_unlock);
413
339#endif /* _TRACE_NFS4_H */ 414#endif /* _TRACE_NFS4_H */
340 415
341#undef TRACE_INCLUDE_PATH 416#undef TRACE_INCLUDE_PATH