1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM timestamp
5 #if !defined(_TRACE_TIMESTAMP_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_TIMESTAMP_H
8 #include <linux/tracepoint.h>
11 #define CTIME_QUERIED_FLAGS \
12 { I_CTIME_QUERIED, "Q" }
14 DECLARE_EVENT_CLASS(ctime
,
15 TP_PROTO(struct inode
*inode
,
16 struct timespec64
*ctime
),
18 TP_ARGS(inode
, ctime
),
23 __field(time64_t
, ctime_s
)
24 __field(u32
, ctime_ns
)
29 __entry
->dev
= inode
->i_sb
->s_dev
;
30 __entry
->ino
= inode
->i_ino
;
31 __entry
->gen
= inode
->i_generation
;
32 __entry
->ctime_s
= ctime
->tv_sec
;
33 __entry
->ctime_ns
= ctime
->tv_nsec
;
36 TP_printk("ino=%d:%d:%ld:%u ctime=%lld.%u",
37 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->ino
, __entry
->gen
,
38 __entry
->ctime_s
, __entry
->ctime_ns
42 DEFINE_EVENT(ctime
, inode_set_ctime_to_ts
,
43 TP_PROTO(struct inode
*inode
,
44 struct timespec64
*ctime
),
45 TP_ARGS(inode
, ctime
));
47 DEFINE_EVENT(ctime
, ctime_xchg_skip
,
48 TP_PROTO(struct inode
*inode
,
49 struct timespec64
*ctime
),
50 TP_ARGS(inode
, ctime
));
52 TRACE_EVENT(ctime_ns_xchg
,
53 TP_PROTO(struct inode
*inode
,
58 TP_ARGS(inode
, old
, new, cur
),
70 __entry
->dev
= inode
->i_sb
->s_dev
;
71 __entry
->ino
= inode
->i_ino
;
72 __entry
->gen
= inode
->i_generation
;
78 TP_printk("ino=%d:%d:%ld:%u old=%u:%s new=%u cur=%u:%s",
79 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->ino
, __entry
->gen
,
80 __entry
->old
& ~I_CTIME_QUERIED
,
81 __print_flags(__entry
->old
& I_CTIME_QUERIED
, "|", CTIME_QUERIED_FLAGS
),
83 __entry
->cur
& ~I_CTIME_QUERIED
,
84 __print_flags(__entry
->cur
& I_CTIME_QUERIED
, "|", CTIME_QUERIED_FLAGS
)
88 TRACE_EVENT(fill_mg_cmtime
,
89 TP_PROTO(struct inode
*inode
,
90 struct timespec64
*ctime
,
91 struct timespec64
*mtime
),
93 TP_ARGS(inode
, ctime
, mtime
),
98 __field(time64_t
, ctime_s
)
99 __field(time64_t
, mtime_s
)
100 __field(u32
, ctime_ns
)
101 __field(u32
, mtime_ns
)
106 __entry
->dev
= inode
->i_sb
->s_dev
;
107 __entry
->ino
= inode
->i_ino
;
108 __entry
->gen
= inode
->i_generation
;
109 __entry
->ctime_s
= ctime
->tv_sec
;
110 __entry
->mtime_s
= mtime
->tv_sec
;
111 __entry
->ctime_ns
= ctime
->tv_nsec
;
112 __entry
->mtime_ns
= mtime
->tv_nsec
;
115 TP_printk("ino=%d:%d:%ld:%u ctime=%lld.%u mtime=%lld.%u",
116 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->ino
, __entry
->gen
,
117 __entry
->ctime_s
, __entry
->ctime_ns
,
118 __entry
->mtime_s
, __entry
->mtime_ns
121 #endif /* _TRACE_TIMESTAMP_H */
123 /* This part must be outside protection */
124 #include <trace/define_trace.h>