summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorRitesh Harjani <riteshh@linux.ibm.com>2022-03-12 08:39:48 +0300
committerTheodore Ts'o <tytso@mit.edu>2022-03-13 05:26:08 +0300
commit8cb5a30372ef5cf2b1d258fce1711d80f834740a (patch)
treea053b31c2d7fd23415302bb38c806e082227f98e /include/trace
parent7af1974af0a9ba8a8ed2e3e947d87dd4d9a78d27 (diff)
downloadlinux-8cb5a30372ef5cf2b1d258fce1711d80f834740a.tar.xz
ext4: convert ext4_fc_track_dentry type events to use event class
One should use DECLARE_EVENT_CLASS for similar event types instead of defining TRACE_EVENT for each event type. This is helpful in reducing the text section footprint for e.g. [1] [1]: https://lwn.net/Articles/381064/ Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com> Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/a019cb46219ef4b30e4d98d7ced7d8819a2fc61d.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/ext4.h56
1 files changed, 31 insertions, 25 deletions
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 1a0b7030f72a..3d48fcb62987 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -2780,33 +2780,39 @@ TRACE_EVENT(ext4_fc_stats,
__entry->fc_numblks)
);
-#define DEFINE_TRACE_DENTRY_EVENT(__type) \
- TRACE_EVENT(ext4_fc_track_##__type, \
- TP_PROTO(struct inode *inode, struct dentry *dentry, int ret), \
- \
- TP_ARGS(inode, dentry, ret), \
- \
- TP_STRUCT__entry( \
- __field(dev_t, dev) \
- __field(int, ino) \
- __field(int, error) \
- ), \
- \
- TP_fast_assign( \
- __entry->dev = inode->i_sb->s_dev; \
- __entry->ino = inode->i_ino; \
- __entry->error = ret; \
- ), \
- \
- TP_printk("dev %d:%d, inode %d, error %d, fc_%s", \
- MAJOR(__entry->dev), MINOR(__entry->dev), \
- __entry->ino, __entry->error, \
- #__type) \
+DECLARE_EVENT_CLASS(ext4_fc_track_dentry,
+
+ TP_PROTO(struct inode *inode, struct dentry *dentry, int ret),
+
+ TP_ARGS(inode, dentry, ret),
+
+ TP_STRUCT__entry(
+ __field(dev_t, dev)
+ __field(ino_t, i_ino)
+ __field(int, error)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = inode->i_sb->s_dev;
+ __entry->i_ino = inode->i_ino;
+ __entry->error = ret;
+ ),
+
+ TP_printk("dev %d,%d, ino %lu, error %d",
+ MAJOR(__entry->dev), MINOR(__entry->dev),
+ __entry->i_ino, __entry->error
)
+);
+
+#define DEFINE_EVENT_CLASS_DENTRY(__type) \
+DEFINE_EVENT(ext4_fc_track_dentry, ext4_fc_track_##__type, \
+ TP_PROTO(struct inode *inode, struct dentry *dentry, int ret), \
+ TP_ARGS(inode, dentry, ret) \
+)
-DEFINE_TRACE_DENTRY_EVENT(create);
-DEFINE_TRACE_DENTRY_EVENT(link);
-DEFINE_TRACE_DENTRY_EVENT(unlink);
+DEFINE_EVENT_CLASS_DENTRY(create);
+DEFINE_EVENT_CLASS_DENTRY(link);
+DEFINE_EVENT_CLASS_DENTRY(unlink);
TRACE_EVENT(ext4_fc_track_inode,
TP_PROTO(struct inode *inode, int ret),