1 /* SPDX-License-Identifier: GPL-2.0 */
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
),
24 __entry
->dev
= inode
->i_sb
->s_dev
;
25 __entry
->ino
= inode
->i_ino
;
26 __entry
->dir
= dir
->i_ino
;
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
),
47 __field(unsigned int, nlink
)
48 __field(unsigned int, seals
)
49 __field(blkcnt_t
, blocks
)
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
),
75 DEFINE_EVENT(hugetlbfs__inode
, hugetlbfs_free_inode
,
77 TP_PROTO(struct inode
*inode
),
82 TRACE_EVENT(hugetlbfs_setattr
,
84 TP_PROTO(struct inode
*inode
, struct dentry
*dentry
,
87 TP_ARGS(inode
, dentry
, attr
),
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
)
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
),
128 __field(loff_t
, offset
)
130 __field(loff_t
, size
)
135 __entry
->dev
= inode
->i_sb
->s_dev
;
136 __entry
->ino
= inode
->i_ino
;
137 __entry
->mode
= mode
;
138 __entry
->offset
= offset
;
140 __entry
->size
= inode
->i_size
;
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
,
153 #endif /* _TRACE_HUGETLBFS_H */
155 /* This part must be outside protection */
156 #include <trace/define_trace.h>