1 #if !defined(_TRACE_ANDROID_FS_TEMPLATE_H) || defined(TRACE_HEADER_MULTI_READ)
2 #define _TRACE_ANDROID_FS_TEMPLATE_H
4 #include <linux/tracepoint.h>
6 DECLARE_EVENT_CLASS(android_fs_data_start_template,
7 TP_PROTO(struct inode *inode, loff_t offset, int bytes,
8 pid_t pid, char *command),
9 TP_ARGS(inode, offset, bytes, pid, command),
11 __array(char, path, MAX_FILTER_STR_VAL);
12 __field(char *, pathname);
13 __field(loff_t, offset);
15 __field(loff_t, i_size);
16 __string(cmdline, command);
25 * Grab a reference to the inode here because
26 * d_obtain_alias() will either drop the inode
27 * reference if it locates an existing dentry
28 * or transfer the reference to the new dentry
29 * created. In our case, the file is still open,
30 * so the dentry is guaranteed to exist (connected),
31 * so d_obtain_alias() drops the reference we
35 d = d_obtain_alias(inode);
37 __entry->pathname = dentry_path(d,
42 __entry->pathname = ERR_PTR(-EINVAL);
43 __entry->offset = offset;
44 __entry->bytes = bytes;
45 __entry->i_size = i_size_read(inode);
46 __assign_str(cmdline, command);
48 __entry->ino = inode->i_ino;
51 TP_printk("entry_name %s, offset %llu, bytes %d, cmdline %s,"
52 " pid %d, i_size %llu, ino %lu",
53 (IS_ERR(__entry->pathname) ? "ERROR" : __entry->pathname),
54 __entry->offset, __entry->bytes, __get_str(cmdline),
55 __entry->pid, __entry->i_size,
56 (unsigned long) __entry->ino)
59 DECLARE_EVENT_CLASS(android_fs_data_end_template,
60 TP_PROTO(struct inode *inode, loff_t offset, int bytes),
61 TP_ARGS(inode, offset, bytes),
64 __field(loff_t, offset);
69 __entry->ino = inode->i_ino;
70 __entry->offset = offset;
71 __entry->bytes = bytes;
74 TP_printk("ino %lu, offset %llu, bytes %d",
75 (unsigned long) __entry->ino,
76 __entry->offset, __entry->bytes)
79 #endif /* _TRACE_ANDROID_FS_TEMPLATE_H */