Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / trace / events / hugetlbfs.h
blob8331c904a9ba871ecc159925c4ddea38dc0fa2d4
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM hugetlbfs
5 #if !defined(_TRACE_HUGETLBFS_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_HUGETLBFS_H
8 #include <linux/tracepoint.h>
10 TRACE_EVENT(hugetlbfs_alloc_inode,
12 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
14 TP_ARGS(inode, dir, mode),
16 TP_STRUCT__entry(
17 __field(dev_t, dev)
18 __field(ino_t, ino)
19 __field(ino_t, dir)
20 __field(__u16, mode)
23 TP_fast_assign(
24 __entry->dev = inode->i_sb->s_dev;
25 __entry->ino = inode->i_ino;
26 __entry->dir = dir->i_ino;
27 __entry->mode = mode;
30 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
31 MAJOR(__entry->dev), MINOR(__entry->dev),
32 (unsigned long) __entry->ino,
33 (unsigned long) __entry->dir, __entry->mode)
36 DECLARE_EVENT_CLASS(hugetlbfs__inode,
38 TP_PROTO(struct inode *inode),
40 TP_ARGS(inode),
42 TP_STRUCT__entry(
43 __field(dev_t, dev)
44 __field(ino_t, ino)
45 __field(__u16, mode)
46 __field(loff_t, size)
47 __field(unsigned int, nlink)
48 __field(unsigned int, seals)
49 __field(blkcnt_t, blocks)
52 TP_fast_assign(
53 __entry->dev = inode->i_sb->s_dev;
54 __entry->ino = inode->i_ino;
55 __entry->mode = inode->i_mode;
56 __entry->size = inode->i_size;
57 __entry->nlink = inode->i_nlink;
58 __entry->seals = HUGETLBFS_I(inode)->seals;
59 __entry->blocks = inode->i_blocks;
62 TP_printk("dev %d,%d ino %lu mode 0%o size %lld nlink %u seals %u blocks %llu",
63 MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long) __entry->ino,
64 __entry->mode, __entry->size, __entry->nlink, __entry->seals,
65 (unsigned long long)__entry->blocks)
68 DEFINE_EVENT(hugetlbfs__inode, hugetlbfs_evict_inode,
70 TP_PROTO(struct inode *inode),
72 TP_ARGS(inode)
75 DEFINE_EVENT(hugetlbfs__inode, hugetlbfs_free_inode,
77 TP_PROTO(struct inode *inode),
79 TP_ARGS(inode)
82 TRACE_EVENT(hugetlbfs_setattr,
84 TP_PROTO(struct inode *inode, struct dentry *dentry,
85 struct iattr *attr),
87 TP_ARGS(inode, dentry, attr),
89 TP_STRUCT__entry(
90 __field(dev_t, dev)
91 __field(ino_t, ino)
92 __field(unsigned int, d_len)
93 __string(d_name, dentry->d_name.name)
94 __field(unsigned int, ia_valid)
95 __field(unsigned int, ia_mode)
96 __field(loff_t, old_size)
97 __field(loff_t, ia_size)
100 TP_fast_assign(
101 __entry->dev = inode->i_sb->s_dev;
102 __entry->ino = inode->i_ino;
103 __entry->d_len = dentry->d_name.len;
104 __assign_str(d_name);
105 __entry->ia_valid = attr->ia_valid;
106 __entry->ia_mode = attr->ia_mode;
107 __entry->old_size = inode->i_size;
108 __entry->ia_size = attr->ia_size;
111 TP_printk("dev %d,%d ino %lu name %.*s valid %#x mode 0%o old_size %lld size %lld",
112 MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long)__entry->ino,
113 __entry->d_len, __get_str(d_name), __entry->ia_valid, __entry->ia_mode,
114 __entry->old_size, __entry->ia_size)
117 TRACE_EVENT(hugetlbfs_fallocate,
119 TP_PROTO(struct inode *inode, int mode,
120 loff_t offset, loff_t len, int ret),
122 TP_ARGS(inode, mode, offset, len, ret),
124 TP_STRUCT__entry(
125 __field(dev_t, dev)
126 __field(ino_t, ino)
127 __field(int, mode)
128 __field(loff_t, offset)
129 __field(loff_t, len)
130 __field(loff_t, size)
131 __field(int, ret)
134 TP_fast_assign(
135 __entry->dev = inode->i_sb->s_dev;
136 __entry->ino = inode->i_ino;
137 __entry->mode = mode;
138 __entry->offset = offset;
139 __entry->len = len;
140 __entry->size = inode->i_size;
141 __entry->ret = ret;
144 TP_printk("dev %d,%d ino %lu mode 0%o offset %lld len %lld size %lld ret %d",
145 MAJOR(__entry->dev), MINOR(__entry->dev),
146 (unsigned long)__entry->ino, __entry->mode,
147 (unsigned long long)__entry->offset,
148 (unsigned long long)__entry->len,
149 (unsigned long long)__entry->size,
150 __entry->ret)
153 #endif /* _TRACE_HUGETLBFS_H */
155 /* This part must be outside protection */
156 #include <trace/define_trace.h>