diff options
author | Jeff Layton <jeff.layton@primarydata.com> | 2015-09-21 07:26:45 -0400 |
---|---|---|
committer | Jeff Layton <jeff.layton@primarydata.com> | 2015-09-21 07:26:45 -0400 |
commit | d11797a0a7acc1fe6a51b1605e166adad04da29b (patch) | |
tree | 403c9a283e09f5e6c3765f2f521b5078f531cac7 /include/trace | |
parent | 1f93e4a96c9109378204c147b3eec0d0e8100fde (diff) |
locks: change tracepoint for generic_add_lease
Add some more helpful info to make it easier to determine why a lease
wasn't granted.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/filelock.h | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/include/trace/events/filelock.h b/include/trace/events/filelock.h index a0d008070962..c72f2dc01d0b 100644 --- a/include/trace/events/filelock.h +++ b/include/trace/events/filelock.h | |||
@@ -81,15 +81,47 @@ DEFINE_EVENT(filelock_lease, break_lease_block, TP_PROTO(struct inode *inode, st | |||
81 | DEFINE_EVENT(filelock_lease, break_lease_unblock, TP_PROTO(struct inode *inode, struct file_lock *fl), | 81 | DEFINE_EVENT(filelock_lease, break_lease_unblock, TP_PROTO(struct inode *inode, struct file_lock *fl), |
82 | TP_ARGS(inode, fl)); | 82 | TP_ARGS(inode, fl)); |
83 | 83 | ||
84 | DEFINE_EVENT(filelock_lease, generic_add_lease, TP_PROTO(struct inode *inode, struct file_lock *fl), | ||
85 | TP_ARGS(inode, fl)); | ||
86 | |||
87 | DEFINE_EVENT(filelock_lease, generic_delete_lease, TP_PROTO(struct inode *inode, struct file_lock *fl), | 84 | DEFINE_EVENT(filelock_lease, generic_delete_lease, TP_PROTO(struct inode *inode, struct file_lock *fl), |
88 | TP_ARGS(inode, fl)); | 85 | TP_ARGS(inode, fl)); |
89 | 86 | ||
90 | DEFINE_EVENT(filelock_lease, time_out_leases, TP_PROTO(struct inode *inode, struct file_lock *fl), | 87 | DEFINE_EVENT(filelock_lease, time_out_leases, TP_PROTO(struct inode *inode, struct file_lock *fl), |
91 | TP_ARGS(inode, fl)); | 88 | TP_ARGS(inode, fl)); |
92 | 89 | ||
90 | TRACE_EVENT(generic_add_lease, | ||
91 | TP_PROTO(struct inode *inode, struct file_lock *fl), | ||
92 | |||
93 | TP_ARGS(inode, fl), | ||
94 | |||
95 | TP_STRUCT__entry( | ||
96 | __field(unsigned long, i_ino) | ||
97 | __field(int, wcount) | ||
98 | __field(int, dcount) | ||
99 | __field(int, icount) | ||
100 | __field(dev_t, s_dev) | ||
101 | __field(fl_owner_t, fl_owner) | ||
102 | __field(unsigned int, fl_flags) | ||
103 | __field(unsigned char, fl_type) | ||
104 | ), | ||
105 | |||
106 | TP_fast_assign( | ||
107 | __entry->s_dev = inode->i_sb->s_dev; | ||
108 | __entry->i_ino = inode->i_ino; | ||
109 | __entry->wcount = atomic_read(&inode->i_writecount); | ||
110 | __entry->dcount = d_count(fl->fl_file->f_path.dentry); | ||
111 | __entry->icount = atomic_read(&inode->i_count); | ||
112 | __entry->fl_owner = fl ? fl->fl_owner : NULL; | ||
113 | __entry->fl_flags = fl ? fl->fl_flags : 0; | ||
114 | __entry->fl_type = fl ? fl->fl_type : 0; | ||
115 | ), | ||
116 | |||
117 | TP_printk("dev=0x%x:0x%x ino=0x%lx wcount=%d dcount=%d icount=%d fl_owner=0x%p fl_flags=%s fl_type=%s", | ||
118 | MAJOR(__entry->s_dev), MINOR(__entry->s_dev), | ||
119 | __entry->i_ino, __entry->wcount, __entry->dcount, | ||
120 | __entry->icount, __entry->fl_owner, | ||
121 | show_fl_flags(__entry->fl_flags), | ||
122 | show_fl_type(__entry->fl_type)) | ||
123 | ); | ||
124 | |||
93 | #endif /* _TRACE_FILELOCK_H */ | 125 | #endif /* _TRACE_FILELOCK_H */ |
94 | 126 | ||
95 | /* This part must be outside protection */ | 127 | /* This part must be outside protection */ |