1 | // SPDX-License-Identifier: GPL-2.0 |
2 | /* |
3 | * Copyright (c) 2009, Christoph Hellwig |
4 | * All Rights Reserved. |
5 | * |
6 | * NOTE: none of these tracepoints shall be considered a stable kernel ABI |
7 | * as they can change at any time. |
8 | * |
9 | * Current conventions for printing numbers measuring specific units: |
10 | * |
11 | * agno: allocation group number |
12 | * |
13 | * agino: per-AG inode number |
14 | * ino: filesystem inode number |
15 | * |
16 | * agbno: per-AG block number in fs blocks |
17 | * startblock: physical block number for file mappings. This is either a |
18 | * segmented fsblock for data device mappings, or a rfsblock |
19 | * for realtime device mappings |
20 | * fsbcount: number of blocks in an extent, in fs blocks |
21 | * |
22 | * daddr: physical block number in 512b blocks |
23 | * bbcount: number of blocks in a physical extent, in 512b blocks |
24 | * |
25 | * rtx: physical rt extent number for extent mappings |
26 | * rtxcount: number of rt extents in an extent mapping |
27 | * |
28 | * owner: reverse-mapping owner, usually inodes |
29 | * |
30 | * fileoff: file offset, in fs blocks |
31 | * pos: file offset, in bytes |
32 | * bytecount: number of bytes |
33 | * |
34 | * disize: ondisk file size, in bytes |
35 | * isize: incore file size, in bytes |
36 | * |
37 | * forkoff: inode fork offset, in bytes |
38 | * |
39 | * ireccount: number of inode records |
40 | * |
41 | * Numbers describing space allocations (blocks, extents, inodes) should be |
42 | * formatted in hexadecimal. |
43 | */ |
44 | #undef TRACE_SYSTEM |
45 | #define TRACE_SYSTEM xfs |
46 | |
47 | #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ) |
48 | #define _TRACE_XFS_H |
49 | |
50 | #include <linux/tracepoint.h> |
51 | |
52 | struct xfs_agf; |
53 | struct xfs_alloc_arg; |
54 | struct xfs_attr_list_context; |
55 | struct xfs_buf_log_item; |
56 | struct xfs_da_args; |
57 | struct xfs_da_node_entry; |
58 | struct xfs_dquot; |
59 | struct xfs_log_item; |
60 | struct xlog; |
61 | struct xlog_ticket; |
62 | struct xlog_recover; |
63 | struct xlog_recover_item; |
64 | struct ; |
65 | struct xlog_in_core; |
66 | struct xfs_buf_log_format; |
67 | struct xfs_inode_log_format; |
68 | struct xfs_bmbt_irec; |
69 | struct xfs_btree_cur; |
70 | struct xfs_defer_op_type; |
71 | struct xfs_refcount_irec; |
72 | struct xfs_fsmap; |
73 | struct xfs_rmap_irec; |
74 | struct xfs_icreate_log; |
75 | struct xfs_owner_info; |
76 | struct xfs_trans_res; |
77 | struct xfs_inobt_rec_incore; |
78 | union xfs_btree_ptr; |
79 | struct xfs_dqtrx; |
80 | struct xfs_icwalk; |
81 | struct xfs_perag; |
82 | struct xfbtree; |
83 | struct xfs_btree_ops; |
84 | struct xfs_bmap_intent; |
85 | |
86 | #define XFS_ATTR_FILTER_FLAGS \ |
87 | { XFS_ATTR_ROOT, "ROOT" }, \ |
88 | { XFS_ATTR_SECURE, "SECURE" }, \ |
89 | { XFS_ATTR_INCOMPLETE, "INCOMPLETE" } |
90 | |
91 | DECLARE_EVENT_CLASS(xfs_attr_list_class, |
92 | TP_PROTO(struct xfs_attr_list_context *ctx), |
93 | TP_ARGS(ctx), |
94 | TP_STRUCT__entry( |
95 | __field(dev_t, dev) |
96 | __field(xfs_ino_t, ino) |
97 | __field(u32, hashval) |
98 | __field(u32, blkno) |
99 | __field(u32, offset) |
100 | __field(void *, buffer) |
101 | __field(int, bufsize) |
102 | __field(int, count) |
103 | __field(int, firstu) |
104 | __field(int, dupcnt) |
105 | __field(unsigned int, attr_filter) |
106 | ), |
107 | TP_fast_assign( |
108 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; |
109 | __entry->ino = ctx->dp->i_ino; |
110 | __entry->hashval = ctx->cursor.hashval; |
111 | __entry->blkno = ctx->cursor.blkno; |
112 | __entry->offset = ctx->cursor.offset; |
113 | __entry->buffer = ctx->buffer; |
114 | __entry->bufsize = ctx->bufsize; |
115 | __entry->count = ctx->count; |
116 | __entry->firstu = ctx->firstu; |
117 | __entry->attr_filter = ctx->attr_filter; |
118 | ), |
119 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " |
120 | "buffer %p size %u count %u firstu %u filter %s" , |
121 | MAJOR(__entry->dev), MINOR(__entry->dev), |
122 | __entry->ino, |
123 | __entry->hashval, |
124 | __entry->blkno, |
125 | __entry->offset, |
126 | __entry->dupcnt, |
127 | __entry->buffer, |
128 | __entry->bufsize, |
129 | __entry->count, |
130 | __entry->firstu, |
131 | __print_flags(__entry->attr_filter, "|" , |
132 | XFS_ATTR_FILTER_FLAGS) |
133 | ) |
134 | ) |
135 | |
136 | #define DEFINE_ATTR_LIST_EVENT(name) \ |
137 | DEFINE_EVENT(xfs_attr_list_class, name, \ |
138 | TP_PROTO(struct xfs_attr_list_context *ctx), \ |
139 | TP_ARGS(ctx)) |
140 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf); |
141 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all); |
142 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf); |
143 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end); |
144 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full); |
145 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add); |
146 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); |
147 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); |
148 | DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list); |
149 | DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list); |
150 | |
151 | TRACE_EVENT(xlog_intent_recovery_failed, |
152 | TP_PROTO(struct xfs_mount *mp, const struct xfs_defer_op_type *ops, |
153 | int error), |
154 | TP_ARGS(mp, ops, error), |
155 | TP_STRUCT__entry( |
156 | __field(dev_t, dev) |
157 | __string(name, ops->name) |
158 | __field(int, error) |
159 | ), |
160 | TP_fast_assign( |
161 | __entry->dev = mp->m_super->s_dev; |
162 | __assign_str(name, ops->name); |
163 | __entry->error = error; |
164 | ), |
165 | TP_printk("dev %d:%d optype %s error %d" , |
166 | MAJOR(__entry->dev), MINOR(__entry->dev), |
167 | __get_str(name), |
168 | __entry->error) |
169 | ); |
170 | |
171 | DECLARE_EVENT_CLASS(xfs_perag_class, |
172 | TP_PROTO(struct xfs_perag *pag, unsigned long caller_ip), |
173 | TP_ARGS(pag, caller_ip), |
174 | TP_STRUCT__entry( |
175 | __field(dev_t, dev) |
176 | __field(xfs_agnumber_t, agno) |
177 | __field(int, refcount) |
178 | __field(int, active_refcount) |
179 | __field(unsigned long, caller_ip) |
180 | ), |
181 | TP_fast_assign( |
182 | __entry->dev = pag->pag_mount->m_super->s_dev; |
183 | __entry->agno = pag->pag_agno; |
184 | __entry->refcount = atomic_read(&pag->pag_ref); |
185 | __entry->active_refcount = atomic_read(&pag->pag_active_ref); |
186 | __entry->caller_ip = caller_ip; |
187 | ), |
188 | TP_printk("dev %d:%d agno 0x%x passive refs %d active refs %d caller %pS" , |
189 | MAJOR(__entry->dev), MINOR(__entry->dev), |
190 | __entry->agno, |
191 | __entry->refcount, |
192 | __entry->active_refcount, |
193 | (char *)__entry->caller_ip) |
194 | ); |
195 | |
196 | #define DEFINE_PERAG_REF_EVENT(name) \ |
197 | DEFINE_EVENT(xfs_perag_class, name, \ |
198 | TP_PROTO(struct xfs_perag *pag, unsigned long caller_ip), \ |
199 | TP_ARGS(pag, caller_ip)) |
200 | DEFINE_PERAG_REF_EVENT(xfs_perag_get); |
201 | DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag); |
202 | DEFINE_PERAG_REF_EVENT(xfs_perag_hold); |
203 | DEFINE_PERAG_REF_EVENT(xfs_perag_put); |
204 | DEFINE_PERAG_REF_EVENT(xfs_perag_grab); |
205 | DEFINE_PERAG_REF_EVENT(xfs_perag_grab_tag); |
206 | DEFINE_PERAG_REF_EVENT(xfs_perag_rele); |
207 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_inode_tag); |
208 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_inode_tag); |
209 | |
210 | TRACE_EVENT(xfs_inodegc_worker, |
211 | TP_PROTO(struct xfs_mount *mp, unsigned int shrinker_hits), |
212 | TP_ARGS(mp, shrinker_hits), |
213 | TP_STRUCT__entry( |
214 | __field(dev_t, dev) |
215 | __field(unsigned int, shrinker_hits) |
216 | ), |
217 | TP_fast_assign( |
218 | __entry->dev = mp->m_super->s_dev; |
219 | __entry->shrinker_hits = shrinker_hits; |
220 | ), |
221 | TP_printk("dev %d:%d shrinker_hits %u" , |
222 | MAJOR(__entry->dev), MINOR(__entry->dev), |
223 | __entry->shrinker_hits) |
224 | ); |
225 | |
226 | DECLARE_EVENT_CLASS(xfs_fs_class, |
227 | TP_PROTO(struct xfs_mount *mp, void *caller_ip), |
228 | TP_ARGS(mp, caller_ip), |
229 | TP_STRUCT__entry( |
230 | __field(dev_t, dev) |
231 | __field(unsigned long long, mflags) |
232 | __field(unsigned long, opstate) |
233 | __field(unsigned long, sbflags) |
234 | __field(void *, caller_ip) |
235 | ), |
236 | TP_fast_assign( |
237 | if (mp) { |
238 | __entry->dev = mp->m_super->s_dev; |
239 | __entry->mflags = mp->m_features; |
240 | __entry->opstate = mp->m_opstate; |
241 | __entry->sbflags = mp->m_super->s_flags; |
242 | } |
243 | __entry->caller_ip = caller_ip; |
244 | ), |
245 | TP_printk("dev %d:%d m_features 0x%llx opstate (%s) s_flags 0x%lx caller %pS" , |
246 | MAJOR(__entry->dev), MINOR(__entry->dev), |
247 | __entry->mflags, |
248 | __print_flags(__entry->opstate, "|" , XFS_OPSTATE_STRINGS), |
249 | __entry->sbflags, |
250 | __entry->caller_ip) |
251 | ); |
252 | |
253 | #define DEFINE_FS_EVENT(name) \ |
254 | DEFINE_EVENT(xfs_fs_class, name, \ |
255 | TP_PROTO(struct xfs_mount *mp, void *caller_ip), \ |
256 | TP_ARGS(mp, caller_ip)) |
257 | DEFINE_FS_EVENT(xfs_inodegc_flush); |
258 | DEFINE_FS_EVENT(xfs_inodegc_push); |
259 | DEFINE_FS_EVENT(xfs_inodegc_start); |
260 | DEFINE_FS_EVENT(xfs_inodegc_stop); |
261 | DEFINE_FS_EVENT(xfs_inodegc_queue); |
262 | DEFINE_FS_EVENT(xfs_inodegc_throttle); |
263 | DEFINE_FS_EVENT(xfs_fs_sync_fs); |
264 | DEFINE_FS_EVENT(xfs_blockgc_start); |
265 | DEFINE_FS_EVENT(xfs_blockgc_stop); |
266 | DEFINE_FS_EVENT(xfs_blockgc_worker); |
267 | DEFINE_FS_EVENT(xfs_blockgc_flush_all); |
268 | |
269 | TRACE_EVENT(xfs_inodegc_shrinker_scan, |
270 | TP_PROTO(struct xfs_mount *mp, struct shrink_control *sc, |
271 | void *caller_ip), |
272 | TP_ARGS(mp, sc, caller_ip), |
273 | TP_STRUCT__entry( |
274 | __field(dev_t, dev) |
275 | __field(unsigned long, nr_to_scan) |
276 | __field(void *, caller_ip) |
277 | ), |
278 | TP_fast_assign( |
279 | __entry->dev = mp->m_super->s_dev; |
280 | __entry->nr_to_scan = sc->nr_to_scan; |
281 | __entry->caller_ip = caller_ip; |
282 | ), |
283 | TP_printk("dev %d:%d nr_to_scan %lu caller %pS" , |
284 | MAJOR(__entry->dev), MINOR(__entry->dev), |
285 | __entry->nr_to_scan, |
286 | __entry->caller_ip) |
287 | ); |
288 | |
289 | DECLARE_EVENT_CLASS(xfs_ag_class, |
290 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), |
291 | TP_ARGS(mp, agno), |
292 | TP_STRUCT__entry( |
293 | __field(dev_t, dev) |
294 | __field(xfs_agnumber_t, agno) |
295 | ), |
296 | TP_fast_assign( |
297 | __entry->dev = mp->m_super->s_dev; |
298 | __entry->agno = agno; |
299 | ), |
300 | TP_printk("dev %d:%d agno 0x%x" , |
301 | MAJOR(__entry->dev), MINOR(__entry->dev), |
302 | __entry->agno) |
303 | ); |
304 | #define DEFINE_AG_EVENT(name) \ |
305 | DEFINE_EVENT(xfs_ag_class, name, \ |
306 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \ |
307 | TP_ARGS(mp, agno)) |
308 | |
309 | DEFINE_AG_EVENT(xfs_read_agf); |
310 | DEFINE_AG_EVENT(xfs_alloc_read_agf); |
311 | DEFINE_AG_EVENT(xfs_read_agi); |
312 | DEFINE_AG_EVENT(xfs_ialloc_read_agi); |
313 | |
314 | TRACE_EVENT(xfs_attr_list_node_descend, |
315 | TP_PROTO(struct xfs_attr_list_context *ctx, |
316 | struct xfs_da_node_entry *btree), |
317 | TP_ARGS(ctx, btree), |
318 | TP_STRUCT__entry( |
319 | __field(dev_t, dev) |
320 | __field(xfs_ino_t, ino) |
321 | __field(u32, hashval) |
322 | __field(u32, blkno) |
323 | __field(u32, offset) |
324 | __field(void *, buffer) |
325 | __field(int, bufsize) |
326 | __field(int, count) |
327 | __field(int, firstu) |
328 | __field(int, dupcnt) |
329 | __field(unsigned int, attr_filter) |
330 | __field(u32, bt_hashval) |
331 | __field(u32, bt_before) |
332 | ), |
333 | TP_fast_assign( |
334 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; |
335 | __entry->ino = ctx->dp->i_ino; |
336 | __entry->hashval = ctx->cursor.hashval; |
337 | __entry->blkno = ctx->cursor.blkno; |
338 | __entry->offset = ctx->cursor.offset; |
339 | __entry->buffer = ctx->buffer; |
340 | __entry->bufsize = ctx->bufsize; |
341 | __entry->count = ctx->count; |
342 | __entry->firstu = ctx->firstu; |
343 | __entry->attr_filter = ctx->attr_filter; |
344 | __entry->bt_hashval = be32_to_cpu(btree->hashval); |
345 | __entry->bt_before = be32_to_cpu(btree->before); |
346 | ), |
347 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " |
348 | "buffer %p size %u count %u firstu %u filter %s " |
349 | "node hashval %u, node before %u" , |
350 | MAJOR(__entry->dev), MINOR(__entry->dev), |
351 | __entry->ino, |
352 | __entry->hashval, |
353 | __entry->blkno, |
354 | __entry->offset, |
355 | __entry->dupcnt, |
356 | __entry->buffer, |
357 | __entry->bufsize, |
358 | __entry->count, |
359 | __entry->firstu, |
360 | __print_flags(__entry->attr_filter, "|" , |
361 | XFS_ATTR_FILTER_FLAGS), |
362 | __entry->bt_hashval, |
363 | __entry->bt_before) |
364 | ); |
365 | |
366 | DECLARE_EVENT_CLASS(xfs_bmap_class, |
367 | TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, |
368 | unsigned long caller_ip), |
369 | TP_ARGS(ip, cur, state, caller_ip), |
370 | TP_STRUCT__entry( |
371 | __field(dev_t, dev) |
372 | __field(xfs_ino_t, ino) |
373 | __field(void *, leaf) |
374 | __field(int, pos) |
375 | __field(xfs_fileoff_t, startoff) |
376 | __field(xfs_fsblock_t, startblock) |
377 | __field(xfs_filblks_t, blockcount) |
378 | __field(xfs_exntst_t, state) |
379 | __field(int, bmap_state) |
380 | __field(unsigned long, caller_ip) |
381 | ), |
382 | TP_fast_assign( |
383 | struct xfs_ifork *ifp; |
384 | struct xfs_bmbt_irec r; |
385 | |
386 | ifp = xfs_iext_state_to_fork(ip, state); |
387 | xfs_iext_get_extent(ifp, cur, &r); |
388 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
389 | __entry->ino = ip->i_ino; |
390 | __entry->leaf = cur->leaf; |
391 | __entry->pos = cur->pos; |
392 | __entry->startoff = r.br_startoff; |
393 | __entry->startblock = r.br_startblock; |
394 | __entry->blockcount = r.br_blockcount; |
395 | __entry->state = r.br_state; |
396 | __entry->bmap_state = state; |
397 | __entry->caller_ip = caller_ip; |
398 | ), |
399 | TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d " |
400 | "fileoff 0x%llx startblock 0x%llx fsbcount 0x%llx flag %d caller %pS" , |
401 | MAJOR(__entry->dev), MINOR(__entry->dev), |
402 | __entry->ino, |
403 | __print_flags(__entry->bmap_state, "|" , XFS_BMAP_EXT_FLAGS), |
404 | __entry->leaf, |
405 | __entry->pos, |
406 | __entry->startoff, |
407 | (int64_t)__entry->startblock, |
408 | __entry->blockcount, |
409 | __entry->state, |
410 | (char *)__entry->caller_ip) |
411 | ) |
412 | |
413 | #define DEFINE_BMAP_EVENT(name) \ |
414 | DEFINE_EVENT(xfs_bmap_class, name, \ |
415 | TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \ |
416 | unsigned long caller_ip), \ |
417 | TP_ARGS(ip, cur, state, caller_ip)) |
418 | DEFINE_BMAP_EVENT(xfs_iext_insert); |
419 | DEFINE_BMAP_EVENT(xfs_iext_remove); |
420 | DEFINE_BMAP_EVENT(xfs_bmap_pre_update); |
421 | DEFINE_BMAP_EVENT(xfs_bmap_post_update); |
422 | DEFINE_BMAP_EVENT(xfs_read_extent); |
423 | DEFINE_BMAP_EVENT(xfs_write_extent); |
424 | |
425 | DECLARE_EVENT_CLASS(xfs_buf_class, |
426 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), |
427 | TP_ARGS(bp, caller_ip), |
428 | TP_STRUCT__entry( |
429 | __field(dev_t, dev) |
430 | __field(xfs_daddr_t, bno) |
431 | __field(int, nblks) |
432 | __field(int, hold) |
433 | __field(int, pincount) |
434 | __field(unsigned, lockval) |
435 | __field(unsigned, flags) |
436 | __field(unsigned long, caller_ip) |
437 | __field(const void *, buf_ops) |
438 | ), |
439 | TP_fast_assign( |
440 | __entry->dev = bp->b_target->bt_dev; |
441 | __entry->bno = xfs_buf_daddr(bp); |
442 | __entry->nblks = bp->b_length; |
443 | __entry->hold = atomic_read(&bp->b_hold); |
444 | __entry->pincount = atomic_read(&bp->b_pin_count); |
445 | __entry->lockval = bp->b_sema.count; |
446 | __entry->flags = bp->b_flags; |
447 | __entry->caller_ip = caller_ip; |
448 | __entry->buf_ops = bp->b_ops; |
449 | ), |
450 | TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d " |
451 | "lock %d flags %s bufops %pS caller %pS" , |
452 | MAJOR(__entry->dev), MINOR(__entry->dev), |
453 | (unsigned long long)__entry->bno, |
454 | __entry->nblks, |
455 | __entry->hold, |
456 | __entry->pincount, |
457 | __entry->lockval, |
458 | __print_flags(__entry->flags, "|" , XFS_BUF_FLAGS), |
459 | __entry->buf_ops, |
460 | (void *)__entry->caller_ip) |
461 | ) |
462 | |
463 | #define DEFINE_BUF_EVENT(name) \ |
464 | DEFINE_EVENT(xfs_buf_class, name, \ |
465 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \ |
466 | TP_ARGS(bp, caller_ip)) |
467 | DEFINE_BUF_EVENT(xfs_buf_init); |
468 | DEFINE_BUF_EVENT(xfs_buf_free); |
469 | DEFINE_BUF_EVENT(xfs_buf_hold); |
470 | DEFINE_BUF_EVENT(xfs_buf_rele); |
471 | DEFINE_BUF_EVENT(xfs_buf_iodone); |
472 | DEFINE_BUF_EVENT(xfs_buf_submit); |
473 | DEFINE_BUF_EVENT(xfs_buf_lock); |
474 | DEFINE_BUF_EVENT(xfs_buf_lock_done); |
475 | DEFINE_BUF_EVENT(xfs_buf_trylock_fail); |
476 | DEFINE_BUF_EVENT(xfs_buf_trylock); |
477 | DEFINE_BUF_EVENT(xfs_buf_unlock); |
478 | DEFINE_BUF_EVENT(xfs_buf_iowait); |
479 | DEFINE_BUF_EVENT(xfs_buf_iowait_done); |
480 | DEFINE_BUF_EVENT(xfs_buf_delwri_queue); |
481 | DEFINE_BUF_EVENT(xfs_buf_delwri_queued); |
482 | DEFINE_BUF_EVENT(xfs_buf_delwri_split); |
483 | DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf); |
484 | DEFINE_BUF_EVENT(xfs_buf_get_uncached); |
485 | DEFINE_BUF_EVENT(xfs_buf_item_relse); |
486 | DEFINE_BUF_EVENT(xfs_buf_iodone_async); |
487 | DEFINE_BUF_EVENT(xfs_buf_error_relse); |
488 | DEFINE_BUF_EVENT(xfs_buf_drain_buftarg); |
489 | DEFINE_BUF_EVENT(xfs_trans_read_buf_shut); |
490 | |
491 | /* not really buffer traces, but the buf provides useful information */ |
492 | DEFINE_BUF_EVENT(xfs_btree_corrupt); |
493 | DEFINE_BUF_EVENT(xfs_reset_dqcounts); |
494 | |
495 | /* pass flags explicitly */ |
496 | DECLARE_EVENT_CLASS(xfs_buf_flags_class, |
497 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), |
498 | TP_ARGS(bp, flags, caller_ip), |
499 | TP_STRUCT__entry( |
500 | __field(dev_t, dev) |
501 | __field(xfs_daddr_t, bno) |
502 | __field(unsigned int, length) |
503 | __field(int, hold) |
504 | __field(int, pincount) |
505 | __field(unsigned, lockval) |
506 | __field(unsigned, flags) |
507 | __field(unsigned long, caller_ip) |
508 | ), |
509 | TP_fast_assign( |
510 | __entry->dev = bp->b_target->bt_dev; |
511 | __entry->bno = xfs_buf_daddr(bp); |
512 | __entry->length = bp->b_length; |
513 | __entry->flags = flags; |
514 | __entry->hold = atomic_read(&bp->b_hold); |
515 | __entry->pincount = atomic_read(&bp->b_pin_count); |
516 | __entry->lockval = bp->b_sema.count; |
517 | __entry->caller_ip = caller_ip; |
518 | ), |
519 | TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d " |
520 | "lock %d flags %s caller %pS" , |
521 | MAJOR(__entry->dev), MINOR(__entry->dev), |
522 | (unsigned long long)__entry->bno, |
523 | __entry->length, |
524 | __entry->hold, |
525 | __entry->pincount, |
526 | __entry->lockval, |
527 | __print_flags(__entry->flags, "|" , XFS_BUF_FLAGS), |
528 | (void *)__entry->caller_ip) |
529 | ) |
530 | |
531 | #define DEFINE_BUF_FLAGS_EVENT(name) \ |
532 | DEFINE_EVENT(xfs_buf_flags_class, name, \ |
533 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \ |
534 | TP_ARGS(bp, flags, caller_ip)) |
535 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_find); |
536 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_get); |
537 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_read); |
538 | |
539 | TRACE_EVENT(xfs_buf_ioerror, |
540 | TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip), |
541 | TP_ARGS(bp, error, caller_ip), |
542 | TP_STRUCT__entry( |
543 | __field(dev_t, dev) |
544 | __field(xfs_daddr_t, bno) |
545 | __field(unsigned int, length) |
546 | __field(unsigned, flags) |
547 | __field(int, hold) |
548 | __field(int, pincount) |
549 | __field(unsigned, lockval) |
550 | __field(int, error) |
551 | __field(xfs_failaddr_t, caller_ip) |
552 | ), |
553 | TP_fast_assign( |
554 | __entry->dev = bp->b_target->bt_dev; |
555 | __entry->bno = xfs_buf_daddr(bp); |
556 | __entry->length = bp->b_length; |
557 | __entry->hold = atomic_read(&bp->b_hold); |
558 | __entry->pincount = atomic_read(&bp->b_pin_count); |
559 | __entry->lockval = bp->b_sema.count; |
560 | __entry->error = error; |
561 | __entry->flags = bp->b_flags; |
562 | __entry->caller_ip = caller_ip; |
563 | ), |
564 | TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d " |
565 | "lock %d error %d flags %s caller %pS" , |
566 | MAJOR(__entry->dev), MINOR(__entry->dev), |
567 | (unsigned long long)__entry->bno, |
568 | __entry->length, |
569 | __entry->hold, |
570 | __entry->pincount, |
571 | __entry->lockval, |
572 | __entry->error, |
573 | __print_flags(__entry->flags, "|" , XFS_BUF_FLAGS), |
574 | (void *)__entry->caller_ip) |
575 | ); |
576 | |
577 | DECLARE_EVENT_CLASS(xfs_buf_item_class, |
578 | TP_PROTO(struct xfs_buf_log_item *bip), |
579 | TP_ARGS(bip), |
580 | TP_STRUCT__entry( |
581 | __field(dev_t, dev) |
582 | __field(xfs_daddr_t, buf_bno) |
583 | __field(unsigned int, buf_len) |
584 | __field(int, buf_hold) |
585 | __field(int, buf_pincount) |
586 | __field(int, buf_lockval) |
587 | __field(unsigned, buf_flags) |
588 | __field(unsigned, bli_recur) |
589 | __field(int, bli_refcount) |
590 | __field(unsigned, bli_flags) |
591 | __field(unsigned long, li_flags) |
592 | ), |
593 | TP_fast_assign( |
594 | __entry->dev = bip->bli_buf->b_target->bt_dev; |
595 | __entry->bli_flags = bip->bli_flags; |
596 | __entry->bli_recur = bip->bli_recur; |
597 | __entry->bli_refcount = atomic_read(&bip->bli_refcount); |
598 | __entry->buf_bno = xfs_buf_daddr(bip->bli_buf); |
599 | __entry->buf_len = bip->bli_buf->b_length; |
600 | __entry->buf_flags = bip->bli_buf->b_flags; |
601 | __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold); |
602 | __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count); |
603 | __entry->buf_lockval = bip->bli_buf->b_sema.count; |
604 | __entry->li_flags = bip->bli_item.li_flags; |
605 | ), |
606 | TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d " |
607 | "lock %d flags %s recur %d refcount %d bliflags %s " |
608 | "liflags %s" , |
609 | MAJOR(__entry->dev), MINOR(__entry->dev), |
610 | (unsigned long long)__entry->buf_bno, |
611 | __entry->buf_len, |
612 | __entry->buf_hold, |
613 | __entry->buf_pincount, |
614 | __entry->buf_lockval, |
615 | __print_flags(__entry->buf_flags, "|" , XFS_BUF_FLAGS), |
616 | __entry->bli_recur, |
617 | __entry->bli_refcount, |
618 | __print_flags(__entry->bli_flags, "|" , XFS_BLI_FLAGS), |
619 | __print_flags(__entry->li_flags, "|" , XFS_LI_FLAGS)) |
620 | ) |
621 | |
622 | #define DEFINE_BUF_ITEM_EVENT(name) \ |
623 | DEFINE_EVENT(xfs_buf_item_class, name, \ |
624 | TP_PROTO(struct xfs_buf_log_item *bip), \ |
625 | TP_ARGS(bip)) |
626 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size); |
627 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered); |
628 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale); |
629 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format); |
630 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale); |
631 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered); |
632 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin); |
633 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin); |
634 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale); |
635 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release); |
636 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed); |
637 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push); |
638 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf); |
639 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur); |
640 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb); |
641 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur); |
642 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf); |
643 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur); |
644 | DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf); |
645 | DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse); |
646 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bdetach); |
647 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin); |
648 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold); |
649 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release); |
650 | DEFINE_BUF_ITEM_EVENT(xfs_trans_binval); |
651 | |
652 | DECLARE_EVENT_CLASS(xfs_filestream_class, |
653 | TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino), |
654 | TP_ARGS(pag, ino), |
655 | TP_STRUCT__entry( |
656 | __field(dev_t, dev) |
657 | __field(xfs_ino_t, ino) |
658 | __field(xfs_agnumber_t, agno) |
659 | __field(int, streams) |
660 | ), |
661 | TP_fast_assign( |
662 | __entry->dev = pag->pag_mount->m_super->s_dev; |
663 | __entry->ino = ino; |
664 | __entry->agno = pag->pag_agno; |
665 | __entry->streams = atomic_read(&pag->pagf_fstrms); |
666 | ), |
667 | TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d" , |
668 | MAJOR(__entry->dev), MINOR(__entry->dev), |
669 | __entry->ino, |
670 | __entry->agno, |
671 | __entry->streams) |
672 | ) |
673 | #define DEFINE_FILESTREAM_EVENT(name) \ |
674 | DEFINE_EVENT(xfs_filestream_class, name, \ |
675 | TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino), \ |
676 | TP_ARGS(pag, ino)) |
677 | DEFINE_FILESTREAM_EVENT(xfs_filestream_free); |
678 | DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup); |
679 | DEFINE_FILESTREAM_EVENT(xfs_filestream_scan); |
680 | |
681 | TRACE_EVENT(xfs_filestream_pick, |
682 | TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino, xfs_extlen_t free), |
683 | TP_ARGS(pag, ino, free), |
684 | TP_STRUCT__entry( |
685 | __field(dev_t, dev) |
686 | __field(xfs_ino_t, ino) |
687 | __field(xfs_agnumber_t, agno) |
688 | __field(int, streams) |
689 | __field(xfs_extlen_t, free) |
690 | ), |
691 | TP_fast_assign( |
692 | __entry->dev = pag->pag_mount->m_super->s_dev; |
693 | __entry->ino = ino; |
694 | if (pag) { |
695 | __entry->agno = pag->pag_agno; |
696 | __entry->streams = atomic_read(&pag->pagf_fstrms); |
697 | } else { |
698 | __entry->agno = NULLAGNUMBER; |
699 | __entry->streams = 0; |
700 | } |
701 | __entry->free = free; |
702 | ), |
703 | TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d" , |
704 | MAJOR(__entry->dev), MINOR(__entry->dev), |
705 | __entry->ino, |
706 | __entry->agno, |
707 | __entry->streams, |
708 | __entry->free) |
709 | ); |
710 | |
711 | DECLARE_EVENT_CLASS(xfs_lock_class, |
712 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, |
713 | unsigned long caller_ip), |
714 | TP_ARGS(ip, lock_flags, caller_ip), |
715 | TP_STRUCT__entry( |
716 | __field(dev_t, dev) |
717 | __field(xfs_ino_t, ino) |
718 | __field(int, lock_flags) |
719 | __field(unsigned long, caller_ip) |
720 | ), |
721 | TP_fast_assign( |
722 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
723 | __entry->ino = ip->i_ino; |
724 | __entry->lock_flags = lock_flags; |
725 | __entry->caller_ip = caller_ip; |
726 | ), |
727 | TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS" , |
728 | MAJOR(__entry->dev), MINOR(__entry->dev), |
729 | __entry->ino, |
730 | __print_flags(__entry->lock_flags, "|" , XFS_LOCK_FLAGS), |
731 | (void *)__entry->caller_ip) |
732 | ) |
733 | |
734 | #define DEFINE_LOCK_EVENT(name) \ |
735 | DEFINE_EVENT(xfs_lock_class, name, \ |
736 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ |
737 | unsigned long caller_ip), \ |
738 | TP_ARGS(ip, lock_flags, caller_ip)) |
739 | DEFINE_LOCK_EVENT(xfs_ilock); |
740 | DEFINE_LOCK_EVENT(xfs_ilock_nowait); |
741 | DEFINE_LOCK_EVENT(xfs_ilock_demote); |
742 | DEFINE_LOCK_EVENT(xfs_iunlock); |
743 | |
744 | DECLARE_EVENT_CLASS(xfs_inode_class, |
745 | TP_PROTO(struct xfs_inode *ip), |
746 | TP_ARGS(ip), |
747 | TP_STRUCT__entry( |
748 | __field(dev_t, dev) |
749 | __field(xfs_ino_t, ino) |
750 | __field(unsigned long, iflags) |
751 | ), |
752 | TP_fast_assign( |
753 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
754 | __entry->ino = ip->i_ino; |
755 | __entry->iflags = ip->i_flags; |
756 | ), |
757 | TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx" , |
758 | MAJOR(__entry->dev), MINOR(__entry->dev), |
759 | __entry->ino, |
760 | __entry->iflags) |
761 | ) |
762 | |
763 | #define DEFINE_INODE_EVENT(name) \ |
764 | DEFINE_EVENT(xfs_inode_class, name, \ |
765 | TP_PROTO(struct xfs_inode * |
---|