Commit | Line | Data |
---|---|---|
b7cdc182 | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
b283666f PW |
2 | #undef TRACE_SYSTEM |
3 | #define TRACE_SYSTEM jbd2 | |
4 | ||
3bc29f0a MD |
5 | #if !defined(LTTNG_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) |
6 | #define LTTNG_TRACE_JBD2_H | |
b283666f | 7 | |
3b4aafcb | 8 | #include <lttng/tracepoint-event.h> |
b283666f | 9 | #include <linux/jbd2.h> |
5f4c791e | 10 | #include <lttng/kernel-version.h> |
b283666f PW |
11 | |
12 | #ifndef _TRACE_JBD2_DEF | |
13 | #define _TRACE_JBD2_DEF | |
14 | struct transaction_chp_stats_s; | |
15 | struct transaction_run_stats_s; | |
16 | #endif | |
17 | ||
3bc29f0a | 18 | LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint, |
b283666f PW |
19 | |
20 | TP_PROTO(journal_t *journal, int result), | |
21 | ||
22 | TP_ARGS(journal, result), | |
23 | ||
f127e61e MD |
24 | TP_FIELDS( |
25 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | |
26 | ctf_integer(int, result, result) | |
27 | ) | |
b283666f PW |
28 | ) |
29 | ||
b28830a0 | 30 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,2,0) \ |
612c99eb | 31 | || LTTNG_KERNEL_RANGE(5,4,229, 5,5,0) \ |
4fd2615b | 32 | || LTTNG_KERNEL_RANGE(5,10,163, 5,11,0) \ |
b28830a0 MJ |
33 | || LTTNG_KERNEL_RANGE(5,15,87, 5,16,0) \ |
34 | || LTTNG_KERNEL_RANGE(6,0,18, 6,1,0) \ | |
35 | || LTTNG_KERNEL_RANGE(6,1,4, 6,2,0)) | |
36 | LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit, | |
37 | ||
38 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | |
39 | ||
40 | TP_ARGS(journal, commit_transaction), | |
41 | ||
42 | TP_FIELDS( | |
43 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | |
44 | ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) | |
45 | ctf_integer(tid_t, transaction, commit_transaction->t_tid) | |
46 | ) | |
47 | ) | |
48 | #else | |
3bc29f0a | 49 | LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit, |
b283666f PW |
50 | |
51 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | |
52 | ||
53 | TP_ARGS(journal, commit_transaction), | |
54 | ||
f127e61e MD |
55 | TP_FIELDS( |
56 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | |
57 | ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) | |
58 | ctf_integer(int, transaction, commit_transaction->t_tid) | |
59 | ) | |
b283666f | 60 | ) |
b28830a0 | 61 | #endif |
b283666f | 62 | |
3bc29f0a | 63 | LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_start_commit, |
b283666f PW |
64 | |
65 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | |
66 | ||
67 | TP_ARGS(journal, commit_transaction) | |
68 | ) | |
69 | ||
3bc29f0a | 70 | LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_locking, |
b283666f PW |
71 | |
72 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | |
73 | ||
74 | TP_ARGS(journal, commit_transaction) | |
75 | ) | |
76 | ||
3bc29f0a | 77 | LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_flushing, |
b283666f PW |
78 | |
79 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | |
80 | ||
81 | TP_ARGS(journal, commit_transaction) | |
82 | ) | |
83 | ||
3bc29f0a | 84 | LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_logging, |
b283666f PW |
85 | |
86 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | |
87 | ||
88 | TP_ARGS(journal, commit_transaction) | |
89 | ) | |
90 | ||
5f4c791e | 91 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,4,0)) |
3bc29f0a | 92 | LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_drop_transaction, |
7c68b363 AG |
93 | |
94 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | |
95 | ||
96 | TP_ARGS(journal, commit_transaction) | |
97 | ) | |
98 | #endif | |
99 | ||
b28830a0 | 100 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,2,0) \ |
612c99eb | 101 | || LTTNG_KERNEL_RANGE(5,4,229, 5,5,0) \ |
4fd2615b | 102 | || LTTNG_KERNEL_RANGE(5,10,163, 5,11,0) \ |
b28830a0 MJ |
103 | || LTTNG_KERNEL_RANGE(5,15,87, 5,16,0) \ |
104 | || LTTNG_KERNEL_RANGE(6,0,18, 6,1,0) \ | |
105 | || LTTNG_KERNEL_RANGE(6,1,4, 6,2,0)) | |
106 | LTTNG_TRACEPOINT_EVENT(jbd2_end_commit, | |
107 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | |
108 | ||
109 | TP_ARGS(journal, commit_transaction), | |
110 | ||
111 | TP_FIELDS( | |
112 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | |
113 | ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) | |
114 | ctf_integer(tid_t, transaction, commit_transaction->t_tid) | |
115 | ctf_integer(tid_t, head, journal->j_tail_sequence) | |
116 | ) | |
117 | ) | |
118 | #else | |
3bc29f0a | 119 | LTTNG_TRACEPOINT_EVENT(jbd2_end_commit, |
b283666f PW |
120 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
121 | ||
122 | TP_ARGS(journal, commit_transaction), | |
123 | ||
f127e61e MD |
124 | TP_FIELDS( |
125 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | |
126 | ctf_integer(char, sync_commit, commit_transaction->t_synchronous_commit) | |
127 | ctf_integer(int, transaction, commit_transaction->t_tid) | |
128 | ctf_integer(int, head, journal->j_tail_sequence) | |
129 | ) | |
b283666f | 130 | ) |
b28830a0 | 131 | #endif |
b283666f | 132 | |
3bc29f0a | 133 | LTTNG_TRACEPOINT_EVENT(jbd2_submit_inode_data, |
b283666f PW |
134 | TP_PROTO(struct inode *inode), |
135 | ||
136 | TP_ARGS(inode), | |
137 | ||
f127e61e MD |
138 | TP_FIELDS( |
139 | ctf_integer(dev_t, dev, inode->i_sb->s_dev) | |
140 | ctf_integer(ino_t, ino, inode->i_ino) | |
141 | ) | |
b283666f PW |
142 | ) |
143 | ||
b28830a0 | 144 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,2,0) \ |
612c99eb | 145 | || LTTNG_KERNEL_RANGE(5,4,229, 5,5,0) \ |
4fd2615b | 146 | || LTTNG_KERNEL_RANGE(5,10,163, 5,11,0) \ |
b28830a0 MJ |
147 | || LTTNG_KERNEL_RANGE(5,15,87, 5,16,0) \ |
148 | || LTTNG_KERNEL_RANGE(6,0,18, 6,1,0) \ | |
de5eee31 | 149 | || LTTNG_KERNEL_RANGE(6,1,4, 6,2,0) \ |
93e9f463 | 150 | || LTTNG_SLE_KERNEL_RANGE(5,14,21,150400,24,46, 5,15,0,0,0,0) \ |
de5eee31 MJ |
151 | || LTTNG_UBUNTU_KERNEL_RANGE(5,19,17,42, 5,19,18,0) \ |
152 | || LTTNG_UBUNTU_KERNEL_RANGE(5,19,7,1024, 5,19,8,0)) | |
b28830a0 MJ |
153 | LTTNG_TRACEPOINT_EVENT(jbd2_run_stats, |
154 | TP_PROTO(dev_t dev, tid_t tid, | |
155 | struct transaction_run_stats_s *stats), | |
156 | ||
157 | TP_ARGS(dev, tid, stats), | |
158 | ||
159 | TP_FIELDS( | |
160 | ctf_integer(dev_t, dev, dev) | |
161 | ctf_integer(tid_t, tid, tid) | |
162 | ctf_integer(unsigned long, wait, stats->rs_wait) | |
163 | ctf_integer(unsigned long, running, stats->rs_running) | |
164 | ctf_integer(unsigned long, locked, stats->rs_locked) | |
165 | ctf_integer(unsigned long, flushing, stats->rs_flushing) | |
166 | ctf_integer(unsigned long, logging, stats->rs_logging) | |
167 | ctf_integer(__u32, handle_count, stats->rs_handle_count) | |
168 | ctf_integer(__u32, blocks, stats->rs_blocks) | |
169 | ctf_integer(__u32, blocks_logged, stats->rs_blocks_logged) | |
170 | ) | |
171 | ) | |
172 | ||
173 | LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint_stats, | |
174 | TP_PROTO(dev_t dev, tid_t tid, | |
175 | struct transaction_chp_stats_s *stats), | |
176 | ||
177 | TP_ARGS(dev, tid, stats), | |
178 | ||
179 | TP_FIELDS( | |
180 | ctf_integer(dev_t, dev, dev) | |
181 | ctf_integer(tid_t, tid, tid) | |
182 | ctf_integer(unsigned long, chp_time, stats->cs_chp_time) | |
183 | ctf_integer(__u32, forced_to_close, stats->cs_forced_to_close) | |
184 | ctf_integer(__u32, written, stats->cs_written) | |
185 | ctf_integer(__u32, dropped, stats->cs_dropped) | |
186 | ) | |
187 | ) | |
188 | #else | |
3bc29f0a | 189 | LTTNG_TRACEPOINT_EVENT(jbd2_run_stats, |
b283666f PW |
190 | TP_PROTO(dev_t dev, unsigned long tid, |
191 | struct transaction_run_stats_s *stats), | |
192 | ||
193 | TP_ARGS(dev, tid, stats), | |
194 | ||
f127e61e MD |
195 | TP_FIELDS( |
196 | ctf_integer(dev_t, dev, dev) | |
197 | ctf_integer(unsigned long, tid, tid) | |
198 | ctf_integer(unsigned long, wait, stats->rs_wait) | |
199 | ctf_integer(unsigned long, running, stats->rs_running) | |
200 | ctf_integer(unsigned long, locked, stats->rs_locked) | |
201 | ctf_integer(unsigned long, flushing, stats->rs_flushing) | |
202 | ctf_integer(unsigned long, logging, stats->rs_logging) | |
203 | ctf_integer(__u32, handle_count, stats->rs_handle_count) | |
204 | ctf_integer(__u32, blocks, stats->rs_blocks) | |
205 | ctf_integer(__u32, blocks_logged, stats->rs_blocks_logged) | |
206 | ) | |
b283666f PW |
207 | ) |
208 | ||
3bc29f0a | 209 | LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint_stats, |
b283666f PW |
210 | TP_PROTO(dev_t dev, unsigned long tid, |
211 | struct transaction_chp_stats_s *stats), | |
212 | ||
213 | TP_ARGS(dev, tid, stats), | |
214 | ||
f127e61e MD |
215 | TP_FIELDS( |
216 | ctf_integer(dev_t, dev, dev) | |
217 | ctf_integer(unsigned long, tid, tid) | |
218 | ctf_integer(unsigned long, chp_time, stats->cs_chp_time) | |
219 | ctf_integer(__u32, forced_to_close, stats->cs_forced_to_close) | |
220 | ctf_integer(__u32, written, stats->cs_written) | |
221 | ctf_integer(__u32, dropped, stats->cs_dropped) | |
222 | ) | |
b283666f | 223 | ) |
b28830a0 | 224 | #endif |
b283666f | 225 | |
3bc29f0a | 226 | LTTNG_TRACEPOINT_EVENT(jbd2_update_log_tail, |
b283666f PW |
227 | TP_PROTO(journal_t *journal, tid_t first_tid, |
228 | unsigned long block_nr, unsigned long freed), | |
229 | ||
230 | TP_ARGS(journal, first_tid, block_nr, freed), | |
231 | ||
f127e61e MD |
232 | TP_FIELDS( |
233 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | |
234 | ctf_integer(tid_t, tail_sequence, journal->j_tail_sequence) | |
235 | ctf_integer(tid_t, first_tid, first_tid) | |
236 | ctf_integer(unsigned long, block_nr, block_nr) | |
237 | ctf_integer(unsigned long, freed, freed) | |
238 | ) | |
b283666f | 239 | ) |
7c68b363 | 240 | |
a9d49ac6 MH |
241 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,0,0) || \ |
242 | LTTNG_RHEL_KERNEL_RANGE(5,14,0,163,0,0, 5,15,0,0,0,0)) | |
d2771276 MJ |
243 | |
244 | #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM | |
245 | LTTNG_TRACEPOINT_ENUM(req_op, | |
246 | TP_ENUM_VALUES( | |
247 | ctf_enum_value("REQ_OP_READ", REQ_OP_READ) | |
248 | ctf_enum_value("REQ_OP_WRITE", REQ_OP_WRITE) | |
249 | ctf_enum_value("REQ_OP_FLUSH", REQ_OP_FLUSH) | |
250 | ctf_enum_value("REQ_OP_DISCARD", REQ_OP_DISCARD) | |
251 | ctf_enum_value("REQ_OP_SECURE_ERASE", REQ_OP_SECURE_ERASE) | |
252 | ctf_enum_value("REQ_OP_WRITE_ZEROES", REQ_OP_WRITE_ZEROES) | |
253 | ctf_enum_value("REQ_OP_ZONE_OPEN", REQ_OP_ZONE_OPEN) | |
254 | ctf_enum_value("REQ_OP_ZONE_CLOSE", REQ_OP_ZONE_CLOSE) | |
255 | ctf_enum_value("REQ_OP_ZONE_FINISH", REQ_OP_ZONE_FINISH) | |
256 | ctf_enum_value("REQ_OP_ZONE_APPEND", REQ_OP_ZONE_APPEND) | |
257 | ctf_enum_value("REQ_OP_ZONE_RESET", REQ_OP_ZONE_RESET) | |
258 | ctf_enum_value("REQ_OP_ZONE_RESET_ALL", REQ_OP_ZONE_RESET_ALL) | |
259 | ctf_enum_value("REQ_OP_DRV_IN", REQ_OP_DRV_IN) | |
260 | ctf_enum_value("REQ_OP_DRV_OUT", REQ_OP_DRV_OUT) | |
261 | ctf_enum_value("REQ_OP_LAST", REQ_OP_LAST) | |
262 | ) | |
263 | ) | |
264 | #endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */ | |
265 | ||
266 | LTTNG_TRACEPOINT_EVENT(jbd2_write_superblock, | |
267 | ||
268 | TP_PROTO(journal_t *journal, blk_opf_t write_flags), | |
269 | ||
270 | TP_ARGS(journal, write_flags), | |
271 | ||
272 | TP_FIELDS( | |
273 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | |
274 | #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM | |
275 | ctf_enum(req_op, blk_opf_t, write_flags, write_flags) | |
276 | #else | |
277 | ctf_integer_hex(blk_opf_t, write_flags, write_flags) | |
278 | #endif | |
279 | ) | |
280 | ) | |
1efbdb9f | 281 | #else |
3bc29f0a | 282 | LTTNG_TRACEPOINT_EVENT(jbd2_write_superblock, |
7c68b363 AG |
283 | |
284 | TP_PROTO(journal_t *journal, int write_op), | |
285 | ||
286 | TP_ARGS(journal, write_op), | |
287 | ||
f127e61e MD |
288 | TP_FIELDS( |
289 | ctf_integer(dev_t, dev, journal->j_fs_dev->bd_dev) | |
290 | ctf_integer(int, write_op, write_op) | |
291 | ) | |
7c68b363 AG |
292 | ) |
293 | #endif | |
b283666f | 294 | |
3bc29f0a | 295 | #endif /* LTTNG_TRACE_JBD2_H */ |
b283666f PW |
296 | |
297 | /* This part must be outside protection */ | |
3b4aafcb | 298 | #include <lttng/define_trace.h> |