Commit | Line | Data |
---|---|---|
0b61f8a4 | 1 | // SPDX-License-Identifier: GPL-2.0 |
0b1b213f CH |
2 | /* |
3 | * Copyright (c) 2009, Christoph Hellwig | |
4 | * All Rights Reserved. | |
0b1b213f CH |
5 | */ |
6 | #undef TRACE_SYSTEM | |
7 | #define TRACE_SYSTEM xfs | |
8 | ||
9 | #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ) | |
10 | #define _TRACE_XFS_H | |
11 | ||
12 | #include <linux/tracepoint.h> | |
13 | ||
14 | struct xfs_agf; | |
15 | struct xfs_alloc_arg; | |
16 | struct xfs_attr_list_context; | |
17 | struct xfs_buf_log_item; | |
18 | struct xfs_da_args; | |
19 | struct xfs_da_node_entry; | |
20 | struct xfs_dquot; | |
9e4c109a | 21 | struct xfs_log_item; |
ad223e60 | 22 | struct xlog; |
750b9c90 | 23 | struct xlog_ticket; |
9abbc539 DC |
24 | struct xlog_recover; |
25 | struct xlog_recover_item; | |
0ad95687 | 26 | struct xlog_rec_header; |
956f6daa | 27 | struct xlog_in_core; |
9abbc539 DC |
28 | struct xfs_buf_log_format; |
29 | struct xfs_inode_log_format; | |
1ed845df | 30 | struct xfs_bmbt_irec; |
2c813ad6 | 31 | struct xfs_btree_cur; |
1946b91c | 32 | struct xfs_refcount_irec; |
e89c0413 DW |
33 | struct xfs_fsmap; |
34 | struct xfs_rmap_irec; | |
0ad95687 DC |
35 | struct xfs_icreate_log; |
36 | struct xfs_owner_info; | |
37 | struct xfs_trans_res; | |
38 | struct xfs_inobt_rec_incore; | |
60e3d707 | 39 | union xfs_btree_ptr; |
2cb91bab | 40 | struct xfs_dqtrx; |
b26b2bf1 | 41 | struct xfs_icwalk; |
0b1b213f | 42 | |
d5f0f49a CH |
43 | #define XFS_ATTR_FILTER_FLAGS \ |
44 | { XFS_ATTR_ROOT, "ROOT" }, \ | |
254f800f CH |
45 | { XFS_ATTR_SECURE, "SECURE" }, \ |
46 | { XFS_ATTR_INCOMPLETE, "INCOMPLETE" } | |
d5f0f49a | 47 | |
ea9a4888 CH |
48 | DECLARE_EVENT_CLASS(xfs_attr_list_class, |
49 | TP_PROTO(struct xfs_attr_list_context *ctx), | |
50 | TP_ARGS(ctx), | |
51 | TP_STRUCT__entry( | |
52 | __field(dev_t, dev) | |
53 | __field(xfs_ino_t, ino) | |
54 | __field(u32, hashval) | |
55 | __field(u32, blkno) | |
56 | __field(u32, offset) | |
a9c8c69b | 57 | __field(void *, buffer) |
ea9a4888 CH |
58 | __field(int, bufsize) |
59 | __field(int, count) | |
60 | __field(int, firstu) | |
61 | __field(int, dupcnt) | |
d5f0f49a | 62 | __field(unsigned int, attr_filter) |
ea9a4888 CH |
63 | ), |
64 | TP_fast_assign( | |
65 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; | |
66 | __entry->ino = ctx->dp->i_ino; | |
e3a19cde CH |
67 | __entry->hashval = ctx->cursor.hashval; |
68 | __entry->blkno = ctx->cursor.blkno; | |
69 | __entry->offset = ctx->cursor.offset; | |
a9c8c69b | 70 | __entry->buffer = ctx->buffer; |
ea9a4888 CH |
71 | __entry->bufsize = ctx->bufsize; |
72 | __entry->count = ctx->count; | |
73 | __entry->firstu = ctx->firstu; | |
d5f0f49a | 74 | __entry->attr_filter = ctx->attr_filter; |
ea9a4888 CH |
75 | ), |
76 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " | |
d5f0f49a | 77 | "buffer %p size %u count %u firstu %u filter %s", |
ea9a4888 CH |
78 | MAJOR(__entry->dev), MINOR(__entry->dev), |
79 | __entry->ino, | |
80 | __entry->hashval, | |
81 | __entry->blkno, | |
82 | __entry->offset, | |
83 | __entry->dupcnt, | |
a9c8c69b | 84 | __entry->buffer, |
ea9a4888 CH |
85 | __entry->bufsize, |
86 | __entry->count, | |
87 | __entry->firstu, | |
d5f0f49a CH |
88 | __print_flags(__entry->attr_filter, "|", |
89 | XFS_ATTR_FILTER_FLAGS) | |
ea9a4888 CH |
90 | ) |
91 | ) | |
92 | ||
0b1b213f | 93 | #define DEFINE_ATTR_LIST_EVENT(name) \ |
ea9a4888 | 94 | DEFINE_EVENT(xfs_attr_list_class, name, \ |
0b1b213f | 95 | TP_PROTO(struct xfs_attr_list_context *ctx), \ |
ea9a4888 | 96 | TP_ARGS(ctx)) |
0b1b213f CH |
97 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf); |
98 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all); | |
99 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf); | |
100 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end); | |
101 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full); | |
102 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add); | |
103 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); | |
104 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); | |
ee73259b DC |
105 | DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list); |
106 | DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list); | |
0b1b213f | 107 | |
63370326 DW |
108 | TRACE_EVENT(xlog_intent_recovery_failed, |
109 | TP_PROTO(struct xfs_mount *mp, int error, void *function), | |
110 | TP_ARGS(mp, error, function), | |
111 | TP_STRUCT__entry( | |
112 | __field(dev_t, dev) | |
113 | __field(int, error) | |
114 | __field(void *, function) | |
115 | ), | |
116 | TP_fast_assign( | |
117 | __entry->dev = mp->m_super->s_dev; | |
118 | __entry->error = error; | |
119 | __entry->function = function; | |
120 | ), | |
121 | TP_printk("dev %d:%d error %d function %pS", | |
122 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
123 | __entry->error, __entry->function) | |
124 | ); | |
125 | ||
f8adb4d5 LZ |
126 | DECLARE_EVENT_CLASS(xfs_perag_class, |
127 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, | |
128 | unsigned long caller_ip), | |
129 | TP_ARGS(mp, agno, refcount, caller_ip), | |
130 | TP_STRUCT__entry( | |
131 | __field(dev_t, dev) | |
132 | __field(xfs_agnumber_t, agno) | |
133 | __field(int, refcount) | |
134 | __field(unsigned long, caller_ip) | |
135 | ), | |
136 | TP_fast_assign( | |
137 | __entry->dev = mp->m_super->s_dev; | |
138 | __entry->agno = agno; | |
139 | __entry->refcount = refcount; | |
140 | __entry->caller_ip = caller_ip; | |
141 | ), | |
9febf39d | 142 | TP_printk("dev %d:%d agno 0x%x refcount %d caller %pS", |
f8adb4d5 LZ |
143 | MAJOR(__entry->dev), MINOR(__entry->dev), |
144 | __entry->agno, | |
145 | __entry->refcount, | |
146 | (char *)__entry->caller_ip) | |
147 | ); | |
148 | ||
149 | #define DEFINE_PERAG_REF_EVENT(name) \ | |
150 | DEFINE_EVENT(xfs_perag_class, name, \ | |
151 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \ | |
152 | unsigned long caller_ip), \ | |
153 | TP_ARGS(mp, agno, refcount, caller_ip)) | |
154 | DEFINE_PERAG_REF_EVENT(xfs_perag_get); | |
65d0f205 | 155 | DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag); |
f8adb4d5 | 156 | DEFINE_PERAG_REF_EVENT(xfs_perag_put); |
c076ae7a DW |
157 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_inode_tag); |
158 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_inode_tag); | |
f8adb4d5 | 159 | |
40b1de00 DW |
160 | TRACE_EVENT(xfs_inodegc_worker, |
161 | TP_PROTO(struct xfs_mount *mp, unsigned int shrinker_hits), | |
162 | TP_ARGS(mp, shrinker_hits), | |
163 | TP_STRUCT__entry( | |
164 | __field(dev_t, dev) | |
165 | __field(unsigned int, shrinker_hits) | |
166 | ), | |
167 | TP_fast_assign( | |
168 | __entry->dev = mp->m_super->s_dev; | |
169 | __entry->shrinker_hits = shrinker_hits; | |
170 | ), | |
171 | TP_printk("dev %d:%d shrinker_hits %u", | |
172 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
173 | __entry->shrinker_hits) | |
174 | ); | |
175 | ||
ab23a776 DC |
176 | DECLARE_EVENT_CLASS(xfs_fs_class, |
177 | TP_PROTO(struct xfs_mount *mp, void *caller_ip), | |
178 | TP_ARGS(mp, caller_ip), | |
179 | TP_STRUCT__entry( | |
180 | __field(dev_t, dev) | |
181 | __field(unsigned long long, mflags) | |
182 | __field(unsigned long, opstate) | |
183 | __field(unsigned long, sbflags) | |
184 | __field(void *, caller_ip) | |
185 | ), | |
186 | TP_fast_assign( | |
187 | if (mp) { | |
188 | __entry->dev = mp->m_super->s_dev; | |
189 | __entry->mflags = mp->m_flags; | |
190 | __entry->opstate = mp->m_opstate; | |
191 | __entry->sbflags = mp->m_super->s_flags; | |
192 | } | |
193 | __entry->caller_ip = caller_ip; | |
194 | ), | |
195 | TP_printk("dev %d:%d m_flags 0x%llx opstate (%s) s_flags 0x%lx caller %pS", | |
196 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
197 | __entry->mflags, | |
198 | __print_flags(__entry->opstate, "|", XFS_OPSTATE_STRINGS), | |
199 | __entry->sbflags, | |
200 | __entry->caller_ip) | |
201 | ); | |
202 | ||
203 | #define DEFINE_FS_EVENT(name) \ | |
204 | DEFINE_EVENT(xfs_fs_class, name, \ | |
205 | TP_PROTO(struct xfs_mount *mp, void *caller_ip), \ | |
206 | TP_ARGS(mp, caller_ip)) | |
207 | DEFINE_FS_EVENT(xfs_inodegc_flush); | |
208 | DEFINE_FS_EVENT(xfs_inodegc_start); | |
209 | DEFINE_FS_EVENT(xfs_inodegc_stop); | |
ab23a776 DC |
210 | DEFINE_FS_EVENT(xfs_inodegc_queue); |
211 | DEFINE_FS_EVENT(xfs_inodegc_throttle); | |
212 | DEFINE_FS_EVENT(xfs_fs_sync_fs); | |
6f649091 DW |
213 | DEFINE_FS_EVENT(xfs_blockgc_start); |
214 | DEFINE_FS_EVENT(xfs_blockgc_stop); | |
215 | DEFINE_FS_EVENT(xfs_blockgc_worker); | |
e8d04c2a | 216 | DEFINE_FS_EVENT(xfs_blockgc_flush_all); |
ab23a776 | 217 | |
40b1de00 DW |
218 | TRACE_EVENT(xfs_inodegc_shrinker_scan, |
219 | TP_PROTO(struct xfs_mount *mp, struct shrink_control *sc, | |
220 | void *caller_ip), | |
221 | TP_ARGS(mp, sc, caller_ip), | |
222 | TP_STRUCT__entry( | |
223 | __field(dev_t, dev) | |
224 | __field(unsigned long, nr_to_scan) | |
225 | __field(void *, caller_ip) | |
226 | ), | |
227 | TP_fast_assign( | |
228 | __entry->dev = mp->m_super->s_dev; | |
229 | __entry->nr_to_scan = sc->nr_to_scan; | |
230 | __entry->caller_ip = caller_ip; | |
231 | ), | |
232 | TP_printk("dev %d:%d nr_to_scan %lu caller %pS", | |
233 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
234 | __entry->nr_to_scan, | |
235 | __entry->caller_ip) | |
236 | ); | |
237 | ||
d123031a DC |
238 | DECLARE_EVENT_CLASS(xfs_ag_class, |
239 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), | |
240 | TP_ARGS(mp, agno), | |
241 | TP_STRUCT__entry( | |
242 | __field(dev_t, dev) | |
243 | __field(xfs_agnumber_t, agno) | |
244 | ), | |
245 | TP_fast_assign( | |
246 | __entry->dev = mp->m_super->s_dev; | |
247 | __entry->agno = agno; | |
248 | ), | |
9febf39d | 249 | TP_printk("dev %d:%d agno 0x%x", |
d123031a DC |
250 | MAJOR(__entry->dev), MINOR(__entry->dev), |
251 | __entry->agno) | |
252 | ); | |
253 | #define DEFINE_AG_EVENT(name) \ | |
254 | DEFINE_EVENT(xfs_ag_class, name, \ | |
255 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \ | |
256 | TP_ARGS(mp, agno)) | |
257 | ||
258 | DEFINE_AG_EVENT(xfs_read_agf); | |
259 | DEFINE_AG_EVENT(xfs_alloc_read_agf); | |
260 | DEFINE_AG_EVENT(xfs_read_agi); | |
261 | DEFINE_AG_EVENT(xfs_ialloc_read_agi); | |
262 | ||
0b1b213f CH |
263 | TRACE_EVENT(xfs_attr_list_node_descend, |
264 | TP_PROTO(struct xfs_attr_list_context *ctx, | |
265 | struct xfs_da_node_entry *btree), | |
266 | TP_ARGS(ctx, btree), | |
267 | TP_STRUCT__entry( | |
268 | __field(dev_t, dev) | |
269 | __field(xfs_ino_t, ino) | |
270 | __field(u32, hashval) | |
271 | __field(u32, blkno) | |
272 | __field(u32, offset) | |
a9c8c69b | 273 | __field(void *, buffer) |
0b1b213f CH |
274 | __field(int, bufsize) |
275 | __field(int, count) | |
276 | __field(int, firstu) | |
277 | __field(int, dupcnt) | |
d5f0f49a | 278 | __field(unsigned int, attr_filter) |
0b1b213f CH |
279 | __field(u32, bt_hashval) |
280 | __field(u32, bt_before) | |
281 | ), | |
282 | TP_fast_assign( | |
283 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; | |
284 | __entry->ino = ctx->dp->i_ino; | |
e3a19cde CH |
285 | __entry->hashval = ctx->cursor.hashval; |
286 | __entry->blkno = ctx->cursor.blkno; | |
287 | __entry->offset = ctx->cursor.offset; | |
a9c8c69b | 288 | __entry->buffer = ctx->buffer; |
0b1b213f CH |
289 | __entry->bufsize = ctx->bufsize; |
290 | __entry->count = ctx->count; | |
291 | __entry->firstu = ctx->firstu; | |
d5f0f49a | 292 | __entry->attr_filter = ctx->attr_filter; |
0b1b213f CH |
293 | __entry->bt_hashval = be32_to_cpu(btree->hashval); |
294 | __entry->bt_before = be32_to_cpu(btree->before); | |
295 | ), | |
296 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " | |
d5f0f49a | 297 | "buffer %p size %u count %u firstu %u filter %s " |
0b1b213f CH |
298 | "node hashval %u, node before %u", |
299 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
300 | __entry->ino, | |
301 | __entry->hashval, | |
302 | __entry->blkno, | |
303 | __entry->offset, | |
304 | __entry->dupcnt, | |
a9c8c69b | 305 | __entry->buffer, |
0b1b213f CH |
306 | __entry->bufsize, |
307 | __entry->count, | |
308 | __entry->firstu, | |
d5f0f49a CH |
309 | __print_flags(__entry->attr_filter, "|", |
310 | XFS_ATTR_FILTER_FLAGS), | |
0b1b213f CH |
311 | __entry->bt_hashval, |
312 | __entry->bt_before) | |
313 | ); | |
314 | ||
ea9a4888 | 315 | DECLARE_EVENT_CLASS(xfs_bmap_class, |
b2b1712a | 316 | TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, |
ea9a4888 | 317 | unsigned long caller_ip), |
b2b1712a | 318 | TP_ARGS(ip, cur, state, caller_ip), |
ea9a4888 CH |
319 | TP_STRUCT__entry( |
320 | __field(dev_t, dev) | |
321 | __field(xfs_ino_t, ino) | |
04ae87a5 PZ |
322 | __field(void *, leaf) |
323 | __field(int, pos) | |
ea9a4888 CH |
324 | __field(xfs_fileoff_t, startoff) |
325 | __field(xfs_fsblock_t, startblock) | |
326 | __field(xfs_filblks_t, blockcount) | |
327 | __field(xfs_exntst_t, state) | |
328 | __field(int, bmap_state) | |
329 | __field(unsigned long, caller_ip) | |
330 | ), | |
331 | TP_fast_assign( | |
3993baeb | 332 | struct xfs_ifork *ifp; |
ea9a4888 CH |
333 | struct xfs_bmbt_irec r; |
334 | ||
3993baeb | 335 | ifp = xfs_iext_state_to_fork(ip, state); |
b2b1712a | 336 | xfs_iext_get_extent(ifp, cur, &r); |
ea9a4888 CH |
337 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
338 | __entry->ino = ip->i_ino; | |
6bdcf26a CH |
339 | __entry->leaf = cur->leaf; |
340 | __entry->pos = cur->pos; | |
ea9a4888 CH |
341 | __entry->startoff = r.br_startoff; |
342 | __entry->startblock = r.br_startblock; | |
343 | __entry->blockcount = r.br_blockcount; | |
344 | __entry->state = r.br_state; | |
345 | __entry->bmap_state = state; | |
346 | __entry->caller_ip = caller_ip; | |
347 | ), | |
3d170aa2 | 348 | TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d " |
aff68a55 | 349 | "offset %lld block %lld count %lld flag %d caller %pS", |
ea9a4888 CH |
350 | MAJOR(__entry->dev), MINOR(__entry->dev), |
351 | __entry->ino, | |
352 | __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), | |
6bdcf26a CH |
353 | __entry->leaf, |
354 | __entry->pos, | |
ea9a4888 | 355 | __entry->startoff, |
c8ce540d | 356 | (int64_t)__entry->startblock, |
ea9a4888 CH |
357 | __entry->blockcount, |
358 | __entry->state, | |
359 | (char *)__entry->caller_ip) | |
360 | ) | |
361 | ||
0b1b213f | 362 | #define DEFINE_BMAP_EVENT(name) \ |
ea9a4888 | 363 | DEFINE_EVENT(xfs_bmap_class, name, \ |
b2b1712a | 364 | TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \ |
0b1b213f | 365 | unsigned long caller_ip), \ |
b2b1712a | 366 | TP_ARGS(ip, cur, state, caller_ip)) |
6bdcf26a | 367 | DEFINE_BMAP_EVENT(xfs_iext_insert); |
0b1b213f CH |
368 | DEFINE_BMAP_EVENT(xfs_iext_remove); |
369 | DEFINE_BMAP_EVENT(xfs_bmap_pre_update); | |
370 | DEFINE_BMAP_EVENT(xfs_bmap_post_update); | |
e8e0e170 CH |
371 | DEFINE_BMAP_EVENT(xfs_read_extent); |
372 | DEFINE_BMAP_EVENT(xfs_write_extent); | |
0b1b213f | 373 | |
ea9a4888 CH |
374 | DECLARE_EVENT_CLASS(xfs_buf_class, |
375 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), | |
376 | TP_ARGS(bp, caller_ip), | |
377 | TP_STRUCT__entry( | |
378 | __field(dev_t, dev) | |
379 | __field(xfs_daddr_t, bno) | |
4e94b71b | 380 | __field(int, nblks) |
ea9a4888 CH |
381 | __field(int, hold) |
382 | __field(int, pincount) | |
383 | __field(unsigned, lockval) | |
384 | __field(unsigned, flags) | |
385 | __field(unsigned long, caller_ip) | |
386 | ), | |
387 | TP_fast_assign( | |
388 | __entry->dev = bp->b_target->bt_dev; | |
d61fa8cb DC |
389 | if (bp->b_bn == XFS_BUF_DADDR_NULL) |
390 | __entry->bno = bp->b_maps[0].bm_bn; | |
391 | else | |
392 | __entry->bno = bp->b_bn; | |
4e94b71b | 393 | __entry->nblks = bp->b_length; |
ea9a4888 CH |
394 | __entry->hold = atomic_read(&bp->b_hold); |
395 | __entry->pincount = atomic_read(&bp->b_pin_count); | |
0c842ad4 | 396 | __entry->lockval = bp->b_sema.count; |
ea9a4888 CH |
397 | __entry->flags = bp->b_flags; |
398 | __entry->caller_ip = caller_ip; | |
399 | ), | |
4e94b71b | 400 | TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d " |
aff68a55 | 401 | "lock %d flags %s caller %pS", |
ea9a4888 CH |
402 | MAJOR(__entry->dev), MINOR(__entry->dev), |
403 | (unsigned long long)__entry->bno, | |
4e94b71b | 404 | __entry->nblks, |
ea9a4888 CH |
405 | __entry->hold, |
406 | __entry->pincount, | |
407 | __entry->lockval, | |
408 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), | |
409 | (void *)__entry->caller_ip) | |
0b1b213f | 410 | ) |
ea9a4888 CH |
411 | |
412 | #define DEFINE_BUF_EVENT(name) \ | |
413 | DEFINE_EVENT(xfs_buf_class, name, \ | |
414 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \ | |
415 | TP_ARGS(bp, caller_ip)) | |
0b1b213f CH |
416 | DEFINE_BUF_EVENT(xfs_buf_init); |
417 | DEFINE_BUF_EVENT(xfs_buf_free); | |
418 | DEFINE_BUF_EVENT(xfs_buf_hold); | |
419 | DEFINE_BUF_EVENT(xfs_buf_rele); | |
0b1b213f | 420 | DEFINE_BUF_EVENT(xfs_buf_iodone); |
595bff75 | 421 | DEFINE_BUF_EVENT(xfs_buf_submit); |
0b1b213f CH |
422 | DEFINE_BUF_EVENT(xfs_buf_lock); |
423 | DEFINE_BUF_EVENT(xfs_buf_lock_done); | |
479c6412 | 424 | DEFINE_BUF_EVENT(xfs_buf_trylock_fail); |
0c842ad4 | 425 | DEFINE_BUF_EVENT(xfs_buf_trylock); |
0b1b213f | 426 | DEFINE_BUF_EVENT(xfs_buf_unlock); |
0b1b213f CH |
427 | DEFINE_BUF_EVENT(xfs_buf_iowait); |
428 | DEFINE_BUF_EVENT(xfs_buf_iowait_done); | |
429 | DEFINE_BUF_EVENT(xfs_buf_delwri_queue); | |
43ff2122 | 430 | DEFINE_BUF_EVENT(xfs_buf_delwri_queued); |
0b1b213f | 431 | DEFINE_BUF_EVENT(xfs_buf_delwri_split); |
7912e7fe | 432 | DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf); |
686865f7 | 433 | DEFINE_BUF_EVENT(xfs_buf_get_uncached); |
0b1b213f | 434 | DEFINE_BUF_EVENT(xfs_buf_item_relse); |
664ffb8a | 435 | DEFINE_BUF_EVENT(xfs_buf_iodone_async); |
0b1b213f | 436 | DEFINE_BUF_EVENT(xfs_buf_error_relse); |
10fb9ac1 | 437 | DEFINE_BUF_EVENT(xfs_buf_drain_buftarg); |
0b1b213f CH |
438 | DEFINE_BUF_EVENT(xfs_trans_read_buf_shut); |
439 | ||
440 | /* not really buffer traces, but the buf provides useful information */ | |
441 | DEFINE_BUF_EVENT(xfs_btree_corrupt); | |
0b1b213f | 442 | DEFINE_BUF_EVENT(xfs_reset_dqcounts); |
0b1b213f CH |
443 | |
444 | /* pass flags explicitly */ | |
ea9a4888 CH |
445 | DECLARE_EVENT_CLASS(xfs_buf_flags_class, |
446 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), | |
447 | TP_ARGS(bp, flags, caller_ip), | |
448 | TP_STRUCT__entry( | |
449 | __field(dev_t, dev) | |
450 | __field(xfs_daddr_t, bno) | |
451 | __field(size_t, buffer_length) | |
452 | __field(int, hold) | |
453 | __field(int, pincount) | |
454 | __field(unsigned, lockval) | |
455 | __field(unsigned, flags) | |
456 | __field(unsigned long, caller_ip) | |
457 | ), | |
458 | TP_fast_assign( | |
459 | __entry->dev = bp->b_target->bt_dev; | |
460 | __entry->bno = bp->b_bn; | |
4e94b71b | 461 | __entry->buffer_length = BBTOB(bp->b_length); |
ea9a4888 CH |
462 | __entry->flags = flags; |
463 | __entry->hold = atomic_read(&bp->b_hold); | |
464 | __entry->pincount = atomic_read(&bp->b_pin_count); | |
0c842ad4 | 465 | __entry->lockval = bp->b_sema.count; |
ea9a4888 CH |
466 | __entry->caller_ip = caller_ip; |
467 | ), | |
468 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
aff68a55 | 469 | "lock %d flags %s caller %pS", |
ea9a4888 CH |
470 | MAJOR(__entry->dev), MINOR(__entry->dev), |
471 | (unsigned long long)__entry->bno, | |
472 | __entry->buffer_length, | |
473 | __entry->hold, | |
474 | __entry->pincount, | |
475 | __entry->lockval, | |
476 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), | |
477 | (void *)__entry->caller_ip) | |
0b1b213f | 478 | ) |
ea9a4888 CH |
479 | |
480 | #define DEFINE_BUF_FLAGS_EVENT(name) \ | |
481 | DEFINE_EVENT(xfs_buf_flags_class, name, \ | |
482 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \ | |
483 | TP_ARGS(bp, flags, caller_ip)) | |
0b1b213f CH |
484 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_find); |
485 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_get); | |
486 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_read); | |
487 | ||
488 | TRACE_EVENT(xfs_buf_ioerror, | |
31ca03c9 | 489 | TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip), |
0b1b213f CH |
490 | TP_ARGS(bp, error, caller_ip), |
491 | TP_STRUCT__entry( | |
492 | __field(dev_t, dev) | |
493 | __field(xfs_daddr_t, bno) | |
494 | __field(size_t, buffer_length) | |
495 | __field(unsigned, flags) | |
496 | __field(int, hold) | |
497 | __field(int, pincount) | |
498 | __field(unsigned, lockval) | |
499 | __field(int, error) | |
31ca03c9 | 500 | __field(xfs_failaddr_t, caller_ip) |
0b1b213f CH |
501 | ), |
502 | TP_fast_assign( | |
503 | __entry->dev = bp->b_target->bt_dev; | |
504 | __entry->bno = bp->b_bn; | |
4e94b71b | 505 | __entry->buffer_length = BBTOB(bp->b_length); |
0b1b213f CH |
506 | __entry->hold = atomic_read(&bp->b_hold); |
507 | __entry->pincount = atomic_read(&bp->b_pin_count); | |
0c842ad4 | 508 | __entry->lockval = bp->b_sema.count; |
0b1b213f CH |
509 | __entry->error = error; |
510 | __entry->flags = bp->b_flags; | |
511 | __entry->caller_ip = caller_ip; | |
512 | ), | |
513 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
31ca03c9 | 514 | "lock %d error %d flags %s caller %pS", |
0b1b213f CH |
515 | MAJOR(__entry->dev), MINOR(__entry->dev), |
516 | (unsigned long long)__entry->bno, | |
517 | __entry->buffer_length, | |
518 | __entry->hold, | |
519 | __entry->pincount, | |
520 | __entry->lockval, | |
521 | __entry->error, | |
522 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), | |
523 | (void *)__entry->caller_ip) | |
524 | ); | |
525 | ||
ea9a4888 CH |
526 | DECLARE_EVENT_CLASS(xfs_buf_item_class, |
527 | TP_PROTO(struct xfs_buf_log_item *bip), | |
528 | TP_ARGS(bip), | |
529 | TP_STRUCT__entry( | |
530 | __field(dev_t, dev) | |
531 | __field(xfs_daddr_t, buf_bno) | |
532 | __field(size_t, buf_len) | |
533 | __field(int, buf_hold) | |
534 | __field(int, buf_pincount) | |
535 | __field(int, buf_lockval) | |
536 | __field(unsigned, buf_flags) | |
537 | __field(unsigned, bli_recur) | |
538 | __field(int, bli_refcount) | |
539 | __field(unsigned, bli_flags) | |
22525c17 | 540 | __field(unsigned long, li_flags) |
ea9a4888 CH |
541 | ), |
542 | TP_fast_assign( | |
543 | __entry->dev = bip->bli_buf->b_target->bt_dev; | |
544 | __entry->bli_flags = bip->bli_flags; | |
545 | __entry->bli_recur = bip->bli_recur; | |
546 | __entry->bli_refcount = atomic_read(&bip->bli_refcount); | |
547 | __entry->buf_bno = bip->bli_buf->b_bn; | |
4e94b71b | 548 | __entry->buf_len = BBTOB(bip->bli_buf->b_length); |
ea9a4888 CH |
549 | __entry->buf_flags = bip->bli_buf->b_flags; |
550 | __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold); | |
551 | __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count); | |
0c842ad4 | 552 | __entry->buf_lockval = bip->bli_buf->b_sema.count; |
ea9a4888 CH |
553 | __entry->li_flags = bip->bli_item.li_flags; |
554 | ), | |
555 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " | |
556 | "lock %d flags %s recur %d refcount %d bliflags %s " | |
e6631f85 | 557 | "liflags %s", |
ea9a4888 CH |
558 | MAJOR(__entry->dev), MINOR(__entry->dev), |
559 | (unsigned long long)__entry->buf_bno, | |
560 | __entry->buf_len, | |
561 | __entry->buf_hold, | |
562 | __entry->buf_pincount, | |
563 | __entry->buf_lockval, | |
564 | __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS), | |
565 | __entry->bli_recur, | |
566 | __entry->bli_refcount, | |
567 | __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS), | |
ea9a4888 | 568 | __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS)) |
0b1b213f | 569 | ) |
ea9a4888 CH |
570 | |
571 | #define DEFINE_BUF_ITEM_EVENT(name) \ | |
572 | DEFINE_EVENT(xfs_buf_item_class, name, \ | |
573 | TP_PROTO(struct xfs_buf_log_item *bip), \ | |
574 | TP_ARGS(bip)) | |
0b1b213f | 575 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size); |
5f6bed76 | 576 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered); |
0b1b213f CH |
577 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale); |
578 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format); | |
579 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale); | |
5f6bed76 | 580 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered); |
0b1b213f CH |
581 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin); |
582 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin); | |
583 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale); | |
ddf92053 | 584 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release); |
0b1b213f CH |
585 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed); |
586 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push); | |
587 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf); | |
588 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur); | |
589 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb); | |
590 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur); | |
591 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf); | |
592 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur); | |
593 | DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf); | |
594 | DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse); | |
595 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin); | |
596 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold); | |
597 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release); | |
598 | DEFINE_BUF_ITEM_EVENT(xfs_trans_binval); | |
599 | ||
b94acd47 | 600 | DECLARE_EVENT_CLASS(xfs_filestream_class, |
7fcd3efa CH |
601 | TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), |
602 | TP_ARGS(mp, ino, agno), | |
b94acd47 CH |
603 | TP_STRUCT__entry( |
604 | __field(dev_t, dev) | |
605 | __field(xfs_ino_t, ino) | |
606 | __field(xfs_agnumber_t, agno) | |
607 | __field(int, streams) | |
608 | ), | |
609 | TP_fast_assign( | |
7fcd3efa CH |
610 | __entry->dev = mp->m_super->s_dev; |
611 | __entry->ino = ino; | |
b94acd47 | 612 | __entry->agno = agno; |
7fcd3efa | 613 | __entry->streams = xfs_filestream_peek_ag(mp, agno); |
b94acd47 | 614 | ), |
9febf39d | 615 | TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d", |
b94acd47 CH |
616 | MAJOR(__entry->dev), MINOR(__entry->dev), |
617 | __entry->ino, | |
618 | __entry->agno, | |
619 | __entry->streams) | |
620 | ) | |
621 | #define DEFINE_FILESTREAM_EVENT(name) \ | |
622 | DEFINE_EVENT(xfs_filestream_class, name, \ | |
7fcd3efa CH |
623 | TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \ |
624 | TP_ARGS(mp, ino, agno)) | |
b94acd47 CH |
625 | DEFINE_FILESTREAM_EVENT(xfs_filestream_free); |
626 | DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup); | |
627 | DEFINE_FILESTREAM_EVENT(xfs_filestream_scan); | |
628 | ||
629 | TRACE_EVENT(xfs_filestream_pick, | |
630 | TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno, | |
631 | xfs_extlen_t free, int nscan), | |
632 | TP_ARGS(ip, agno, free, nscan), | |
633 | TP_STRUCT__entry( | |
634 | __field(dev_t, dev) | |
635 | __field(xfs_ino_t, ino) | |
636 | __field(xfs_agnumber_t, agno) | |
637 | __field(int, streams) | |
638 | __field(xfs_extlen_t, free) | |
639 | __field(int, nscan) | |
640 | ), | |
641 | TP_fast_assign( | |
642 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
643 | __entry->ino = ip->i_ino; | |
644 | __entry->agno = agno; | |
645 | __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno); | |
646 | __entry->free = free; | |
647 | __entry->nscan = nscan; | |
648 | ), | |
9febf39d | 649 | TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d nscan %d", |
b94acd47 CH |
650 | MAJOR(__entry->dev), MINOR(__entry->dev), |
651 | __entry->ino, | |
652 | __entry->agno, | |
653 | __entry->streams, | |
654 | __entry->free, | |
655 | __entry->nscan) | |
656 | ); | |
657 | ||
ea9a4888 CH |
658 | DECLARE_EVENT_CLASS(xfs_lock_class, |
659 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, | |
660 | unsigned long caller_ip), | |
661 | TP_ARGS(ip, lock_flags, caller_ip), | |
662 | TP_STRUCT__entry( | |
663 | __field(dev_t, dev) | |
664 | __field(xfs_ino_t, ino) | |
665 | __field(int, lock_flags) | |
666 | __field(unsigned long, caller_ip) | |
667 | ), | |
668 | TP_fast_assign( | |
669 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
670 | __entry->ino = ip->i_ino; | |
671 | __entry->lock_flags = lock_flags; | |
672 | __entry->caller_ip = caller_ip; | |
673 | ), | |
aff68a55 | 674 | TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS", |
ea9a4888 CH |
675 | MAJOR(__entry->dev), MINOR(__entry->dev), |
676 | __entry->ino, | |
677 | __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS), | |
678 | (void *)__entry->caller_ip) | |
679 | ) | |
680 | ||
0b1b213f | 681 | #define DEFINE_LOCK_EVENT(name) \ |
ea9a4888 | 682 | DEFINE_EVENT(xfs_lock_class, name, \ |
0b1b213f CH |
683 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ |
684 | unsigned long caller_ip), \ | |
ea9a4888 | 685 | TP_ARGS(ip, lock_flags, caller_ip)) |
0b1b213f CH |
686 | DEFINE_LOCK_EVENT(xfs_ilock); |
687 | DEFINE_LOCK_EVENT(xfs_ilock_nowait); | |
688 | DEFINE_LOCK_EVENT(xfs_ilock_demote); | |
689 | DEFINE_LOCK_EVENT(xfs_iunlock); | |
690 | ||
cca28fb8 | 691 | DECLARE_EVENT_CLASS(xfs_inode_class, |
ea9a4888 CH |
692 | TP_PROTO(struct xfs_inode *ip), |
693 | TP_ARGS(ip), | |
694 | TP_STRUCT__entry( | |
695 | __field(dev_t, dev) | |
696 | __field(xfs_ino_t, ino) | |
ab23a776 | 697 | __field(unsigned long, iflags) |
ea9a4888 CH |
698 | ), |
699 | TP_fast_assign( | |
700 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
701 | __entry->ino = ip->i_ino; | |
ab23a776 | 702 | __entry->iflags = ip->i_flags; |
ea9a4888 | 703 | ), |
ab23a776 | 704 | TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx", |
ea9a4888 | 705 | MAJOR(__entry->dev), MINOR(__entry->dev), |
ab23a776 DC |
706 | __entry->ino, |
707 | __entry->iflags) | |
ea9a4888 CH |
708 | ) |
709 | ||
cca28fb8 CH |
710 | #define DEFINE_INODE_EVENT(name) \ |
711 | DEFINE_EVENT(xfs_inode_class, name, \ | |
0b1b213f | 712 | TP_PROTO(struct xfs_inode *ip), \ |
ea9a4888 | 713 | TP_ARGS(ip)) |
cca28fb8 | 714 | DEFINE_INODE_EVENT(xfs_iget_skip); |
ff7bebeb DW |
715 | DEFINE_INODE_EVENT(xfs_iget_recycle); |
716 | DEFINE_INODE_EVENT(xfs_iget_recycle_fail); | |
cca28fb8 CH |
717 | DEFINE_INODE_EVENT(xfs_iget_hit); |
718 | DEFINE_INODE_EVENT(xfs_iget_miss); | |
0b1b213f | 719 | |
cca28fb8 CH |
720 | DEFINE_INODE_EVENT(xfs_getattr); |
721 | DEFINE_INODE_EVENT(xfs_setattr); | |
722 | DEFINE_INODE_EVENT(xfs_readlink); | |
725eb1eb | 723 | DEFINE_INODE_EVENT(xfs_inactive_symlink); |
cca28fb8 CH |
724 | DEFINE_INODE_EVENT(xfs_alloc_file_space); |
725 | DEFINE_INODE_EVENT(xfs_free_file_space); | |
897b73b6 | 726 | DEFINE_INODE_EVENT(xfs_zero_file_space); |
e1d8fb88 | 727 | DEFINE_INODE_EVENT(xfs_collapse_file_space); |
a904b1ca | 728 | DEFINE_INODE_EVENT(xfs_insert_file_space); |
cca28fb8 | 729 | DEFINE_INODE_EVENT(xfs_readdir); |
0f1a932f | 730 | #ifdef CONFIG_XFS_POSIX_ACL |
4e34e719 | 731 | DEFINE_INODE_EVENT(xfs_get_acl); |
0f1a932f | 732 | #endif |
cca28fb8 CH |
733 | DEFINE_INODE_EVENT(xfs_vm_bmap); |
734 | DEFINE_INODE_EVENT(xfs_file_ioctl); | |
735 | DEFINE_INODE_EVENT(xfs_file_compat_ioctl); | |
736 | DEFINE_INODE_EVENT(xfs_ioctl_setattr); | |
1da2f2db | 737 | DEFINE_INODE_EVENT(xfs_dir_fsync); |
cca28fb8 CH |
738 | DEFINE_INODE_EVENT(xfs_file_fsync); |
739 | DEFINE_INODE_EVENT(xfs_destroy_inode); | |
69ff2826 | 740 | DEFINE_INODE_EVENT(xfs_update_time); |
cca28fb8 CH |
741 | |
742 | DEFINE_INODE_EVENT(xfs_dquot_dqalloc); | |
743 | DEFINE_INODE_EVENT(xfs_dquot_dqdetach); | |
744 | ||
27b52867 BF |
745 | DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag); |
746 | DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag); | |
41176a68 | 747 | DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid); |
83104d44 DW |
748 | DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag); |
749 | DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag); | |
750 | DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid); | |
ab23a776 DC |
751 | DEFINE_INODE_EVENT(xfs_inode_set_reclaimable); |
752 | DEFINE_INODE_EVENT(xfs_inode_reclaiming); | |
753 | DEFINE_INODE_EVENT(xfs_inode_set_need_inactive); | |
754 | DEFINE_INODE_EVENT(xfs_inode_inactivating); | |
27b52867 | 755 | |
85f8dff0 DW |
756 | /* |
757 | * ftrace's __print_symbolic requires that all enum values be wrapped in the | |
758 | * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace | |
759 | * ring buffer. Somehow this was only worth mentioning in the ftrace sample | |
760 | * code. | |
761 | */ | |
762 | TRACE_DEFINE_ENUM(PE_SIZE_PTE); | |
763 | TRACE_DEFINE_ENUM(PE_SIZE_PMD); | |
764 | TRACE_DEFINE_ENUM(PE_SIZE_PUD); | |
765 | ||
d522d569 CH |
766 | TRACE_EVENT(xfs_filemap_fault, |
767 | TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size, | |
768 | bool write_fault), | |
769 | TP_ARGS(ip, pe_size, write_fault), | |
770 | TP_STRUCT__entry( | |
771 | __field(dev_t, dev) | |
772 | __field(xfs_ino_t, ino) | |
773 | __field(enum page_entry_size, pe_size) | |
774 | __field(bool, write_fault) | |
775 | ), | |
776 | TP_fast_assign( | |
777 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
778 | __entry->ino = ip->i_ino; | |
779 | __entry->pe_size = pe_size; | |
780 | __entry->write_fault = write_fault; | |
781 | ), | |
782 | TP_printk("dev %d:%d ino 0x%llx %s write_fault %d", | |
783 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
784 | __entry->ino, | |
785 | __print_symbolic(__entry->pe_size, | |
786 | { PE_SIZE_PTE, "PTE" }, | |
787 | { PE_SIZE_PMD, "PMD" }, | |
788 | { PE_SIZE_PUD, "PUD" }), | |
789 | __entry->write_fault) | |
790 | ) | |
791 | ||
cca28fb8 | 792 | DECLARE_EVENT_CLASS(xfs_iref_class, |
ea9a4888 CH |
793 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), |
794 | TP_ARGS(ip, caller_ip), | |
795 | TP_STRUCT__entry( | |
796 | __field(dev_t, dev) | |
797 | __field(xfs_ino_t, ino) | |
798 | __field(int, count) | |
4aaf15d1 | 799 | __field(int, pincount) |
ea9a4888 CH |
800 | __field(unsigned long, caller_ip) |
801 | ), | |
802 | TP_fast_assign( | |
803 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
804 | __entry->ino = ip->i_ino; | |
805 | __entry->count = atomic_read(&VFS_I(ip)->i_count); | |
4aaf15d1 | 806 | __entry->pincount = atomic_read(&ip->i_pincount); |
ea9a4888 CH |
807 | __entry->caller_ip = caller_ip; |
808 | ), | |
aff68a55 | 809 | TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS", |
ea9a4888 CH |
810 | MAJOR(__entry->dev), MINOR(__entry->dev), |
811 | __entry->ino, | |
812 | __entry->count, | |
4aaf15d1 | 813 | __entry->pincount, |
ea9a4888 | 814 | (char *)__entry->caller_ip) |
19cb7e38 BF |
815 | ) |
816 | ||
817 | TRACE_EVENT(xfs_iomap_prealloc_size, | |
818 | TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift, | |
819 | unsigned int writeio_blocks), | |
820 | TP_ARGS(ip, blocks, shift, writeio_blocks), | |
821 | TP_STRUCT__entry( | |
822 | __field(dev_t, dev) | |
823 | __field(xfs_ino_t, ino) | |
824 | __field(xfs_fsblock_t, blocks) | |
825 | __field(int, shift) | |
826 | __field(unsigned int, writeio_blocks) | |
827 | ), | |
828 | TP_fast_assign( | |
829 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
830 | __entry->ino = ip->i_ino; | |
831 | __entry->blocks = blocks; | |
832 | __entry->shift = shift; | |
833 | __entry->writeio_blocks = writeio_blocks; | |
834 | ), | |
835 | TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d " | |
5da8a07c | 836 | "m_allocsize_blocks %u", |
19cb7e38 BF |
837 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, |
838 | __entry->blocks, __entry->shift, __entry->writeio_blocks) | |
ea9a4888 CH |
839 | ) |
840 | ||
56d1115c BF |
841 | TRACE_EVENT(xfs_irec_merge_pre, |
842 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, | |
843 | uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask), | |
844 | TP_ARGS(mp, agno, agino, holemask, nagino, nholemask), | |
845 | TP_STRUCT__entry( | |
846 | __field(dev_t, dev) | |
847 | __field(xfs_agnumber_t, agno) | |
848 | __field(xfs_agino_t, agino) | |
849 | __field(uint16_t, holemask) | |
850 | __field(xfs_agino_t, nagino) | |
851 | __field(uint16_t, nholemask) | |
852 | ), | |
853 | TP_fast_assign( | |
854 | __entry->dev = mp->m_super->s_dev; | |
855 | __entry->agno = agno; | |
856 | __entry->agino = agino; | |
857 | __entry->holemask = holemask; | |
858 | __entry->nagino = nagino; | |
859 | __entry->nholemask = holemask; | |
860 | ), | |
9febf39d | 861 | TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x", |
af6265a0 DW |
862 | MAJOR(__entry->dev), MINOR(__entry->dev), |
863 | __entry->agno, | |
864 | __entry->agino, | |
865 | __entry->holemask, | |
866 | __entry->nagino, | |
56d1115c BF |
867 | __entry->nholemask) |
868 | ) | |
869 | ||
870 | TRACE_EVENT(xfs_irec_merge_post, | |
871 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, | |
872 | uint16_t holemask), | |
873 | TP_ARGS(mp, agno, agino, holemask), | |
874 | TP_STRUCT__entry( | |
875 | __field(dev_t, dev) | |
876 | __field(xfs_agnumber_t, agno) | |
877 | __field(xfs_agino_t, agino) | |
878 | __field(uint16_t, holemask) | |
879 | ), | |
880 | TP_fast_assign( | |
881 | __entry->dev = mp->m_super->s_dev; | |
882 | __entry->agno = agno; | |
883 | __entry->agino = agino; | |
884 | __entry->holemask = holemask; | |
885 | ), | |
9febf39d | 886 | TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x", |
af6265a0 DW |
887 | MAJOR(__entry->dev), |
888 | MINOR(__entry->dev), | |
889 | __entry->agno, | |
890 | __entry->agino, | |
56d1115c BF |
891 | __entry->holemask) |
892 | ) | |
893 | ||
cca28fb8 CH |
894 | #define DEFINE_IREF_EVENT(name) \ |
895 | DEFINE_EVENT(xfs_iref_class, name, \ | |
0b1b213f | 896 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \ |
ea9a4888 | 897 | TP_ARGS(ip, caller_ip)) |
cca28fb8 CH |
898 | DEFINE_IREF_EVENT(xfs_irele); |
899 | DEFINE_IREF_EVENT(xfs_inode_pin); | |
900 | DEFINE_IREF_EVENT(xfs_inode_unpin); | |
901 | DEFINE_IREF_EVENT(xfs_inode_unpin_nowait); | |
902 | ||
903 | DECLARE_EVENT_CLASS(xfs_namespace_class, | |
904 | TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), | |
905 | TP_ARGS(dp, name), | |
906 | TP_STRUCT__entry( | |
907 | __field(dev_t, dev) | |
908 | __field(xfs_ino_t, dp_ino) | |
f6161375 | 909 | __field(int, namelen) |
cca28fb8 CH |
910 | __dynamic_array(char, name, name->len) |
911 | ), | |
912 | TP_fast_assign( | |
913 | __entry->dev = VFS_I(dp)->i_sb->s_dev; | |
914 | __entry->dp_ino = dp->i_ino; | |
f6161375 | 915 | __entry->namelen = name->len; |
cca28fb8 CH |
916 | memcpy(__get_str(name), name->name, name->len); |
917 | ), | |
f6161375 | 918 | TP_printk("dev %d:%d dp ino 0x%llx name %.*s", |
cca28fb8 CH |
919 | MAJOR(__entry->dev), MINOR(__entry->dev), |
920 | __entry->dp_ino, | |
f6161375 | 921 | __entry->namelen, |
cca28fb8 CH |
922 | __get_str(name)) |
923 | ) | |
924 | ||
925 | #define DEFINE_NAMESPACE_EVENT(name) \ | |
926 | DEFINE_EVENT(xfs_namespace_class, name, \ | |
927 | TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \ | |
928 | TP_ARGS(dp, name)) | |
929 | DEFINE_NAMESPACE_EVENT(xfs_remove); | |
930 | DEFINE_NAMESPACE_EVENT(xfs_link); | |
931 | DEFINE_NAMESPACE_EVENT(xfs_lookup); | |
932 | DEFINE_NAMESPACE_EVENT(xfs_create); | |
933 | DEFINE_NAMESPACE_EVENT(xfs_symlink); | |
4aaf15d1 | 934 | |
cca28fb8 CH |
935 | TRACE_EVENT(xfs_rename, |
936 | TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp, | |
937 | struct xfs_name *src_name, struct xfs_name *target_name), | |
938 | TP_ARGS(src_dp, target_dp, src_name, target_name), | |
939 | TP_STRUCT__entry( | |
940 | __field(dev_t, dev) | |
941 | __field(xfs_ino_t, src_dp_ino) | |
942 | __field(xfs_ino_t, target_dp_ino) | |
f6161375 CH |
943 | __field(int, src_namelen) |
944 | __field(int, target_namelen) | |
cca28fb8 CH |
945 | __dynamic_array(char, src_name, src_name->len) |
946 | __dynamic_array(char, target_name, target_name->len) | |
947 | ), | |
948 | TP_fast_assign( | |
949 | __entry->dev = VFS_I(src_dp)->i_sb->s_dev; | |
950 | __entry->src_dp_ino = src_dp->i_ino; | |
951 | __entry->target_dp_ino = target_dp->i_ino; | |
f6161375 CH |
952 | __entry->src_namelen = src_name->len; |
953 | __entry->target_namelen = target_name->len; | |
cca28fb8 | 954 | memcpy(__get_str(src_name), src_name->name, src_name->len); |
f6161375 CH |
955 | memcpy(__get_str(target_name), target_name->name, |
956 | target_name->len); | |
cca28fb8 CH |
957 | ), |
958 | TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx" | |
f6161375 | 959 | " src name %.*s target name %.*s", |
cca28fb8 CH |
960 | MAJOR(__entry->dev), MINOR(__entry->dev), |
961 | __entry->src_dp_ino, | |
962 | __entry->target_dp_ino, | |
f6161375 | 963 | __entry->src_namelen, |
cca28fb8 | 964 | __get_str(src_name), |
f6161375 | 965 | __entry->target_namelen, |
cca28fb8 CH |
966 | __get_str(target_name)) |
967 | ) | |
0b1b213f | 968 | |
ea9a4888 CH |
969 | DECLARE_EVENT_CLASS(xfs_dquot_class, |
970 | TP_PROTO(struct xfs_dquot *dqp), | |
971 | TP_ARGS(dqp), | |
972 | TP_STRUCT__entry( | |
973 | __field(dev_t, dev) | |
b262e5df | 974 | __field(u32, id) |
1a7ed271 | 975 | __field(xfs_dqtype_t, type) |
ea9a4888 CH |
976 | __field(unsigned, flags) |
977 | __field(unsigned, nrefs) | |
978 | __field(unsigned long long, res_bcount) | |
2cb91bab DW |
979 | __field(unsigned long long, res_rtbcount) |
980 | __field(unsigned long long, res_icount) | |
981 | ||
ea9a4888 | 982 | __field(unsigned long long, bcount) |
2cb91bab | 983 | __field(unsigned long long, rtbcount) |
ea9a4888 | 984 | __field(unsigned long long, icount) |
2cb91bab | 985 | |
ea9a4888 CH |
986 | __field(unsigned long long, blk_hardlimit) |
987 | __field(unsigned long long, blk_softlimit) | |
2cb91bab DW |
988 | __field(unsigned long long, rtb_hardlimit) |
989 | __field(unsigned long long, rtb_softlimit) | |
ea9a4888 CH |
990 | __field(unsigned long long, ino_hardlimit) |
991 | __field(unsigned long long, ino_softlimit) | |
2cb91bab | 992 | ), |
ea9a4888 CH |
993 | TP_fast_assign( |
994 | __entry->dev = dqp->q_mount->m_super->s_dev; | |
c51df733 | 995 | __entry->id = dqp->q_id; |
1a7ed271 DW |
996 | __entry->type = dqp->q_type; |
997 | __entry->flags = dqp->q_flags; | |
ea9a4888 | 998 | __entry->nrefs = dqp->q_nrefs; |
2cb91bab | 999 | |
784e80f5 | 1000 | __entry->res_bcount = dqp->q_blk.reserved; |
2cb91bab DW |
1001 | __entry->res_rtbcount = dqp->q_rtb.reserved; |
1002 | __entry->res_icount = dqp->q_ino.reserved; | |
1003 | ||
be37d40c | 1004 | __entry->bcount = dqp->q_blk.count; |
2cb91bab | 1005 | __entry->rtbcount = dqp->q_rtb.count; |
be37d40c | 1006 | __entry->icount = dqp->q_ino.count; |
2cb91bab | 1007 | |
d3537cf9 DW |
1008 | __entry->blk_hardlimit = dqp->q_blk.hardlimit; |
1009 | __entry->blk_softlimit = dqp->q_blk.softlimit; | |
2cb91bab DW |
1010 | __entry->rtb_hardlimit = dqp->q_rtb.hardlimit; |
1011 | __entry->rtb_softlimit = dqp->q_rtb.softlimit; | |
d3537cf9 DW |
1012 | __entry->ino_hardlimit = dqp->q_ino.hardlimit; |
1013 | __entry->ino_softlimit = dqp->q_ino.softlimit; | |
ea9a4888 | 1014 | ), |
1a7ed271 | 1015 | TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u " |
2cb91bab | 1016 | "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx " |
b262e5df | 1017 | "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx " |
2cb91bab | 1018 | "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx " |
b262e5df | 1019 | "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]", |
ea9a4888 | 1020 | MAJOR(__entry->dev), MINOR(__entry->dev), |
b262e5df | 1021 | __entry->id, |
1a7ed271 | 1022 | __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS), |
985a78fd | 1023 | __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS), |
ea9a4888 CH |
1024 | __entry->nrefs, |
1025 | __entry->res_bcount, | |
2cb91bab DW |
1026 | __entry->res_rtbcount, |
1027 | __entry->res_icount, | |
ea9a4888 CH |
1028 | __entry->bcount, |
1029 | __entry->blk_hardlimit, | |
1030 | __entry->blk_softlimit, | |
2cb91bab DW |
1031 | __entry->rtbcount, |
1032 | __entry->rtb_hardlimit, | |
1033 | __entry->rtb_softlimit, | |
ea9a4888 CH |
1034 | __entry->icount, |
1035 | __entry->ino_hardlimit, | |
1036 | __entry->ino_softlimit) | |
0b1b213f | 1037 | ) |
ea9a4888 CH |
1038 | |
1039 | #define DEFINE_DQUOT_EVENT(name) \ | |
1040 | DEFINE_EVENT(xfs_dquot_class, name, \ | |
1041 | TP_PROTO(struct xfs_dquot *dqp), \ | |
1042 | TP_ARGS(dqp)) | |
0b1b213f | 1043 | DEFINE_DQUOT_EVENT(xfs_dqadjust); |
0b1b213f CH |
1044 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_want); |
1045 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty); | |
92b2e5b3 CH |
1046 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy); |
1047 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_done); | |
0b1b213f CH |
1048 | DEFINE_DQUOT_EVENT(xfs_dqattach_found); |
1049 | DEFINE_DQUOT_EVENT(xfs_dqattach_get); | |
0b1b213f CH |
1050 | DEFINE_DQUOT_EVENT(xfs_dqalloc); |
1051 | DEFINE_DQUOT_EVENT(xfs_dqtobp_read); | |
1052 | DEFINE_DQUOT_EVENT(xfs_dqread); | |
1053 | DEFINE_DQUOT_EVENT(xfs_dqread_fail); | |
0b1b213f CH |
1054 | DEFINE_DQUOT_EVENT(xfs_dqget_hit); |
1055 | DEFINE_DQUOT_EVENT(xfs_dqget_miss); | |
9f920f11 CH |
1056 | DEFINE_DQUOT_EVENT(xfs_dqget_freeing); |
1057 | DEFINE_DQUOT_EVENT(xfs_dqget_dup); | |
0b1b213f | 1058 | DEFINE_DQUOT_EVENT(xfs_dqput); |
0b1b213f CH |
1059 | DEFINE_DQUOT_EVENT(xfs_dqput_free); |
1060 | DEFINE_DQUOT_EVENT(xfs_dqrele); | |
1061 | DEFINE_DQUOT_EVENT(xfs_dqflush); | |
1062 | DEFINE_DQUOT_EVENT(xfs_dqflush_force); | |
1063 | DEFINE_DQUOT_EVENT(xfs_dqflush_done); | |
2cb91bab DW |
1064 | DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before); |
1065 | DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after); | |
1066 | ||
1067 | #define XFS_QMOPT_FLAGS \ | |
1068 | { XFS_QMOPT_UQUOTA, "UQUOTA" }, \ | |
1069 | { XFS_QMOPT_PQUOTA, "PQUOTA" }, \ | |
1070 | { XFS_QMOPT_FORCE_RES, "FORCE_RES" }, \ | |
1071 | { XFS_QMOPT_SBVERSION, "SBVERSION" }, \ | |
1072 | { XFS_QMOPT_GQUOTA, "GQUOTA" }, \ | |
1073 | { XFS_QMOPT_INHERIT, "INHERIT" }, \ | |
1074 | { XFS_QMOPT_RES_REGBLKS, "RES_REGBLKS" }, \ | |
1075 | { XFS_QMOPT_RES_RTBLKS, "RES_RTBLKS" }, \ | |
1076 | { XFS_QMOPT_BCOUNT, "BCOUNT" }, \ | |
1077 | { XFS_QMOPT_ICOUNT, "ICOUNT" }, \ | |
1078 | { XFS_QMOPT_RTBCOUNT, "RTBCOUNT" }, \ | |
1079 | { XFS_QMOPT_DELBCOUNT, "DELBCOUNT" }, \ | |
1080 | { XFS_QMOPT_DELRTBCOUNT, "DELRTBCOUNT" }, \ | |
1081 | { XFS_QMOPT_RES_INOS, "RES_INOS" } | |
1082 | ||
1083 | TRACE_EVENT(xfs_trans_mod_dquot, | |
1084 | TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp, | |
1085 | unsigned int field, int64_t delta), | |
1086 | TP_ARGS(tp, dqp, field, delta), | |
1087 | TP_STRUCT__entry( | |
1088 | __field(dev_t, dev) | |
1a7ed271 | 1089 | __field(xfs_dqtype_t, type) |
2cb91bab DW |
1090 | __field(unsigned int, flags) |
1091 | __field(unsigned int, dqid) | |
1092 | __field(unsigned int, field) | |
1093 | __field(int64_t, delta) | |
1094 | ), | |
1095 | TP_fast_assign( | |
1096 | __entry->dev = tp->t_mountp->m_super->s_dev; | |
1a7ed271 DW |
1097 | __entry->type = dqp->q_type; |
1098 | __entry->flags = dqp->q_flags; | |
2cb91bab DW |
1099 | __entry->dqid = dqp->q_id; |
1100 | __entry->field = field; | |
1101 | __entry->delta = delta; | |
1102 | ), | |
1a7ed271 | 1103 | TP_printk("dev %d:%d dquot id 0x%x type %s flags %s field %s delta %lld", |
2cb91bab DW |
1104 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1105 | __entry->dqid, | |
1a7ed271 | 1106 | __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS), |
2cb91bab DW |
1107 | __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS), |
1108 | __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS), | |
1109 | __entry->delta) | |
1110 | ); | |
1111 | ||
1112 | DECLARE_EVENT_CLASS(xfs_dqtrx_class, | |
1113 | TP_PROTO(struct xfs_dqtrx *qtrx), | |
1114 | TP_ARGS(qtrx), | |
1115 | TP_STRUCT__entry( | |
1116 | __field(dev_t, dev) | |
1a7ed271 | 1117 | __field(xfs_dqtype_t, type) |
2cb91bab DW |
1118 | __field(unsigned int, flags) |
1119 | __field(u32, dqid) | |
1120 | ||
1121 | __field(uint64_t, blk_res) | |
1122 | __field(int64_t, bcount_delta) | |
1123 | __field(int64_t, delbcnt_delta) | |
1124 | ||
1125 | __field(uint64_t, rtblk_res) | |
1126 | __field(uint64_t, rtblk_res_used) | |
1127 | __field(int64_t, rtbcount_delta) | |
1128 | __field(int64_t, delrtb_delta) | |
1129 | ||
1130 | __field(uint64_t, ino_res) | |
1131 | __field(uint64_t, ino_res_used) | |
1132 | __field(int64_t, icount_delta) | |
1133 | ), | |
1134 | TP_fast_assign( | |
1135 | __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev; | |
1a7ed271 DW |
1136 | __entry->type = qtrx->qt_dquot->q_type; |
1137 | __entry->flags = qtrx->qt_dquot->q_flags; | |
2cb91bab DW |
1138 | __entry->dqid = qtrx->qt_dquot->q_id; |
1139 | ||
1140 | __entry->blk_res = qtrx->qt_blk_res; | |
1141 | __entry->bcount_delta = qtrx->qt_bcount_delta; | |
1142 | __entry->delbcnt_delta = qtrx->qt_delbcnt_delta; | |
1143 | ||
1144 | __entry->rtblk_res = qtrx->qt_rtblk_res; | |
1145 | __entry->rtblk_res_used = qtrx->qt_rtblk_res_used; | |
1146 | __entry->rtbcount_delta = qtrx->qt_rtbcount_delta; | |
1147 | __entry->delrtb_delta = qtrx->qt_delrtb_delta; | |
1148 | ||
1149 | __entry->ino_res = qtrx->qt_ino_res; | |
1150 | __entry->ino_res_used = qtrx->qt_ino_res_used; | |
1151 | __entry->icount_delta = qtrx->qt_icount_delta; | |
1152 | ), | |
1a7ed271 | 1153 | TP_printk("dev %d:%d dquot id 0x%x type %s flags %s" |
2cb91bab DW |
1154 | "blk_res %llu bcount_delta %lld delbcnt_delta %lld " |
1155 | "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld " | |
1156 | "ino_res %llu ino_res_used %llu icount_delta %lld", | |
1157 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1158 | __entry->dqid, | |
1a7ed271 | 1159 | __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS), |
2cb91bab DW |
1160 | __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS), |
1161 | ||
1162 | __entry->blk_res, | |
1163 | __entry->bcount_delta, | |
1164 | __entry->delbcnt_delta, | |
1165 | ||
1166 | __entry->rtblk_res, | |
1167 | __entry->rtblk_res_used, | |
1168 | __entry->rtbcount_delta, | |
1169 | __entry->delrtb_delta, | |
1170 | ||
1171 | __entry->ino_res, | |
1172 | __entry->ino_res_used, | |
1173 | __entry->icount_delta) | |
1174 | ) | |
1175 | ||
1176 | #define DEFINE_DQTRX_EVENT(name) \ | |
1177 | DEFINE_EVENT(xfs_dqtrx_class, name, \ | |
1178 | TP_PROTO(struct xfs_dqtrx *qtrx), \ | |
1179 | TP_ARGS(qtrx)) | |
1180 | DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas); | |
1181 | DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before); | |
1182 | DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after); | |
0b1b213f | 1183 | |
ea9a4888 | 1184 | DECLARE_EVENT_CLASS(xfs_loggrant_class, |
ad223e60 | 1185 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), |
ea9a4888 CH |
1186 | TP_ARGS(log, tic), |
1187 | TP_STRUCT__entry( | |
1188 | __field(dev_t, dev) | |
ea9a4888 CH |
1189 | __field(char, ocnt) |
1190 | __field(char, cnt) | |
1191 | __field(int, curr_res) | |
1192 | __field(int, unit_res) | |
1193 | __field(unsigned int, flags) | |
10547941 DC |
1194 | __field(int, reserveq) |
1195 | __field(int, writeq) | |
ea9a4888 CH |
1196 | __field(int, grant_reserve_cycle) |
1197 | __field(int, grant_reserve_bytes) | |
1198 | __field(int, grant_write_cycle) | |
1199 | __field(int, grant_write_bytes) | |
1200 | __field(int, curr_cycle) | |
1201 | __field(int, curr_block) | |
1202 | __field(xfs_lsn_t, tail_lsn) | |
1203 | ), | |
1204 | TP_fast_assign( | |
1205 | __entry->dev = log->l_mp->m_super->s_dev; | |
ea9a4888 CH |
1206 | __entry->ocnt = tic->t_ocnt; |
1207 | __entry->cnt = tic->t_cnt; | |
1208 | __entry->curr_res = tic->t_curr_res; | |
1209 | __entry->unit_res = tic->t_unit_res; | |
1210 | __entry->flags = tic->t_flags; | |
28496968 CH |
1211 | __entry->reserveq = list_empty(&log->l_reserve_head.waiters); |
1212 | __entry->writeq = list_empty(&log->l_write_head.waiters); | |
1213 | xlog_crack_grant_head(&log->l_reserve_head.grant, | |
a69ed03c DC |
1214 | &__entry->grant_reserve_cycle, |
1215 | &__entry->grant_reserve_bytes); | |
28496968 | 1216 | xlog_crack_grant_head(&log->l_write_head.grant, |
a69ed03c DC |
1217 | &__entry->grant_write_cycle, |
1218 | &__entry->grant_write_bytes); | |
ea9a4888 CH |
1219 | __entry->curr_cycle = log->l_curr_cycle; |
1220 | __entry->curr_block = log->l_curr_block; | |
1c3cb9ec | 1221 | __entry->tail_lsn = atomic64_read(&log->l_tail_lsn); |
ea9a4888 | 1222 | ), |
710b1e2c | 1223 | TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u " |
10547941 DC |
1224 | "t_unit_res %u t_flags %s reserveq %s " |
1225 | "writeq %s grant_reserve_cycle %d " | |
ea9a4888 CH |
1226 | "grant_reserve_bytes %d grant_write_cycle %d " |
1227 | "grant_write_bytes %d curr_cycle %d curr_block %d " | |
1228 | "tail_cycle %d tail_block %d", | |
1229 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
ea9a4888 CH |
1230 | __entry->ocnt, |
1231 | __entry->cnt, | |
1232 | __entry->curr_res, | |
1233 | __entry->unit_res, | |
1234 | __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS), | |
10547941 DC |
1235 | __entry->reserveq ? "empty" : "active", |
1236 | __entry->writeq ? "empty" : "active", | |
ea9a4888 CH |
1237 | __entry->grant_reserve_cycle, |
1238 | __entry->grant_reserve_bytes, | |
1239 | __entry->grant_write_cycle, | |
1240 | __entry->grant_write_bytes, | |
1241 | __entry->curr_cycle, | |
1242 | __entry->curr_block, | |
1243 | CYCLE_LSN(__entry->tail_lsn), | |
1244 | BLOCK_LSN(__entry->tail_lsn) | |
1245 | ) | |
1246 | ) | |
0b1b213f | 1247 | |
ea9a4888 CH |
1248 | #define DEFINE_LOGGRANT_EVENT(name) \ |
1249 | DEFINE_EVENT(xfs_loggrant_class, name, \ | |
ad223e60 | 1250 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \ |
ea9a4888 | 1251 | TP_ARGS(log, tic)) |
0b1b213f | 1252 | DEFINE_LOGGRANT_EVENT(xfs_log_umount_write); |
9f9c19ec CH |
1253 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep); |
1254 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake); | |
3f16b985 | 1255 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up); |
9006fb91 CH |
1256 | DEFINE_LOGGRANT_EVENT(xfs_log_reserve); |
1257 | DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit); | |
1258 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant); | |
1259 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit); | |
8b41e3f9 CH |
1260 | DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant); |
1261 | DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit); | |
1262 | DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub); | |
1263 | DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant); | |
1264 | DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub); | |
1265 | DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit); | |
0e7ab7ef | 1266 | DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait); |
0b1b213f | 1267 | |
9e4c109a CH |
1268 | DECLARE_EVENT_CLASS(xfs_log_item_class, |
1269 | TP_PROTO(struct xfs_log_item *lip), | |
1270 | TP_ARGS(lip), | |
1271 | TP_STRUCT__entry( | |
1272 | __field(dev_t, dev) | |
1273 | __field(void *, lip) | |
1274 | __field(uint, type) | |
22525c17 | 1275 | __field(unsigned long, flags) |
9e4c109a CH |
1276 | __field(xfs_lsn_t, lsn) |
1277 | ), | |
1278 | TP_fast_assign( | |
1279 | __entry->dev = lip->li_mountp->m_super->s_dev; | |
1280 | __entry->lip = lip; | |
1281 | __entry->type = lip->li_type; | |
1282 | __entry->flags = lip->li_flags; | |
1283 | __entry->lsn = lip->li_lsn; | |
1284 | ), | |
3d170aa2 | 1285 | TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s", |
9e4c109a CH |
1286 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1287 | __entry->lip, | |
1288 | CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn), | |
1289 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), | |
1290 | __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) | |
1291 | ) | |
1292 | ||
14c26c6a | 1293 | TRACE_EVENT(xfs_log_force, |
9f27889f CM |
1294 | TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip), |
1295 | TP_ARGS(mp, lsn, caller_ip), | |
14c26c6a DC |
1296 | TP_STRUCT__entry( |
1297 | __field(dev_t, dev) | |
1298 | __field(xfs_lsn_t, lsn) | |
9f27889f | 1299 | __field(unsigned long, caller_ip) |
14c26c6a DC |
1300 | ), |
1301 | TP_fast_assign( | |
1302 | __entry->dev = mp->m_super->s_dev; | |
1303 | __entry->lsn = lsn; | |
9f27889f | 1304 | __entry->caller_ip = caller_ip; |
14c26c6a | 1305 | ), |
aff68a55 | 1306 | TP_printk("dev %d:%d lsn 0x%llx caller %pS", |
14c26c6a | 1307 | MAJOR(__entry->dev), MINOR(__entry->dev), |
9f27889f | 1308 | __entry->lsn, (void *)__entry->caller_ip) |
14c26c6a DC |
1309 | ) |
1310 | ||
9e4c109a CH |
1311 | #define DEFINE_LOG_ITEM_EVENT(name) \ |
1312 | DEFINE_EVENT(xfs_log_item_class, name, \ | |
1313 | TP_PROTO(struct xfs_log_item *lip), \ | |
1314 | TP_ARGS(lip)) | |
1315 | DEFINE_LOG_ITEM_EVENT(xfs_ail_push); | |
9e4c109a CH |
1316 | DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned); |
1317 | DEFINE_LOG_ITEM_EVENT(xfs_ail_locked); | |
43ff2122 | 1318 | DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing); |
9e4c109a | 1319 | |
750b9c90 DC |
1320 | DECLARE_EVENT_CLASS(xfs_ail_class, |
1321 | TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), | |
1322 | TP_ARGS(lip, old_lsn, new_lsn), | |
1323 | TP_STRUCT__entry( | |
1324 | __field(dev_t, dev) | |
1325 | __field(void *, lip) | |
1326 | __field(uint, type) | |
22525c17 | 1327 | __field(unsigned long, flags) |
750b9c90 DC |
1328 | __field(xfs_lsn_t, old_lsn) |
1329 | __field(xfs_lsn_t, new_lsn) | |
1330 | ), | |
1331 | TP_fast_assign( | |
1332 | __entry->dev = lip->li_mountp->m_super->s_dev; | |
1333 | __entry->lip = lip; | |
1334 | __entry->type = lip->li_type; | |
1335 | __entry->flags = lip->li_flags; | |
1336 | __entry->old_lsn = old_lsn; | |
1337 | __entry->new_lsn = new_lsn; | |
1338 | ), | |
3d170aa2 | 1339 | TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s", |
750b9c90 DC |
1340 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1341 | __entry->lip, | |
1342 | CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), | |
1343 | CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), | |
1344 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), | |
1345 | __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) | |
1346 | ) | |
1347 | ||
1348 | #define DEFINE_AIL_EVENT(name) \ | |
1349 | DEFINE_EVENT(xfs_ail_class, name, \ | |
1350 | TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \ | |
1351 | TP_ARGS(lip, old_lsn, new_lsn)) | |
1352 | DEFINE_AIL_EVENT(xfs_ail_insert); | |
1353 | DEFINE_AIL_EVENT(xfs_ail_move); | |
1354 | DEFINE_AIL_EVENT(xfs_ail_delete); | |
1355 | ||
1356 | TRACE_EVENT(xfs_log_assign_tail_lsn, | |
1357 | TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn), | |
1358 | TP_ARGS(log, new_lsn), | |
1359 | TP_STRUCT__entry( | |
1360 | __field(dev_t, dev) | |
1361 | __field(xfs_lsn_t, new_lsn) | |
1362 | __field(xfs_lsn_t, old_lsn) | |
1363 | __field(xfs_lsn_t, last_sync_lsn) | |
1364 | ), | |
1365 | TP_fast_assign( | |
1366 | __entry->dev = log->l_mp->m_super->s_dev; | |
1367 | __entry->new_lsn = new_lsn; | |
1368 | __entry->old_lsn = atomic64_read(&log->l_tail_lsn); | |
1369 | __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn); | |
1370 | ), | |
1371 | TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d", | |
1372 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1373 | CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), | |
1374 | CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), | |
1375 | CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn)) | |
1376 | ) | |
9e4c109a | 1377 | |
f8adb4d5 | 1378 | DECLARE_EVENT_CLASS(xfs_file_class, |
3e40b13c CH |
1379 | TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), |
1380 | TP_ARGS(iocb, iter), | |
f8adb4d5 LZ |
1381 | TP_STRUCT__entry( |
1382 | __field(dev_t, dev) | |
1383 | __field(xfs_ino_t, ino) | |
1384 | __field(xfs_fsize_t, size) | |
f8adb4d5 LZ |
1385 | __field(loff_t, offset) |
1386 | __field(size_t, count) | |
f8adb4d5 LZ |
1387 | ), |
1388 | TP_fast_assign( | |
3e40b13c CH |
1389 | __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev; |
1390 | __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino; | |
13d2c10b | 1391 | __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size; |
3e40b13c CH |
1392 | __entry->offset = iocb->ki_pos; |
1393 | __entry->count = iov_iter_count(iter); | |
f8adb4d5 | 1394 | ), |
3176c3e0 | 1395 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx", |
f8adb4d5 LZ |
1396 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1397 | __entry->ino, | |
1398 | __entry->size, | |
f8adb4d5 | 1399 | __entry->offset, |
3176c3e0 | 1400 | __entry->count) |
0b1b213f | 1401 | ) |
f8adb4d5 LZ |
1402 | |
1403 | #define DEFINE_RW_EVENT(name) \ | |
1404 | DEFINE_EVENT(xfs_file_class, name, \ | |
3e40b13c CH |
1405 | TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), \ |
1406 | TP_ARGS(iocb, iter)) | |
3176c3e0 CH |
1407 | DEFINE_RW_EVENT(xfs_file_buffered_read); |
1408 | DEFINE_RW_EVENT(xfs_file_direct_read); | |
16d4d435 | 1409 | DEFINE_RW_EVENT(xfs_file_dax_read); |
0b1b213f CH |
1410 | DEFINE_RW_EVENT(xfs_file_buffered_write); |
1411 | DEFINE_RW_EVENT(xfs_file_direct_write); | |
16d4d435 | 1412 | DEFINE_RW_EVENT(xfs_file_dax_write); |
896f72d0 CH |
1413 | DEFINE_RW_EVENT(xfs_reflink_bounce_dio_write); |
1414 | ||
0b1b213f | 1415 | |
a206c817 | 1416 | DECLARE_EVENT_CLASS(xfs_imap_class, |
f8adb4d5 | 1417 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, |
be225fec CH |
1418 | int whichfork, struct xfs_bmbt_irec *irec), |
1419 | TP_ARGS(ip, offset, count, whichfork, irec), | |
f8adb4d5 LZ |
1420 | TP_STRUCT__entry( |
1421 | __field(dev_t, dev) | |
1422 | __field(xfs_ino_t, ino) | |
1423 | __field(loff_t, size) | |
f8adb4d5 LZ |
1424 | __field(loff_t, offset) |
1425 | __field(size_t, count) | |
be225fec | 1426 | __field(int, whichfork) |
f8adb4d5 LZ |
1427 | __field(xfs_fileoff_t, startoff) |
1428 | __field(xfs_fsblock_t, startblock) | |
1429 | __field(xfs_filblks_t, blockcount) | |
1430 | ), | |
1431 | TP_fast_assign( | |
1432 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1433 | __entry->ino = ip->i_ino; | |
13d2c10b | 1434 | __entry->size = ip->i_disk_size; |
f8adb4d5 LZ |
1435 | __entry->offset = offset; |
1436 | __entry->count = count; | |
be225fec | 1437 | __entry->whichfork = whichfork; |
f8adb4d5 LZ |
1438 | __entry->startoff = irec ? irec->br_startoff : 0; |
1439 | __entry->startblock = irec ? irec->br_startblock : 0; | |
1440 | __entry->blockcount = irec ? irec->br_blockcount : 0; | |
1441 | ), | |
2813d682 | 1442 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd " |
be225fec | 1443 | "fork %s startoff 0x%llx startblock %lld blockcount 0x%llx", |
f8adb4d5 LZ |
1444 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1445 | __entry->ino, | |
1446 | __entry->size, | |
f8adb4d5 LZ |
1447 | __entry->offset, |
1448 | __entry->count, | |
be225fec | 1449 | __entry->whichfork == XFS_COW_FORK ? "cow" : "data", |
f8adb4d5 | 1450 | __entry->startoff, |
c8ce540d | 1451 | (int64_t)__entry->startblock, |
f8adb4d5 | 1452 | __entry->blockcount) |
0b1b213f | 1453 | ) |
f8adb4d5 | 1454 | |
be225fec | 1455 | #define DEFINE_IMAP_EVENT(name) \ |
a206c817 | 1456 | DEFINE_EVENT(xfs_imap_class, name, \ |
f8adb4d5 | 1457 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \ |
be225fec CH |
1458 | int whichfork, struct xfs_bmbt_irec *irec), \ |
1459 | TP_ARGS(ip, offset, count, whichfork, irec)) | |
1460 | DEFINE_IMAP_EVENT(xfs_map_blocks_found); | |
1461 | DEFINE_IMAP_EVENT(xfs_map_blocks_alloc); | |
1462 | DEFINE_IMAP_EVENT(xfs_iomap_alloc); | |
1463 | DEFINE_IMAP_EVENT(xfs_iomap_found); | |
0b1b213f | 1464 | |
f8adb4d5 LZ |
1465 | DECLARE_EVENT_CLASS(xfs_simple_io_class, |
1466 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), | |
1467 | TP_ARGS(ip, offset, count), | |
1468 | TP_STRUCT__entry( | |
1469 | __field(dev_t, dev) | |
1470 | __field(xfs_ino_t, ino) | |
55fb25d5 DC |
1471 | __field(loff_t, isize) |
1472 | __field(loff_t, disize) | |
f8adb4d5 LZ |
1473 | __field(loff_t, offset) |
1474 | __field(size_t, count) | |
1475 | ), | |
1476 | TP_fast_assign( | |
1477 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1478 | __entry->ino = ip->i_ino; | |
ce7ae151 | 1479 | __entry->isize = VFS_I(ip)->i_size; |
13d2c10b | 1480 | __entry->disize = ip->i_disk_size; |
f8adb4d5 LZ |
1481 | __entry->offset = offset; |
1482 | __entry->count = count; | |
1483 | ), | |
2813d682 | 1484 | TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx " |
f8adb4d5 LZ |
1485 | "offset 0x%llx count %zd", |
1486 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1487 | __entry->ino, | |
55fb25d5 DC |
1488 | __entry->isize, |
1489 | __entry->disize, | |
f8adb4d5 LZ |
1490 | __entry->offset, |
1491 | __entry->count) | |
0b1b213f | 1492 | ); |
f8adb4d5 LZ |
1493 | |
1494 | #define DEFINE_SIMPLE_IO_EVENT(name) \ | |
1495 | DEFINE_EVENT(xfs_simple_io_class, name, \ | |
1496 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \ | |
1497 | TP_ARGS(ip, offset, count)) | |
0b1b213f CH |
1498 | DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc); |
1499 | DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); | |
55fb25d5 | 1500 | DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize); |
0a50f162 | 1501 | DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof); |
273dda76 CH |
1502 | DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write); |
1503 | DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten); | |
1504 | DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append); | |
0b1b213f | 1505 | |
ea9a4888 CH |
1506 | DECLARE_EVENT_CLASS(xfs_itrunc_class, |
1507 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), | |
1508 | TP_ARGS(ip, new_size), | |
1509 | TP_STRUCT__entry( | |
1510 | __field(dev_t, dev) | |
1511 | __field(xfs_ino_t, ino) | |
1512 | __field(xfs_fsize_t, size) | |
1513 | __field(xfs_fsize_t, new_size) | |
1514 | ), | |
1515 | TP_fast_assign( | |
1516 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1517 | __entry->ino = ip->i_ino; | |
13d2c10b | 1518 | __entry->size = ip->i_disk_size; |
ea9a4888 CH |
1519 | __entry->new_size = new_size; |
1520 | ), | |
1521 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx", | |
1522 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1523 | __entry->ino, | |
1524 | __entry->size, | |
1525 | __entry->new_size) | |
1526 | ) | |
1527 | ||
0b1b213f | 1528 | #define DEFINE_ITRUNC_EVENT(name) \ |
ea9a4888 | 1529 | DEFINE_EVENT(xfs_itrunc_class, name, \ |
0b1b213f | 1530 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \ |
ea9a4888 | 1531 | TP_ARGS(ip, new_size)) |
673e8e59 CH |
1532 | DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start); |
1533 | DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end); | |
0b1b213f CH |
1534 | |
1535 | TRACE_EVENT(xfs_pagecache_inval, | |
1536 | TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish), | |
1537 | TP_ARGS(ip, start, finish), | |
1538 | TP_STRUCT__entry( | |
1539 | __field(dev_t, dev) | |
1540 | __field(xfs_ino_t, ino) | |
1541 | __field(xfs_fsize_t, size) | |
1542 | __field(xfs_off_t, start) | |
1543 | __field(xfs_off_t, finish) | |
1544 | ), | |
1545 | TP_fast_assign( | |
1546 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1547 | __entry->ino = ip->i_ino; | |
13d2c10b | 1548 | __entry->size = ip->i_disk_size; |
0b1b213f CH |
1549 | __entry->start = start; |
1550 | __entry->finish = finish; | |
1551 | ), | |
1552 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx", | |
1553 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1554 | __entry->ino, | |
1555 | __entry->size, | |
1556 | __entry->start, | |
1557 | __entry->finish) | |
1558 | ); | |
1559 | ||
1560 | TRACE_EVENT(xfs_bunmap, | |
1561 | TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len, | |
1562 | int flags, unsigned long caller_ip), | |
1563 | TP_ARGS(ip, bno, len, flags, caller_ip), | |
1564 | TP_STRUCT__entry( | |
1565 | __field(dev_t, dev) | |
1566 | __field(xfs_ino_t, ino) | |
1567 | __field(xfs_fsize_t, size) | |
1568 | __field(xfs_fileoff_t, bno) | |
1569 | __field(xfs_filblks_t, len) | |
1570 | __field(unsigned long, caller_ip) | |
1571 | __field(int, flags) | |
1572 | ), | |
1573 | TP_fast_assign( | |
1574 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
1575 | __entry->ino = ip->i_ino; | |
13d2c10b | 1576 | __entry->size = ip->i_disk_size; |
0b1b213f CH |
1577 | __entry->bno = bno; |
1578 | __entry->len = len; | |
1579 | __entry->caller_ip = caller_ip; | |
1580 | __entry->flags = flags; | |
1581 | ), | |
1582 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx" | |
aff68a55 | 1583 | "flags %s caller %pS", |
0b1b213f CH |
1584 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1585 | __entry->ino, | |
1586 | __entry->size, | |
1587 | __entry->bno, | |
1588 | __entry->len, | |
1589 | __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS), | |
1590 | (void *)__entry->caller_ip) | |
1591 | ||
1592 | ); | |
1593 | ||
4ecbfe63 | 1594 | DECLARE_EVENT_CLASS(xfs_extent_busy_class, |
0b1b213f | 1595 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
ed3b4d6c DC |
1596 | xfs_agblock_t agbno, xfs_extlen_t len), |
1597 | TP_ARGS(mp, agno, agbno, len), | |
0b1b213f CH |
1598 | TP_STRUCT__entry( |
1599 | __field(dev_t, dev) | |
1600 | __field(xfs_agnumber_t, agno) | |
ed3b4d6c DC |
1601 | __field(xfs_agblock_t, agbno) |
1602 | __field(xfs_extlen_t, len) | |
0b1b213f CH |
1603 | ), |
1604 | TP_fast_assign( | |
1605 | __entry->dev = mp->m_super->s_dev; | |
1606 | __entry->agno = agno; | |
ed3b4d6c DC |
1607 | __entry->agbno = agbno; |
1608 | __entry->len = len; | |
0b1b213f | 1609 | ), |
9febf39d | 1610 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u", |
0b1b213f CH |
1611 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1612 | __entry->agno, | |
ed3b4d6c DC |
1613 | __entry->agbno, |
1614 | __entry->len) | |
0b1b213f | 1615 | ); |
97d3ac75 | 1616 | #define DEFINE_BUSY_EVENT(name) \ |
4ecbfe63 | 1617 | DEFINE_EVENT(xfs_extent_busy_class, name, \ |
97d3ac75 CH |
1618 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
1619 | xfs_agblock_t agbno, xfs_extlen_t len), \ | |
1620 | TP_ARGS(mp, agno, agbno, len)) | |
4ecbfe63 DC |
1621 | DEFINE_BUSY_EVENT(xfs_extent_busy); |
1622 | DEFINE_BUSY_EVENT(xfs_extent_busy_enomem); | |
1623 | DEFINE_BUSY_EVENT(xfs_extent_busy_force); | |
1624 | DEFINE_BUSY_EVENT(xfs_extent_busy_reuse); | |
1625 | DEFINE_BUSY_EVENT(xfs_extent_busy_clear); | |
ed3b4d6c | 1626 | |
4ecbfe63 | 1627 | TRACE_EVENT(xfs_extent_busy_trim, |
e26f0501 CH |
1628 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
1629 | xfs_agblock_t agbno, xfs_extlen_t len, | |
1630 | xfs_agblock_t tbno, xfs_extlen_t tlen), | |
1631 | TP_ARGS(mp, agno, agbno, len, tbno, tlen), | |
1632 | TP_STRUCT__entry( | |
1633 | __field(dev_t, dev) | |
1634 | __field(xfs_agnumber_t, agno) | |
1635 | __field(xfs_agblock_t, agbno) | |
1636 | __field(xfs_extlen_t, len) | |
1637 | __field(xfs_agblock_t, tbno) | |
1638 | __field(xfs_extlen_t, tlen) | |
1639 | ), | |
1640 | TP_fast_assign( | |
1641 | __entry->dev = mp->m_super->s_dev; | |
1642 | __entry->agno = agno; | |
1643 | __entry->agbno = agbno; | |
1644 | __entry->len = len; | |
1645 | __entry->tbno = tbno; | |
1646 | __entry->tlen = tlen; | |
1647 | ), | |
9febf39d | 1648 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u tbno %u tlen %u", |
e26f0501 CH |
1649 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1650 | __entry->agno, | |
1651 | __entry->agbno, | |
1652 | __entry->len, | |
1653 | __entry->tbno, | |
1654 | __entry->tlen) | |
1655 | ); | |
1656 | ||
a27ba260 | 1657 | DECLARE_EVENT_CLASS(xfs_agf_class, |
0b1b213f CH |
1658 | TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, |
1659 | unsigned long caller_ip), | |
1660 | TP_ARGS(mp, agf, flags, caller_ip), | |
1661 | TP_STRUCT__entry( | |
1662 | __field(dev_t, dev) | |
1663 | __field(xfs_agnumber_t, agno) | |
1664 | __field(int, flags) | |
1665 | __field(__u32, length) | |
1666 | __field(__u32, bno_root) | |
1667 | __field(__u32, cnt_root) | |
1668 | __field(__u32, bno_level) | |
1669 | __field(__u32, cnt_level) | |
1670 | __field(__u32, flfirst) | |
1671 | __field(__u32, fllast) | |
1672 | __field(__u32, flcount) | |
1673 | __field(__u32, freeblks) | |
1674 | __field(__u32, longest) | |
1675 | __field(unsigned long, caller_ip) | |
1676 | ), | |
1677 | TP_fast_assign( | |
1678 | __entry->dev = mp->m_super->s_dev; | |
1679 | __entry->agno = be32_to_cpu(agf->agf_seqno), | |
1680 | __entry->flags = flags; | |
1681 | __entry->length = be32_to_cpu(agf->agf_length), | |
1682 | __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]), | |
1683 | __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]), | |
1684 | __entry->bno_level = | |
1685 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]), | |
1686 | __entry->cnt_level = | |
1687 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]), | |
1688 | __entry->flfirst = be32_to_cpu(agf->agf_flfirst), | |
1689 | __entry->fllast = be32_to_cpu(agf->agf_fllast), | |
1690 | __entry->flcount = be32_to_cpu(agf->agf_flcount), | |
1691 | __entry->freeblks = be32_to_cpu(agf->agf_freeblks), | |
1692 | __entry->longest = be32_to_cpu(agf->agf_longest); | |
1693 | __entry->caller_ip = caller_ip; | |
1694 | ), | |
9febf39d | 1695 | TP_printk("dev %d:%d agno 0x%x flags %s length %u roots b %u c %u " |
0b1b213f | 1696 | "levels b %u c %u flfirst %u fllast %u flcount %u " |
aff68a55 | 1697 | "freeblks %u longest %u caller %pS", |
0b1b213f CH |
1698 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1699 | __entry->agno, | |
1700 | __print_flags(__entry->flags, "|", XFS_AGF_FLAGS), | |
1701 | __entry->length, | |
1702 | __entry->bno_root, | |
1703 | __entry->cnt_root, | |
1704 | __entry->bno_level, | |
1705 | __entry->cnt_level, | |
1706 | __entry->flfirst, | |
1707 | __entry->fllast, | |
1708 | __entry->flcount, | |
1709 | __entry->freeblks, | |
1710 | __entry->longest, | |
1711 | (void *)__entry->caller_ip) | |
1712 | ); | |
a27ba260 BF |
1713 | #define DEFINE_AGF_EVENT(name) \ |
1714 | DEFINE_EVENT(xfs_agf_class, name, \ | |
1715 | TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \ | |
1716 | unsigned long caller_ip), \ | |
1717 | TP_ARGS(mp, agf, flags, caller_ip)) | |
1718 | DEFINE_AGF_EVENT(xfs_agf); | |
1719 | DEFINE_AGF_EVENT(xfs_agfl_reset); | |
0b1b213f CH |
1720 | |
1721 | TRACE_EVENT(xfs_free_extent, | |
1722 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, | |
3fd129b6 DW |
1723 | xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft, |
1724 | int haveright), | |
1725 | TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright), | |
0b1b213f CH |
1726 | TP_STRUCT__entry( |
1727 | __field(dev_t, dev) | |
1728 | __field(xfs_agnumber_t, agno) | |
1729 | __field(xfs_agblock_t, agbno) | |
1730 | __field(xfs_extlen_t, len) | |
3fd129b6 | 1731 | __field(int, resv) |
0b1b213f CH |
1732 | __field(int, haveleft) |
1733 | __field(int, haveright) | |
1734 | ), | |
1735 | TP_fast_assign( | |
1736 | __entry->dev = mp->m_super->s_dev; | |
1737 | __entry->agno = agno; | |
1738 | __entry->agbno = agbno; | |
1739 | __entry->len = len; | |
3fd129b6 | 1740 | __entry->resv = resv; |
0b1b213f CH |
1741 | __entry->haveleft = haveleft; |
1742 | __entry->haveright = haveright; | |
1743 | ), | |
9febf39d | 1744 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u resv %d %s", |
0b1b213f CH |
1745 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1746 | __entry->agno, | |
1747 | __entry->agbno, | |
1748 | __entry->len, | |
3fd129b6 | 1749 | __entry->resv, |
0b1b213f CH |
1750 | __entry->haveleft ? |
1751 | (__entry->haveright ? "both" : "left") : | |
1752 | (__entry->haveright ? "right" : "none")) | |
1753 | ||
1754 | ); | |
1755 | ||
ea9a4888 CH |
1756 | DECLARE_EVENT_CLASS(xfs_alloc_class, |
1757 | TP_PROTO(struct xfs_alloc_arg *args), | |
1758 | TP_ARGS(args), | |
1759 | TP_STRUCT__entry( | |
1760 | __field(dev_t, dev) | |
1761 | __field(xfs_agnumber_t, agno) | |
1762 | __field(xfs_agblock_t, agbno) | |
1763 | __field(xfs_extlen_t, minlen) | |
1764 | __field(xfs_extlen_t, maxlen) | |
1765 | __field(xfs_extlen_t, mod) | |
1766 | __field(xfs_extlen_t, prod) | |
1767 | __field(xfs_extlen_t, minleft) | |
1768 | __field(xfs_extlen_t, total) | |
1769 | __field(xfs_extlen_t, alignment) | |
1770 | __field(xfs_extlen_t, minalignslop) | |
1771 | __field(xfs_extlen_t, len) | |
1772 | __field(short, type) | |
1773 | __field(short, otype) | |
1774 | __field(char, wasdel) | |
1775 | __field(char, wasfromfl) | |
3fd129b6 | 1776 | __field(int, resv) |
292378ed | 1777 | __field(int, datatype) |
ea9a4888 CH |
1778 | __field(xfs_fsblock_t, firstblock) |
1779 | ), | |
1780 | TP_fast_assign( | |
1781 | __entry->dev = args->mp->m_super->s_dev; | |
1782 | __entry->agno = args->agno; | |
1783 | __entry->agbno = args->agbno; | |
1784 | __entry->minlen = args->minlen; | |
1785 | __entry->maxlen = args->maxlen; | |
1786 | __entry->mod = args->mod; | |
1787 | __entry->prod = args->prod; | |
1788 | __entry->minleft = args->minleft; | |
1789 | __entry->total = args->total; | |
1790 | __entry->alignment = args->alignment; | |
1791 | __entry->minalignslop = args->minalignslop; | |
1792 | __entry->len = args->len; | |
1793 | __entry->type = args->type; | |
1794 | __entry->otype = args->otype; | |
1795 | __entry->wasdel = args->wasdel; | |
1796 | __entry->wasfromfl = args->wasfromfl; | |
3fd129b6 | 1797 | __entry->resv = args->resv; |
292378ed | 1798 | __entry->datatype = args->datatype; |
64396ff2 | 1799 | __entry->firstblock = args->tp->t_firstblock; |
ea9a4888 | 1800 | ), |
9febf39d | 1801 | TP_printk("dev %d:%d agno 0x%x agbno %u minlen %u maxlen %u mod %u " |
ea9a4888 | 1802 | "prod %u minleft %u total %u alignment %u minalignslop %u " |
3fd129b6 | 1803 | "len %u type %s otype %s wasdel %d wasfromfl %d resv %d " |
292378ed | 1804 | "datatype 0x%x firstblock 0x%llx", |
ea9a4888 CH |
1805 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1806 | __entry->agno, | |
1807 | __entry->agbno, | |
1808 | __entry->minlen, | |
1809 | __entry->maxlen, | |
1810 | __entry->mod, | |
1811 | __entry->prod, | |
1812 | __entry->minleft, | |
1813 | __entry->total, | |
1814 | __entry->alignment, | |
1815 | __entry->minalignslop, | |
1816 | __entry->len, | |
1817 | __print_symbolic(__entry->type, XFS_ALLOC_TYPES), | |
1818 | __print_symbolic(__entry->otype, XFS_ALLOC_TYPES), | |
1819 | __entry->wasdel, | |
1820 | __entry->wasfromfl, | |
3fd129b6 | 1821 | __entry->resv, |
292378ed | 1822 | __entry->datatype, |
1a18a294 | 1823 | (unsigned long long)__entry->firstblock) |
0b1b213f CH |
1824 | ) |
1825 | ||
ea9a4888 CH |
1826 | #define DEFINE_ALLOC_EVENT(name) \ |
1827 | DEFINE_EVENT(xfs_alloc_class, name, \ | |
1828 | TP_PROTO(struct xfs_alloc_arg *args), \ | |
1829 | TP_ARGS(args)) | |
0b1b213f | 1830 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_done); |
9f9baab3 | 1831 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound); |
0b1b213f CH |
1832 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_error); |
1833 | DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft); | |
1834 | DEFINE_ALLOC_EVENT(xfs_alloc_near_first); | |
d2968825 | 1835 | DEFINE_ALLOC_EVENT(xfs_alloc_cur); |
fec0afda BF |
1836 | DEFINE_ALLOC_EVENT(xfs_alloc_cur_right); |
1837 | DEFINE_ALLOC_EVENT(xfs_alloc_cur_left); | |
dc8e69bd BF |
1838 | DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup); |
1839 | DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done); | |
0b1b213f | 1840 | DEFINE_ALLOC_EVENT(xfs_alloc_near_error); |
e26f0501 CH |
1841 | DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry); |
1842 | DEFINE_ALLOC_EVENT(xfs_alloc_near_busy); | |
0b1b213f CH |
1843 | DEFINE_ALLOC_EVENT(xfs_alloc_size_neither); |
1844 | DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry); | |
1845 | DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft); | |
1846 | DEFINE_ALLOC_EVENT(xfs_alloc_size_done); | |
1847 | DEFINE_ALLOC_EVENT(xfs_alloc_size_error); | |
e26f0501 | 1848 | DEFINE_ALLOC_EVENT(xfs_alloc_size_busy); |
0b1b213f CH |
1849 | DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist); |
1850 | DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough); | |
1851 | DEFINE_ALLOC_EVENT(xfs_alloc_small_done); | |
1852 | DEFINE_ALLOC_EVENT(xfs_alloc_small_error); | |
1853 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs); | |
1854 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix); | |
1855 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp); | |
1856 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed); | |
1857 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed); | |
1858 | ||
396bbf3c BF |
1859 | TRACE_EVENT(xfs_alloc_cur_check, |
1860 | TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno, | |
1861 | xfs_extlen_t len, xfs_extlen_t diff, bool new), | |
1862 | TP_ARGS(mp, btnum, bno, len, diff, new), | |
1863 | TP_STRUCT__entry( | |
1864 | __field(dev_t, dev) | |
1865 | __field(xfs_btnum_t, btnum) | |
1866 | __field(xfs_agblock_t, bno) | |
1867 | __field(xfs_extlen_t, len) | |
1868 | __field(xfs_extlen_t, diff) | |
1869 | __field(bool, new) | |
1870 | ), | |
1871 | TP_fast_assign( | |
1872 | __entry->dev = mp->m_super->s_dev; | |
1873 | __entry->btnum = btnum; | |
1874 | __entry->bno = bno; | |
1875 | __entry->len = len; | |
1876 | __entry->diff = diff; | |
1877 | __entry->new = new; | |
1878 | ), | |
1879 | TP_printk("dev %d:%d btree %s bno 0x%x len 0x%x diff 0x%x new %d", | |
1880 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1881 | __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS), | |
1882 | __entry->bno, __entry->len, __entry->diff, __entry->new) | |
1883 | ) | |
1884 | ||
5a5881cd | 1885 | DECLARE_EVENT_CLASS(xfs_da_class, |
ea9a4888 CH |
1886 | TP_PROTO(struct xfs_da_args *args), |
1887 | TP_ARGS(args), | |
1888 | TP_STRUCT__entry( | |
1889 | __field(dev_t, dev) | |
1890 | __field(xfs_ino_t, ino) | |
1891 | __dynamic_array(char, name, args->namelen) | |
1892 | __field(int, namelen) | |
1893 | __field(xfs_dahash_t, hashval) | |
1894 | __field(xfs_ino_t, inumber) | |
1895 | __field(int, op_flags) | |
1896 | ), | |
1897 | TP_fast_assign( | |
1898 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
1899 | __entry->ino = args->dp->i_ino; | |
1900 | if (args->namelen) | |
1901 | memcpy(__get_str(name), args->name, args->namelen); | |
1902 | __entry->namelen = args->namelen; | |
1903 | __entry->hashval = args->hashval; | |
1904 | __entry->inumber = args->inumber; | |
1905 | __entry->op_flags = args->op_flags; | |
1906 | ), | |
1907 | TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x " | |
1908 | "inumber 0x%llx op_flags %s", | |
1909 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
1910 | __entry->ino, | |
1911 | __entry->namelen, | |
1912 | __entry->namelen ? __get_str(name) : NULL, | |
1913 | __entry->namelen, | |
1914 | __entry->hashval, | |
1915 | __entry->inumber, | |
1916 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) | |
1917 | ) | |
1918 | ||
1919 | #define DEFINE_DIR2_EVENT(name) \ | |
5a5881cd | 1920 | DEFINE_EVENT(xfs_da_class, name, \ |
0b1b213f | 1921 | TP_PROTO(struct xfs_da_args *args), \ |
ea9a4888 CH |
1922 | TP_ARGS(args)) |
1923 | DEFINE_DIR2_EVENT(xfs_dir2_sf_addname); | |
1924 | DEFINE_DIR2_EVENT(xfs_dir2_sf_create); | |
1925 | DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup); | |
1926 | DEFINE_DIR2_EVENT(xfs_dir2_sf_replace); | |
1927 | DEFINE_DIR2_EVENT(xfs_dir2_sf_removename); | |
1928 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4); | |
1929 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8); | |
1930 | DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block); | |
1931 | DEFINE_DIR2_EVENT(xfs_dir2_block_addname); | |
1932 | DEFINE_DIR2_EVENT(xfs_dir2_block_lookup); | |
1933 | DEFINE_DIR2_EVENT(xfs_dir2_block_replace); | |
1934 | DEFINE_DIR2_EVENT(xfs_dir2_block_removename); | |
1935 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf); | |
1936 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf); | |
1937 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname); | |
1938 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup); | |
1939 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace); | |
1940 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename); | |
1941 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block); | |
1942 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node); | |
1943 | DEFINE_DIR2_EVENT(xfs_dir2_node_addname); | |
1944 | DEFINE_DIR2_EVENT(xfs_dir2_node_lookup); | |
1945 | DEFINE_DIR2_EVENT(xfs_dir2_node_replace); | |
1946 | DEFINE_DIR2_EVENT(xfs_dir2_node_removename); | |
1947 | DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf); | |
1948 | ||
ee73259b DC |
1949 | DECLARE_EVENT_CLASS(xfs_attr_class, |
1950 | TP_PROTO(struct xfs_da_args *args), | |
1951 | TP_ARGS(args), | |
1952 | TP_STRUCT__entry( | |
1953 | __field(dev_t, dev) | |
1954 | __field(xfs_ino_t, ino) | |
1955 | __dynamic_array(char, name, args->namelen) | |
1956 | __field(int, namelen) | |
1957 | __field(int, valuelen) | |
1958 | __field(xfs_dahash_t, hashval) | |
d5f0f49a CH |
1959 | __field(unsigned int, attr_filter) |
1960 | __field(unsigned int, attr_flags) | |
ee73259b DC |
1961 | __field(int, op_flags) |
1962 | ), | |
1963 | TP_fast_assign( | |
1964 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
1965 | __entry->ino = args->dp->i_ino; | |
1966 | if (args->namelen) | |
1967 | memcpy(__get_str(name), args->name, args->namelen); | |
1968 | __entry->namelen = args->namelen; | |
1969 | __entry->valuelen = args->valuelen; | |
1970 | __entry->hashval = args->hashval; | |
d5f0f49a CH |
1971 | __entry->attr_filter = args->attr_filter; |
1972 | __entry->attr_flags = args->attr_flags; | |
ee73259b DC |
1973 | __entry->op_flags = args->op_flags; |
1974 | ), | |
1975 | TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d " | |
d5f0f49a | 1976 | "hashval 0x%x filter %s flags %s op_flags %s", |
ee73259b DC |
1977 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1978 | __entry->ino, | |
1979 | __entry->namelen, | |
1980 | __entry->namelen ? __get_str(name) : NULL, | |
1981 | __entry->namelen, | |
1982 | __entry->valuelen, | |
1983 | __entry->hashval, | |
d5f0f49a CH |
1984 | __print_flags(__entry->attr_filter, "|", |
1985 | XFS_ATTR_FILTER_FLAGS), | |
1986 | __print_flags(__entry->attr_flags, "|", | |
1987 | { XATTR_CREATE, "CREATE" }, | |
1988 | { XATTR_REPLACE, "REPLACE" }), | |
ee73259b DC |
1989 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) |
1990 | ) | |
1991 | ||
5a5881cd | 1992 | #define DEFINE_ATTR_EVENT(name) \ |
ee73259b | 1993 | DEFINE_EVENT(xfs_attr_class, name, \ |
5a5881cd DC |
1994 | TP_PROTO(struct xfs_da_args *args), \ |
1995 | TP_ARGS(args)) | |
1996 | DEFINE_ATTR_EVENT(xfs_attr_sf_add); | |
1997 | DEFINE_ATTR_EVENT(xfs_attr_sf_addname); | |
1998 | DEFINE_ATTR_EVENT(xfs_attr_sf_create); | |
1999 | DEFINE_ATTR_EVENT(xfs_attr_sf_lookup); | |
2000 | DEFINE_ATTR_EVENT(xfs_attr_sf_remove); | |
5a5881cd DC |
2001 | DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf); |
2002 | ||
2003 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add); | |
2004 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old); | |
2005 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new); | |
ee73259b | 2006 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work); |
5a5881cd | 2007 | DEFINE_ATTR_EVENT(xfs_attr_leaf_create); |
ee73259b DC |
2008 | DEFINE_ATTR_EVENT(xfs_attr_leaf_compact); |
2009 | DEFINE_ATTR_EVENT(xfs_attr_leaf_get); | |
5a5881cd DC |
2010 | DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup); |
2011 | DEFINE_ATTR_EVENT(xfs_attr_leaf_replace); | |
ee73259b | 2012 | DEFINE_ATTR_EVENT(xfs_attr_leaf_remove); |
5a5881cd DC |
2013 | DEFINE_ATTR_EVENT(xfs_attr_leaf_removename); |
2014 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split); | |
2015 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before); | |
2016 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after); | |
2017 | DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag); | |
2018 | DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag); | |
2019 | DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags); | |
2020 | DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf); | |
2021 | DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node); | |
2022 | DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance); | |
2023 | DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance); | |
ee73259b | 2024 | DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall); |
5a5881cd DC |
2025 | |
2026 | DEFINE_ATTR_EVENT(xfs_attr_node_addname); | |
ee73259b | 2027 | DEFINE_ATTR_EVENT(xfs_attr_node_get); |
5a5881cd DC |
2028 | DEFINE_ATTR_EVENT(xfs_attr_node_replace); |
2029 | DEFINE_ATTR_EVENT(xfs_attr_node_removename); | |
2030 | ||
ee73259b DC |
2031 | DEFINE_ATTR_EVENT(xfs_attr_fillstate); |
2032 | DEFINE_ATTR_EVENT(xfs_attr_refillstate); | |
2033 | ||
2034 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_get); | |
2035 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_set); | |
ee73259b | 2036 | |
5a5881cd DC |
2037 | #define DEFINE_DA_EVENT(name) \ |
2038 | DEFINE_EVENT(xfs_da_class, name, \ | |
2039 | TP_PROTO(struct xfs_da_args *args), \ | |
2040 | TP_ARGS(args)) | |
2041 | DEFINE_DA_EVENT(xfs_da_split); | |
2042 | DEFINE_DA_EVENT(xfs_da_join); | |
2043 | DEFINE_DA_EVENT(xfs_da_link_before); | |
2044 | DEFINE_DA_EVENT(xfs_da_link_after); | |
2045 | DEFINE_DA_EVENT(xfs_da_unlink_back); | |
2046 | DEFINE_DA_EVENT(xfs_da_unlink_forward); | |
2047 | DEFINE_DA_EVENT(xfs_da_root_split); | |
2048 | DEFINE_DA_EVENT(xfs_da_root_join); | |
2049 | DEFINE_DA_EVENT(xfs_da_node_add); | |
2050 | DEFINE_DA_EVENT(xfs_da_node_create); | |
2051 | DEFINE_DA_EVENT(xfs_da_node_split); | |
2052 | DEFINE_DA_EVENT(xfs_da_node_remove); | |
2053 | DEFINE_DA_EVENT(xfs_da_node_rebalance); | |
2054 | DEFINE_DA_EVENT(xfs_da_node_unbalance); | |
ee73259b | 2055 | DEFINE_DA_EVENT(xfs_da_node_toosmall); |
5a5881cd DC |
2056 | DEFINE_DA_EVENT(xfs_da_swap_lastblock); |
2057 | DEFINE_DA_EVENT(xfs_da_grow_inode); | |
2058 | DEFINE_DA_EVENT(xfs_da_shrink_inode); | |
ee73259b DC |
2059 | DEFINE_DA_EVENT(xfs_da_fixhashpath); |
2060 | DEFINE_DA_EVENT(xfs_da_path_shift); | |
5a5881cd | 2061 | |
ea9a4888 CH |
2062 | DECLARE_EVENT_CLASS(xfs_dir2_space_class, |
2063 | TP_PROTO(struct xfs_da_args *args, int idx), | |
2064 | TP_ARGS(args, idx), | |
2065 | TP_STRUCT__entry( | |
2066 | __field(dev_t, dev) | |
2067 | __field(xfs_ino_t, ino) | |
2068 | __field(int, op_flags) | |
2069 | __field(int, idx) | |
2070 | ), | |
2071 | TP_fast_assign( | |
2072 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
2073 | __entry->ino = args->dp->i_ino; | |
2074 | __entry->op_flags = args->op_flags; | |
2075 | __entry->idx = idx; | |
2076 | ), | |
2077 | TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d", | |
2078 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2079 | __entry->ino, | |
2080 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), | |
2081 | __entry->idx) | |
0b1b213f | 2082 | ) |
0b1b213f | 2083 | |
ea9a4888 CH |
2084 | #define DEFINE_DIR2_SPACE_EVENT(name) \ |
2085 | DEFINE_EVENT(xfs_dir2_space_class, name, \ | |
0b1b213f | 2086 | TP_PROTO(struct xfs_da_args *args, int idx), \ |
ea9a4888 CH |
2087 | TP_ARGS(args, idx)) |
2088 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add); | |
2089 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove); | |
2090 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode); | |
2091 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode); | |
0b1b213f CH |
2092 | |
2093 | TRACE_EVENT(xfs_dir2_leafn_moveents, | |
2094 | TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count), | |
2095 | TP_ARGS(args, src_idx, dst_idx, count), | |
2096 | TP_STRUCT__entry( | |
2097 | __field(dev_t, dev) | |
2098 | __field(xfs_ino_t, ino) | |
2099 | __field(int, op_flags) | |
2100 | __field(int, src_idx) | |
2101 | __field(int, dst_idx) | |
2102 | __field(int, count) | |
2103 | ), | |
2104 | TP_fast_assign( | |
2105 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; | |
2106 | __entry->ino = args->dp->i_ino; | |
2107 | __entry->op_flags = args->op_flags; | |
2108 | __entry->src_idx = src_idx; | |
2109 | __entry->dst_idx = dst_idx; | |
2110 | __entry->count = count; | |
2111 | ), | |
2112 | TP_printk("dev %d:%d ino 0x%llx op_flags %s " | |
2113 | "src_idx %d dst_idx %d count %d", | |
2114 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2115 | __entry->ino, | |
2116 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), | |
2117 | __entry->src_idx, | |
2118 | __entry->dst_idx, | |
2119 | __entry->count) | |
2120 | ); | |
2121 | ||
3a85cd96 DC |
2122 | #define XFS_SWAPEXT_INODES \ |
2123 | { 0, "target" }, \ | |
2124 | { 1, "temp" } | |
2125 | ||
0357d21a DW |
2126 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV); |
2127 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL); | |
2128 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS); | |
2129 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE); | |
2130 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID); | |
3a85cd96 DC |
2131 | |
2132 | DECLARE_EVENT_CLASS(xfs_swap_extent_class, | |
2133 | TP_PROTO(struct xfs_inode *ip, int which), | |
2134 | TP_ARGS(ip, which), | |
2135 | TP_STRUCT__entry( | |
2136 | __field(dev_t, dev) | |
2137 | __field(int, which) | |
2138 | __field(xfs_ino_t, ino) | |
2139 | __field(int, format) | |
2140 | __field(int, nex) | |
3a85cd96 DC |
2141 | __field(int, broot_size) |
2142 | __field(int, fork_off) | |
2143 | ), | |
2144 | TP_fast_assign( | |
2145 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
2146 | __entry->which = which; | |
2147 | __entry->ino = ip->i_ino; | |
f7e67b20 | 2148 | __entry->format = ip->i_df.if_format; |
daf83964 | 2149 | __entry->nex = ip->i_df.if_nextents; |
3a85cd96 DC |
2150 | __entry->broot_size = ip->i_df.if_broot_bytes; |
2151 | __entry->fork_off = XFS_IFORK_BOFF(ip); | |
2152 | ), | |
2153 | TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, " | |
8096b1eb | 2154 | "broot size %d, fork offset %d", |
3a85cd96 DC |
2155 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2156 | __entry->ino, | |
2157 | __print_symbolic(__entry->which, XFS_SWAPEXT_INODES), | |
2158 | __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR), | |
2159 | __entry->nex, | |
3a85cd96 DC |
2160 | __entry->broot_size, |
2161 | __entry->fork_off) | |
2162 | ) | |
2163 | ||
2164 | #define DEFINE_SWAPEXT_EVENT(name) \ | |
2165 | DEFINE_EVENT(xfs_swap_extent_class, name, \ | |
2166 | TP_PROTO(struct xfs_inode *ip, int which), \ | |
2167 | TP_ARGS(ip, which)) | |
2168 | ||
2169 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before); | |
2170 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after); | |
2171 | ||
e67d3d42 BF |
2172 | TRACE_EVENT(xfs_log_recover, |
2173 | TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk), | |
2174 | TP_ARGS(log, headblk, tailblk), | |
2175 | TP_STRUCT__entry( | |
2176 | __field(dev_t, dev) | |
2177 | __field(xfs_daddr_t, headblk) | |
2178 | __field(xfs_daddr_t, tailblk) | |
2179 | ), | |
2180 | TP_fast_assign( | |
2181 | __entry->dev = log->l_mp->m_super->s_dev; | |
2182 | __entry->headblk = headblk; | |
2183 | __entry->tailblk = tailblk; | |
2184 | ), | |
2185 | TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx", | |
2186 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk, | |
2187 | __entry->tailblk) | |
2188 | ) | |
2189 | ||
5cd9cee9 BF |
2190 | TRACE_EVENT(xfs_log_recover_record, |
2191 | TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass), | |
2192 | TP_ARGS(log, rhead, pass), | |
2193 | TP_STRUCT__entry( | |
2194 | __field(dev_t, dev) | |
2195 | __field(xfs_lsn_t, lsn) | |
2196 | __field(int, len) | |
2197 | __field(int, num_logops) | |
2198 | __field(int, pass) | |
2199 | ), | |
2200 | TP_fast_assign( | |
2201 | __entry->dev = log->l_mp->m_super->s_dev; | |
2202 | __entry->lsn = be64_to_cpu(rhead->h_lsn); | |
2203 | __entry->len = be32_to_cpu(rhead->h_len); | |
2204 | __entry->num_logops = be32_to_cpu(rhead->h_num_logops); | |
2205 | __entry->pass = pass; | |
2206 | ), | |
2207 | TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d", | |
2208 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2209 | __entry->lsn, __entry->len, __entry->num_logops, | |
2210 | __entry->pass) | |
2211 | ) | |
2212 | ||
9abbc539 | 2213 | DECLARE_EVENT_CLASS(xfs_log_recover_item_class, |
ad223e60 | 2214 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, |
9abbc539 DC |
2215 | struct xlog_recover_item *item, int pass), |
2216 | TP_ARGS(log, trans, item, pass), | |
2217 | TP_STRUCT__entry( | |
2218 | __field(dev_t, dev) | |
2219 | __field(unsigned long, item) | |
2220 | __field(xlog_tid_t, tid) | |
5cd9cee9 | 2221 | __field(xfs_lsn_t, lsn) |
9abbc539 DC |
2222 | __field(int, type) |
2223 | __field(int, pass) | |
2224 | __field(int, count) | |
2225 | __field(int, total) | |
2226 | ), | |
2227 | TP_fast_assign( | |
2228 | __entry->dev = log->l_mp->m_super->s_dev; | |
2229 | __entry->item = (unsigned long)item; | |
2230 | __entry->tid = trans->r_log_tid; | |
5cd9cee9 | 2231 | __entry->lsn = trans->r_lsn; |
9abbc539 DC |
2232 | __entry->type = ITEM_TYPE(item); |
2233 | __entry->pass = pass; | |
2234 | __entry->count = item->ri_cnt; | |
2235 | __entry->total = item->ri_total; | |
2236 | ), | |
3d170aa2 | 2237 | TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, " |
5cd9cee9 | 2238 | "item type %s item region count/total %d/%d", |
9abbc539 DC |
2239 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2240 | __entry->tid, | |
5cd9cee9 | 2241 | __entry->lsn, |
9abbc539 DC |
2242 | __entry->pass, |
2243 | (void *)__entry->item, | |
2244 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), | |
2245 | __entry->count, | |
2246 | __entry->total) | |
2247 | ) | |
2248 | ||
2249 | #define DEFINE_LOG_RECOVER_ITEM(name) \ | |
2250 | DEFINE_EVENT(xfs_log_recover_item_class, name, \ | |
ad223e60 | 2251 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, \ |
9abbc539 DC |
2252 | struct xlog_recover_item *item, int pass), \ |
2253 | TP_ARGS(log, trans, item, pass)) | |
2254 | ||
2255 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add); | |
2256 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont); | |
2257 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head); | |
2258 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail); | |
2259 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover); | |
2260 | ||
2261 | DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class, | |
ad223e60 | 2262 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), |
9abbc539 DC |
2263 | TP_ARGS(log, buf_f), |
2264 | TP_STRUCT__entry( | |
2265 | __field(dev_t, dev) | |
c8ce540d | 2266 | __field(int64_t, blkno) |
9abbc539 DC |
2267 | __field(unsigned short, len) |
2268 | __field(unsigned short, flags) | |
2269 | __field(unsigned short, size) | |
2270 | __field(unsigned int, map_size) | |
2271 | ), | |
2272 | TP_fast_assign( | |
2273 | __entry->dev = log->l_mp->m_super->s_dev; | |
2274 | __entry->blkno = buf_f->blf_blkno; | |
2275 | __entry->len = buf_f->blf_len; | |
2276 | __entry->flags = buf_f->blf_flags; | |
2277 | __entry->size = buf_f->blf_size; | |
2278 | __entry->map_size = buf_f->blf_map_size; | |
2279 | ), | |
2280 | TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, " | |
2281 | "map_size %d", | |
2282 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2283 | __entry->blkno, | |
2284 | __entry->len, | |
2285 | __entry->flags, | |
2286 | __entry->size, | |
2287 | __entry->map_size) | |
2288 | ) | |
2289 | ||
2290 | #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \ | |
2291 | DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \ | |
ad223e60 | 2292 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \ |
9abbc539 DC |
2293 | TP_ARGS(log, buf_f)) |
2294 | ||
2295 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel); | |
2296 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel); | |
2297 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add); | |
2298 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc); | |
2299 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover); | |
5cd9cee9 | 2300 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip); |
9abbc539 DC |
2301 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf); |
2302 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf); | |
2303 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf); | |
2304 | ||
2305 | DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class, | |
ad223e60 | 2306 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), |
9abbc539 DC |
2307 | TP_ARGS(log, in_f), |
2308 | TP_STRUCT__entry( | |
2309 | __field(dev_t, dev) | |
2310 | __field(xfs_ino_t, ino) | |
2311 | __field(unsigned short, size) | |
2312 | __field(int, fields) | |
2313 | __field(unsigned short, asize) | |
2314 | __field(unsigned short, dsize) | |
c8ce540d | 2315 | __field(int64_t, blkno) |
9abbc539 DC |
2316 | __field(int, len) |
2317 | __field(int, boffset) | |
2318 | ), | |
2319 | TP_fast_assign( | |
2320 | __entry->dev = log->l_mp->m_super->s_dev; | |
2321 | __entry->ino = in_f->ilf_ino; | |
2322 | __entry->size = in_f->ilf_size; | |
2323 | __entry->fields = in_f->ilf_fields; | |
2324 | __entry->asize = in_f->ilf_asize; | |
2325 | __entry->dsize = in_f->ilf_dsize; | |
2326 | __entry->blkno = in_f->ilf_blkno; | |
2327 | __entry->len = in_f->ilf_len; | |
2328 | __entry->boffset = in_f->ilf_boffset; | |
2329 | ), | |
2330 | TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, " | |
2331 | "dsize %d, blkno 0x%llx, len %d, boffset %d", | |
2332 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
2333 | __entry->ino, | |
2334 | __entry->size, | |
2335 | __entry->fields, | |
2336 | __entry->asize, | |
2337 | __entry->dsize, | |
2338 | __entry->blkno, | |
2339 | __entry->len, | |
2340 | __entry->boffset) | |
2341 | ) | |
2342 | #define DEFINE_LOG_RECOVER_INO_ITEM(name) \ | |
2343 | DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \ | |
ad223e60 | 2344 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \ |
9abbc539 DC |
2345 | TP_ARGS(log, in_f)) |
2346 | ||
2347 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover); | |
2348 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel); | |
2349 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip); | |
2350 | ||
78d57e45 BF |
2351 | DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class, |
2352 | TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), | |
2353 | TP_ARGS(log, in_f), | |
2354 | TP_STRUCT__entry( | |
2355 | __field(dev_t, dev) | |
2356 | __field(xfs_agnumber_t, agno) | |
2357 | __field(xfs_agblock_t, agbno) | |
2358 | __field(unsigned int, count) | |
2359 | __field(unsigned int, isize) | |
2360 | __field(xfs_agblock_t, length) | |
2361 | __field(unsigned int, gen) | |
2362 | ), | |
2363 | TP_fast_assign( | |
2364 | __entry->dev = log->l_mp->m_super->s_dev; | |
2365 | __entry->agno = be32_to_cpu(in_f->icl_ag); | |
2366 | __entry->agbno = be32_to_cpu(in_f->icl_agbno); | |
2367 | __entry->count = be32_to_cpu(in_f->icl_count); | |
2368 | __entry->isize = be32_to_cpu(in_f->icl_isize); | |
2369 | __entry->length = be32_to_cpu(in_f->icl_length); | |
2370 | __entry->gen = be32_to_cpu(in_f->icl_gen); | |
2371 | ), | |
9febf39d | 2372 | TP_printk("dev %d:%d agno 0x%x agbno %u count %u isize %u length %u " |
78d57e45 BF |
2373 | "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev), |
2374 | __entry->agno, __entry->agbno, __entry->count, __entry->isize, | |
2375 | __entry->length, __entry->gen) | |
2376 | ) | |
2377 | #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \ | |
2378 | DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \ | |
2379 | TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \ | |
2380 | TP_ARGS(log, in_f)) | |
2381 | ||
2382 | DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel); | |
2383 | DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover); | |
2384 | ||
a46db608 CH |
2385 | DECLARE_EVENT_CLASS(xfs_discard_class, |
2386 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2387 | xfs_agblock_t agbno, xfs_extlen_t len), | |
2388 | TP_ARGS(mp, agno, agbno, len), | |
2389 | TP_STRUCT__entry( | |
2390 | __field(dev_t, dev) | |
2391 | __field(xfs_agnumber_t, agno) | |
2392 | __field(xfs_agblock_t, agbno) | |
2393 | __field(xfs_extlen_t, len) | |
2394 | ), | |
2395 | TP_fast_assign( | |
2396 | __entry->dev = mp->m_super->s_dev; | |
2397 | __entry->agno = agno; | |
2398 | __entry->agbno = agbno; | |
2399 | __entry->len = len; | |
2400 | ), | |
9febf39d | 2401 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u", |
a46db608 CH |
2402 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2403 | __entry->agno, | |
2404 | __entry->agbno, | |
2405 | __entry->len) | |
2406 | ) | |
2407 | ||
2408 | #define DEFINE_DISCARD_EVENT(name) \ | |
2409 | DEFINE_EVENT(xfs_discard_class, name, \ | |
2410 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2411 | xfs_agblock_t agbno, xfs_extlen_t len), \ | |
2412 | TP_ARGS(mp, agno, agbno, len)) | |
2413 | DEFINE_DISCARD_EVENT(xfs_discard_extent); | |
2414 | DEFINE_DISCARD_EVENT(xfs_discard_toosmall); | |
2415 | DEFINE_DISCARD_EVENT(xfs_discard_exclude); | |
2416 | DEFINE_DISCARD_EVENT(xfs_discard_busy); | |
2417 | ||
2c813ad6 | 2418 | /* btree cursor events */ |
c494213f DW |
2419 | TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi); |
2420 | TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi); | |
2421 | TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi); | |
2422 | TRACE_DEFINE_ENUM(XFS_BTNUM_INOi); | |
2423 | TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi); | |
2424 | TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi); | |
2425 | TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi); | |
2426 | ||
2c813ad6 DW |
2427 | DECLARE_EVENT_CLASS(xfs_btree_cur_class, |
2428 | TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), | |
2429 | TP_ARGS(cur, level, bp), | |
2430 | TP_STRUCT__entry( | |
2431 | __field(dev_t, dev) | |
2432 | __field(xfs_btnum_t, btnum) | |
2433 | __field(int, level) | |
2434 | __field(int, nlevels) | |
2435 | __field(int, ptr) | |
2436 | __field(xfs_daddr_t, daddr) | |
2437 | ), | |
2438 | TP_fast_assign( | |
2439 | __entry->dev = cur->bc_mp->m_super->s_dev; | |
2440 | __entry->btnum = cur->bc_btnum; | |
2441 | __entry->level = level; | |
2442 | __entry->nlevels = cur->bc_nlevels; | |
2443 | __entry->ptr = cur->bc_ptrs[level]; | |
2444 | __entry->daddr = bp ? bp->b_bn : -1; | |
2445 | ), | |
c494213f | 2446 | TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx", |
2c813ad6 | 2447 | MAJOR(__entry->dev), MINOR(__entry->dev), |
c494213f | 2448 | __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS), |
2c813ad6 DW |
2449 | __entry->level, |
2450 | __entry->nlevels, | |
2451 | __entry->ptr, | |
2452 | (unsigned long long)__entry->daddr) | |
2453 | ) | |
2454 | ||
2455 | #define DEFINE_BTREE_CUR_EVENT(name) \ | |
2456 | DEFINE_EVENT(xfs_btree_cur_class, name, \ | |
2457 | TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \ | |
2458 | TP_ARGS(cur, level, bp)) | |
2459 | DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys); | |
105f7d83 | 2460 | DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range); |
2c813ad6 | 2461 | |
3cd48abc DW |
2462 | /* deferred ops */ |
2463 | struct xfs_defer_pending; | |
3cd48abc DW |
2464 | |
2465 | DECLARE_EVENT_CLASS(xfs_defer_class, | |
9d9e6233 BF |
2466 | TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), |
2467 | TP_ARGS(tp, caller_ip), | |
3cd48abc DW |
2468 | TP_STRUCT__entry( |
2469 | __field(dev_t, dev) | |
9d9e6233 | 2470 | __field(struct xfs_trans *, tp) |
3f88a15a | 2471 | __field(char, committed) |
e632a569 | 2472 | __field(unsigned long, caller_ip) |
3cd48abc DW |
2473 | ), |
2474 | TP_fast_assign( | |
9d9e6233 BF |
2475 | __entry->dev = tp->t_mountp->m_super->s_dev; |
2476 | __entry->tp = tp; | |
e632a569 | 2477 | __entry->caller_ip = caller_ip; |
3cd48abc | 2478 | ), |
9d9e6233 | 2479 | TP_printk("dev %d:%d tp %p caller %pS", |
3cd48abc | 2480 | MAJOR(__entry->dev), MINOR(__entry->dev), |
9d9e6233 | 2481 | __entry->tp, |
e632a569 | 2482 | (char *)__entry->caller_ip) |
3cd48abc DW |
2483 | ) |
2484 | #define DEFINE_DEFER_EVENT(name) \ | |
2485 | DEFINE_EVENT(xfs_defer_class, name, \ | |
9d9e6233 BF |
2486 | TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \ |
2487 | TP_ARGS(tp, caller_ip)) | |
3cd48abc DW |
2488 | |
2489 | DECLARE_EVENT_CLASS(xfs_defer_error_class, | |
9d9e6233 BF |
2490 | TP_PROTO(struct xfs_trans *tp, int error), |
2491 | TP_ARGS(tp, error), | |
3cd48abc DW |
2492 | TP_STRUCT__entry( |
2493 | __field(dev_t, dev) | |
9d9e6233 | 2494 | __field(struct xfs_trans *, tp) |
3f88a15a | 2495 | __field(char, committed) |
3cd48abc DW |
2496 | __field(int, error) |
2497 | ), | |
2498 | TP_fast_assign( | |
9d9e6233 BF |
2499 | __entry->dev = tp->t_mountp->m_super->s_dev; |
2500 | __entry->tp = tp; | |
3cd48abc DW |
2501 | __entry->error = error; |
2502 | ), | |
9d9e6233 | 2503 | TP_printk("dev %d:%d tp %p err %d", |
3cd48abc | 2504 | MAJOR(__entry->dev), MINOR(__entry->dev), |
9d9e6233 | 2505 | __entry->tp, |
3cd48abc DW |
2506 | __entry->error) |
2507 | ) | |
2508 | #define DEFINE_DEFER_ERROR_EVENT(name) \ | |
2509 | DEFINE_EVENT(xfs_defer_error_class, name, \ | |
9d9e6233 BF |
2510 | TP_PROTO(struct xfs_trans *tp, int error), \ |
2511 | TP_ARGS(tp, error)) | |
3cd48abc DW |
2512 | |
2513 | DECLARE_EVENT_CLASS(xfs_defer_pending_class, | |
2514 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), | |
2515 | TP_ARGS(mp, dfp), | |
2516 | TP_STRUCT__entry( | |
2517 | __field(dev_t, dev) | |
2518 | __field(int, type) | |
2519 | __field(void *, intent) | |
3f88a15a | 2520 | __field(char, committed) |
3cd48abc DW |
2521 | __field(int, nr) |
2522 | ), | |
2523 | TP_fast_assign( | |
2524 | __entry->dev = mp ? mp->m_super->s_dev : 0; | |
02b100fb | 2525 | __entry->type = dfp->dfp_type; |
3cd48abc | 2526 | __entry->intent = dfp->dfp_intent; |
ea78d808 | 2527 | __entry->committed = dfp->dfp_done != NULL; |
3cd48abc DW |
2528 | __entry->nr = dfp->dfp_count; |
2529 | ), | |
42bf9dba | 2530 | TP_printk("dev %d:%d optype %d intent %p committed %d nr %d", |
3cd48abc DW |
2531 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2532 | __entry->type, | |
2533 | __entry->intent, | |
2534 | __entry->committed, | |
2535 | __entry->nr) | |
2536 | ) | |
2537 | #define DEFINE_DEFER_PENDING_EVENT(name) \ | |
2538 | DEFINE_EVENT(xfs_defer_pending_class, name, \ | |
2539 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \ | |
2540 | TP_ARGS(mp, dfp)) | |
2541 | ||
2542 | DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class, | |
2543 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2544 | int type, xfs_agblock_t agbno, xfs_extlen_t len), | |
2545 | TP_ARGS(mp, agno, type, agbno, len), | |
2546 | TP_STRUCT__entry( | |
2547 | __field(dev_t, dev) | |
2548 | __field(xfs_agnumber_t, agno) | |
2549 | __field(int, type) | |
2550 | __field(xfs_agblock_t, agbno) | |
2551 | __field(xfs_extlen_t, len) | |
2552 | ), | |
2553 | TP_fast_assign( | |
2554 | __entry->dev = mp->m_super->s_dev; | |
2555 | __entry->agno = agno; | |
2556 | __entry->type = type; | |
2557 | __entry->agbno = agbno; | |
2558 | __entry->len = len; | |
2559 | ), | |
9febf39d | 2560 | TP_printk("dev %d:%d op %d agno 0x%x agbno %u len %u", |
3cd48abc DW |
2561 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2562 | __entry->type, | |
2563 | __entry->agno, | |
2564 | __entry->agbno, | |
2565 | __entry->len) | |
2566 | ); | |
2567 | #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \ | |
2568 | DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \ | |
2569 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2570 | int type, \ | |
2571 | xfs_agblock_t bno, \ | |
2572 | xfs_extlen_t len), \ | |
2573 | TP_ARGS(mp, agno, type, bno, len)) | |
2574 | ||
2575 | DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class, | |
2576 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2577 | int op, | |
2578 | xfs_agblock_t agbno, | |
2579 | xfs_ino_t ino, | |
2580 | int whichfork, | |
2581 | xfs_fileoff_t offset, | |
2582 | xfs_filblks_t len, | |
2583 | xfs_exntst_t state), | |
2584 | TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state), | |
2585 | TP_STRUCT__entry( | |
2586 | __field(dev_t, dev) | |
2587 | __field(xfs_agnumber_t, agno) | |
2588 | __field(xfs_ino_t, ino) | |
2589 | __field(xfs_agblock_t, agbno) | |
2590 | __field(int, whichfork) | |
2591 | __field(xfs_fileoff_t, l_loff) | |
2592 | __field(xfs_filblks_t, l_len) | |
2593 | __field(xfs_exntst_t, l_state) | |
2594 | __field(int, op) | |
2595 | ), | |
2596 | TP_fast_assign( | |
2597 | __entry->dev = mp->m_super->s_dev; | |
2598 | __entry->agno = agno; | |
2599 | __entry->ino = ino; | |
2600 | __entry->agbno = agbno; | |
2601 | __entry->whichfork = whichfork; | |
2602 | __entry->l_loff = offset; | |
2603 | __entry->l_len = len; | |
2604 | __entry->l_state = state; | |
2605 | __entry->op = op; | |
2606 | ), | |
9febf39d | 2607 | TP_printk("dev %d:%d op %d agno 0x%x agbno %u owner %lld %s offset %llu len %llu state %d", |
3cd48abc DW |
2608 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2609 | __entry->op, | |
2610 | __entry->agno, | |
2611 | __entry->agbno, | |
2612 | __entry->ino, | |
2613 | __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data", | |
2614 | __entry->l_loff, | |
2615 | __entry->l_len, | |
2616 | __entry->l_state) | |
2617 | ); | |
2618 | #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \ | |
2619 | DEFINE_EVENT(xfs_map_extent_deferred_class, name, \ | |
2620 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2621 | int op, \ | |
2622 | xfs_agblock_t agbno, \ | |
2623 | xfs_ino_t ino, \ | |
2624 | int whichfork, \ | |
2625 | xfs_fileoff_t offset, \ | |
2626 | xfs_filblks_t len, \ | |
2627 | xfs_exntst_t state), \ | |
2628 | TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state)) | |
2629 | ||
3cd48abc DW |
2630 | DEFINE_DEFER_EVENT(xfs_defer_cancel); |
2631 | DEFINE_DEFER_EVENT(xfs_defer_trans_roll); | |
2632 | DEFINE_DEFER_EVENT(xfs_defer_trans_abort); | |
2633 | DEFINE_DEFER_EVENT(xfs_defer_finish); | |
2634 | DEFINE_DEFER_EVENT(xfs_defer_finish_done); | |
2635 | ||
2636 | DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error); | |
2637 | DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error); | |
3cd48abc | 2638 | |
1ae093cb BF |
2639 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent); |
2640 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list); | |
3cd48abc DW |
2641 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish); |
2642 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort); | |
4e919af7 | 2643 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent); |
3cd48abc | 2644 | |
ba9e7802 DW |
2645 | #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT |
2646 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer); | |
2647 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred); | |
f8f2835a BF |
2648 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer); |
2649 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred); | |
ba9e7802 | 2650 | |
673930c3 DW |
2651 | /* rmap tracepoints */ |
2652 | DECLARE_EVENT_CLASS(xfs_rmap_class, | |
2653 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2654 | xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, | |
66e3237e | 2655 | const struct xfs_owner_info *oinfo), |
673930c3 DW |
2656 | TP_ARGS(mp, agno, agbno, len, unwritten, oinfo), |
2657 | TP_STRUCT__entry( | |
2658 | __field(dev_t, dev) | |
2659 | __field(xfs_agnumber_t, agno) | |
2660 | __field(xfs_agblock_t, agbno) | |
2661 | __field(xfs_extlen_t, len) | |
2662 | __field(uint64_t, owner) | |
2663 | __field(uint64_t, offset) | |
2664 | __field(unsigned long, flags) | |
2665 | ), | |
2666 | TP_fast_assign( | |
2667 | __entry->dev = mp->m_super->s_dev; | |
2668 | __entry->agno = agno; | |
2669 | __entry->agbno = agbno; | |
2670 | __entry->len = len; | |
2671 | __entry->owner = oinfo->oi_owner; | |
2672 | __entry->offset = oinfo->oi_offset; | |
2673 | __entry->flags = oinfo->oi_flags; | |
035e00ac DW |
2674 | if (unwritten) |
2675 | __entry->flags |= XFS_RMAP_UNWRITTEN; | |
673930c3 | 2676 | ), |
9febf39d | 2677 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u owner %lld offset %llu flags 0x%lx", |
673930c3 DW |
2678 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2679 | __entry->agno, | |
2680 | __entry->agbno, | |
2681 | __entry->len, | |
2682 | __entry->owner, | |
2683 | __entry->offset, | |
2684 | __entry->flags) | |
2685 | ); | |
2686 | #define DEFINE_RMAP_EVENT(name) \ | |
2687 | DEFINE_EVENT(xfs_rmap_class, name, \ | |
2688 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2689 | xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \ | |
66e3237e | 2690 | const struct xfs_owner_info *oinfo), \ |
673930c3 DW |
2691 | TP_ARGS(mp, agno, agbno, len, unwritten, oinfo)) |
2692 | ||
2693 | /* simple AG-based error/%ip tracepoint class */ | |
2694 | DECLARE_EVENT_CLASS(xfs_ag_error_class, | |
2695 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, | |
2696 | unsigned long caller_ip), | |
2697 | TP_ARGS(mp, agno, error, caller_ip), | |
2698 | TP_STRUCT__entry( | |
2699 | __field(dev_t, dev) | |
2700 | __field(xfs_agnumber_t, agno) | |
2701 | __field(int, error) | |
2702 | __field(unsigned long, caller_ip) | |
2703 | ), | |
2704 | TP_fast_assign( | |
2705 | __entry->dev = mp->m_super->s_dev; | |
2706 | __entry->agno = agno; | |
2707 | __entry->error = error; | |
2708 | __entry->caller_ip = caller_ip; | |
2709 | ), | |
9febf39d | 2710 | TP_printk("dev %d:%d agno 0x%x error %d caller %pS", |
673930c3 DW |
2711 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2712 | __entry->agno, | |
2713 | __entry->error, | |
2714 | (char *)__entry->caller_ip) | |
2715 | ); | |
2716 | ||
2717 | #define DEFINE_AG_ERROR_EVENT(name) \ | |
2718 | DEFINE_EVENT(xfs_ag_error_class, name, \ | |
2719 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \ | |
2720 | unsigned long caller_ip), \ | |
2721 | TP_ARGS(mp, agno, error, caller_ip)) | |
2722 | ||
2723 | DEFINE_RMAP_EVENT(xfs_rmap_unmap); | |
2724 | DEFINE_RMAP_EVENT(xfs_rmap_unmap_done); | |
2725 | DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error); | |
2726 | DEFINE_RMAP_EVENT(xfs_rmap_map); | |
2727 | DEFINE_RMAP_EVENT(xfs_rmap_map_done); | |
2728 | DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error); | |
fb7d9267 DW |
2729 | DEFINE_RMAP_EVENT(xfs_rmap_convert); |
2730 | DEFINE_RMAP_EVENT(xfs_rmap_convert_done); | |
2731 | DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error); | |
2732 | DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state); | |
673930c3 | 2733 | |
aa966d84 DW |
2734 | DECLARE_EVENT_CLASS(xfs_rmapbt_class, |
2735 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2736 | xfs_agblock_t agbno, xfs_extlen_t len, | |
2737 | uint64_t owner, uint64_t offset, unsigned int flags), | |
2738 | TP_ARGS(mp, agno, agbno, len, owner, offset, flags), | |
2739 | TP_STRUCT__entry( | |
2740 | __field(dev_t, dev) | |
2741 | __field(xfs_agnumber_t, agno) | |
2742 | __field(xfs_agblock_t, agbno) | |
2743 | __field(xfs_extlen_t, len) | |
2744 | __field(uint64_t, owner) | |
2745 | __field(uint64_t, offset) | |
2746 | __field(unsigned int, flags) | |
2747 | ), | |
2748 | TP_fast_assign( | |
2749 | __entry->dev = mp->m_super->s_dev; | |
2750 | __entry->agno = agno; | |
2751 | __entry->agbno = agbno; | |
2752 | __entry->len = len; | |
2753 | __entry->owner = owner; | |
2754 | __entry->offset = offset; | |
2755 | __entry->flags = flags; | |
2756 | ), | |
9febf39d | 2757 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u owner %lld offset %llu flags 0x%x", |
aa966d84 DW |
2758 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2759 | __entry->agno, | |
2760 | __entry->agbno, | |
2761 | __entry->len, | |
2762 | __entry->owner, | |
2763 | __entry->offset, | |
2764 | __entry->flags) | |
2765 | ); | |
2766 | #define DEFINE_RMAPBT_EVENT(name) \ | |
2767 | DEFINE_EVENT(xfs_rmapbt_class, name, \ | |
2768 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2769 | xfs_agblock_t agbno, xfs_extlen_t len, \ | |
2770 | uint64_t owner, uint64_t offset, unsigned int flags), \ | |
2771 | TP_ARGS(mp, agno, agbno, len, owner, offset, flags)) | |
2772 | ||
2773 | #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT | |
2774 | DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer); | |
2775 | DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred); | |
2776 | ||
4b8ed677 DW |
2777 | DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block); |
2778 | DEFINE_BUSY_EVENT(xfs_rmapbt_free_block); | |
aa966d84 DW |
2779 | DEFINE_RMAPBT_EVENT(xfs_rmap_update); |
2780 | DEFINE_RMAPBT_EVENT(xfs_rmap_insert); | |
2781 | DEFINE_RMAPBT_EVENT(xfs_rmap_delete); | |
2782 | DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error); | |
2783 | DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error); | |
2784 | DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error); | |
ceeb9c83 DW |
2785 | |
2786 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate); | |
2787 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query); | |
2788 | DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate); | |
2789 | DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range); | |
0a1b0b38 DW |
2790 | DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result); |
2791 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result); | |
fb7d9267 | 2792 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result); |
4b8ed677 | 2793 | |
9f3afb57 DW |
2794 | /* deferred bmbt updates */ |
2795 | #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT | |
2796 | DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer); | |
2797 | DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred); | |
2798 | ||
3fd129b6 DW |
2799 | /* per-AG reservation */ |
2800 | DECLARE_EVENT_CLASS(xfs_ag_resv_class, | |
2801 | TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv, | |
2802 | xfs_extlen_t len), | |
2803 | TP_ARGS(pag, resv, len), | |
2804 | TP_STRUCT__entry( | |
2805 | __field(dev_t, dev) | |
2806 | __field(xfs_agnumber_t, agno) | |
2807 | __field(int, resv) | |
2808 | __field(xfs_extlen_t, freeblks) | |
2809 | __field(xfs_extlen_t, flcount) | |
2810 | __field(xfs_extlen_t, reserved) | |
2811 | __field(xfs_extlen_t, asked) | |
2812 | __field(xfs_extlen_t, len) | |
2813 | ), | |
2814 | TP_fast_assign( | |
2815 | struct xfs_ag_resv *r = xfs_perag_resv(pag, resv); | |
2816 | ||
2817 | __entry->dev = pag->pag_mount->m_super->s_dev; | |
2818 | __entry->agno = pag->pag_agno; | |
2819 | __entry->resv = resv; | |
2820 | __entry->freeblks = pag->pagf_freeblks; | |
2821 | __entry->flcount = pag->pagf_flcount; | |
2822 | __entry->reserved = r ? r->ar_reserved : 0; | |
2823 | __entry->asked = r ? r->ar_asked : 0; | |
2824 | __entry->len = len; | |
2825 | ), | |
9febf39d | 2826 | TP_printk("dev %d:%d agno 0x%x resv %d freeblks %u flcount %u " |
42bf9dba | 2827 | "resv %u ask %u len %u", |
3fd129b6 DW |
2828 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2829 | __entry->agno, | |
2830 | __entry->resv, | |
2831 | __entry->freeblks, | |
2832 | __entry->flcount, | |
2833 | __entry->reserved, | |
2834 | __entry->asked, | |
2835 | __entry->len) | |
2836 | ) | |
2837 | #define DEFINE_AG_RESV_EVENT(name) \ | |
2838 | DEFINE_EVENT(xfs_ag_resv_class, name, \ | |
2839 | TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \ | |
2840 | xfs_extlen_t len), \ | |
2841 | TP_ARGS(pag, type, len)) | |
2842 | ||
2843 | /* per-AG reservation tracepoints */ | |
2844 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_init); | |
2845 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_free); | |
2846 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent); | |
2847 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent); | |
2848 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical); | |
2849 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed); | |
2850 | ||
2851 | DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error); | |
2852 | DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error); | |
2853 | ||
c75c752d DW |
2854 | /* refcount tracepoint classes */ |
2855 | ||
2856 | /* reuse the discard trace class for agbno/aglen-based traces */ | |
2857 | #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name) | |
2858 | ||
2859 | /* ag btree lookup tracepoint class */ | |
85f8dff0 DW |
2860 | TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi); |
2861 | TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi); | |
2862 | TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi); | |
c75c752d DW |
2863 | DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class, |
2864 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2865 | xfs_agblock_t agbno, xfs_lookup_t dir), | |
2866 | TP_ARGS(mp, agno, agbno, dir), | |
2867 | TP_STRUCT__entry( | |
2868 | __field(dev_t, dev) | |
2869 | __field(xfs_agnumber_t, agno) | |
2870 | __field(xfs_agblock_t, agbno) | |
2871 | __field(xfs_lookup_t, dir) | |
2872 | ), | |
2873 | TP_fast_assign( | |
2874 | __entry->dev = mp->m_super->s_dev; | |
2875 | __entry->agno = agno; | |
2876 | __entry->agbno = agbno; | |
2877 | __entry->dir = dir; | |
2878 | ), | |
9febf39d | 2879 | TP_printk("dev %d:%d agno 0x%x agbno %u cmp %s(%d)", |
c75c752d DW |
2880 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2881 | __entry->agno, | |
2882 | __entry->agbno, | |
2883 | __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR), | |
2884 | __entry->dir) | |
2885 | ) | |
2886 | ||
2887 | #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \ | |
2888 | DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \ | |
2889 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2890 | xfs_agblock_t agbno, xfs_lookup_t dir), \ | |
2891 | TP_ARGS(mp, agno, agbno, dir)) | |
2892 | ||
2893 | /* single-rcext tracepoint class */ | |
2894 | DECLARE_EVENT_CLASS(xfs_refcount_extent_class, | |
2895 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2896 | struct xfs_refcount_irec *irec), | |
2897 | TP_ARGS(mp, agno, irec), | |
2898 | TP_STRUCT__entry( | |
2899 | __field(dev_t, dev) | |
2900 | __field(xfs_agnumber_t, agno) | |
2901 | __field(xfs_agblock_t, startblock) | |
2902 | __field(xfs_extlen_t, blockcount) | |
2903 | __field(xfs_nlink_t, refcount) | |
2904 | ), | |
2905 | TP_fast_assign( | |
2906 | __entry->dev = mp->m_super->s_dev; | |
2907 | __entry->agno = agno; | |
2908 | __entry->startblock = irec->rc_startblock; | |
2909 | __entry->blockcount = irec->rc_blockcount; | |
2910 | __entry->refcount = irec->rc_refcount; | |
2911 | ), | |
9febf39d | 2912 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u refcount %u", |
c75c752d DW |
2913 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2914 | __entry->agno, | |
2915 | __entry->startblock, | |
2916 | __entry->blockcount, | |
2917 | __entry->refcount) | |
2918 | ) | |
2919 | ||
2920 | #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \ | |
2921 | DEFINE_EVENT(xfs_refcount_extent_class, name, \ | |
2922 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2923 | struct xfs_refcount_irec *irec), \ | |
2924 | TP_ARGS(mp, agno, irec)) | |
2925 | ||
2926 | /* single-rcext and an agbno tracepoint class */ | |
2927 | DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class, | |
2928 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2929 | struct xfs_refcount_irec *irec, xfs_agblock_t agbno), | |
2930 | TP_ARGS(mp, agno, irec, agbno), | |
2931 | TP_STRUCT__entry( | |
2932 | __field(dev_t, dev) | |
2933 | __field(xfs_agnumber_t, agno) | |
2934 | __field(xfs_agblock_t, startblock) | |
2935 | __field(xfs_extlen_t, blockcount) | |
2936 | __field(xfs_nlink_t, refcount) | |
2937 | __field(xfs_agblock_t, agbno) | |
2938 | ), | |
2939 | TP_fast_assign( | |
2940 | __entry->dev = mp->m_super->s_dev; | |
2941 | __entry->agno = agno; | |
2942 | __entry->startblock = irec->rc_startblock; | |
2943 | __entry->blockcount = irec->rc_blockcount; | |
2944 | __entry->refcount = irec->rc_refcount; | |
2945 | __entry->agbno = agbno; | |
2946 | ), | |
9febf39d | 2947 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u refcount %u @ agbno %u", |
c75c752d DW |
2948 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2949 | __entry->agno, | |
2950 | __entry->startblock, | |
2951 | __entry->blockcount, | |
2952 | __entry->refcount, | |
2953 | __entry->agbno) | |
2954 | ) | |
2955 | ||
2956 | #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \ | |
2957 | DEFINE_EVENT(xfs_refcount_extent_at_class, name, \ | |
2958 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
2959 | struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \ | |
2960 | TP_ARGS(mp, agno, irec, agbno)) | |
2961 | ||
2962 | /* double-rcext tracepoint class */ | |
2963 | DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class, | |
2964 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
2965 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), | |
2966 | TP_ARGS(mp, agno, i1, i2), | |
2967 | TP_STRUCT__entry( | |
2968 | __field(dev_t, dev) | |
2969 | __field(xfs_agnumber_t, agno) | |
2970 | __field(xfs_agblock_t, i1_startblock) | |
2971 | __field(xfs_extlen_t, i1_blockcount) | |
2972 | __field(xfs_nlink_t, i1_refcount) | |
2973 | __field(xfs_agblock_t, i2_startblock) | |
2974 | __field(xfs_extlen_t, i2_blockcount) | |
2975 | __field(xfs_nlink_t, i2_refcount) | |
2976 | ), | |
2977 | TP_fast_assign( | |
2978 | __entry->dev = mp->m_super->s_dev; | |
2979 | __entry->agno = agno; | |
2980 | __entry->i1_startblock = i1->rc_startblock; | |
2981 | __entry->i1_blockcount = i1->rc_blockcount; | |
2982 | __entry->i1_refcount = i1->rc_refcount; | |
2983 | __entry->i2_startblock = i2->rc_startblock; | |
2984 | __entry->i2_blockcount = i2->rc_blockcount; | |
2985 | __entry->i2_refcount = i2->rc_refcount; | |
2986 | ), | |
9febf39d | 2987 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u refcount %u -- " |
42bf9dba | 2988 | "agbno %u len %u refcount %u", |
c75c752d DW |
2989 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2990 | __entry->agno, | |
2991 | __entry->i1_startblock, | |
2992 | __entry->i1_blockcount, | |
2993 | __entry->i1_refcount, | |
2994 | __entry->i2_startblock, | |
2995 | __entry->i2_blockcount, | |
2996 | __entry->i2_refcount) | |
2997 | ) | |
2998 | ||
2999 | #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \ | |
3000 | DEFINE_EVENT(xfs_refcount_double_extent_class, name, \ | |
3001 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
3002 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \ | |
3003 | TP_ARGS(mp, agno, i1, i2)) | |
3004 | ||
3005 | /* double-rcext and an agbno tracepoint class */ | |
3006 | DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class, | |
3007 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
3008 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, | |
3009 | xfs_agblock_t agbno), | |
3010 | TP_ARGS(mp, agno, i1, i2, agbno), | |
3011 | TP_STRUCT__entry( | |
3012 | __field(dev_t, dev) | |
3013 | __field(xfs_agnumber_t, agno) | |
3014 | __field(xfs_agblock_t, i1_startblock) | |
3015 | __field(xfs_extlen_t, i1_blockcount) | |
3016 | __field(xfs_nlink_t, i1_refcount) | |
3017 | __field(xfs_agblock_t, i2_startblock) | |
3018 | __field(xfs_extlen_t, i2_blockcount) | |
3019 | __field(xfs_nlink_t, i2_refcount) | |
3020 | __field(xfs_agblock_t, agbno) | |
3021 | ), | |
3022 | TP_fast_assign( | |
3023 | __entry->dev = mp->m_super->s_dev; | |
3024 | __entry->agno = agno; | |
3025 | __entry->i1_startblock = i1->rc_startblock; | |
3026 | __entry->i1_blockcount = i1->rc_blockcount; | |
3027 | __entry->i1_refcount = i1->rc_refcount; | |
3028 | __entry->i2_startblock = i2->rc_startblock; | |
3029 | __entry->i2_blockcount = i2->rc_blockcount; | |
3030 | __entry->i2_refcount = i2->rc_refcount; | |
3031 | __entry->agbno = agbno; | |
3032 | ), | |
9febf39d | 3033 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u refcount %u -- " |
42bf9dba | 3034 | "agbno %u len %u refcount %u @ agbno %u", |
c75c752d DW |
3035 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3036 | __entry->agno, | |
3037 | __entry->i1_startblock, | |
3038 | __entry->i1_blockcount, | |
3039 | __entry->i1_refcount, | |
3040 | __entry->i2_startblock, | |
3041 | __entry->i2_blockcount, | |
3042 | __entry->i2_refcount, | |
3043 | __entry->agbno) | |
3044 | ) | |
3045 | ||
3046 | #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \ | |
3047 | DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \ | |
3048 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
3049 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \ | |
3050 | xfs_agblock_t agbno), \ | |
3051 | TP_ARGS(mp, agno, i1, i2, agbno)) | |
3052 | ||
3053 | /* triple-rcext tracepoint class */ | |
3054 | DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class, | |
3055 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
3056 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, | |
3057 | struct xfs_refcount_irec *i3), | |
3058 | TP_ARGS(mp, agno, i1, i2, i3), | |
3059 | TP_STRUCT__entry( | |
3060 | __field(dev_t, dev) | |
3061 | __field(xfs_agnumber_t, agno) | |
3062 | __field(xfs_agblock_t, i1_startblock) | |
3063 | __field(xfs_extlen_t, i1_blockcount) | |
3064 | __field(xfs_nlink_t, i1_refcount) | |
3065 | __field(xfs_agblock_t, i2_startblock) | |
3066 | __field(xfs_extlen_t, i2_blockcount) | |
3067 | __field(xfs_nlink_t, i2_refcount) | |
3068 | __field(xfs_agblock_t, i3_startblock) | |
3069 | __field(xfs_extlen_t, i3_blockcount) | |
3070 | __field(xfs_nlink_t, i3_refcount) | |
3071 | ), | |
3072 | TP_fast_assign( | |
3073 | __entry->dev = mp->m_super->s_dev; | |
3074 | __entry->agno = agno; | |
3075 | __entry->i1_startblock = i1->rc_startblock; | |
3076 | __entry->i1_blockcount = i1->rc_blockcount; | |
3077 | __entry->i1_refcount = i1->rc_refcount; | |
3078 | __entry->i2_startblock = i2->rc_startblock; | |
3079 | __entry->i2_blockcount = i2->rc_blockcount; | |
3080 | __entry->i2_refcount = i2->rc_refcount; | |
3081 | __entry->i3_startblock = i3->rc_startblock; | |
3082 | __entry->i3_blockcount = i3->rc_blockcount; | |
3083 | __entry->i3_refcount = i3->rc_refcount; | |
3084 | ), | |
9febf39d | 3085 | TP_printk("dev %d:%d agno 0x%x agbno %u len %u refcount %u -- " |
c75c752d | 3086 | "agbno %u len %u refcount %u -- " |
42bf9dba | 3087 | "agbno %u len %u refcount %u", |
c75c752d DW |
3088 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3089 | __entry->agno, | |
3090 | __entry->i1_startblock, | |
3091 | __entry->i1_blockcount, | |
3092 | __entry->i1_refcount, | |
3093 | __entry->i2_startblock, | |
3094 | __entry->i2_blockcount, | |
3095 | __entry->i2_refcount, | |
3096 | __entry->i3_startblock, | |
3097 | __entry->i3_blockcount, | |
3098 | __entry->i3_refcount) | |
3099 | ); | |
3100 | ||
3101 | #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \ | |
3102 | DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \ | |
3103 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
3104 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \ | |
3105 | struct xfs_refcount_irec *i3), \ | |
3106 | TP_ARGS(mp, agno, i1, i2, i3)) | |
3107 | ||
3108 | /* refcount btree tracepoints */ | |
3109 | DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block); | |
3110 | DEFINE_BUSY_EVENT(xfs_refcountbt_free_block); | |
3111 | DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup); | |
3112 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get); | |
3113 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update); | |
3114 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert); | |
3115 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete); | |
3116 | DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error); | |
3117 | DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error); | |
3118 | DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error); | |
3119 | ||
3120 | /* refcount adjustment tracepoints */ | |
3121 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase); | |
3122 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease); | |
174edb0e DW |
3123 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase); |
3124 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease); | |
c75c752d DW |
3125 | DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents); |
3126 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent); | |
174edb0e | 3127 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent); |
c75c752d DW |
3128 | DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent); |
3129 | DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent); | |
3130 | DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent); | |
3131 | DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent); | |
3132 | DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent); | |
3133 | DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error); | |
174edb0e | 3134 | DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error); |
c75c752d DW |
3135 | DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error); |
3136 | DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error); | |
3137 | DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error); | |
3138 | DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error); | |
3139 | DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error); | |
3140 | DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error); | |
3141 | DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error); | |
3142 | ||
3143 | /* reflink helpers */ | |
3144 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared); | |
3145 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result); | |
3146 | DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error); | |
33ba6129 DW |
3147 | #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT |
3148 | DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer); | |
3149 | DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred); | |
c75c752d | 3150 | |
f997ee21 DW |
3151 | TRACE_EVENT(xfs_refcount_finish_one_leftover, |
3152 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
3153 | int type, xfs_agblock_t agbno, xfs_extlen_t len, | |
3154 | xfs_agblock_t new_agbno, xfs_extlen_t new_len), | |
3155 | TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len), | |
3156 | TP_STRUCT__entry( | |
3157 | __field(dev_t, dev) | |
3158 | __field(xfs_agnumber_t, agno) | |
3159 | __field(int, type) | |
3160 | __field(xfs_agblock_t, agbno) | |
3161 | __field(xfs_extlen_t, len) | |
3162 | __field(xfs_agblock_t, new_agbno) | |
3163 | __field(xfs_extlen_t, new_len) | |
3164 | ), | |
3165 | TP_fast_assign( | |
3166 | __entry->dev = mp->m_super->s_dev; | |
3167 | __entry->agno = agno; | |
3168 | __entry->type = type; | |
3169 | __entry->agbno = agbno; | |
3170 | __entry->len = len; | |
3171 | __entry->new_agbno = new_agbno; | |
3172 | __entry->new_len = new_len; | |
3173 | ), | |
9febf39d | 3174 | TP_printk("dev %d:%d type %d agno 0x%x agbno %u len %u new_agbno %u new_len %u", |
f997ee21 DW |
3175 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3176 | __entry->type, | |
3177 | __entry->agno, | |
3178 | __entry->agbno, | |
3179 | __entry->len, | |
3180 | __entry->new_agbno, | |
3181 | __entry->new_len) | |
3182 | ); | |
3183 | ||
f65306ea DW |
3184 | /* simple inode-based error/%ip tracepoint class */ |
3185 | DECLARE_EVENT_CLASS(xfs_inode_error_class, | |
3186 | TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip), | |
3187 | TP_ARGS(ip, error, caller_ip), | |
3188 | TP_STRUCT__entry( | |
3189 | __field(dev_t, dev) | |
3190 | __field(xfs_ino_t, ino) | |
3191 | __field(int, error) | |
3192 | __field(unsigned long, caller_ip) | |
3193 | ), | |
3194 | TP_fast_assign( | |
3195 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
3196 | __entry->ino = ip->i_ino; | |
3197 | __entry->error = error; | |
3198 | __entry->caller_ip = caller_ip; | |
3199 | ), | |
af6265a0 | 3200 | TP_printk("dev %d:%d ino 0x%llx error %d caller %pS", |
f65306ea DW |
3201 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3202 | __entry->ino, | |
3203 | __entry->error, | |
3204 | (char *)__entry->caller_ip) | |
3205 | ); | |
3206 | ||
3207 | #define DEFINE_INODE_ERROR_EVENT(name) \ | |
3208 | DEFINE_EVENT(xfs_inode_error_class, name, \ | |
3209 | TP_PROTO(struct xfs_inode *ip, int error, \ | |
3210 | unsigned long caller_ip), \ | |
3211 | TP_ARGS(ip, error, caller_ip)) | |
3212 | ||
53aa1c34 DW |
3213 | /* reflink tracepoint classes */ |
3214 | ||
3215 | /* two-file io tracepoint class */ | |
3216 | DECLARE_EVENT_CLASS(xfs_double_io_class, | |
3217 | TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, | |
3218 | struct xfs_inode *dest, xfs_off_t doffset), | |
3219 | TP_ARGS(src, soffset, len, dest, doffset), | |
3220 | TP_STRUCT__entry( | |
3221 | __field(dev_t, dev) | |
3222 | __field(xfs_ino_t, src_ino) | |
3223 | __field(loff_t, src_isize) | |
3224 | __field(loff_t, src_disize) | |
3225 | __field(loff_t, src_offset) | |
3226 | __field(size_t, len) | |
3227 | __field(xfs_ino_t, dest_ino) | |
3228 | __field(loff_t, dest_isize) | |
3229 | __field(loff_t, dest_disize) | |
3230 | __field(loff_t, dest_offset) | |
3231 | ), | |
3232 | TP_fast_assign( | |
3233 | __entry->dev = VFS_I(src)->i_sb->s_dev; | |
3234 | __entry->src_ino = src->i_ino; | |
3235 | __entry->src_isize = VFS_I(src)->i_size; | |
13d2c10b | 3236 | __entry->src_disize = src->i_disk_size; |
53aa1c34 DW |
3237 | __entry->src_offset = soffset; |
3238 | __entry->len = len; | |
3239 | __entry->dest_ino = dest->i_ino; | |
3240 | __entry->dest_isize = VFS_I(dest)->i_size; | |
13d2c10b | 3241 | __entry->dest_disize = dest->i_disk_size; |
53aa1c34 DW |
3242 | __entry->dest_offset = doffset; |
3243 | ), | |
3244 | TP_printk("dev %d:%d count %zd " | |
3245 | "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> " | |
3246 | "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx", | |
3247 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3248 | __entry->len, | |
3249 | __entry->src_ino, | |
3250 | __entry->src_isize, | |
3251 | __entry->src_disize, | |
3252 | __entry->src_offset, | |
3253 | __entry->dest_ino, | |
3254 | __entry->dest_isize, | |
3255 | __entry->dest_disize, | |
3256 | __entry->dest_offset) | |
3257 | ) | |
3258 | ||
3259 | #define DEFINE_DOUBLE_IO_EVENT(name) \ | |
3260 | DEFINE_EVENT(xfs_double_io_class, name, \ | |
3261 | TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \ | |
3262 | struct xfs_inode *dest, xfs_off_t doffset), \ | |
3263 | TP_ARGS(src, soffset, len, dest, doffset)) | |
3264 | ||
53aa1c34 DW |
3265 | /* inode/irec events */ |
3266 | DECLARE_EVENT_CLASS(xfs_inode_irec_class, | |
3267 | TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), | |
3268 | TP_ARGS(ip, irec), | |
3269 | TP_STRUCT__entry( | |
3270 | __field(dev_t, dev) | |
3271 | __field(xfs_ino_t, ino) | |
3272 | __field(xfs_fileoff_t, lblk) | |
3273 | __field(xfs_extlen_t, len) | |
3274 | __field(xfs_fsblock_t, pblk) | |
5eda4300 | 3275 | __field(int, state) |
53aa1c34 DW |
3276 | ), |
3277 | TP_fast_assign( | |
3278 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
3279 | __entry->ino = ip->i_ino; | |
3280 | __entry->lblk = irec->br_startoff; | |
3281 | __entry->len = irec->br_blockcount; | |
3282 | __entry->pblk = irec->br_startblock; | |
5eda4300 | 3283 | __entry->state = irec->br_state; |
53aa1c34 | 3284 | ), |
5eda4300 | 3285 | TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d", |
53aa1c34 DW |
3286 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3287 | __entry->ino, | |
3288 | __entry->lblk, | |
3289 | __entry->len, | |
5eda4300 DW |
3290 | __entry->pblk, |
3291 | __entry->state) | |
53aa1c34 DW |
3292 | ); |
3293 | #define DEFINE_INODE_IREC_EVENT(name) \ | |
3294 | DEFINE_EVENT(xfs_inode_irec_class, name, \ | |
3295 | TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \ | |
3296 | TP_ARGS(ip, irec)) | |
3297 | ||
3298 | /* refcount/reflink tracepoint definitions */ | |
3299 | ||
3300 | /* reflink tracepoints */ | |
3301 | DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag); | |
3302 | DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag); | |
3303 | DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size); | |
00fd1d56 | 3304 | TRACE_EVENT(xfs_reflink_remap_blocks, |
53aa1c34 DW |
3305 | TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset, |
3306 | xfs_filblks_t len, struct xfs_inode *dest, | |
3307 | xfs_fileoff_t doffset), | |
3308 | TP_ARGS(src, soffset, len, dest, doffset), | |
3309 | TP_STRUCT__entry( | |
3310 | __field(dev_t, dev) | |
3311 | __field(xfs_ino_t, src_ino) | |
3312 | __field(xfs_fileoff_t, src_lblk) | |
3313 | __field(xfs_filblks_t, len) | |
3314 | __field(xfs_ino_t, dest_ino) | |
3315 | __field(xfs_fileoff_t, dest_lblk) | |
3316 | ), | |
3317 | TP_fast_assign( | |
3318 | __entry->dev = VFS_I(src)->i_sb->s_dev; | |
3319 | __entry->src_ino = src->i_ino; | |
3320 | __entry->src_lblk = soffset; | |
3321 | __entry->len = len; | |
3322 | __entry->dest_ino = dest->i_ino; | |
3323 | __entry->dest_lblk = doffset; | |
3324 | ), | |
3325 | TP_printk("dev %d:%d len 0x%llx " | |
3326 | "ino 0x%llx offset 0x%llx blocks -> " | |
3327 | "ino 0x%llx offset 0x%llx blocks", | |
3328 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3329 | __entry->len, | |
3330 | __entry->src_ino, | |
3331 | __entry->src_lblk, | |
3332 | __entry->dest_ino, | |
3333 | __entry->dest_lblk) | |
3334 | ); | |
53aa1c34 DW |
3335 | DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range); |
3336 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error); | |
3337 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error); | |
3338 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error); | |
53aa1c34 DW |
3339 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error); |
3340 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error); | |
00fd1d56 DW |
3341 | DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src); |
3342 | DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest); | |
53aa1c34 DW |
3343 | |
3344 | /* dedupe tracepoints */ | |
3345 | DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents); | |
3346 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error); | |
3347 | ||
3348 | /* ioctl tracepoints */ | |
53aa1c34 DW |
3349 | TRACE_EVENT(xfs_ioctl_clone, |
3350 | TP_PROTO(struct inode *src, struct inode *dest), | |
3351 | TP_ARGS(src, dest), | |
3352 | TP_STRUCT__entry( | |
3353 | __field(dev_t, dev) | |
3354 | __field(unsigned long, src_ino) | |
3355 | __field(loff_t, src_isize) | |
3356 | __field(unsigned long, dest_ino) | |
3357 | __field(loff_t, dest_isize) | |
3358 | ), | |
3359 | TP_fast_assign( | |
3360 | __entry->dev = src->i_sb->s_dev; | |
3361 | __entry->src_ino = src->i_ino; | |
3362 | __entry->src_isize = i_size_read(src); | |
3363 | __entry->dest_ino = dest->i_ino; | |
3364 | __entry->dest_isize = i_size_read(dest); | |
3365 | ), | |
3366 | TP_printk("dev %d:%d " | |
3367 | "ino 0x%lx isize 0x%llx -> " | |
42bf9dba | 3368 | "ino 0x%lx isize 0x%llx", |
53aa1c34 DW |
3369 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3370 | __entry->src_ino, | |
3371 | __entry->src_isize, | |
3372 | __entry->dest_ino, | |
3373 | __entry->dest_isize) | |
3374 | ); | |
3375 | ||
3376 | /* unshare tracepoints */ | |
3377 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare); | |
53aa1c34 | 3378 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error); |
53aa1c34 DW |
3379 | |
3380 | /* copy on write */ | |
3381 | DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared); | |
be51f811 DW |
3382 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found); |
3383 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc); | |
5eda4300 | 3384 | DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow); |
53aa1c34 | 3385 | |
53aa1c34 DW |
3386 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range); |
3387 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow); | |
3388 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap); | |
53aa1c34 | 3389 | |
53aa1c34 DW |
3390 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error); |
3391 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error); | |
3392 | ||
53aa1c34 | 3393 | |
53aa1c34 | 3394 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow); |
53aa1c34 | 3395 | |
1f08af52 DW |
3396 | /* rmap swapext tracepoints */ |
3397 | DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap); | |
3398 | DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece); | |
3399 | DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error); | |
3400 | ||
e89c0413 DW |
3401 | /* fsmap traces */ |
3402 | DECLARE_EVENT_CLASS(xfs_fsmap_class, | |
3403 | TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, | |
159eb69d | 3404 | const struct xfs_rmap_irec *rmap), |
e89c0413 DW |
3405 | TP_ARGS(mp, keydev, agno, rmap), |
3406 | TP_STRUCT__entry( | |
3407 | __field(dev_t, dev) | |
3408 | __field(dev_t, keydev) | |
3409 | __field(xfs_agnumber_t, agno) | |
3410 | __field(xfs_fsblock_t, bno) | |
3411 | __field(xfs_filblks_t, len) | |
c8ce540d DW |
3412 | __field(uint64_t, owner) |
3413 | __field(uint64_t, offset) | |
e89c0413 DW |
3414 | __field(unsigned int, flags) |
3415 | ), | |
3416 | TP_fast_assign( | |
3417 | __entry->dev = mp->m_super->s_dev; | |
3418 | __entry->keydev = new_decode_dev(keydev); | |
3419 | __entry->agno = agno; | |
3420 | __entry->bno = rmap->rm_startblock; | |
3421 | __entry->len = rmap->rm_blockcount; | |
3422 | __entry->owner = rmap->rm_owner; | |
3423 | __entry->offset = rmap->rm_offset; | |
3424 | __entry->flags = rmap->rm_flags; | |
3425 | ), | |
9febf39d | 3426 | TP_printk("dev %d:%d keydev %d:%d agno 0x%x bno %llu len %llu owner %lld offset %llu flags 0x%x", |
e89c0413 DW |
3427 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3428 | MAJOR(__entry->keydev), MINOR(__entry->keydev), | |
3429 | __entry->agno, | |
3430 | __entry->bno, | |
3431 | __entry->len, | |
3432 | __entry->owner, | |
3433 | __entry->offset, | |
3434 | __entry->flags) | |
3435 | ) | |
3436 | #define DEFINE_FSMAP_EVENT(name) \ | |
3437 | DEFINE_EVENT(xfs_fsmap_class, name, \ | |
3438 | TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \ | |
159eb69d | 3439 | const struct xfs_rmap_irec *rmap), \ |
e89c0413 DW |
3440 | TP_ARGS(mp, keydev, agno, rmap)) |
3441 | DEFINE_FSMAP_EVENT(xfs_fsmap_low_key); | |
3442 | DEFINE_FSMAP_EVENT(xfs_fsmap_high_key); | |
3443 | DEFINE_FSMAP_EVENT(xfs_fsmap_mapping); | |
3444 | ||
3445 | DECLARE_EVENT_CLASS(xfs_getfsmap_class, | |
3446 | TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), | |
3447 | TP_ARGS(mp, fsmap), | |
3448 | TP_STRUCT__entry( | |
3449 | __field(dev_t, dev) | |
3450 | __field(dev_t, keydev) | |
3451 | __field(xfs_daddr_t, block) | |
3452 | __field(xfs_daddr_t, len) | |
c8ce540d DW |
3453 | __field(uint64_t, owner) |
3454 | __field(uint64_t, offset) | |
3455 | __field(uint64_t, flags) | |
e89c0413 DW |
3456 | ), |
3457 | TP_fast_assign( | |
3458 | __entry->dev = mp->m_super->s_dev; | |
3459 | __entry->keydev = new_decode_dev(fsmap->fmr_device); | |
3460 | __entry->block = fsmap->fmr_physical; | |
3461 | __entry->len = fsmap->fmr_length; | |
3462 | __entry->owner = fsmap->fmr_owner; | |
3463 | __entry->offset = fsmap->fmr_offset; | |
3464 | __entry->flags = fsmap->fmr_flags; | |
3465 | ), | |
42bf9dba | 3466 | TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld offset %llu flags 0x%llx", |
e89c0413 DW |
3467 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3468 | MAJOR(__entry->keydev), MINOR(__entry->keydev), | |
3469 | __entry->block, | |
3470 | __entry->len, | |
3471 | __entry->owner, | |
3472 | __entry->offset, | |
3473 | __entry->flags) | |
3474 | ) | |
3475 | #define DEFINE_GETFSMAP_EVENT(name) \ | |
3476 | DEFINE_EVENT(xfs_getfsmap_class, name, \ | |
3477 | TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \ | |
3478 | TP_ARGS(mp, fsmap)) | |
3479 | DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key); | |
3480 | DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key); | |
3481 | DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping); | |
3482 | ||
b872af2c DW |
3483 | TRACE_EVENT(xfs_trans_resv_calc, |
3484 | TP_PROTO(struct xfs_mount *mp, unsigned int type, | |
3485 | struct xfs_trans_res *res), | |
3486 | TP_ARGS(mp, type, res), | |
3487 | TP_STRUCT__entry( | |
3488 | __field(dev_t, dev) | |
3489 | __field(int, type) | |
3490 | __field(uint, logres) | |
3491 | __field(int, logcount) | |
3492 | __field(int, logflags) | |
3493 | ), | |
3494 | TP_fast_assign( | |
3495 | __entry->dev = mp->m_super->s_dev; | |
3496 | __entry->type = type; | |
3497 | __entry->logres = res->tr_logres; | |
3498 | __entry->logcount = res->tr_logcount; | |
3499 | __entry->logflags = res->tr_logflags; | |
3500 | ), | |
3501 | TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x", | |
3502 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3503 | __entry->type, | |
3504 | __entry->logres, | |
3505 | __entry->logcount, | |
3506 | __entry->logflags) | |
3507 | ); | |
3508 | ||
ba18781b DC |
3509 | DECLARE_EVENT_CLASS(xfs_trans_class, |
3510 | TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), | |
3511 | TP_ARGS(tp, caller_ip), | |
3512 | TP_STRUCT__entry( | |
3513 | __field(dev_t, dev) | |
3514 | __field(uint32_t, tid) | |
3515 | __field(uint32_t, flags) | |
3516 | __field(unsigned long, caller_ip) | |
3517 | ), | |
3518 | TP_fast_assign( | |
3519 | __entry->dev = tp->t_mountp->m_super->s_dev; | |
3520 | __entry->tid = 0; | |
3521 | if (tp->t_ticket) | |
3522 | __entry->tid = tp->t_ticket->t_tid; | |
3523 | __entry->flags = tp->t_flags; | |
3524 | __entry->caller_ip = caller_ip; | |
3525 | ), | |
3526 | TP_printk("dev %d:%d trans %x flags 0x%x caller %pS", | |
3527 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3528 | __entry->tid, | |
3529 | __entry->flags, | |
3530 | (char *)__entry->caller_ip) | |
3531 | ) | |
3532 | ||
3533 | #define DEFINE_TRANS_EVENT(name) \ | |
3534 | DEFINE_EVENT(xfs_trans_class, name, \ | |
3535 | TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \ | |
3536 | TP_ARGS(tp, caller_ip)) | |
3537 | DEFINE_TRANS_EVENT(xfs_trans_alloc); | |
3538 | DEFINE_TRANS_EVENT(xfs_trans_cancel); | |
3539 | DEFINE_TRANS_EVENT(xfs_trans_commit); | |
3540 | DEFINE_TRANS_EVENT(xfs_trans_dup); | |
3541 | DEFINE_TRANS_EVENT(xfs_trans_free); | |
3542 | DEFINE_TRANS_EVENT(xfs_trans_roll); | |
3543 | DEFINE_TRANS_EVENT(xfs_trans_add_item); | |
195cd83d | 3544 | DEFINE_TRANS_EVENT(xfs_trans_commit_items); |
ba18781b DC |
3545 | DEFINE_TRANS_EVENT(xfs_trans_free_items); |
3546 | ||
9a4a5118 DW |
3547 | TRACE_EVENT(xfs_iunlink_update_bucket, |
3548 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket, | |
3549 | xfs_agino_t old_ptr, xfs_agino_t new_ptr), | |
3550 | TP_ARGS(mp, agno, bucket, old_ptr, new_ptr), | |
3551 | TP_STRUCT__entry( | |
3552 | __field(dev_t, dev) | |
3553 | __field(xfs_agnumber_t, agno) | |
3554 | __field(unsigned int, bucket) | |
3555 | __field(xfs_agino_t, old_ptr) | |
3556 | __field(xfs_agino_t, new_ptr) | |
3557 | ), | |
3558 | TP_fast_assign( | |
3559 | __entry->dev = mp->m_super->s_dev; | |
3560 | __entry->agno = agno; | |
3561 | __entry->bucket = bucket; | |
3562 | __entry->old_ptr = old_ptr; | |
3563 | __entry->new_ptr = new_ptr; | |
3564 | ), | |
9febf39d | 3565 | TP_printk("dev %d:%d agno 0x%x bucket %u old 0x%x new 0x%x", |
9a4a5118 DW |
3566 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3567 | __entry->agno, | |
3568 | __entry->bucket, | |
3569 | __entry->old_ptr, | |
3570 | __entry->new_ptr) | |
3571 | ); | |
3572 | ||
f2fc16a3 DW |
3573 | TRACE_EVENT(xfs_iunlink_update_dinode, |
3574 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, | |
3575 | xfs_agino_t old_ptr, xfs_agino_t new_ptr), | |
3576 | TP_ARGS(mp, agno, agino, old_ptr, new_ptr), | |
3577 | TP_STRUCT__entry( | |
3578 | __field(dev_t, dev) | |
3579 | __field(xfs_agnumber_t, agno) | |
3580 | __field(xfs_agino_t, agino) | |
3581 | __field(xfs_agino_t, old_ptr) | |
3582 | __field(xfs_agino_t, new_ptr) | |
3583 | ), | |
3584 | TP_fast_assign( | |
3585 | __entry->dev = mp->m_super->s_dev; | |
3586 | __entry->agno = agno; | |
3587 | __entry->agino = agino; | |
3588 | __entry->old_ptr = old_ptr; | |
3589 | __entry->new_ptr = new_ptr; | |
3590 | ), | |
9febf39d | 3591 | TP_printk("dev %d:%d agno 0x%x agino 0x%x old 0x%x new 0x%x", |
f2fc16a3 DW |
3592 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3593 | __entry->agno, | |
3594 | __entry->agino, | |
3595 | __entry->old_ptr, | |
3596 | __entry->new_ptr) | |
3597 | ); | |
3598 | ||
4664c66c DW |
3599 | DECLARE_EVENT_CLASS(xfs_ag_inode_class, |
3600 | TP_PROTO(struct xfs_inode *ip), | |
3601 | TP_ARGS(ip), | |
3602 | TP_STRUCT__entry( | |
3603 | __field(dev_t, dev) | |
3604 | __field(xfs_agnumber_t, agno) | |
3605 | __field(xfs_agino_t, agino) | |
3606 | ), | |
3607 | TP_fast_assign( | |
3608 | __entry->dev = VFS_I(ip)->i_sb->s_dev; | |
3609 | __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino); | |
3610 | __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino); | |
3611 | ), | |
9febf39d | 3612 | TP_printk("dev %d:%d agno 0x%x agino 0x%x", |
4664c66c DW |
3613 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3614 | __entry->agno, __entry->agino) | |
3615 | ) | |
3616 | ||
3617 | #define DEFINE_AGINODE_EVENT(name) \ | |
3618 | DEFINE_EVENT(xfs_ag_inode_class, name, \ | |
3619 | TP_PROTO(struct xfs_inode *ip), \ | |
3620 | TP_ARGS(ip)) | |
3621 | DEFINE_AGINODE_EVENT(xfs_iunlink); | |
3622 | DEFINE_AGINODE_EVENT(xfs_iunlink_remove); | |
9b247179 | 3623 | DEFINE_AG_EVENT(xfs_iunlink_map_prev_fallback); |
4664c66c | 3624 | |
6772c1f1 DW |
3625 | DECLARE_EVENT_CLASS(xfs_fs_corrupt_class, |
3626 | TP_PROTO(struct xfs_mount *mp, unsigned int flags), | |
3627 | TP_ARGS(mp, flags), | |
3628 | TP_STRUCT__entry( | |
3629 | __field(dev_t, dev) | |
3630 | __field(unsigned int, flags) | |
3631 | ), | |
3632 | TP_fast_assign( | |
3633 | __entry->dev = mp->m_super->s_dev; | |
3634 | __entry->flags = flags; | |
3635 | ), | |
3636 | TP_printk("dev %d:%d flags 0x%x", | |
3637 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3638 | __entry->flags) | |
3639 | ); | |
3640 | #define DEFINE_FS_CORRUPT_EVENT(name) \ | |
3641 | DEFINE_EVENT(xfs_fs_corrupt_class, name, \ | |
3642 | TP_PROTO(struct xfs_mount *mp, unsigned int flags), \ | |
3643 | TP_ARGS(mp, flags)) | |
3644 | DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick); | |
3645 | DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy); | |
519841c2 | 3646 | DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption); |
6772c1f1 DW |
3647 | DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick); |
3648 | DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy); | |
519841c2 | 3649 | DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption); |
6772c1f1 DW |
3650 | |
3651 | DECLARE_EVENT_CLASS(xfs_ag_corrupt_class, | |
3652 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags), | |
3653 | TP_ARGS(mp, agno, flags), | |
3654 | TP_STRUCT__entry( | |
3655 | __field(dev_t, dev) | |
3656 | __field(xfs_agnumber_t, agno) | |
3657 | __field(unsigned int, flags) | |
3658 | ), | |
3659 | TP_fast_assign( | |
3660 | __entry->dev = mp->m_super->s_dev; | |
3661 | __entry->agno = agno; | |
3662 | __entry->flags = flags; | |
3663 | ), | |
9febf39d | 3664 | TP_printk("dev %d:%d agno 0x%x flags 0x%x", |
6772c1f1 DW |
3665 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3666 | __entry->agno, __entry->flags) | |
3667 | ); | |
3668 | #define DEFINE_AG_CORRUPT_EVENT(name) \ | |
3669 | DEFINE_EVENT(xfs_ag_corrupt_class, name, \ | |
3670 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ | |
3671 | unsigned int flags), \ | |
3672 | TP_ARGS(mp, agno, flags)) | |
3673 | DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick); | |
3674 | DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy); | |
519841c2 | 3675 | DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption); |
6772c1f1 DW |
3676 | |
3677 | DECLARE_EVENT_CLASS(xfs_inode_corrupt_class, | |
3678 | TP_PROTO(struct xfs_inode *ip, unsigned int flags), | |
3679 | TP_ARGS(ip, flags), | |
3680 | TP_STRUCT__entry( | |
3681 | __field(dev_t, dev) | |
3682 | __field(xfs_ino_t, ino) | |
3683 | __field(unsigned int, flags) | |
3684 | ), | |
3685 | TP_fast_assign( | |
3686 | __entry->dev = ip->i_mount->m_super->s_dev; | |
3687 | __entry->ino = ip->i_ino; | |
3688 | __entry->flags = flags; | |
3689 | ), | |
3690 | TP_printk("dev %d:%d ino 0x%llx flags 0x%x", | |
3691 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3692 | __entry->ino, __entry->flags) | |
3693 | ); | |
3694 | #define DEFINE_INODE_CORRUPT_EVENT(name) \ | |
3695 | DEFINE_EVENT(xfs_inode_corrupt_class, name, \ | |
3696 | TP_PROTO(struct xfs_inode *ip, unsigned int flags), \ | |
3697 | TP_ARGS(ip, flags)) | |
3698 | DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick); | |
3699 | DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy); | |
3700 | ||
a211432c DW |
3701 | TRACE_EVENT(xfs_iwalk_ag, |
3702 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
3703 | xfs_agino_t startino), | |
3704 | TP_ARGS(mp, agno, startino), | |
3705 | TP_STRUCT__entry( | |
3706 | __field(dev_t, dev) | |
3707 | __field(xfs_agnumber_t, agno) | |
3708 | __field(xfs_agino_t, startino) | |
3709 | ), | |
3710 | TP_fast_assign( | |
3711 | __entry->dev = mp->m_super->s_dev; | |
3712 | __entry->agno = agno; | |
3713 | __entry->startino = startino; | |
3714 | ), | |
9febf39d | 3715 | TP_printk("dev %d:%d agno 0x%x startino 0x%x", |
a211432c DW |
3716 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, |
3717 | __entry->startino) | |
3718 | ) | |
3719 | ||
3720 | TRACE_EVENT(xfs_iwalk_ag_rec, | |
3721 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, | |
3722 | struct xfs_inobt_rec_incore *irec), | |
3723 | TP_ARGS(mp, agno, irec), | |
3724 | TP_STRUCT__entry( | |
3725 | __field(dev_t, dev) | |
3726 | __field(xfs_agnumber_t, agno) | |
3727 | __field(xfs_agino_t, startino) | |
3728 | __field(uint64_t, freemask) | |
3729 | ), | |
3730 | TP_fast_assign( | |
3731 | __entry->dev = mp->m_super->s_dev; | |
3732 | __entry->agno = agno; | |
3733 | __entry->startino = irec->ir_startino; | |
3734 | __entry->freemask = irec->ir_free; | |
3735 | ), | |
9febf39d | 3736 | TP_printk("dev %d:%d agno 0x%x startino 0x%x freemask 0x%llx", |
a211432c DW |
3737 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, |
3738 | __entry->startino, __entry->freemask) | |
3739 | ) | |
3740 | ||
40786717 DW |
3741 | TRACE_EVENT(xfs_pwork_init, |
3742 | TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid), | |
3743 | TP_ARGS(mp, nr_threads, pid), | |
3744 | TP_STRUCT__entry( | |
3745 | __field(dev_t, dev) | |
3746 | __field(unsigned int, nr_threads) | |
3747 | __field(pid_t, pid) | |
3748 | ), | |
3749 | TP_fast_assign( | |
3750 | __entry->dev = mp->m_super->s_dev; | |
3751 | __entry->nr_threads = nr_threads; | |
3752 | __entry->pid = pid; | |
3753 | ), | |
3754 | TP_printk("dev %d:%d nr_threads %u pid %u", | |
3755 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3756 | __entry->nr_threads, __entry->pid) | |
3757 | ) | |
3758 | ||
0ad95687 DC |
3759 | DECLARE_EVENT_CLASS(xfs_kmem_class, |
3760 | TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), | |
3761 | TP_ARGS(size, flags, caller_ip), | |
3762 | TP_STRUCT__entry( | |
3763 | __field(ssize_t, size) | |
3764 | __field(int, flags) | |
3765 | __field(unsigned long, caller_ip) | |
3766 | ), | |
3767 | TP_fast_assign( | |
3768 | __entry->size = size; | |
3769 | __entry->flags = flags; | |
3770 | __entry->caller_ip = caller_ip; | |
3771 | ), | |
3772 | TP_printk("size %zd flags 0x%x caller %pS", | |
3773 | __entry->size, | |
3774 | __entry->flags, | |
3775 | (char *)__entry->caller_ip) | |
3776 | ) | |
3777 | ||
3778 | #define DEFINE_KMEM_EVENT(name) \ | |
3779 | DEFINE_EVENT(xfs_kmem_class, name, \ | |
3780 | TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \ | |
3781 | TP_ARGS(size, flags, caller_ip)) | |
3782 | DEFINE_KMEM_EVENT(kmem_alloc); | |
0ad95687 | 3783 | |
13eaec4b DW |
3784 | TRACE_EVENT(xfs_check_new_dalign, |
3785 | TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino), | |
3786 | TP_ARGS(mp, new_dalign, calc_rootino), | |
3787 | TP_STRUCT__entry( | |
3788 | __field(dev_t, dev) | |
3789 | __field(int, new_dalign) | |
3790 | __field(xfs_ino_t, sb_rootino) | |
3791 | __field(xfs_ino_t, calc_rootino) | |
3792 | ), | |
3793 | TP_fast_assign( | |
3794 | __entry->dev = mp->m_super->s_dev; | |
3795 | __entry->new_dalign = new_dalign; | |
3796 | __entry->sb_rootino = mp->m_sb.sb_rootino; | |
3797 | __entry->calc_rootino = calc_rootino; | |
3798 | ), | |
af6265a0 | 3799 | TP_printk("dev %d:%d new_dalign %d sb_rootino 0x%llx calc_rootino 0x%llx", |
13eaec4b DW |
3800 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3801 | __entry->new_dalign, __entry->sb_rootino, | |
3802 | __entry->calc_rootino) | |
3803 | ) | |
3804 | ||
e06536a6 DW |
3805 | TRACE_EVENT(xfs_btree_commit_afakeroot, |
3806 | TP_PROTO(struct xfs_btree_cur *cur), | |
3807 | TP_ARGS(cur), | |
3808 | TP_STRUCT__entry( | |
3809 | __field(dev_t, dev) | |
3810 | __field(xfs_btnum_t, btnum) | |
3811 | __field(xfs_agnumber_t, agno) | |
3812 | __field(xfs_agblock_t, agbno) | |
3813 | __field(unsigned int, levels) | |
3814 | __field(unsigned int, blocks) | |
3815 | ), | |
3816 | TP_fast_assign( | |
3817 | __entry->dev = cur->bc_mp->m_super->s_dev; | |
3818 | __entry->btnum = cur->bc_btnum; | |
50f02fe3 | 3819 | __entry->agno = cur->bc_ag.pag->pag_agno; |
e06536a6 DW |
3820 | __entry->agbno = cur->bc_ag.afake->af_root; |
3821 | __entry->levels = cur->bc_ag.afake->af_levels; | |
3822 | __entry->blocks = cur->bc_ag.afake->af_blocks; | |
3823 | ), | |
9febf39d | 3824 | TP_printk("dev %d:%d btree %s agno 0x%x levels %u blocks %u root %u", |
e06536a6 DW |
3825 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3826 | __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS), | |
3827 | __entry->agno, | |
3828 | __entry->levels, | |
3829 | __entry->blocks, | |
3830 | __entry->agbno) | |
3831 | ) | |
3832 | ||
349e1c03 DW |
3833 | TRACE_EVENT(xfs_btree_commit_ifakeroot, |
3834 | TP_PROTO(struct xfs_btree_cur *cur), | |
3835 | TP_ARGS(cur), | |
3836 | TP_STRUCT__entry( | |
3837 | __field(dev_t, dev) | |
3838 | __field(xfs_btnum_t, btnum) | |
3839 | __field(xfs_agnumber_t, agno) | |
3840 | __field(xfs_agino_t, agino) | |
3841 | __field(unsigned int, levels) | |
3842 | __field(unsigned int, blocks) | |
3843 | __field(int, whichfork) | |
3844 | ), | |
3845 | TP_fast_assign( | |
3846 | __entry->dev = cur->bc_mp->m_super->s_dev; | |
3847 | __entry->btnum = cur->bc_btnum; | |
3848 | __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp, | |
3849 | cur->bc_ino.ip->i_ino); | |
3850 | __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp, | |
3851 | cur->bc_ino.ip->i_ino); | |
3852 | __entry->levels = cur->bc_ino.ifake->if_levels; | |
3853 | __entry->blocks = cur->bc_ino.ifake->if_blocks; | |
3854 | __entry->whichfork = cur->bc_ino.whichfork; | |
3855 | ), | |
9febf39d | 3856 | TP_printk("dev %d:%d btree %s agno 0x%x agino 0x%x whichfork %s levels %u blocks %u", |
349e1c03 DW |
3857 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3858 | __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS), | |
3859 | __entry->agno, | |
3860 | __entry->agino, | |
3861 | __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data", | |
3862 | __entry->levels, | |
3863 | __entry->blocks) | |
3864 | ) | |
3865 | ||
60e3d707 DW |
3866 | TRACE_EVENT(xfs_btree_bload_level_geometry, |
3867 | TP_PROTO(struct xfs_btree_cur *cur, unsigned int level, | |
3868 | uint64_t nr_this_level, unsigned int nr_per_block, | |
3869 | unsigned int desired_npb, uint64_t blocks, | |
3870 | uint64_t blocks_with_extra), | |
3871 | TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks, | |
3872 | blocks_with_extra), | |
3873 | TP_STRUCT__entry( | |
3874 | __field(dev_t, dev) | |
3875 | __field(xfs_btnum_t, btnum) | |
3876 | __field(unsigned int, level) | |
3877 | __field(unsigned int, nlevels) | |
3878 | __field(uint64_t, nr_this_level) | |
3879 | __field(unsigned int, nr_per_block) | |
3880 | __field(unsigned int, desired_npb) | |
3881 | __field(unsigned long long, blocks) | |
3882 | __field(unsigned long long, blocks_with_extra) | |
3883 | ), | |
3884 | TP_fast_assign( | |
3885 | __entry->dev = cur->bc_mp->m_super->s_dev; | |
3886 | __entry->btnum = cur->bc_btnum; | |
3887 | __entry->level = level; | |
3888 | __entry->nlevels = cur->bc_nlevels; | |
3889 | __entry->nr_this_level = nr_this_level; | |
3890 | __entry->nr_per_block = nr_per_block; | |
3891 | __entry->desired_npb = desired_npb; | |
3892 | __entry->blocks = blocks; | |
3893 | __entry->blocks_with_extra = blocks_with_extra; | |
3894 | ), | |
3895 | TP_printk("dev %d:%d btree %s level %u/%u nr_this_level %llu nr_per_block %u desired_npb %u blocks %llu blocks_with_extra %llu", | |
3896 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3897 | __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS), | |
3898 | __entry->level, | |
3899 | __entry->nlevels, | |
3900 | __entry->nr_this_level, | |
3901 | __entry->nr_per_block, | |
3902 | __entry->desired_npb, | |
3903 | __entry->blocks, | |
3904 | __entry->blocks_with_extra) | |
3905 | ) | |
3906 | ||
3907 | TRACE_EVENT(xfs_btree_bload_block, | |
3908 | TP_PROTO(struct xfs_btree_cur *cur, unsigned int level, | |
3909 | uint64_t block_idx, uint64_t nr_blocks, | |
3910 | union xfs_btree_ptr *ptr, unsigned int nr_records), | |
3911 | TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records), | |
3912 | TP_STRUCT__entry( | |
3913 | __field(dev_t, dev) | |
3914 | __field(xfs_btnum_t, btnum) | |
3915 | __field(unsigned int, level) | |
3916 | __field(unsigned long long, block_idx) | |
3917 | __field(unsigned long long, nr_blocks) | |
3918 | __field(xfs_agnumber_t, agno) | |
3919 | __field(xfs_agblock_t, agbno) | |
3920 | __field(unsigned int, nr_records) | |
3921 | ), | |
3922 | TP_fast_assign( | |
3923 | __entry->dev = cur->bc_mp->m_super->s_dev; | |
3924 | __entry->btnum = cur->bc_btnum; | |
3925 | __entry->level = level; | |
3926 | __entry->block_idx = block_idx; | |
3927 | __entry->nr_blocks = nr_blocks; | |
3928 | if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { | |
3929 | xfs_fsblock_t fsb = be64_to_cpu(ptr->l); | |
3930 | ||
3931 | __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb); | |
3932 | __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb); | |
3933 | } else { | |
50f02fe3 | 3934 | __entry->agno = cur->bc_ag.pag->pag_agno; |
60e3d707 DW |
3935 | __entry->agbno = be32_to_cpu(ptr->s); |
3936 | } | |
3937 | __entry->nr_records = nr_records; | |
3938 | ), | |
9febf39d | 3939 | TP_printk("dev %d:%d btree %s level %u block %llu/%llu agno 0x%x agbno %u recs %u", |
60e3d707 DW |
3940 | MAJOR(__entry->dev), MINOR(__entry->dev), |
3941 | __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS), | |
3942 | __entry->level, | |
3943 | __entry->block_idx, | |
3944 | __entry->nr_blocks, | |
3945 | __entry->agno, | |
3946 | __entry->agbno, | |
3947 | __entry->nr_records) | |
3948 | ) | |
3949 | ||
06dbf82b DW |
3950 | DECLARE_EVENT_CLASS(xfs_timestamp_range_class, |
3951 | TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max), | |
3952 | TP_ARGS(mp, min, max), | |
3953 | TP_STRUCT__entry( | |
3954 | __field(dev_t, dev) | |
3955 | __field(long long, min) | |
3956 | __field(long long, max) | |
3957 | ), | |
3958 | TP_fast_assign( | |
3959 | __entry->dev = mp->m_super->s_dev; | |
3960 | __entry->min = min; | |
3961 | __entry->max = max; | |
3962 | ), | |
3963 | TP_printk("dev %d:%d min %lld max %lld", | |
3964 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
3965 | __entry->min, | |
3966 | __entry->max) | |
3967 | ) | |
3968 | ||
3969 | #define DEFINE_TIMESTAMP_RANGE_EVENT(name) \ | |
3970 | DEFINE_EVENT(xfs_timestamp_range_class, name, \ | |
3971 | TP_PROTO(struct xfs_mount *mp, long long min, long long max), \ | |
3972 | TP_ARGS(mp, min, max)) | |
3973 | DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range); | |
3974 | DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range); | |
3975 | ||
b26b2bf1 DW |
3976 | DECLARE_EVENT_CLASS(xfs_icwalk_class, |
3977 | TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw, | |
38899f80 | 3978 | unsigned long caller_ip), |
b26b2bf1 | 3979 | TP_ARGS(mp, icw, caller_ip), |
38899f80 DW |
3980 | TP_STRUCT__entry( |
3981 | __field(dev_t, dev) | |
3982 | __field(__u32, flags) | |
3983 | __field(uint32_t, uid) | |
3984 | __field(uint32_t, gid) | |
3985 | __field(prid_t, prid) | |
3986 | __field(__u64, min_file_size) | |
10be350b | 3987 | __field(long, scan_limit) |
38899f80 DW |
3988 | __field(unsigned long, caller_ip) |
3989 | ), | |
3990 | TP_fast_assign( | |
3991 | __entry->dev = mp->m_super->s_dev; | |
b26b2bf1 DW |
3992 | __entry->flags = icw ? icw->icw_flags : 0; |
3993 | __entry->uid = icw ? from_kuid(mp->m_super->s_user_ns, | |
3994 | icw->icw_uid) : 0; | |
3995 | __entry->gid = icw ? from_kgid(mp->m_super->s_user_ns, | |
3996 | icw->icw_gid) : 0; | |
3997 | __entry->prid = icw ? icw->icw_prid : 0; | |
3998 | __entry->min_file_size = icw ? icw->icw_min_file_size : 0; | |
3999 | __entry->scan_limit = icw ? icw->icw_scan_limit : 0; | |
38899f80 DW |
4000 | __entry->caller_ip = caller_ip; |
4001 | ), | |
10be350b | 4002 | TP_printk("dev %d:%d flags 0x%x uid %u gid %u prid %u minsize %llu scan_limit %ld caller %pS", |
38899f80 DW |
4003 | MAJOR(__entry->dev), MINOR(__entry->dev), |
4004 | __entry->flags, | |
4005 | __entry->uid, | |
4006 | __entry->gid, | |
4007 | __entry->prid, | |
4008 | __entry->min_file_size, | |
f1bc5c56 | 4009 | __entry->scan_limit, |
38899f80 DW |
4010 | (char *)__entry->caller_ip) |
4011 | ); | |
b26b2bf1 DW |
4012 | #define DEFINE_ICWALK_EVENT(name) \ |
4013 | DEFINE_EVENT(xfs_icwalk_class, name, \ | |
4014 | TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw, \ | |
38899f80 | 4015 | unsigned long caller_ip), \ |
b26b2bf1 DW |
4016 | TP_ARGS(mp, icw, caller_ip)) |
4017 | DEFINE_ICWALK_EVENT(xfs_ioc_free_eofblocks); | |
4018 | DEFINE_ICWALK_EVENT(xfs_blockgc_free_space); | |
38899f80 | 4019 | |
956f6daa DC |
4020 | TRACE_DEFINE_ENUM(XLOG_STATE_ACTIVE); |
4021 | TRACE_DEFINE_ENUM(XLOG_STATE_WANT_SYNC); | |
4022 | TRACE_DEFINE_ENUM(XLOG_STATE_SYNCING); | |
4023 | TRACE_DEFINE_ENUM(XLOG_STATE_DONE_SYNC); | |
4024 | TRACE_DEFINE_ENUM(XLOG_STATE_CALLBACK); | |
4025 | TRACE_DEFINE_ENUM(XLOG_STATE_DIRTY); | |
956f6daa DC |
4026 | |
4027 | DECLARE_EVENT_CLASS(xlog_iclog_class, | |
4028 | TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip), | |
4029 | TP_ARGS(iclog, caller_ip), | |
4030 | TP_STRUCT__entry( | |
4031 | __field(dev_t, dev) | |
4032 | __field(uint32_t, state) | |
4033 | __field(int32_t, refcount) | |
4034 | __field(uint32_t, offset) | |
b2ae3a9e | 4035 | __field(uint32_t, flags) |
956f6daa DC |
4036 | __field(unsigned long long, lsn) |
4037 | __field(unsigned long, caller_ip) | |
4038 | ), | |
4039 | TP_fast_assign( | |
4040 | __entry->dev = iclog->ic_log->l_mp->m_super->s_dev; | |
4041 | __entry->state = iclog->ic_state; | |
4042 | __entry->refcount = atomic_read(&iclog->ic_refcnt); | |
4043 | __entry->offset = iclog->ic_offset; | |
b2ae3a9e | 4044 | __entry->flags = iclog->ic_flags; |
956f6daa DC |
4045 | __entry->lsn = be64_to_cpu(iclog->ic_header.h_lsn); |
4046 | __entry->caller_ip = caller_ip; | |
4047 | ), | |
b2ae3a9e | 4048 | TP_printk("dev %d:%d state %s refcnt %d offset %u lsn 0x%llx flags %s caller %pS", |
956f6daa DC |
4049 | MAJOR(__entry->dev), MINOR(__entry->dev), |
4050 | __print_symbolic(__entry->state, XLOG_STATE_STRINGS), | |
4051 | __entry->refcount, | |
4052 | __entry->offset, | |
4053 | __entry->lsn, | |
b2ae3a9e | 4054 | __print_flags(__entry->flags, "|", XLOG_ICL_STRINGS), |
956f6daa DC |
4055 | (char *)__entry->caller_ip) |
4056 | ||
4057 | ); | |
4058 | ||
4059 | #define DEFINE_ICLOG_EVENT(name) \ | |
4060 | DEFINE_EVENT(xlog_iclog_class, name, \ | |
4061 | TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip), \ | |
4062 | TP_ARGS(iclog, caller_ip)) | |
4063 | ||
4064 | DEFINE_ICLOG_EVENT(xlog_iclog_activate); | |
4065 | DEFINE_ICLOG_EVENT(xlog_iclog_clean); | |
4066 | DEFINE_ICLOG_EVENT(xlog_iclog_callback); | |
4067 | DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_start); | |
4068 | DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_done); | |
4069 | DEFINE_ICLOG_EVENT(xlog_iclog_force); | |
4070 | DEFINE_ICLOG_EVENT(xlog_iclog_force_lsn); | |
4071 | DEFINE_ICLOG_EVENT(xlog_iclog_get_space); | |
4072 | DEFINE_ICLOG_EVENT(xlog_iclog_release); | |
4073 | DEFINE_ICLOG_EVENT(xlog_iclog_switch); | |
4074 | DEFINE_ICLOG_EVENT(xlog_iclog_sync); | |
4075 | DEFINE_ICLOG_EVENT(xlog_iclog_syncing); | |
4076 | DEFINE_ICLOG_EVENT(xlog_iclog_sync_done); | |
4077 | DEFINE_ICLOG_EVENT(xlog_iclog_want_sync); | |
4078 | DEFINE_ICLOG_EVENT(xlog_iclog_wait_on); | |
4079 | DEFINE_ICLOG_EVENT(xlog_iclog_write); | |
4080 | ||
df082631 AH |
4081 | DECLARE_EVENT_CLASS(xfs_das_state_class, |
4082 | TP_PROTO(int das, struct xfs_inode *ip), | |
4083 | TP_ARGS(das, ip), | |
4084 | TP_STRUCT__entry( | |
4085 | __field(int, das) | |
4086 | __field(xfs_ino_t, ino) | |
4087 | ), | |
4088 | TP_fast_assign( | |
4089 | __entry->das = das; | |
4090 | __entry->ino = ip->i_ino; | |
4091 | ), | |
4092 | TP_printk("state change %d ino 0x%llx", | |
4093 | __entry->das, __entry->ino) | |
4094 | ) | |
4095 | ||
4096 | #define DEFINE_DAS_STATE_EVENT(name) \ | |
4097 | DEFINE_EVENT(xfs_das_state_class, name, \ | |
4098 | TP_PROTO(int das, struct xfs_inode *ip), \ | |
4099 | TP_ARGS(das, ip)) | |
4100 | DEFINE_DAS_STATE_EVENT(xfs_attr_sf_addname_return); | |
4101 | DEFINE_DAS_STATE_EVENT(xfs_attr_set_iter_return); | |
4102 | DEFINE_DAS_STATE_EVENT(xfs_attr_node_addname_return); | |
4103 | DEFINE_DAS_STATE_EVENT(xfs_attr_remove_iter_return); | |
4104 | DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_remove_return); | |
7f89c838 DW |
4105 | |
4106 | TRACE_EVENT(xfs_force_shutdown, | |
4107 | TP_PROTO(struct xfs_mount *mp, int ptag, int flags, const char *fname, | |
4108 | int line_num), | |
4109 | TP_ARGS(mp, ptag, flags, fname, line_num), | |
4110 | TP_STRUCT__entry( | |
4111 | __field(dev_t, dev) | |
4112 | __field(int, ptag) | |
4113 | __field(int, flags) | |
4114 | __string(fname, fname) | |
4115 | __field(int, line_num) | |
4116 | ), | |
4117 | TP_fast_assign( | |
4118 | __entry->dev = mp->m_super->s_dev; | |
4119 | __entry->ptag = ptag; | |
4120 | __entry->flags = flags; | |
4121 | __assign_str(fname, fname); | |
4122 | __entry->line_num = line_num; | |
4123 | ), | |
4124 | TP_printk("dev %d:%d tag %s flags %s file %s line_num %d", | |
4125 | MAJOR(__entry->dev), MINOR(__entry->dev), | |
4126 | __print_flags(__entry->ptag, "|", XFS_PTAG_STRINGS), | |
4127 | __print_flags(__entry->flags, "|", XFS_SHUTDOWN_STRINGS), | |
4128 | __get_str(fname), | |
4129 | __entry->line_num) | |
4130 | ); | |
4131 | ||
0b1b213f CH |
4132 | #endif /* _TRACE_XFS_H */ |
4133 | ||
4134 | #undef TRACE_INCLUDE_PATH | |
4135 | #define TRACE_INCLUDE_PATH . | |
4136 | #define TRACE_INCLUDE_FILE xfs_trace | |
4137 | #include <trace/define_trace.h> |