xref: /linux/include/trace/events/hugetlbfs.h (revision c34e9ab9a612ee8b18273398ef75c207b01f516d)
1*318580adSHongbo Li /* SPDX-License-Identifier: GPL-2.0 */
2*318580adSHongbo Li #undef TRACE_SYSTEM
3*318580adSHongbo Li #define TRACE_SYSTEM hugetlbfs
4*318580adSHongbo Li 
5*318580adSHongbo Li #if !defined(_TRACE_HUGETLBFS_H) || defined(TRACE_HEADER_MULTI_READ)
6*318580adSHongbo Li #define _TRACE_HUGETLBFS_H
7*318580adSHongbo Li 
8*318580adSHongbo Li #include <linux/tracepoint.h>
9*318580adSHongbo Li 
10*318580adSHongbo Li TRACE_EVENT(hugetlbfs_alloc_inode,
11*318580adSHongbo Li 
12*318580adSHongbo Li 	TP_PROTO(struct inode *inode, struct inode *dir, int mode),
13*318580adSHongbo Li 
14*318580adSHongbo Li 	TP_ARGS(inode, dir, mode),
15*318580adSHongbo Li 
16*318580adSHongbo Li 	TP_STRUCT__entry(
17*318580adSHongbo Li 		__field(dev_t,		dev)
18*318580adSHongbo Li 		__field(ino_t,		ino)
19*318580adSHongbo Li 		__field(ino_t,		dir)
20*318580adSHongbo Li 		__field(__u16,		mode)
21*318580adSHongbo Li 	),
22*318580adSHongbo Li 
23*318580adSHongbo Li 	TP_fast_assign(
24*318580adSHongbo Li 		__entry->dev		= inode->i_sb->s_dev;
25*318580adSHongbo Li 		__entry->ino		= inode->i_ino;
26*318580adSHongbo Li 		__entry->dir		= dir->i_ino;
27*318580adSHongbo Li 		__entry->mode		= mode;
28*318580adSHongbo Li 	),
29*318580adSHongbo Li 
30*318580adSHongbo Li 	TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
31*318580adSHongbo Li 		MAJOR(__entry->dev), MINOR(__entry->dev),
32*318580adSHongbo Li 		(unsigned long) __entry->ino,
33*318580adSHongbo Li 		(unsigned long) __entry->dir, __entry->mode)
34*318580adSHongbo Li );
35*318580adSHongbo Li 
36*318580adSHongbo Li DECLARE_EVENT_CLASS(hugetlbfs__inode,
37*318580adSHongbo Li 
38*318580adSHongbo Li 	TP_PROTO(struct inode *inode),
39*318580adSHongbo Li 
40*318580adSHongbo Li 	TP_ARGS(inode),
41*318580adSHongbo Li 
42*318580adSHongbo Li 	TP_STRUCT__entry(
43*318580adSHongbo Li 		__field(dev_t,		dev)
44*318580adSHongbo Li 		__field(ino_t,		ino)
45*318580adSHongbo Li 		__field(__u16,		mode)
46*318580adSHongbo Li 		__field(loff_t,		size)
47*318580adSHongbo Li 		__field(unsigned int,	nlink)
48*318580adSHongbo Li 		__field(unsigned int,	seals)
49*318580adSHongbo Li 		__field(blkcnt_t,	blocks)
50*318580adSHongbo Li 	),
51*318580adSHongbo Li 
52*318580adSHongbo Li 	TP_fast_assign(
53*318580adSHongbo Li 		__entry->dev		= inode->i_sb->s_dev;
54*318580adSHongbo Li 		__entry->ino		= inode->i_ino;
55*318580adSHongbo Li 		__entry->mode		= inode->i_mode;
56*318580adSHongbo Li 		__entry->size		= inode->i_size;
57*318580adSHongbo Li 		__entry->nlink		= inode->i_nlink;
58*318580adSHongbo Li 		__entry->seals		= HUGETLBFS_I(inode)->seals;
59*318580adSHongbo Li 		__entry->blocks		= inode->i_blocks;
60*318580adSHongbo Li 	),
61*318580adSHongbo Li 
62*318580adSHongbo Li 	TP_printk("dev %d,%d ino %lu mode 0%o size %lld nlink %u seals %u blocks %llu",
63*318580adSHongbo Li 		MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long) __entry->ino,
64*318580adSHongbo Li 		__entry->mode, __entry->size, __entry->nlink, __entry->seals,
65*318580adSHongbo Li 		(unsigned long long)__entry->blocks)
66*318580adSHongbo Li );
67*318580adSHongbo Li 
68*318580adSHongbo Li DEFINE_EVENT(hugetlbfs__inode, hugetlbfs_evict_inode,
69*318580adSHongbo Li 
70*318580adSHongbo Li 	TP_PROTO(struct inode *inode),
71*318580adSHongbo Li 
72*318580adSHongbo Li 	TP_ARGS(inode)
73*318580adSHongbo Li );
74*318580adSHongbo Li 
75*318580adSHongbo Li DEFINE_EVENT(hugetlbfs__inode, hugetlbfs_free_inode,
76*318580adSHongbo Li 
77*318580adSHongbo Li 	TP_PROTO(struct inode *inode),
78*318580adSHongbo Li 
79*318580adSHongbo Li 	TP_ARGS(inode)
80*318580adSHongbo Li );
81*318580adSHongbo Li 
82*318580adSHongbo Li TRACE_EVENT(hugetlbfs_setattr,
83*318580adSHongbo Li 
84*318580adSHongbo Li 	TP_PROTO(struct inode *inode, struct dentry *dentry,
85*318580adSHongbo Li 		struct iattr *attr),
86*318580adSHongbo Li 
87*318580adSHongbo Li 	TP_ARGS(inode, dentry, attr),
88*318580adSHongbo Li 
89*318580adSHongbo Li 	TP_STRUCT__entry(
90*318580adSHongbo Li 		__field(dev_t,		dev)
91*318580adSHongbo Li 		__field(ino_t,		ino)
92*318580adSHongbo Li 		__field(unsigned int,	d_len)
93*318580adSHongbo Li 		__string(d_name,	dentry->d_name.name)
94*318580adSHongbo Li 		__field(unsigned int,	ia_valid)
95*318580adSHongbo Li 		__field(unsigned int,	ia_mode)
96*318580adSHongbo Li 		__field(loff_t,		old_size)
97*318580adSHongbo Li 		__field(loff_t,		ia_size)
98*318580adSHongbo Li 	),
99*318580adSHongbo Li 
100*318580adSHongbo Li 	TP_fast_assign(
101*318580adSHongbo Li 		__entry->dev		= inode->i_sb->s_dev;
102*318580adSHongbo Li 		__entry->ino		= inode->i_ino;
103*318580adSHongbo Li 		__entry->d_len		= dentry->d_name.len;
104*318580adSHongbo Li 		__assign_str(d_name);
105*318580adSHongbo Li 		__entry->ia_valid	= attr->ia_valid;
106*318580adSHongbo Li 		__entry->ia_mode	= attr->ia_mode;
107*318580adSHongbo Li 		__entry->old_size	= inode->i_size;
108*318580adSHongbo Li 		__entry->ia_size	= attr->ia_size;
109*318580adSHongbo Li 	),
110*318580adSHongbo Li 
111*318580adSHongbo Li 	TP_printk("dev %d,%d ino %lu name %.*s valid %#x mode 0%o old_size %lld size %lld",
112*318580adSHongbo Li 		MAJOR(__entry->dev), MINOR(__entry->dev), (unsigned long)__entry->ino,
113*318580adSHongbo Li 		__entry->d_len, __get_str(d_name), __entry->ia_valid, __entry->ia_mode,
114*318580adSHongbo Li 		__entry->old_size, __entry->ia_size)
115*318580adSHongbo Li );
116*318580adSHongbo Li 
117*318580adSHongbo Li TRACE_EVENT(hugetlbfs_fallocate,
118*318580adSHongbo Li 
119*318580adSHongbo Li 	TP_PROTO(struct inode *inode, int mode,
120*318580adSHongbo Li 		loff_t offset, loff_t len, int ret),
121*318580adSHongbo Li 
122*318580adSHongbo Li 	TP_ARGS(inode, mode, offset, len, ret),
123*318580adSHongbo Li 
124*318580adSHongbo Li 	TP_STRUCT__entry(
125*318580adSHongbo Li 		__field(dev_t,		dev)
126*318580adSHongbo Li 		__field(ino_t,		ino)
127*318580adSHongbo Li 		__field(int,		mode)
128*318580adSHongbo Li 		__field(loff_t,		offset)
129*318580adSHongbo Li 		__field(loff_t,		len)
130*318580adSHongbo Li 		__field(loff_t,		size)
131*318580adSHongbo Li 		__field(int,		ret)
132*318580adSHongbo Li 	),
133*318580adSHongbo Li 
134*318580adSHongbo Li 	TP_fast_assign(
135*318580adSHongbo Li 		__entry->dev		= inode->i_sb->s_dev;
136*318580adSHongbo Li 		__entry->ino		= inode->i_ino;
137*318580adSHongbo Li 		__entry->mode		= mode;
138*318580adSHongbo Li 		__entry->offset		= offset;
139*318580adSHongbo Li 		__entry->len		= len;
140*318580adSHongbo Li 		__entry->size		= inode->i_size;
141*318580adSHongbo Li 		__entry->ret		= ret;
142*318580adSHongbo Li 	),
143*318580adSHongbo Li 
144*318580adSHongbo Li 	TP_printk("dev %d,%d ino %lu mode 0%o offset %lld len %lld size %lld ret %d",
145*318580adSHongbo Li 		MAJOR(__entry->dev), MINOR(__entry->dev),
146*318580adSHongbo Li 		(unsigned long)__entry->ino, __entry->mode,
147*318580adSHongbo Li 		(unsigned long long)__entry->offset,
148*318580adSHongbo Li 		(unsigned long long)__entry->len,
149*318580adSHongbo Li 		(unsigned long long)__entry->size,
150*318580adSHongbo Li 		__entry->ret)
151*318580adSHongbo Li );
152*318580adSHongbo Li 
153*318580adSHongbo Li #endif /* _TRACE_HUGETLBFS_H */
154*318580adSHongbo Li 
155*318580adSHongbo Li  /* This part must be outside protection */
156*318580adSHongbo Li #include <trace/define_trace.h>
157