1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2009, Christoph Hellwig
6 * NOTE: none of these tracepoints shall be considered a stable kernel ABI
7 * as they can change at any time.
9 * Current conventions for printing numbers measuring specific units:
11 * agno: allocation group number
13 * agino: per-AG inode number
14 * ino: filesystem inode number
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
22 * daddr: physical block number in 512b blocks
23 * bbcount: number of blocks in a physical extent, in 512b blocks
25 * rtx: physical rt extent number for extent mappings
26 * rtxcount: number of rt extents in an extent mapping
28 * owner: reverse-mapping owner, usually inodes
30 * fileoff: file offset, in fs blocks
31 * pos: file offset, in bytes
32 * bytecount: number of bytes
34 * disize: ondisk file size, in bytes
35 * isize: incore file size, in bytes
37 * forkoff: inode fork offset, in bytes
39 * ireccount: number of inode records
41 * Numbers describing space allocations (blocks, extents, inodes) should be
42 * formatted in hexadecimal.
45 #define TRACE_SYSTEM xfs
47 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
50 #include <linux/tracepoint.h>
54 struct xfs_attr_list_context;
55 struct xfs_buf_log_item;
57 struct xfs_da_node_entry;
63 struct xlog_recover_item;
64 struct xlog_rec_header;
66 struct xfs_buf_log_format;
67 struct xfs_inode_log_format;
70 struct xfs_refcount_irec;
73 struct xfs_icreate_log;
74 struct xfs_owner_info;
76 struct xfs_inobt_rec_incore;
82 #define XFS_ATTR_FILTER_FLAGS \
83 { XFS_ATTR_ROOT, "ROOT" }, \
84 { XFS_ATTR_SECURE, "SECURE" }, \
85 { XFS_ATTR_INCOMPLETE, "INCOMPLETE" }
87 DECLARE_EVENT_CLASS(xfs_attr_list_class,
88 TP_PROTO(struct xfs_attr_list_context *ctx),
92 __field(xfs_ino_t, ino)
96 __field(void *, buffer)
101 __field(unsigned int, attr_filter)
104 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
105 __entry->ino = ctx->dp->i_ino;
106 __entry->hashval = ctx->cursor.hashval;
107 __entry->blkno = ctx->cursor.blkno;
108 __entry->offset = ctx->cursor.offset;
109 __entry->buffer = ctx->buffer;
110 __entry->bufsize = ctx->bufsize;
111 __entry->count = ctx->count;
112 __entry->firstu = ctx->firstu;
113 __entry->attr_filter = ctx->attr_filter;
115 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
116 "buffer %p size %u count %u firstu %u filter %s",
117 MAJOR(__entry->dev), MINOR(__entry->dev),
127 __print_flags(__entry->attr_filter, "|",
128 XFS_ATTR_FILTER_FLAGS)
132 #define DEFINE_ATTR_LIST_EVENT(name) \
133 DEFINE_EVENT(xfs_attr_list_class, name, \
134 TP_PROTO(struct xfs_attr_list_context *ctx), \
136 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
137 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
138 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
139 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
140 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
141 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
142 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
143 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
144 DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
145 DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
147 TRACE_EVENT(xlog_intent_recovery_failed,
148 TP_PROTO(struct xfs_mount *mp, int error, void *function),
149 TP_ARGS(mp, error, function),
153 __field(void *, function)
156 __entry->dev = mp->m_super->s_dev;
157 __entry->error = error;
158 __entry->function = function;
160 TP_printk("dev %d:%d error %d function %pS",
161 MAJOR(__entry->dev), MINOR(__entry->dev),
162 __entry->error, __entry->function)
165 DECLARE_EVENT_CLASS(xfs_perag_class,
166 TP_PROTO(struct xfs_perag *pag, unsigned long caller_ip),
167 TP_ARGS(pag, caller_ip),
170 __field(xfs_agnumber_t, agno)
171 __field(int, refcount)
172 __field(int, active_refcount)
173 __field(unsigned long, caller_ip)
176 __entry->dev = pag->pag_mount->m_super->s_dev;
177 __entry->agno = pag->pag_agno;
178 __entry->refcount = atomic_read(&pag->pag_ref);
179 __entry->active_refcount = atomic_read(&pag->pag_active_ref);
180 __entry->caller_ip = caller_ip;
182 TP_printk("dev %d:%d agno 0x%x passive refs %d active refs %d caller %pS",
183 MAJOR(__entry->dev), MINOR(__entry->dev),
186 __entry->active_refcount,
187 (char *)__entry->caller_ip)
190 #define DEFINE_PERAG_REF_EVENT(name) \
191 DEFINE_EVENT(xfs_perag_class, name, \
192 TP_PROTO(struct xfs_perag *pag, unsigned long caller_ip), \
193 TP_ARGS(pag, caller_ip))
194 DEFINE_PERAG_REF_EVENT(xfs_perag_get);
195 DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
196 DEFINE_PERAG_REF_EVENT(xfs_perag_hold);
197 DEFINE_PERAG_REF_EVENT(xfs_perag_put);
198 DEFINE_PERAG_REF_EVENT(xfs_perag_grab);
199 DEFINE_PERAG_REF_EVENT(xfs_perag_grab_tag);
200 DEFINE_PERAG_REF_EVENT(xfs_perag_rele);
201 DEFINE_PERAG_REF_EVENT(xfs_perag_set_inode_tag);
202 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_inode_tag);
204 TRACE_EVENT(xfs_inodegc_worker,
205 TP_PROTO(struct xfs_mount *mp, unsigned int shrinker_hits),
206 TP_ARGS(mp, shrinker_hits),
209 __field(unsigned int, shrinker_hits)
212 __entry->dev = mp->m_super->s_dev;
213 __entry->shrinker_hits = shrinker_hits;
215 TP_printk("dev %d:%d shrinker_hits %u",
216 MAJOR(__entry->dev), MINOR(__entry->dev),
217 __entry->shrinker_hits)
220 DECLARE_EVENT_CLASS(xfs_fs_class,
221 TP_PROTO(struct xfs_mount *mp, void *caller_ip),
222 TP_ARGS(mp, caller_ip),
225 __field(unsigned long long, mflags)
226 __field(unsigned long, opstate)
227 __field(unsigned long, sbflags)
228 __field(void *, caller_ip)
232 __entry->dev = mp->m_super->s_dev;
233 __entry->mflags = mp->m_features;
234 __entry->opstate = mp->m_opstate;
235 __entry->sbflags = mp->m_super->s_flags;
237 __entry->caller_ip = caller_ip;
239 TP_printk("dev %d:%d m_features 0x%llx opstate (%s) s_flags 0x%lx caller %pS",
240 MAJOR(__entry->dev), MINOR(__entry->dev),
242 __print_flags(__entry->opstate, "|", XFS_OPSTATE_STRINGS),
247 #define DEFINE_FS_EVENT(name) \
248 DEFINE_EVENT(xfs_fs_class, name, \
249 TP_PROTO(struct xfs_mount *mp, void *caller_ip), \
250 TP_ARGS(mp, caller_ip))
251 DEFINE_FS_EVENT(xfs_inodegc_flush);
252 DEFINE_FS_EVENT(xfs_inodegc_push);
253 DEFINE_FS_EVENT(xfs_inodegc_start);
254 DEFINE_FS_EVENT(xfs_inodegc_stop);
255 DEFINE_FS_EVENT(xfs_inodegc_queue);
256 DEFINE_FS_EVENT(xfs_inodegc_throttle);
257 DEFINE_FS_EVENT(xfs_fs_sync_fs);
258 DEFINE_FS_EVENT(xfs_blockgc_start);
259 DEFINE_FS_EVENT(xfs_blockgc_stop);
260 DEFINE_FS_EVENT(xfs_blockgc_worker);
261 DEFINE_FS_EVENT(xfs_blockgc_flush_all);
263 TRACE_EVENT(xfs_inodegc_shrinker_scan,
264 TP_PROTO(struct xfs_mount *mp, struct shrink_control *sc,
266 TP_ARGS(mp, sc, caller_ip),
269 __field(unsigned long, nr_to_scan)
270 __field(void *, caller_ip)
273 __entry->dev = mp->m_super->s_dev;
274 __entry->nr_to_scan = sc->nr_to_scan;
275 __entry->caller_ip = caller_ip;
277 TP_printk("dev %d:%d nr_to_scan %lu caller %pS",
278 MAJOR(__entry->dev), MINOR(__entry->dev),
283 DECLARE_EVENT_CLASS(xfs_ag_class,
284 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
288 __field(xfs_agnumber_t, agno)
291 __entry->dev = mp->m_super->s_dev;
292 __entry->agno = agno;
294 TP_printk("dev %d:%d agno 0x%x",
295 MAJOR(__entry->dev), MINOR(__entry->dev),
298 #define DEFINE_AG_EVENT(name) \
299 DEFINE_EVENT(xfs_ag_class, name, \
300 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
303 DEFINE_AG_EVENT(xfs_read_agf);
304 DEFINE_AG_EVENT(xfs_alloc_read_agf);
305 DEFINE_AG_EVENT(xfs_read_agi);
306 DEFINE_AG_EVENT(xfs_ialloc_read_agi);
308 TRACE_EVENT(xfs_attr_list_node_descend,
309 TP_PROTO(struct xfs_attr_list_context *ctx,
310 struct xfs_da_node_entry *btree),
314 __field(xfs_ino_t, ino)
315 __field(u32, hashval)
318 __field(void *, buffer)
319 __field(int, bufsize)
323 __field(unsigned int, attr_filter)
324 __field(u32, bt_hashval)
325 __field(u32, bt_before)
328 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
329 __entry->ino = ctx->dp->i_ino;
330 __entry->hashval = ctx->cursor.hashval;
331 __entry->blkno = ctx->cursor.blkno;
332 __entry->offset = ctx->cursor.offset;
333 __entry->buffer = ctx->buffer;
334 __entry->bufsize = ctx->bufsize;
335 __entry->count = ctx->count;
336 __entry->firstu = ctx->firstu;
337 __entry->attr_filter = ctx->attr_filter;
338 __entry->bt_hashval = be32_to_cpu(btree->hashval);
339 __entry->bt_before = be32_to_cpu(btree->before);
341 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
342 "buffer %p size %u count %u firstu %u filter %s "
343 "node hashval %u, node before %u",
344 MAJOR(__entry->dev), MINOR(__entry->dev),
354 __print_flags(__entry->attr_filter, "|",
355 XFS_ATTR_FILTER_FLAGS),
360 DECLARE_EVENT_CLASS(xfs_bmap_class,
361 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
362 unsigned long caller_ip),
363 TP_ARGS(ip, cur, state, caller_ip),
366 __field(xfs_ino_t, ino)
367 __field(void *, leaf)
369 __field(xfs_fileoff_t, startoff)
370 __field(xfs_fsblock_t, startblock)
371 __field(xfs_filblks_t, blockcount)
372 __field(xfs_exntst_t, state)
373 __field(int, bmap_state)
374 __field(unsigned long, caller_ip)
377 struct xfs_ifork *ifp;
378 struct xfs_bmbt_irec r;
380 ifp = xfs_iext_state_to_fork(ip, state);
381 xfs_iext_get_extent(ifp, cur, &r);
382 __entry->dev = VFS_I(ip)->i_sb->s_dev;
383 __entry->ino = ip->i_ino;
384 __entry->leaf = cur->leaf;
385 __entry->pos = cur->pos;
386 __entry->startoff = r.br_startoff;
387 __entry->startblock = r.br_startblock;
388 __entry->blockcount = r.br_blockcount;
389 __entry->state = r.br_state;
390 __entry->bmap_state = state;
391 __entry->caller_ip = caller_ip;
393 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
394 "fileoff 0x%llx startblock 0x%llx fsbcount 0x%llx flag %d caller %pS",
395 MAJOR(__entry->dev), MINOR(__entry->dev),
397 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
401 (int64_t)__entry->startblock,
404 (char *)__entry->caller_ip)
407 #define DEFINE_BMAP_EVENT(name) \
408 DEFINE_EVENT(xfs_bmap_class, name, \
409 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
410 unsigned long caller_ip), \
411 TP_ARGS(ip, cur, state, caller_ip))
412 DEFINE_BMAP_EVENT(xfs_iext_insert);
413 DEFINE_BMAP_EVENT(xfs_iext_remove);
414 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
415 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
416 DEFINE_BMAP_EVENT(xfs_read_extent);
417 DEFINE_BMAP_EVENT(xfs_write_extent);
419 DECLARE_EVENT_CLASS(xfs_buf_class,
420 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
421 TP_ARGS(bp, caller_ip),
424 __field(xfs_daddr_t, bno)
427 __field(int, pincount)
428 __field(unsigned, lockval)
429 __field(unsigned, flags)
430 __field(unsigned long, caller_ip)
431 __field(const void *, buf_ops)
434 __entry->dev = bp->b_target->bt_dev;
435 __entry->bno = xfs_buf_daddr(bp);
436 __entry->nblks = bp->b_length;
437 __entry->hold = atomic_read(&bp->b_hold);
438 __entry->pincount = atomic_read(&bp->b_pin_count);
439 __entry->lockval = bp->b_sema.count;
440 __entry->flags = bp->b_flags;
441 __entry->caller_ip = caller_ip;
442 __entry->buf_ops = bp->b_ops;
444 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
445 "lock %d flags %s bufops %pS caller %pS",
446 MAJOR(__entry->dev), MINOR(__entry->dev),
447 (unsigned long long)__entry->bno,
452 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
454 (void *)__entry->caller_ip)
457 #define DEFINE_BUF_EVENT(name) \
458 DEFINE_EVENT(xfs_buf_class, name, \
459 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
460 TP_ARGS(bp, caller_ip))
461 DEFINE_BUF_EVENT(xfs_buf_init);
462 DEFINE_BUF_EVENT(xfs_buf_free);
463 DEFINE_BUF_EVENT(xfs_buf_hold);
464 DEFINE_BUF_EVENT(xfs_buf_rele);
465 DEFINE_BUF_EVENT(xfs_buf_iodone);
466 DEFINE_BUF_EVENT(xfs_buf_submit);
467 DEFINE_BUF_EVENT(xfs_buf_lock);
468 DEFINE_BUF_EVENT(xfs_buf_lock_done);
469 DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
470 DEFINE_BUF_EVENT(xfs_buf_trylock);
471 DEFINE_BUF_EVENT(xfs_buf_unlock);
472 DEFINE_BUF_EVENT(xfs_buf_iowait);
473 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
474 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
475 DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
476 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
477 DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
478 DEFINE_BUF_EVENT(xfs_buf_get_uncached);
479 DEFINE_BUF_EVENT(xfs_buf_item_relse);
480 DEFINE_BUF_EVENT(xfs_buf_iodone_async);
481 DEFINE_BUF_EVENT(xfs_buf_error_relse);
482 DEFINE_BUF_EVENT(xfs_buf_drain_buftarg);
483 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
485 /* not really buffer traces, but the buf provides useful information */
486 DEFINE_BUF_EVENT(xfs_btree_corrupt);
487 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
489 /* pass flags explicitly */
490 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
491 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
492 TP_ARGS(bp, flags, caller_ip),
495 __field(xfs_daddr_t, bno)
496 __field(unsigned int, length)
498 __field(int, pincount)
499 __field(unsigned, lockval)
500 __field(unsigned, flags)
501 __field(unsigned long, caller_ip)
504 __entry->dev = bp->b_target->bt_dev;
505 __entry->bno = xfs_buf_daddr(bp);
506 __entry->length = bp->b_length;
507 __entry->flags = flags;
508 __entry->hold = atomic_read(&bp->b_hold);
509 __entry->pincount = atomic_read(&bp->b_pin_count);
510 __entry->lockval = bp->b_sema.count;
511 __entry->caller_ip = caller_ip;
513 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
514 "lock %d flags %s caller %pS",
515 MAJOR(__entry->dev), MINOR(__entry->dev),
516 (unsigned long long)__entry->bno,
521 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
522 (void *)__entry->caller_ip)
525 #define DEFINE_BUF_FLAGS_EVENT(name) \
526 DEFINE_EVENT(xfs_buf_flags_class, name, \
527 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
528 TP_ARGS(bp, flags, caller_ip))
529 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
530 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
531 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
533 TRACE_EVENT(xfs_buf_ioerror,
534 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
535 TP_ARGS(bp, error, caller_ip),
538 __field(xfs_daddr_t, bno)
539 __field(unsigned int, length)
540 __field(unsigned, flags)
542 __field(int, pincount)
543 __field(unsigned, lockval)
545 __field(xfs_failaddr_t, caller_ip)
548 __entry->dev = bp->b_target->bt_dev;
549 __entry->bno = xfs_buf_daddr(bp);
550 __entry->length = bp->b_length;
551 __entry->hold = atomic_read(&bp->b_hold);
552 __entry->pincount = atomic_read(&bp->b_pin_count);
553 __entry->lockval = bp->b_sema.count;
554 __entry->error = error;
555 __entry->flags = bp->b_flags;
556 __entry->caller_ip = caller_ip;
558 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
559 "lock %d error %d flags %s caller %pS",
560 MAJOR(__entry->dev), MINOR(__entry->dev),
561 (unsigned long long)__entry->bno,
567 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
568 (void *)__entry->caller_ip)
571 DECLARE_EVENT_CLASS(xfs_buf_item_class,
572 TP_PROTO(struct xfs_buf_log_item *bip),
576 __field(xfs_daddr_t, buf_bno)
577 __field(unsigned int, buf_len)
578 __field(int, buf_hold)
579 __field(int, buf_pincount)
580 __field(int, buf_lockval)
581 __field(unsigned, buf_flags)
582 __field(unsigned, bli_recur)
583 __field(int, bli_refcount)
584 __field(unsigned, bli_flags)
585 __field(unsigned long, li_flags)
588 __entry->dev = bip->bli_buf->b_target->bt_dev;
589 __entry->bli_flags = bip->bli_flags;
590 __entry->bli_recur = bip->bli_recur;
591 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
592 __entry->buf_bno = xfs_buf_daddr(bip->bli_buf);
593 __entry->buf_len = bip->bli_buf->b_length;
594 __entry->buf_flags = bip->bli_buf->b_flags;
595 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
596 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
597 __entry->buf_lockval = bip->bli_buf->b_sema.count;
598 __entry->li_flags = bip->bli_item.li_flags;
600 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
601 "lock %d flags %s recur %d refcount %d bliflags %s "
603 MAJOR(__entry->dev), MINOR(__entry->dev),
604 (unsigned long long)__entry->buf_bno,
607 __entry->buf_pincount,
608 __entry->buf_lockval,
609 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
611 __entry->bli_refcount,
612 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
613 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
616 #define DEFINE_BUF_ITEM_EVENT(name) \
617 DEFINE_EVENT(xfs_buf_item_class, name, \
618 TP_PROTO(struct xfs_buf_log_item *bip), \
620 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
621 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
622 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
623 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
624 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
625 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
626 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
627 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
628 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
629 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release);
630 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
631 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
632 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
633 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
634 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
635 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
636 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
637 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
638 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
639 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
640 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
641 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
642 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
643 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
645 DECLARE_EVENT_CLASS(xfs_filestream_class,
646 TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino),
650 __field(xfs_ino_t, ino)
651 __field(xfs_agnumber_t, agno)
652 __field(int, streams)
655 __entry->dev = pag->pag_mount->m_super->s_dev;
657 __entry->agno = pag->pag_agno;
658 __entry->streams = atomic_read(&pag->pagf_fstrms);
660 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d",
661 MAJOR(__entry->dev), MINOR(__entry->dev),
666 #define DEFINE_FILESTREAM_EVENT(name) \
667 DEFINE_EVENT(xfs_filestream_class, name, \
668 TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino), \
670 DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
671 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
672 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
674 TRACE_EVENT(xfs_filestream_pick,
675 TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino, xfs_extlen_t free),
676 TP_ARGS(pag, ino, free),
679 __field(xfs_ino_t, ino)
680 __field(xfs_agnumber_t, agno)
681 __field(int, streams)
682 __field(xfs_extlen_t, free)
685 __entry->dev = pag->pag_mount->m_super->s_dev;
688 __entry->agno = pag->pag_agno;
689 __entry->streams = atomic_read(&pag->pagf_fstrms);
691 __entry->agno = NULLAGNUMBER;
692 __entry->streams = 0;
694 __entry->free = free;
696 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d",
697 MAJOR(__entry->dev), MINOR(__entry->dev),
704 DECLARE_EVENT_CLASS(xfs_lock_class,
705 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
706 unsigned long caller_ip),
707 TP_ARGS(ip, lock_flags, caller_ip),
710 __field(xfs_ino_t, ino)
711 __field(int, lock_flags)
712 __field(unsigned long, caller_ip)
715 __entry->dev = VFS_I(ip)->i_sb->s_dev;
716 __entry->ino = ip->i_ino;
717 __entry->lock_flags = lock_flags;
718 __entry->caller_ip = caller_ip;
720 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
721 MAJOR(__entry->dev), MINOR(__entry->dev),
723 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
724 (void *)__entry->caller_ip)
727 #define DEFINE_LOCK_EVENT(name) \
728 DEFINE_EVENT(xfs_lock_class, name, \
729 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
730 unsigned long caller_ip), \
731 TP_ARGS(ip, lock_flags, caller_ip))
732 DEFINE_LOCK_EVENT(xfs_ilock);
733 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
734 DEFINE_LOCK_EVENT(xfs_ilock_demote);
735 DEFINE_LOCK_EVENT(xfs_iunlock);
737 DECLARE_EVENT_CLASS(xfs_inode_class,
738 TP_PROTO(struct xfs_inode *ip),
742 __field(xfs_ino_t, ino)
743 __field(unsigned long, iflags)
746 __entry->dev = VFS_I(ip)->i_sb->s_dev;
747 __entry->ino = ip->i_ino;
748 __entry->iflags = ip->i_flags;
750 TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx",
751 MAJOR(__entry->dev), MINOR(__entry->dev),
756 #define DEFINE_INODE_EVENT(name) \
757 DEFINE_EVENT(xfs_inode_class, name, \
758 TP_PROTO(struct xfs_inode *ip), \
760 DEFINE_INODE_EVENT(xfs_iget_skip);
761 DEFINE_INODE_EVENT(xfs_iget_recycle);
762 DEFINE_INODE_EVENT(xfs_iget_recycle_fail);
763 DEFINE_INODE_EVENT(xfs_iget_hit);
764 DEFINE_INODE_EVENT(xfs_iget_miss);
766 DEFINE_INODE_EVENT(xfs_getattr);
767 DEFINE_INODE_EVENT(xfs_setattr);
768 DEFINE_INODE_EVENT(xfs_readlink);
769 DEFINE_INODE_EVENT(xfs_inactive_symlink);
770 DEFINE_INODE_EVENT(xfs_alloc_file_space);
771 DEFINE_INODE_EVENT(xfs_free_file_space);
772 DEFINE_INODE_EVENT(xfs_zero_file_space);
773 DEFINE_INODE_EVENT(xfs_collapse_file_space);
774 DEFINE_INODE_EVENT(xfs_insert_file_space);
775 DEFINE_INODE_EVENT(xfs_readdir);
776 #ifdef CONFIG_XFS_POSIX_ACL
777 DEFINE_INODE_EVENT(xfs_get_acl);
779 DEFINE_INODE_EVENT(xfs_vm_bmap);
780 DEFINE_INODE_EVENT(xfs_file_ioctl);
781 DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
782 DEFINE_INODE_EVENT(xfs_ioctl_setattr);
783 DEFINE_INODE_EVENT(xfs_dir_fsync);
784 DEFINE_INODE_EVENT(xfs_file_fsync);
785 DEFINE_INODE_EVENT(xfs_destroy_inode);
786 DEFINE_INODE_EVENT(xfs_update_time);
788 DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
789 DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
791 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
792 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
793 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
794 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
795 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
796 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
797 DEFINE_INODE_EVENT(xfs_inode_set_reclaimable);
798 DEFINE_INODE_EVENT(xfs_inode_reclaiming);
799 DEFINE_INODE_EVENT(xfs_inode_set_need_inactive);
800 DEFINE_INODE_EVENT(xfs_inode_inactivating);
803 * ftrace's __print_symbolic requires that all enum values be wrapped in the
804 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
805 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
808 TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_SHARED);
809 TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_COW);
811 TRACE_EVENT(xfs_filemap_fault,
812 TP_PROTO(struct xfs_inode *ip, unsigned int order, bool write_fault),
813 TP_ARGS(ip, order, write_fault),
816 __field(xfs_ino_t, ino)
817 __field(unsigned int, order)
818 __field(bool, write_fault)
821 __entry->dev = VFS_I(ip)->i_sb->s_dev;
822 __entry->ino = ip->i_ino;
823 __entry->order = order;
824 __entry->write_fault = write_fault;
826 TP_printk("dev %d:%d ino 0x%llx order %u write_fault %d",
827 MAJOR(__entry->dev), MINOR(__entry->dev),
830 __entry->write_fault)
833 DECLARE_EVENT_CLASS(xfs_iref_class,
834 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
835 TP_ARGS(ip, caller_ip),
838 __field(xfs_ino_t, ino)
840 __field(int, pincount)
841 __field(unsigned long, caller_ip)
844 __entry->dev = VFS_I(ip)->i_sb->s_dev;
845 __entry->ino = ip->i_ino;
846 __entry->count = atomic_read(&VFS_I(ip)->i_count);
847 __entry->pincount = atomic_read(&ip->i_pincount);
848 __entry->caller_ip = caller_ip;
850 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
851 MAJOR(__entry->dev), MINOR(__entry->dev),
855 (char *)__entry->caller_ip)
858 TRACE_EVENT(xfs_iomap_prealloc_size,
859 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
860 unsigned int writeio_blocks),
861 TP_ARGS(ip, blocks, shift, writeio_blocks),
864 __field(xfs_ino_t, ino)
865 __field(xfs_fsblock_t, blocks)
867 __field(unsigned int, writeio_blocks)
870 __entry->dev = VFS_I(ip)->i_sb->s_dev;
871 __entry->ino = ip->i_ino;
872 __entry->blocks = blocks;
873 __entry->shift = shift;
874 __entry->writeio_blocks = writeio_blocks;
876 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
877 "m_allocsize_blocks %u",
878 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
879 __entry->blocks, __entry->shift, __entry->writeio_blocks)
882 TRACE_EVENT(xfs_irec_merge_pre,
883 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
884 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
885 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
888 __field(xfs_agnumber_t, agno)
889 __field(xfs_agino_t, agino)
890 __field(uint16_t, holemask)
891 __field(xfs_agino_t, nagino)
892 __field(uint16_t, nholemask)
895 __entry->dev = mp->m_super->s_dev;
896 __entry->agno = agno;
897 __entry->agino = agino;
898 __entry->holemask = holemask;
899 __entry->nagino = nagino;
900 __entry->nholemask = holemask;
902 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x",
903 MAJOR(__entry->dev), MINOR(__entry->dev),
911 TRACE_EVENT(xfs_irec_merge_post,
912 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
914 TP_ARGS(mp, agno, agino, holemask),
917 __field(xfs_agnumber_t, agno)
918 __field(xfs_agino_t, agino)
919 __field(uint16_t, holemask)
922 __entry->dev = mp->m_super->s_dev;
923 __entry->agno = agno;
924 __entry->agino = agino;
925 __entry->holemask = holemask;
927 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x",
935 #define DEFINE_IREF_EVENT(name) \
936 DEFINE_EVENT(xfs_iref_class, name, \
937 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
938 TP_ARGS(ip, caller_ip))
939 DEFINE_IREF_EVENT(xfs_irele);
940 DEFINE_IREF_EVENT(xfs_inode_pin);
941 DEFINE_IREF_EVENT(xfs_inode_unpin);
942 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
944 DECLARE_EVENT_CLASS(xfs_namespace_class,
945 TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name),
949 __field(xfs_ino_t, dp_ino)
950 __field(int, namelen)
951 __dynamic_array(char, name, name->len)
954 __entry->dev = VFS_I(dp)->i_sb->s_dev;
955 __entry->dp_ino = dp->i_ino;
956 __entry->namelen = name->len;
957 memcpy(__get_str(name), name->name, name->len);
959 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
960 MAJOR(__entry->dev), MINOR(__entry->dev),
966 #define DEFINE_NAMESPACE_EVENT(name) \
967 DEFINE_EVENT(xfs_namespace_class, name, \
968 TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name), \
970 DEFINE_NAMESPACE_EVENT(xfs_remove);
971 DEFINE_NAMESPACE_EVENT(xfs_link);
972 DEFINE_NAMESPACE_EVENT(xfs_lookup);
973 DEFINE_NAMESPACE_EVENT(xfs_create);
974 DEFINE_NAMESPACE_EVENT(xfs_symlink);
976 TRACE_EVENT(xfs_rename,
977 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
978 struct xfs_name *src_name, struct xfs_name *target_name),
979 TP_ARGS(src_dp, target_dp, src_name, target_name),
982 __field(xfs_ino_t, src_dp_ino)
983 __field(xfs_ino_t, target_dp_ino)
984 __field(int, src_namelen)
985 __field(int, target_namelen)
986 __dynamic_array(char, src_name, src_name->len)
987 __dynamic_array(char, target_name, target_name->len)
990 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
991 __entry->src_dp_ino = src_dp->i_ino;
992 __entry->target_dp_ino = target_dp->i_ino;
993 __entry->src_namelen = src_name->len;
994 __entry->target_namelen = target_name->len;
995 memcpy(__get_str(src_name), src_name->name, src_name->len);
996 memcpy(__get_str(target_name), target_name->name,
999 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
1000 " src name %.*s target name %.*s",
1001 MAJOR(__entry->dev), MINOR(__entry->dev),
1002 __entry->src_dp_ino,
1003 __entry->target_dp_ino,
1004 __entry->src_namelen,
1005 __get_str(src_name),
1006 __entry->target_namelen,
1007 __get_str(target_name))
1010 DECLARE_EVENT_CLASS(xfs_dquot_class,
1011 TP_PROTO(struct xfs_dquot *dqp),
1016 __field(xfs_dqtype_t, type)
1017 __field(unsigned, flags)
1018 __field(unsigned, nrefs)
1019 __field(unsigned long long, res_bcount)
1020 __field(unsigned long long, res_rtbcount)
1021 __field(unsigned long long, res_icount)
1023 __field(unsigned long long, bcount)
1024 __field(unsigned long long, rtbcount)
1025 __field(unsigned long long, icount)
1027 __field(unsigned long long, blk_hardlimit)
1028 __field(unsigned long long, blk_softlimit)
1029 __field(unsigned long long, rtb_hardlimit)
1030 __field(unsigned long long, rtb_softlimit)
1031 __field(unsigned long long, ino_hardlimit)
1032 __field(unsigned long long, ino_softlimit)
1035 __entry->dev = dqp->q_mount->m_super->s_dev;
1036 __entry->id = dqp->q_id;
1037 __entry->type = dqp->q_type;
1038 __entry->flags = dqp->q_flags;
1039 __entry->nrefs = dqp->q_nrefs;
1041 __entry->res_bcount = dqp->q_blk.reserved;
1042 __entry->res_rtbcount = dqp->q_rtb.reserved;
1043 __entry->res_icount = dqp->q_ino.reserved;
1045 __entry->bcount = dqp->q_blk.count;
1046 __entry->rtbcount = dqp->q_rtb.count;
1047 __entry->icount = dqp->q_ino.count;
1049 __entry->blk_hardlimit = dqp->q_blk.hardlimit;
1050 __entry->blk_softlimit = dqp->q_blk.softlimit;
1051 __entry->rtb_hardlimit = dqp->q_rtb.hardlimit;
1052 __entry->rtb_softlimit = dqp->q_rtb.softlimit;
1053 __entry->ino_hardlimit = dqp->q_ino.hardlimit;
1054 __entry->ino_softlimit = dqp->q_ino.softlimit;
1056 TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u "
1057 "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx "
1058 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
1059 "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx "
1060 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
1061 MAJOR(__entry->dev), MINOR(__entry->dev),
1063 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1064 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1066 __entry->res_bcount,
1067 __entry->res_rtbcount,
1068 __entry->res_icount,
1070 __entry->blk_hardlimit,
1071 __entry->blk_softlimit,
1073 __entry->rtb_hardlimit,
1074 __entry->rtb_softlimit,
1076 __entry->ino_hardlimit,
1077 __entry->ino_softlimit)
1080 #define DEFINE_DQUOT_EVENT(name) \
1081 DEFINE_EVENT(xfs_dquot_class, name, \
1082 TP_PROTO(struct xfs_dquot *dqp), \
1084 DEFINE_DQUOT_EVENT(xfs_dqadjust);
1085 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
1086 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
1087 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
1088 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
1089 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
1090 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
1091 DEFINE_DQUOT_EVENT(xfs_dqalloc);
1092 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
1093 DEFINE_DQUOT_EVENT(xfs_dqread);
1094 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
1095 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
1096 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
1097 DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
1098 DEFINE_DQUOT_EVENT(xfs_dqget_dup);
1099 DEFINE_DQUOT_EVENT(xfs_dqput);
1100 DEFINE_DQUOT_EVENT(xfs_dqput_free);
1101 DEFINE_DQUOT_EVENT(xfs_dqrele);
1102 DEFINE_DQUOT_EVENT(xfs_dqflush);
1103 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
1104 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
1105 DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
1106 DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
1108 TRACE_EVENT(xfs_trans_mod_dquot,
1109 TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
1110 unsigned int field, int64_t delta),
1111 TP_ARGS(tp, dqp, field, delta),
1114 __field(xfs_dqtype_t, type)
1115 __field(unsigned int, flags)
1116 __field(unsigned int, dqid)
1117 __field(unsigned int, field)
1118 __field(int64_t, delta)
1121 __entry->dev = tp->t_mountp->m_super->s_dev;
1122 __entry->type = dqp->q_type;
1123 __entry->flags = dqp->q_flags;
1124 __entry->dqid = dqp->q_id;
1125 __entry->field = field;
1126 __entry->delta = delta;
1128 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s field %s delta %lld",
1129 MAJOR(__entry->dev), MINOR(__entry->dev),
1131 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1132 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1133 __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS),
1137 DECLARE_EVENT_CLASS(xfs_dqtrx_class,
1138 TP_PROTO(struct xfs_dqtrx *qtrx),
1142 __field(xfs_dqtype_t, type)
1143 __field(unsigned int, flags)
1146 __field(uint64_t, blk_res)
1147 __field(int64_t, bcount_delta)
1148 __field(int64_t, delbcnt_delta)
1150 __field(uint64_t, rtblk_res)
1151 __field(uint64_t, rtblk_res_used)
1152 __field(int64_t, rtbcount_delta)
1153 __field(int64_t, delrtb_delta)
1155 __field(uint64_t, ino_res)
1156 __field(uint64_t, ino_res_used)
1157 __field(int64_t, icount_delta)
1160 __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev;
1161 __entry->type = qtrx->qt_dquot->q_type;
1162 __entry->flags = qtrx->qt_dquot->q_flags;
1163 __entry->dqid = qtrx->qt_dquot->q_id;
1165 __entry->blk_res = qtrx->qt_blk_res;
1166 __entry->bcount_delta = qtrx->qt_bcount_delta;
1167 __entry->delbcnt_delta = qtrx->qt_delbcnt_delta;
1169 __entry->rtblk_res = qtrx->qt_rtblk_res;
1170 __entry->rtblk_res_used = qtrx->qt_rtblk_res_used;
1171 __entry->rtbcount_delta = qtrx->qt_rtbcount_delta;
1172 __entry->delrtb_delta = qtrx->qt_delrtb_delta;
1174 __entry->ino_res = qtrx->qt_ino_res;
1175 __entry->ino_res_used = qtrx->qt_ino_res_used;
1176 __entry->icount_delta = qtrx->qt_icount_delta;
1178 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s "
1179 "blk_res %llu bcount_delta %lld delbcnt_delta %lld "
1180 "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld "
1181 "ino_res %llu ino_res_used %llu icount_delta %lld",
1182 MAJOR(__entry->dev), MINOR(__entry->dev),
1184 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1185 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1188 __entry->bcount_delta,
1189 __entry->delbcnt_delta,
1192 __entry->rtblk_res_used,
1193 __entry->rtbcount_delta,
1194 __entry->delrtb_delta,
1197 __entry->ino_res_used,
1198 __entry->icount_delta)
1201 #define DEFINE_DQTRX_EVENT(name) \
1202 DEFINE_EVENT(xfs_dqtrx_class, name, \
1203 TP_PROTO(struct xfs_dqtrx *qtrx), \
1205 DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas);
1206 DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before);
1207 DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after);
1209 DECLARE_EVENT_CLASS(xfs_loggrant_class,
1210 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
1216 __field(int, curr_res)
1217 __field(int, unit_res)
1218 __field(unsigned int, flags)
1219 __field(int, reserveq)
1220 __field(int, writeq)
1221 __field(int, grant_reserve_cycle)
1222 __field(int, grant_reserve_bytes)
1223 __field(int, grant_write_cycle)
1224 __field(int, grant_write_bytes)
1225 __field(int, curr_cycle)
1226 __field(int, curr_block)
1227 __field(xfs_lsn_t, tail_lsn)
1230 __entry->dev = log->l_mp->m_super->s_dev;
1231 __entry->ocnt = tic->t_ocnt;
1232 __entry->cnt = tic->t_cnt;
1233 __entry->curr_res = tic->t_curr_res;
1234 __entry->unit_res = tic->t_unit_res;
1235 __entry->flags = tic->t_flags;
1236 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
1237 __entry->writeq = list_empty(&log->l_write_head.waiters);
1238 xlog_crack_grant_head(&log->l_reserve_head.grant,
1239 &__entry->grant_reserve_cycle,
1240 &__entry->grant_reserve_bytes);
1241 xlog_crack_grant_head(&log->l_write_head.grant,
1242 &__entry->grant_write_cycle,
1243 &__entry->grant_write_bytes);
1244 __entry->curr_cycle = log->l_curr_cycle;
1245 __entry->curr_block = log->l_curr_block;
1246 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
1248 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
1249 "t_unit_res %u t_flags %s reserveq %s "
1250 "writeq %s grant_reserve_cycle %d "
1251 "grant_reserve_bytes %d grant_write_cycle %d "
1252 "grant_write_bytes %d curr_cycle %d curr_block %d "
1253 "tail_cycle %d tail_block %d",
1254 MAJOR(__entry->dev), MINOR(__entry->dev),
1259 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
1260 __entry->reserveq ? "empty" : "active",
1261 __entry->writeq ? "empty" : "active",
1262 __entry->grant_reserve_cycle,
1263 __entry->grant_reserve_bytes,
1264 __entry->grant_write_cycle,
1265 __entry->grant_write_bytes,
1266 __entry->curr_cycle,
1267 __entry->curr_block,
1268 CYCLE_LSN(__entry->tail_lsn),
1269 BLOCK_LSN(__entry->tail_lsn)
1273 #define DEFINE_LOGGRANT_EVENT(name) \
1274 DEFINE_EVENT(xfs_loggrant_class, name, \
1275 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1277 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1278 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1279 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1280 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1281 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1282 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1283 DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1284 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1285 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant);
1286 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit);
1287 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub);
1288 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant);
1289 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub);
1290 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit);
1291 DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait);
1293 DECLARE_EVENT_CLASS(xfs_log_item_class,
1294 TP_PROTO(struct xfs_log_item *lip),
1298 __field(void *, lip)
1300 __field(unsigned long, flags)
1301 __field(xfs_lsn_t, lsn)
1304 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
1306 __entry->type = lip->li_type;
1307 __entry->flags = lip->li_flags;
1308 __entry->lsn = lip->li_lsn;
1310 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
1311 MAJOR(__entry->dev), MINOR(__entry->dev),
1313 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1314 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1315 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1318 TRACE_EVENT(xfs_log_force,
1319 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1320 TP_ARGS(mp, lsn, caller_ip),
1323 __field(xfs_lsn_t, lsn)
1324 __field(unsigned long, caller_ip)
1327 __entry->dev = mp->m_super->s_dev;
1329 __entry->caller_ip = caller_ip;
1331 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
1332 MAJOR(__entry->dev), MINOR(__entry->dev),
1333 __entry->lsn, (void *)__entry->caller_ip)
1336 #define DEFINE_LOG_ITEM_EVENT(name) \
1337 DEFINE_EVENT(xfs_log_item_class, name, \
1338 TP_PROTO(struct xfs_log_item *lip), \
1340 DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1341 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1342 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1343 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1344 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_mark);
1345 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_skip);
1346 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_unpin);
1348 DECLARE_EVENT_CLASS(xfs_ail_class,
1349 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1350 TP_ARGS(lip, old_lsn, new_lsn),
1353 __field(void *, lip)
1355 __field(unsigned long, flags)
1356 __field(xfs_lsn_t, old_lsn)
1357 __field(xfs_lsn_t, new_lsn)
1360 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
1362 __entry->type = lip->li_type;
1363 __entry->flags = lip->li_flags;
1364 __entry->old_lsn = old_lsn;
1365 __entry->new_lsn = new_lsn;
1367 TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s",
1368 MAJOR(__entry->dev), MINOR(__entry->dev),
1370 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1371 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1372 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1373 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1376 #define DEFINE_AIL_EVENT(name) \
1377 DEFINE_EVENT(xfs_ail_class, name, \
1378 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1379 TP_ARGS(lip, old_lsn, new_lsn))
1380 DEFINE_AIL_EVENT(xfs_ail_insert);
1381 DEFINE_AIL_EVENT(xfs_ail_move);
1382 DEFINE_AIL_EVENT(xfs_ail_delete);
1384 TRACE_EVENT(xfs_log_assign_tail_lsn,
1385 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1386 TP_ARGS(log, new_lsn),
1389 __field(xfs_lsn_t, new_lsn)
1390 __field(xfs_lsn_t, old_lsn)
1391 __field(xfs_lsn_t, last_sync_lsn)
1394 __entry->dev = log->l_mp->m_super->s_dev;
1395 __entry->new_lsn = new_lsn;
1396 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1397 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1399 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1400 MAJOR(__entry->dev), MINOR(__entry->dev),
1401 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1402 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1403 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1406 DECLARE_EVENT_CLASS(xfs_file_class,
1407 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter),
1408 TP_ARGS(iocb, iter),
1411 __field(xfs_ino_t, ino)
1412 __field(xfs_fsize_t, size)
1413 __field(loff_t, offset)
1414 __field(size_t, count)
1417 __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
1418 __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
1419 __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size;
1420 __entry->offset = iocb->ki_pos;
1421 __entry->count = iov_iter_count(iter);
1423 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx",
1424 MAJOR(__entry->dev), MINOR(__entry->dev),
1431 #define DEFINE_RW_EVENT(name) \
1432 DEFINE_EVENT(xfs_file_class, name, \
1433 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), \
1434 TP_ARGS(iocb, iter))
1435 DEFINE_RW_EVENT(xfs_file_buffered_read);
1436 DEFINE_RW_EVENT(xfs_file_direct_read);
1437 DEFINE_RW_EVENT(xfs_file_dax_read);
1438 DEFINE_RW_EVENT(xfs_file_buffered_write);
1439 DEFINE_RW_EVENT(xfs_file_direct_write);
1440 DEFINE_RW_EVENT(xfs_file_dax_write);
1441 DEFINE_RW_EVENT(xfs_reflink_bounce_dio_write);
1443 DECLARE_EVENT_CLASS(xfs_imap_class,
1444 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1445 int whichfork, struct xfs_bmbt_irec *irec),
1446 TP_ARGS(ip, offset, count, whichfork, irec),
1449 __field(xfs_ino_t, ino)
1450 __field(loff_t, size)
1451 __field(loff_t, offset)
1452 __field(size_t, count)
1453 __field(int, whichfork)
1454 __field(xfs_fileoff_t, startoff)
1455 __field(xfs_fsblock_t, startblock)
1456 __field(xfs_filblks_t, blockcount)
1459 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1460 __entry->ino = ip->i_ino;
1461 __entry->size = ip->i_disk_size;
1462 __entry->offset = offset;
1463 __entry->count = count;
1464 __entry->whichfork = whichfork;
1465 __entry->startoff = irec ? irec->br_startoff : 0;
1466 __entry->startblock = irec ? irec->br_startblock : 0;
1467 __entry->blockcount = irec ? irec->br_blockcount : 0;
1469 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx "
1470 "fork %s startoff 0x%llx startblock 0x%llx fsbcount 0x%llx",
1471 MAJOR(__entry->dev), MINOR(__entry->dev),
1476 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
1478 (int64_t)__entry->startblock,
1479 __entry->blockcount)
1482 #define DEFINE_IMAP_EVENT(name) \
1483 DEFINE_EVENT(xfs_imap_class, name, \
1484 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1485 int whichfork, struct xfs_bmbt_irec *irec), \
1486 TP_ARGS(ip, offset, count, whichfork, irec))
1487 DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1488 DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1489 DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1490 DEFINE_IMAP_EVENT(xfs_iomap_found);
1492 DECLARE_EVENT_CLASS(xfs_simple_io_class,
1493 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1494 TP_ARGS(ip, offset, count),
1497 __field(xfs_ino_t, ino)
1498 __field(loff_t, isize)
1499 __field(loff_t, disize)
1500 __field(loff_t, offset)
1501 __field(size_t, count)
1504 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1505 __entry->ino = ip->i_ino;
1506 __entry->isize = VFS_I(ip)->i_size;
1507 __entry->disize = ip->i_disk_size;
1508 __entry->offset = offset;
1509 __entry->count = count;
1511 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1512 "pos 0x%llx bytecount 0x%zx",
1513 MAJOR(__entry->dev), MINOR(__entry->dev),
1521 #define DEFINE_SIMPLE_IO_EVENT(name) \
1522 DEFINE_EVENT(xfs_simple_io_class, name, \
1523 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1524 TP_ARGS(ip, offset, count))
1525 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1526 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1527 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1528 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1529 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1530 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1531 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1532 DEFINE_SIMPLE_IO_EVENT(xfs_file_splice_read);
1534 DECLARE_EVENT_CLASS(xfs_itrunc_class,
1535 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1536 TP_ARGS(ip, new_size),
1539 __field(xfs_ino_t, ino)
1540 __field(xfs_fsize_t, size)
1541 __field(xfs_fsize_t, new_size)
1544 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1545 __entry->ino = ip->i_ino;
1546 __entry->size = ip->i_disk_size;
1547 __entry->new_size = new_size;
1549 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx new_size 0x%llx",
1550 MAJOR(__entry->dev), MINOR(__entry->dev),
1556 #define DEFINE_ITRUNC_EVENT(name) \
1557 DEFINE_EVENT(xfs_itrunc_class, name, \
1558 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1559 TP_ARGS(ip, new_size))
1560 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1561 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1563 TRACE_EVENT(xfs_pagecache_inval,
1564 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1565 TP_ARGS(ip, start, finish),
1568 __field(xfs_ino_t, ino)
1569 __field(xfs_fsize_t, size)
1570 __field(xfs_off_t, start)
1571 __field(xfs_off_t, finish)
1574 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1575 __entry->ino = ip->i_ino;
1576 __entry->size = ip->i_disk_size;
1577 __entry->start = start;
1578 __entry->finish = finish;
1580 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx start 0x%llx finish 0x%llx",
1581 MAJOR(__entry->dev), MINOR(__entry->dev),
1588 TRACE_EVENT(xfs_bunmap,
1589 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t fileoff, xfs_filblks_t len,
1590 int flags, unsigned long caller_ip),
1591 TP_ARGS(ip, fileoff, len, flags, caller_ip),
1594 __field(xfs_ino_t, ino)
1595 __field(xfs_fsize_t, size)
1596 __field(xfs_fileoff_t, fileoff)
1597 __field(xfs_filblks_t, len)
1598 __field(unsigned long, caller_ip)
1602 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1603 __entry->ino = ip->i_ino;
1604 __entry->size = ip->i_disk_size;
1605 __entry->fileoff = fileoff;
1607 __entry->caller_ip = caller_ip;
1608 __entry->flags = flags;
1610 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx fileoff 0x%llx fsbcount 0x%llx "
1611 "flags %s caller %pS",
1612 MAJOR(__entry->dev), MINOR(__entry->dev),
1617 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1618 (void *)__entry->caller_ip)
1622 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1623 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1624 xfs_agblock_t agbno, xfs_extlen_t len),
1625 TP_ARGS(mp, agno, agbno, len),
1628 __field(xfs_agnumber_t, agno)
1629 __field(xfs_agblock_t, agbno)
1630 __field(xfs_extlen_t, len)
1633 __entry->dev = mp->m_super->s_dev;
1634 __entry->agno = agno;
1635 __entry->agbno = agbno;
1638 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
1639 MAJOR(__entry->dev), MINOR(__entry->dev),
1644 #define DEFINE_BUSY_EVENT(name) \
1645 DEFINE_EVENT(xfs_extent_busy_class, name, \
1646 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1647 xfs_agblock_t agbno, xfs_extlen_t len), \
1648 TP_ARGS(mp, agno, agbno, len))
1649 DEFINE_BUSY_EVENT(xfs_extent_busy);
1650 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1651 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1652 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1653 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1655 TRACE_EVENT(xfs_extent_busy_trim,
1656 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1657 xfs_agblock_t agbno, xfs_extlen_t len,
1658 xfs_agblock_t tbno, xfs_extlen_t tlen),
1659 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1662 __field(xfs_agnumber_t, agno)
1663 __field(xfs_agblock_t, agbno)
1664 __field(xfs_extlen_t, len)
1665 __field(xfs_agblock_t, tbno)
1666 __field(xfs_extlen_t, tlen)
1669 __entry->dev = mp->m_super->s_dev;
1670 __entry->agno = agno;
1671 __entry->agbno = agbno;
1673 __entry->tbno = tbno;
1674 __entry->tlen = tlen;
1676 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
1677 MAJOR(__entry->dev), MINOR(__entry->dev),
1685 DECLARE_EVENT_CLASS(xfs_agf_class,
1686 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1687 unsigned long caller_ip),
1688 TP_ARGS(mp, agf, flags, caller_ip),
1691 __field(xfs_agnumber_t, agno)
1693 __field(__u32, length)
1694 __field(__u32, bno_root)
1695 __field(__u32, cnt_root)
1696 __field(__u32, bno_level)
1697 __field(__u32, cnt_level)
1698 __field(__u32, flfirst)
1699 __field(__u32, fllast)
1700 __field(__u32, flcount)
1701 __field(__u32, freeblks)
1702 __field(__u32, longest)
1703 __field(unsigned long, caller_ip)
1706 __entry->dev = mp->m_super->s_dev;
1707 __entry->agno = be32_to_cpu(agf->agf_seqno),
1708 __entry->flags = flags;
1709 __entry->length = be32_to_cpu(agf->agf_length),
1710 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1711 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1712 __entry->bno_level =
1713 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1714 __entry->cnt_level =
1715 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1716 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1717 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1718 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1719 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1720 __entry->longest = be32_to_cpu(agf->agf_longest);
1721 __entry->caller_ip = caller_ip;
1723 TP_printk("dev %d:%d agno 0x%x flags %s length %u roots b %u c %u "
1724 "levels b %u c %u flfirst %u fllast %u flcount %u "
1725 "freeblks %u longest %u caller %pS",
1726 MAJOR(__entry->dev), MINOR(__entry->dev),
1728 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1739 (void *)__entry->caller_ip)
1741 #define DEFINE_AGF_EVENT(name) \
1742 DEFINE_EVENT(xfs_agf_class, name, \
1743 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1744 unsigned long caller_ip), \
1745 TP_ARGS(mp, agf, flags, caller_ip))
1746 DEFINE_AGF_EVENT(xfs_agf);
1747 DEFINE_AGF_EVENT(xfs_agfl_reset);
1749 TRACE_EVENT(xfs_free_extent,
1750 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1751 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1753 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
1756 __field(xfs_agnumber_t, agno)
1757 __field(xfs_agblock_t, agbno)
1758 __field(xfs_extlen_t, len)
1760 __field(int, haveleft)
1761 __field(int, haveright)
1764 __entry->dev = mp->m_super->s_dev;
1765 __entry->agno = agno;
1766 __entry->agbno = agbno;
1768 __entry->resv = resv;
1769 __entry->haveleft = haveleft;
1770 __entry->haveright = haveright;
1772 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x resv %d %s",
1773 MAJOR(__entry->dev), MINOR(__entry->dev),
1779 (__entry->haveright ? "both" : "left") :
1780 (__entry->haveright ? "right" : "none"))
1784 DECLARE_EVENT_CLASS(xfs_alloc_class,
1785 TP_PROTO(struct xfs_alloc_arg *args),
1789 __field(xfs_agnumber_t, agno)
1790 __field(xfs_agblock_t, agbno)
1791 __field(xfs_extlen_t, minlen)
1792 __field(xfs_extlen_t, maxlen)
1793 __field(xfs_extlen_t, mod)
1794 __field(xfs_extlen_t, prod)
1795 __field(xfs_extlen_t, minleft)
1796 __field(xfs_extlen_t, total)
1797 __field(xfs_extlen_t, alignment)
1798 __field(xfs_extlen_t, minalignslop)
1799 __field(xfs_extlen_t, len)
1800 __field(char, wasdel)
1801 __field(char, wasfromfl)
1803 __field(int, datatype)
1804 __field(xfs_agnumber_t, highest_agno)
1807 __entry->dev = args->mp->m_super->s_dev;
1808 __entry->agno = args->agno;
1809 __entry->agbno = args->agbno;
1810 __entry->minlen = args->minlen;
1811 __entry->maxlen = args->maxlen;
1812 __entry->mod = args->mod;
1813 __entry->prod = args->prod;
1814 __entry->minleft = args->minleft;
1815 __entry->total = args->total;
1816 __entry->alignment = args->alignment;
1817 __entry->minalignslop = args->minalignslop;
1818 __entry->len = args->len;
1819 __entry->wasdel = args->wasdel;
1820 __entry->wasfromfl = args->wasfromfl;
1821 __entry->resv = args->resv;
1822 __entry->datatype = args->datatype;
1823 __entry->highest_agno = args->tp->t_highest_agno;
1825 TP_printk("dev %d:%d agno 0x%x agbno 0x%x minlen %u maxlen %u mod %u "
1826 "prod %u minleft %u total %u alignment %u minalignslop %u "
1827 "len %u wasdel %d wasfromfl %d resv %d "
1828 "datatype 0x%x highest_agno 0x%x",
1829 MAJOR(__entry->dev), MINOR(__entry->dev),
1839 __entry->minalignslop,
1845 __entry->highest_agno)
1848 #define DEFINE_ALLOC_EVENT(name) \
1849 DEFINE_EVENT(xfs_alloc_class, name, \
1850 TP_PROTO(struct xfs_alloc_arg *args), \
1852 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1853 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1854 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1855 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1856 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1857 DEFINE_ALLOC_EVENT(xfs_alloc_cur);
1858 DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
1859 DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
1860 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
1861 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
1862 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1863 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1864 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1865 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1866 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1867 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1868 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1869 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1870 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1871 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1872 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1873 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1874 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1875 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1876 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_skip_deadlock);
1877 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1878 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1879 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1880 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1882 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_this_ag);
1883 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_start_ag);
1884 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_first_ag);
1885 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_exact_bno);
1886 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_near_bno);
1887 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_finish);
1889 TRACE_EVENT(xfs_alloc_cur_check,
1890 TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
1891 xfs_extlen_t len, xfs_extlen_t diff, bool new),
1892 TP_ARGS(mp, btnum, bno, len, diff, new),
1895 __field(xfs_btnum_t, btnum)
1896 __field(xfs_agblock_t, bno)
1897 __field(xfs_extlen_t, len)
1898 __field(xfs_extlen_t, diff)
1902 __entry->dev = mp->m_super->s_dev;
1903 __entry->btnum = btnum;
1906 __entry->diff = diff;
1909 TP_printk("dev %d:%d btree %s agbno 0x%x fsbcount 0x%x diff 0x%x new %d",
1910 MAJOR(__entry->dev), MINOR(__entry->dev),
1911 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
1912 __entry->bno, __entry->len, __entry->diff, __entry->new)
1915 DECLARE_EVENT_CLASS(xfs_da_class,
1916 TP_PROTO(struct xfs_da_args *args),
1920 __field(xfs_ino_t, ino)
1921 __dynamic_array(char, name, args->namelen)
1922 __field(int, namelen)
1923 __field(xfs_dahash_t, hashval)
1924 __field(xfs_ino_t, inumber)
1925 __field(uint32_t, op_flags)
1928 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1929 __entry->ino = args->dp->i_ino;
1931 memcpy(__get_str(name), args->name, args->namelen);
1932 __entry->namelen = args->namelen;
1933 __entry->hashval = args->hashval;
1934 __entry->inumber = args->inumber;
1935 __entry->op_flags = args->op_flags;
1937 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1938 "inumber 0x%llx op_flags %s",
1939 MAJOR(__entry->dev), MINOR(__entry->dev),
1942 __entry->namelen ? __get_str(name) : NULL,
1946 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1949 #define DEFINE_DIR2_EVENT(name) \
1950 DEFINE_EVENT(xfs_da_class, name, \
1951 TP_PROTO(struct xfs_da_args *args), \
1953 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1954 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1955 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1956 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1957 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1958 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1959 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1960 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1961 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1962 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1963 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1964 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1965 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1966 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1967 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1968 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1969 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1970 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1971 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1972 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1973 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1974 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1975 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1976 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1977 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1979 DECLARE_EVENT_CLASS(xfs_attr_class,
1980 TP_PROTO(struct xfs_da_args *args),
1984 __field(xfs_ino_t, ino)
1985 __dynamic_array(char, name, args->namelen)
1986 __field(int, namelen)
1987 __field(int, valuelen)
1988 __field(xfs_dahash_t, hashval)
1989 __field(unsigned int, attr_filter)
1990 __field(unsigned int, attr_flags)
1991 __field(uint32_t, op_flags)
1994 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1995 __entry->ino = args->dp->i_ino;
1997 memcpy(__get_str(name), args->name, args->namelen);
1998 __entry->namelen = args->namelen;
1999 __entry->valuelen = args->valuelen;
2000 __entry->hashval = args->hashval;
2001 __entry->attr_filter = args->attr_filter;
2002 __entry->attr_flags = args->attr_flags;
2003 __entry->op_flags = args->op_flags;
2005 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
2006 "hashval 0x%x filter %s flags %s op_flags %s",
2007 MAJOR(__entry->dev), MINOR(__entry->dev),
2010 __entry->namelen ? __get_str(name) : NULL,
2014 __print_flags(__entry->attr_filter, "|",
2015 XFS_ATTR_FILTER_FLAGS),
2016 __print_flags(__entry->attr_flags, "|",
2017 { XATTR_CREATE, "CREATE" },
2018 { XATTR_REPLACE, "REPLACE" }),
2019 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
2022 #define DEFINE_ATTR_EVENT(name) \
2023 DEFINE_EVENT(xfs_attr_class, name, \
2024 TP_PROTO(struct xfs_da_args *args), \
2026 DEFINE_ATTR_EVENT(xfs_attr_sf_add);
2027 DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
2028 DEFINE_ATTR_EVENT(xfs_attr_sf_create);
2029 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
2030 DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
2031 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
2033 DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
2034 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
2035 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
2036 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
2037 DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
2038 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
2039 DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
2040 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
2041 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
2042 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
2043 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
2044 DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
2045 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
2046 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
2047 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
2048 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
2049 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
2050 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
2051 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
2052 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
2053 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
2054 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
2056 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
2057 DEFINE_ATTR_EVENT(xfs_attr_node_get);
2058 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
2059 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
2061 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
2062 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
2064 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
2065 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
2067 #define DEFINE_DA_EVENT(name) \
2068 DEFINE_EVENT(xfs_da_class, name, \
2069 TP_PROTO(struct xfs_da_args *args), \
2071 DEFINE_DA_EVENT(xfs_da_split);
2072 DEFINE_DA_EVENT(xfs_da_join);
2073 DEFINE_DA_EVENT(xfs_da_link_before);
2074 DEFINE_DA_EVENT(xfs_da_link_after);
2075 DEFINE_DA_EVENT(xfs_da_unlink_back);
2076 DEFINE_DA_EVENT(xfs_da_unlink_forward);
2077 DEFINE_DA_EVENT(xfs_da_root_split);
2078 DEFINE_DA_EVENT(xfs_da_root_join);
2079 DEFINE_DA_EVENT(xfs_da_node_add);
2080 DEFINE_DA_EVENT(xfs_da_node_create);
2081 DEFINE_DA_EVENT(xfs_da_node_split);
2082 DEFINE_DA_EVENT(xfs_da_node_remove);
2083 DEFINE_DA_EVENT(xfs_da_node_rebalance);
2084 DEFINE_DA_EVENT(xfs_da_node_unbalance);
2085 DEFINE_DA_EVENT(xfs_da_node_toosmall);
2086 DEFINE_DA_EVENT(xfs_da_swap_lastblock);
2087 DEFINE_DA_EVENT(xfs_da_grow_inode);
2088 DEFINE_DA_EVENT(xfs_da_shrink_inode);
2089 DEFINE_DA_EVENT(xfs_da_fixhashpath);
2090 DEFINE_DA_EVENT(xfs_da_path_shift);
2092 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
2093 TP_PROTO(struct xfs_da_args *args, int idx),
2097 __field(xfs_ino_t, ino)
2098 __field(uint32_t, op_flags)
2102 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2103 __entry->ino = args->dp->i_ino;
2104 __entry->op_flags = args->op_flags;
2107 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
2108 MAJOR(__entry->dev), MINOR(__entry->dev),
2110 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2114 #define DEFINE_DIR2_SPACE_EVENT(name) \
2115 DEFINE_EVENT(xfs_dir2_space_class, name, \
2116 TP_PROTO(struct xfs_da_args *args, int idx), \
2118 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
2119 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
2120 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
2121 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
2123 TRACE_EVENT(xfs_dir2_leafn_moveents,
2124 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
2125 TP_ARGS(args, src_idx, dst_idx, count),
2128 __field(xfs_ino_t, ino)
2129 __field(uint32_t, op_flags)
2130 __field(int, src_idx)
2131 __field(int, dst_idx)
2135 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2136 __entry->ino = args->dp->i_ino;
2137 __entry->op_flags = args->op_flags;
2138 __entry->src_idx = src_idx;
2139 __entry->dst_idx = dst_idx;
2140 __entry->count = count;
2142 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
2143 "src_idx %d dst_idx %d count %d",
2144 MAJOR(__entry->dev), MINOR(__entry->dev),
2146 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2152 #define XFS_SWAPEXT_INODES \
2156 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
2157 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
2158 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
2159 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
2160 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
2162 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
2163 TP_PROTO(struct xfs_inode *ip, int which),
2168 __field(xfs_ino_t, ino)
2169 __field(int, format)
2170 __field(xfs_extnum_t, nex)
2171 __field(int, broot_size)
2172 __field(int, fork_off)
2175 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2176 __entry->which = which;
2177 __entry->ino = ip->i_ino;
2178 __entry->format = ip->i_df.if_format;
2179 __entry->nex = ip->i_df.if_nextents;
2180 __entry->broot_size = ip->i_df.if_broot_bytes;
2181 __entry->fork_off = xfs_inode_fork_boff(ip);
2183 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %llu, "
2184 "broot size %d, forkoff 0x%x",
2185 MAJOR(__entry->dev), MINOR(__entry->dev),
2187 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
2188 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
2190 __entry->broot_size,
2194 #define DEFINE_SWAPEXT_EVENT(name) \
2195 DEFINE_EVENT(xfs_swap_extent_class, name, \
2196 TP_PROTO(struct xfs_inode *ip, int which), \
2199 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
2200 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
2202 TRACE_EVENT(xfs_log_recover,
2203 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
2204 TP_ARGS(log, headblk, tailblk),
2207 __field(xfs_daddr_t, headblk)
2208 __field(xfs_daddr_t, tailblk)
2211 __entry->dev = log->l_mp->m_super->s_dev;
2212 __entry->headblk = headblk;
2213 __entry->tailblk = tailblk;
2215 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2216 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2220 TRACE_EVENT(xfs_log_recover_record,
2221 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2222 TP_ARGS(log, rhead, pass),
2225 __field(xfs_lsn_t, lsn)
2227 __field(int, num_logops)
2231 __entry->dev = log->l_mp->m_super->s_dev;
2232 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2233 __entry->len = be32_to_cpu(rhead->h_len);
2234 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2235 __entry->pass = pass;
2237 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2238 MAJOR(__entry->dev), MINOR(__entry->dev),
2239 __entry->lsn, __entry->len, __entry->num_logops,
2243 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2244 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2245 struct xlog_recover_item *item, int pass),
2246 TP_ARGS(log, trans, item, pass),
2249 __field(unsigned long, item)
2250 __field(xlog_tid_t, tid)
2251 __field(xfs_lsn_t, lsn)
2258 __entry->dev = log->l_mp->m_super->s_dev;
2259 __entry->item = (unsigned long)item;
2260 __entry->tid = trans->r_log_tid;
2261 __entry->lsn = trans->r_lsn;
2262 __entry->type = ITEM_TYPE(item);
2263 __entry->pass = pass;
2264 __entry->count = item->ri_cnt;
2265 __entry->total = item->ri_total;
2267 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
2268 "item type %s item region count/total %d/%d",
2269 MAJOR(__entry->dev), MINOR(__entry->dev),
2273 (void *)__entry->item,
2274 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2279 #define DEFINE_LOG_RECOVER_ITEM(name) \
2280 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2281 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2282 struct xlog_recover_item *item, int pass), \
2283 TP_ARGS(log, trans, item, pass))
2285 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2286 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2287 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2288 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2289 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2291 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2292 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2293 TP_ARGS(log, buf_f),
2296 __field(int64_t, blkno)
2297 __field(unsigned short, len)
2298 __field(unsigned short, flags)
2299 __field(unsigned short, size)
2300 __field(unsigned int, map_size)
2303 __entry->dev = log->l_mp->m_super->s_dev;
2304 __entry->blkno = buf_f->blf_blkno;
2305 __entry->len = buf_f->blf_len;
2306 __entry->flags = buf_f->blf_flags;
2307 __entry->size = buf_f->blf_size;
2308 __entry->map_size = buf_f->blf_map_size;
2310 TP_printk("dev %d:%d daddr 0x%llx, bbcount 0x%x, flags 0x%x, size %d, "
2312 MAJOR(__entry->dev), MINOR(__entry->dev),
2320 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2321 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2322 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2323 TP_ARGS(log, buf_f))
2325 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2326 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2327 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2328 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2329 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2330 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2331 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2332 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2333 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2335 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2336 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2340 __field(xfs_ino_t, ino)
2341 __field(unsigned short, size)
2342 __field(int, fields)
2343 __field(unsigned short, asize)
2344 __field(unsigned short, dsize)
2345 __field(int64_t, blkno)
2347 __field(int, boffset)
2350 __entry->dev = log->l_mp->m_super->s_dev;
2351 __entry->ino = in_f->ilf_ino;
2352 __entry->size = in_f->ilf_size;
2353 __entry->fields = in_f->ilf_fields;
2354 __entry->asize = in_f->ilf_asize;
2355 __entry->dsize = in_f->ilf_dsize;
2356 __entry->blkno = in_f->ilf_blkno;
2357 __entry->len = in_f->ilf_len;
2358 __entry->boffset = in_f->ilf_boffset;
2360 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2361 "dsize %d, daddr 0x%llx, bbcount 0x%x, boffset %d",
2362 MAJOR(__entry->dev), MINOR(__entry->dev),
2372 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2373 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2374 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2377 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2378 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2379 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2381 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2382 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2386 __field(xfs_agnumber_t, agno)
2387 __field(xfs_agblock_t, agbno)
2388 __field(unsigned int, count)
2389 __field(unsigned int, isize)
2390 __field(xfs_agblock_t, length)
2391 __field(unsigned int, gen)
2394 __entry->dev = log->l_mp->m_super->s_dev;
2395 __entry->agno = be32_to_cpu(in_f->icl_ag);
2396 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2397 __entry->count = be32_to_cpu(in_f->icl_count);
2398 __entry->isize = be32_to_cpu(in_f->icl_isize);
2399 __entry->length = be32_to_cpu(in_f->icl_length);
2400 __entry->gen = be32_to_cpu(in_f->icl_gen);
2402 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x ireccount %u isize %u gen 0x%x",
2403 MAJOR(__entry->dev), MINOR(__entry->dev),
2411 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2412 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2413 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2416 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2417 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2419 DECLARE_EVENT_CLASS(xfs_discard_class,
2420 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2421 xfs_agblock_t agbno, xfs_extlen_t len),
2422 TP_ARGS(mp, agno, agbno, len),
2425 __field(xfs_agnumber_t, agno)
2426 __field(xfs_agblock_t, agbno)
2427 __field(xfs_extlen_t, len)
2430 __entry->dev = mp->m_super->s_dev;
2431 __entry->agno = agno;
2432 __entry->agbno = agbno;
2435 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
2436 MAJOR(__entry->dev), MINOR(__entry->dev),
2442 #define DEFINE_DISCARD_EVENT(name) \
2443 DEFINE_EVENT(xfs_discard_class, name, \
2444 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2445 xfs_agblock_t agbno, xfs_extlen_t len), \
2446 TP_ARGS(mp, agno, agbno, len))
2447 DEFINE_DISCARD_EVENT(xfs_discard_extent);
2448 DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2449 DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2450 DEFINE_DISCARD_EVENT(xfs_discard_busy);
2452 /* btree cursor events */
2453 TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2454 TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2455 TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2456 TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2457 TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2458 TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2459 TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2461 DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2462 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2463 TP_ARGS(cur, level, bp),
2466 __field(xfs_btnum_t, btnum)
2468 __field(int, nlevels)
2470 __field(xfs_daddr_t, daddr)
2473 __entry->dev = cur->bc_mp->m_super->s_dev;
2474 __entry->btnum = cur->bc_btnum;
2475 __entry->level = level;
2476 __entry->nlevels = cur->bc_nlevels;
2477 __entry->ptr = cur->bc_levels[level].ptr;
2478 __entry->daddr = bp ? xfs_buf_daddr(bp) : -1;
2480 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
2481 MAJOR(__entry->dev), MINOR(__entry->dev),
2482 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
2486 (unsigned long long)__entry->daddr)
2489 #define DEFINE_BTREE_CUR_EVENT(name) \
2490 DEFINE_EVENT(xfs_btree_cur_class, name, \
2491 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2492 TP_ARGS(cur, level, bp))
2493 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2494 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2497 struct xfs_defer_pending;
2499 DECLARE_EVENT_CLASS(xfs_defer_class,
2500 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2501 TP_ARGS(tp, caller_ip),
2504 __field(struct xfs_trans *, tp)
2505 __field(char, committed)
2506 __field(unsigned long, caller_ip)
2509 __entry->dev = tp->t_mountp->m_super->s_dev;
2511 __entry->caller_ip = caller_ip;
2513 TP_printk("dev %d:%d tp %p caller %pS",
2514 MAJOR(__entry->dev), MINOR(__entry->dev),
2516 (char *)__entry->caller_ip)
2518 #define DEFINE_DEFER_EVENT(name) \
2519 DEFINE_EVENT(xfs_defer_class, name, \
2520 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2521 TP_ARGS(tp, caller_ip))
2523 DECLARE_EVENT_CLASS(xfs_defer_error_class,
2524 TP_PROTO(struct xfs_trans *tp, int error),
2528 __field(struct xfs_trans *, tp)
2529 __field(char, committed)
2533 __entry->dev = tp->t_mountp->m_super->s_dev;
2535 __entry->error = error;
2537 TP_printk("dev %d:%d tp %p err %d",
2538 MAJOR(__entry->dev), MINOR(__entry->dev),
2542 #define DEFINE_DEFER_ERROR_EVENT(name) \
2543 DEFINE_EVENT(xfs_defer_error_class, name, \
2544 TP_PROTO(struct xfs_trans *tp, int error), \
2547 DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2548 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2553 __field(void *, intent)
2554 __field(char, committed)
2558 __entry->dev = mp ? mp->m_super->s_dev : 0;
2559 __entry->type = dfp->dfp_type;
2560 __entry->intent = dfp->dfp_intent;
2561 __entry->committed = dfp->dfp_done != NULL;
2562 __entry->nr = dfp->dfp_count;
2564 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
2565 MAJOR(__entry->dev), MINOR(__entry->dev),
2571 #define DEFINE_DEFER_PENDING_EVENT(name) \
2572 DEFINE_EVENT(xfs_defer_pending_class, name, \
2573 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2576 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2577 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2578 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2579 TP_ARGS(mp, agno, type, agbno, len),
2582 __field(xfs_agnumber_t, agno)
2584 __field(xfs_agblock_t, agbno)
2585 __field(xfs_extlen_t, len)
2588 __entry->dev = mp->m_super->s_dev;
2589 __entry->agno = agno;
2590 __entry->type = type;
2591 __entry->agbno = agbno;
2594 TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x fsbcount 0x%x",
2595 MAJOR(__entry->dev), MINOR(__entry->dev),
2601 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2602 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2603 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2605 xfs_agblock_t bno, \
2606 xfs_extlen_t len), \
2607 TP_ARGS(mp, agno, type, bno, len))
2609 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2610 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2612 xfs_agblock_t agbno,
2615 xfs_fileoff_t offset,
2617 xfs_exntst_t state),
2618 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2621 __field(xfs_agnumber_t, agno)
2622 __field(xfs_ino_t, ino)
2623 __field(xfs_agblock_t, agbno)
2624 __field(int, whichfork)
2625 __field(xfs_fileoff_t, l_loff)
2626 __field(xfs_filblks_t, l_len)
2627 __field(xfs_exntst_t, l_state)
2631 __entry->dev = mp->m_super->s_dev;
2632 __entry->agno = agno;
2634 __entry->agbno = agbno;
2635 __entry->whichfork = whichfork;
2636 __entry->l_loff = offset;
2637 __entry->l_len = len;
2638 __entry->l_state = state;
2641 TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x owner 0x%llx %s fileoff 0x%llx fsbcount 0x%llx state %d",
2642 MAJOR(__entry->dev), MINOR(__entry->dev),
2647 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
2652 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2653 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2654 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2656 xfs_agblock_t agbno, \
2659 xfs_fileoff_t offset, \
2660 xfs_filblks_t len, \
2661 xfs_exntst_t state), \
2662 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2664 DEFINE_DEFER_EVENT(xfs_defer_cancel);
2665 DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2666 DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2667 DEFINE_DEFER_EVENT(xfs_defer_finish);
2668 DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2670 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2671 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2673 DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2674 DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
2675 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2676 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2677 DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent);
2679 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2680 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2681 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2682 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2683 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
2685 DECLARE_EVENT_CLASS(xfs_defer_pending_item_class,
2686 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp,
2688 TP_ARGS(mp, dfp, item),
2692 __field(void *, intent)
2693 __field(void *, item)
2694 __field(char, committed)
2698 __entry->dev = mp ? mp->m_super->s_dev : 0;
2699 __entry->type = dfp->dfp_type;
2700 __entry->intent = dfp->dfp_intent;
2701 __entry->item = item;
2702 __entry->committed = dfp->dfp_done != NULL;
2703 __entry->nr = dfp->dfp_count;
2705 TP_printk("dev %d:%d optype %d intent %p item %p committed %d nr %d",
2706 MAJOR(__entry->dev), MINOR(__entry->dev),
2713 #define DEFINE_DEFER_PENDING_ITEM_EVENT(name) \
2714 DEFINE_EVENT(xfs_defer_pending_item_class, name, \
2715 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp, \
2717 TP_ARGS(mp, dfp, item))
2719 DEFINE_DEFER_PENDING_ITEM_EVENT(xfs_defer_add_item);
2720 DEFINE_DEFER_PENDING_ITEM_EVENT(xfs_defer_cancel_item);
2721 DEFINE_DEFER_PENDING_ITEM_EVENT(xfs_defer_finish_item);
2723 /* rmap tracepoints */
2724 DECLARE_EVENT_CLASS(xfs_rmap_class,
2725 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2726 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2727 const struct xfs_owner_info *oinfo),
2728 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2731 __field(xfs_agnumber_t, agno)
2732 __field(xfs_agblock_t, agbno)
2733 __field(xfs_extlen_t, len)
2734 __field(uint64_t, owner)
2735 __field(uint64_t, offset)
2736 __field(unsigned long, flags)
2739 __entry->dev = mp->m_super->s_dev;
2740 __entry->agno = agno;
2741 __entry->agbno = agbno;
2743 __entry->owner = oinfo->oi_owner;
2744 __entry->offset = oinfo->oi_offset;
2745 __entry->flags = oinfo->oi_flags;
2747 __entry->flags |= XFS_RMAP_UNWRITTEN;
2749 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%lx",
2750 MAJOR(__entry->dev), MINOR(__entry->dev),
2758 #define DEFINE_RMAP_EVENT(name) \
2759 DEFINE_EVENT(xfs_rmap_class, name, \
2760 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2761 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2762 const struct xfs_owner_info *oinfo), \
2763 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2765 /* simple AG-based error/%ip tracepoint class */
2766 DECLARE_EVENT_CLASS(xfs_ag_error_class,
2767 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2768 unsigned long caller_ip),
2769 TP_ARGS(mp, agno, error, caller_ip),
2772 __field(xfs_agnumber_t, agno)
2774 __field(unsigned long, caller_ip)
2777 __entry->dev = mp->m_super->s_dev;
2778 __entry->agno = agno;
2779 __entry->error = error;
2780 __entry->caller_ip = caller_ip;
2782 TP_printk("dev %d:%d agno 0x%x error %d caller %pS",
2783 MAJOR(__entry->dev), MINOR(__entry->dev),
2786 (char *)__entry->caller_ip)
2789 #define DEFINE_AG_ERROR_EVENT(name) \
2790 DEFINE_EVENT(xfs_ag_error_class, name, \
2791 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2792 unsigned long caller_ip), \
2793 TP_ARGS(mp, agno, error, caller_ip))
2795 DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2796 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2797 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2798 DEFINE_RMAP_EVENT(xfs_rmap_map);
2799 DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2800 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2801 DEFINE_RMAP_EVENT(xfs_rmap_convert);
2802 DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2803 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2804 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
2806 DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2807 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2808 xfs_agblock_t agbno, xfs_extlen_t len,
2809 uint64_t owner, uint64_t offset, unsigned int flags),
2810 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2813 __field(xfs_agnumber_t, agno)
2814 __field(xfs_agblock_t, agbno)
2815 __field(xfs_extlen_t, len)
2816 __field(uint64_t, owner)
2817 __field(uint64_t, offset)
2818 __field(unsigned int, flags)
2821 __entry->dev = mp->m_super->s_dev;
2822 __entry->agno = agno;
2823 __entry->agbno = agbno;
2825 __entry->owner = owner;
2826 __entry->offset = offset;
2827 __entry->flags = flags;
2829 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
2830 MAJOR(__entry->dev), MINOR(__entry->dev),
2838 #define DEFINE_RMAPBT_EVENT(name) \
2839 DEFINE_EVENT(xfs_rmapbt_class, name, \
2840 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2841 xfs_agblock_t agbno, xfs_extlen_t len, \
2842 uint64_t owner, uint64_t offset, unsigned int flags), \
2843 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2845 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2846 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2847 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2849 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2850 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
2851 DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2852 DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2853 DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2854 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2855 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2856 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
2858 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2859 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2860 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2861 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
2862 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2863 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
2864 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
2866 /* deferred bmbt updates */
2867 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2868 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2869 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2871 /* per-AG reservation */
2872 DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2873 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2875 TP_ARGS(pag, resv, len),
2878 __field(xfs_agnumber_t, agno)
2880 __field(xfs_extlen_t, freeblks)
2881 __field(xfs_extlen_t, flcount)
2882 __field(xfs_extlen_t, reserved)
2883 __field(xfs_extlen_t, asked)
2884 __field(xfs_extlen_t, len)
2887 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2889 __entry->dev = pag->pag_mount->m_super->s_dev;
2890 __entry->agno = pag->pag_agno;
2891 __entry->resv = resv;
2892 __entry->freeblks = pag->pagf_freeblks;
2893 __entry->flcount = pag->pagf_flcount;
2894 __entry->reserved = r ? r->ar_reserved : 0;
2895 __entry->asked = r ? r->ar_asked : 0;
2898 TP_printk("dev %d:%d agno 0x%x resv %d freeblks %u flcount %u "
2899 "resv %u ask %u len %u",
2900 MAJOR(__entry->dev), MINOR(__entry->dev),
2909 #define DEFINE_AG_RESV_EVENT(name) \
2910 DEFINE_EVENT(xfs_ag_resv_class, name, \
2911 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2912 xfs_extlen_t len), \
2913 TP_ARGS(pag, type, len))
2915 /* per-AG reservation tracepoints */
2916 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2917 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2918 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2919 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2920 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2921 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2923 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2924 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2926 /* refcount tracepoint classes */
2928 /* reuse the discard trace class for agbno/aglen-based traces */
2929 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2931 /* ag btree lookup tracepoint class */
2932 TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2933 TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2934 TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
2935 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2936 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2937 xfs_agblock_t agbno, xfs_lookup_t dir),
2938 TP_ARGS(mp, agno, agbno, dir),
2941 __field(xfs_agnumber_t, agno)
2942 __field(xfs_agblock_t, agbno)
2943 __field(xfs_lookup_t, dir)
2946 __entry->dev = mp->m_super->s_dev;
2947 __entry->agno = agno;
2948 __entry->agbno = agbno;
2951 TP_printk("dev %d:%d agno 0x%x agbno 0x%x cmp %s(%d)",
2952 MAJOR(__entry->dev), MINOR(__entry->dev),
2955 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2959 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2960 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2961 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2962 xfs_agblock_t agbno, xfs_lookup_t dir), \
2963 TP_ARGS(mp, agno, agbno, dir))
2965 /* single-rcext tracepoint class */
2966 DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2967 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2968 struct xfs_refcount_irec *irec),
2969 TP_ARGS(mp, agno, irec),
2972 __field(xfs_agnumber_t, agno)
2973 __field(enum xfs_refc_domain, domain)
2974 __field(xfs_agblock_t, startblock)
2975 __field(xfs_extlen_t, blockcount)
2976 __field(xfs_nlink_t, refcount)
2979 __entry->dev = mp->m_super->s_dev;
2980 __entry->agno = agno;
2981 __entry->domain = irec->rc_domain;
2982 __entry->startblock = irec->rc_startblock;
2983 __entry->blockcount = irec->rc_blockcount;
2984 __entry->refcount = irec->rc_refcount;
2986 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u",
2987 MAJOR(__entry->dev), MINOR(__entry->dev),
2989 __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
2990 __entry->startblock,
2991 __entry->blockcount,
2995 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2996 DEFINE_EVENT(xfs_refcount_extent_class, name, \
2997 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2998 struct xfs_refcount_irec *irec), \
2999 TP_ARGS(mp, agno, irec))
3001 /* single-rcext and an agbno tracepoint class */
3002 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
3003 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3004 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
3005 TP_ARGS(mp, agno, irec, agbno),
3008 __field(xfs_agnumber_t, agno)
3009 __field(enum xfs_refc_domain, domain)
3010 __field(xfs_agblock_t, startblock)
3011 __field(xfs_extlen_t, blockcount)
3012 __field(xfs_nlink_t, refcount)
3013 __field(xfs_agblock_t, agbno)
3016 __entry->dev = mp->m_super->s_dev;
3017 __entry->agno = agno;
3018 __entry->domain = irec->rc_domain;
3019 __entry->startblock = irec->rc_startblock;
3020 __entry->blockcount = irec->rc_blockcount;
3021 __entry->refcount = irec->rc_refcount;
3022 __entry->agbno = agbno;
3024 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
3025 MAJOR(__entry->dev), MINOR(__entry->dev),
3027 __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
3028 __entry->startblock,
3029 __entry->blockcount,
3034 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
3035 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
3036 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3037 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
3038 TP_ARGS(mp, agno, irec, agbno))
3040 /* double-rcext tracepoint class */
3041 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
3042 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3043 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
3044 TP_ARGS(mp, agno, i1, i2),
3047 __field(xfs_agnumber_t, agno)
3048 __field(enum xfs_refc_domain, i1_domain)
3049 __field(xfs_agblock_t, i1_startblock)
3050 __field(xfs_extlen_t, i1_blockcount)
3051 __field(xfs_nlink_t, i1_refcount)
3052 __field(enum xfs_refc_domain, i2_domain)
3053 __field(xfs_agblock_t, i2_startblock)
3054 __field(xfs_extlen_t, i2_blockcount)
3055 __field(xfs_nlink_t, i2_refcount)
3058 __entry->dev = mp->m_super->s_dev;
3059 __entry->agno = agno;
3060 __entry->i1_domain = i1->rc_domain;
3061 __entry->i1_startblock = i1->rc_startblock;
3062 __entry->i1_blockcount = i1->rc_blockcount;
3063 __entry->i1_refcount = i1->rc_refcount;
3064 __entry->i2_domain = i2->rc_domain;
3065 __entry->i2_startblock = i2->rc_startblock;
3066 __entry->i2_blockcount = i2->rc_blockcount;
3067 __entry->i2_refcount = i2->rc_refcount;
3069 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3070 "dom %s agbno 0x%x fsbcount 0x%x refcount %u",
3071 MAJOR(__entry->dev), MINOR(__entry->dev),
3073 __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
3074 __entry->i1_startblock,
3075 __entry->i1_blockcount,
3076 __entry->i1_refcount,
3077 __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
3078 __entry->i2_startblock,
3079 __entry->i2_blockcount,
3080 __entry->i2_refcount)
3083 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
3084 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
3085 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3086 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
3087 TP_ARGS(mp, agno, i1, i2))
3089 /* double-rcext and an agbno tracepoint class */
3090 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
3091 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3092 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3093 xfs_agblock_t agbno),
3094 TP_ARGS(mp, agno, i1, i2, agbno),
3097 __field(xfs_agnumber_t, agno)
3098 __field(enum xfs_refc_domain, i1_domain)
3099 __field(xfs_agblock_t, i1_startblock)
3100 __field(xfs_extlen_t, i1_blockcount)
3101 __field(xfs_nlink_t, i1_refcount)
3102 __field(enum xfs_refc_domain, i2_domain)
3103 __field(xfs_agblock_t, i2_startblock)
3104 __field(xfs_extlen_t, i2_blockcount)
3105 __field(xfs_nlink_t, i2_refcount)
3106 __field(xfs_agblock_t, agbno)
3109 __entry->dev = mp->m_super->s_dev;
3110 __entry->agno = agno;
3111 __entry->i1_domain = i1->rc_domain;
3112 __entry->i1_startblock = i1->rc_startblock;
3113 __entry->i1_blockcount = i1->rc_blockcount;
3114 __entry->i1_refcount = i1->rc_refcount;
3115 __entry->i2_domain = i2->rc_domain;
3116 __entry->i2_startblock = i2->rc_startblock;
3117 __entry->i2_blockcount = i2->rc_blockcount;
3118 __entry->i2_refcount = i2->rc_refcount;
3119 __entry->agbno = agbno;
3121 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3122 "dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
3123 MAJOR(__entry->dev), MINOR(__entry->dev),
3125 __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
3126 __entry->i1_startblock,
3127 __entry->i1_blockcount,
3128 __entry->i1_refcount,
3129 __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
3130 __entry->i2_startblock,
3131 __entry->i2_blockcount,
3132 __entry->i2_refcount,
3136 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
3137 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
3138 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3139 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3140 xfs_agblock_t agbno), \
3141 TP_ARGS(mp, agno, i1, i2, agbno))
3143 /* triple-rcext tracepoint class */
3144 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
3145 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3146 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3147 struct xfs_refcount_irec *i3),
3148 TP_ARGS(mp, agno, i1, i2, i3),
3151 __field(xfs_agnumber_t, agno)
3152 __field(enum xfs_refc_domain, i1_domain)
3153 __field(xfs_agblock_t, i1_startblock)
3154 __field(xfs_extlen_t, i1_blockcount)
3155 __field(xfs_nlink_t, i1_refcount)
3156 __field(enum xfs_refc_domain, i2_domain)
3157 __field(xfs_agblock_t, i2_startblock)
3158 __field(xfs_extlen_t, i2_blockcount)
3159 __field(xfs_nlink_t, i2_refcount)
3160 __field(enum xfs_refc_domain, i3_domain)
3161 __field(xfs_agblock_t, i3_startblock)
3162 __field(xfs_extlen_t, i3_blockcount)
3163 __field(xfs_nlink_t, i3_refcount)
3166 __entry->dev = mp->m_super->s_dev;
3167 __entry->agno = agno;
3168 __entry->i1_domain = i1->rc_domain;
3169 __entry->i1_startblock = i1->rc_startblock;
3170 __entry->i1_blockcount = i1->rc_blockcount;
3171 __entry->i1_refcount = i1->rc_refcount;
3172 __entry->i2_domain = i2->rc_domain;
3173 __entry->i2_startblock = i2->rc_startblock;
3174 __entry->i2_blockcount = i2->rc_blockcount;
3175 __entry->i2_refcount = i2->rc_refcount;
3176 __entry->i3_domain = i3->rc_domain;
3177 __entry->i3_startblock = i3->rc_startblock;
3178 __entry->i3_blockcount = i3->rc_blockcount;
3179 __entry->i3_refcount = i3->rc_refcount;
3181 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3182 "dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3183 "dom %s agbno 0x%x fsbcount 0x%x refcount %u",
3184 MAJOR(__entry->dev), MINOR(__entry->dev),
3186 __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
3187 __entry->i1_startblock,
3188 __entry->i1_blockcount,
3189 __entry->i1_refcount,
3190 __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
3191 __entry->i2_startblock,
3192 __entry->i2_blockcount,
3193 __entry->i2_refcount,
3194 __print_symbolic(__entry->i3_domain, XFS_REFC_DOMAIN_STRINGS),
3195 __entry->i3_startblock,
3196 __entry->i3_blockcount,
3197 __entry->i3_refcount)
3200 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
3201 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
3202 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3203 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3204 struct xfs_refcount_irec *i3), \
3205 TP_ARGS(mp, agno, i1, i2, i3))
3207 /* refcount btree tracepoints */
3208 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
3209 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
3210 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
3211 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
3212 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
3213 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
3214 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
3215 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
3216 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
3217 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
3219 /* refcount adjustment tracepoints */
3220 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
3221 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
3222 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
3223 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
3224 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
3225 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
3226 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
3227 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
3228 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
3229 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
3230 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
3231 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
3232 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
3233 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
3234 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
3235 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
3236 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
3237 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
3238 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
3239 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
3240 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
3242 /* reflink helpers */
3243 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
3244 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
3245 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
3246 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
3247 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
3248 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
3250 TRACE_EVENT(xfs_refcount_finish_one_leftover,
3251 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3252 int type, xfs_agblock_t agbno, xfs_extlen_t len),
3253 TP_ARGS(mp, agno, type, agbno, len),
3256 __field(xfs_agnumber_t, agno)
3258 __field(xfs_agblock_t, agbno)
3259 __field(xfs_extlen_t, len)
3262 __entry->dev = mp->m_super->s_dev;
3263 __entry->agno = agno;
3264 __entry->type = type;
3265 __entry->agbno = agbno;
3268 TP_printk("dev %d:%d type %d agno 0x%x agbno 0x%x fsbcount 0x%x",
3269 MAJOR(__entry->dev), MINOR(__entry->dev),
3276 /* simple inode-based error/%ip tracepoint class */
3277 DECLARE_EVENT_CLASS(xfs_inode_error_class,
3278 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3279 TP_ARGS(ip, error, caller_ip),
3282 __field(xfs_ino_t, ino)
3284 __field(unsigned long, caller_ip)
3287 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3288 __entry->ino = ip->i_ino;
3289 __entry->error = error;
3290 __entry->caller_ip = caller_ip;
3292 TP_printk("dev %d:%d ino 0x%llx error %d caller %pS",
3293 MAJOR(__entry->dev), MINOR(__entry->dev),
3296 (char *)__entry->caller_ip)
3299 #define DEFINE_INODE_ERROR_EVENT(name) \
3300 DEFINE_EVENT(xfs_inode_error_class, name, \
3301 TP_PROTO(struct xfs_inode *ip, int error, \
3302 unsigned long caller_ip), \
3303 TP_ARGS(ip, error, caller_ip))
3305 /* reflink tracepoint classes */
3307 /* two-file io tracepoint class */
3308 DECLARE_EVENT_CLASS(xfs_double_io_class,
3309 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3310 struct xfs_inode *dest, xfs_off_t doffset),
3311 TP_ARGS(src, soffset, len, dest, doffset),
3314 __field(xfs_ino_t, src_ino)
3315 __field(loff_t, src_isize)
3316 __field(loff_t, src_disize)
3317 __field(loff_t, src_offset)
3318 __field(long long, len)
3319 __field(xfs_ino_t, dest_ino)
3320 __field(loff_t, dest_isize)
3321 __field(loff_t, dest_disize)
3322 __field(loff_t, dest_offset)
3325 __entry->dev = VFS_I(src)->i_sb->s_dev;
3326 __entry->src_ino = src->i_ino;
3327 __entry->src_isize = VFS_I(src)->i_size;
3328 __entry->src_disize = src->i_disk_size;
3329 __entry->src_offset = soffset;
3331 __entry->dest_ino = dest->i_ino;
3332 __entry->dest_isize = VFS_I(dest)->i_size;
3333 __entry->dest_disize = dest->i_disk_size;
3334 __entry->dest_offset = doffset;
3336 TP_printk("dev %d:%d bytecount 0x%llx "
3337 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx -> "
3338 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx",
3339 MAJOR(__entry->dev), MINOR(__entry->dev),
3343 __entry->src_disize,
3344 __entry->src_offset,
3346 __entry->dest_isize,
3347 __entry->dest_disize,
3348 __entry->dest_offset)
3351 #define DEFINE_DOUBLE_IO_EVENT(name) \
3352 DEFINE_EVENT(xfs_double_io_class, name, \
3353 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3354 struct xfs_inode *dest, xfs_off_t doffset), \
3355 TP_ARGS(src, soffset, len, dest, doffset))
3357 /* inode/irec events */
3358 DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3359 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3363 __field(xfs_ino_t, ino)
3364 __field(xfs_fileoff_t, lblk)
3365 __field(xfs_extlen_t, len)
3366 __field(xfs_fsblock_t, pblk)
3370 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3371 __entry->ino = ip->i_ino;
3372 __entry->lblk = irec->br_startoff;
3373 __entry->len = irec->br_blockcount;
3374 __entry->pblk = irec->br_startblock;
3375 __entry->state = irec->br_state;
3377 TP_printk("dev %d:%d ino 0x%llx fileoff 0x%llx fsbcount 0x%x startblock 0x%llx st %d",
3378 MAJOR(__entry->dev), MINOR(__entry->dev),
3385 #define DEFINE_INODE_IREC_EVENT(name) \
3386 DEFINE_EVENT(xfs_inode_irec_class, name, \
3387 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3390 /* inode iomap invalidation events */
3391 DECLARE_EVENT_CLASS(xfs_wb_invalid_class,
3392 TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap, unsigned int wpcseq, int whichfork),
3393 TP_ARGS(ip, iomap, wpcseq, whichfork),
3396 __field(xfs_ino_t, ino)
3398 __field(loff_t, pos)
3402 __field(u32, wpcseq)
3403 __field(u32, forkseq)
3406 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3407 __entry->ino = ip->i_ino;
3408 __entry->addr = iomap->addr;
3409 __entry->pos = iomap->offset;
3410 __entry->len = iomap->length;
3411 __entry->type = iomap->type;
3412 __entry->flags = iomap->flags;
3413 __entry->wpcseq = wpcseq;
3414 __entry->forkseq = READ_ONCE(xfs_ifork_ptr(ip, whichfork)->if_seq);
3416 TP_printk("dev %d:%d ino 0x%llx pos 0x%llx addr 0x%llx bytecount 0x%llx type 0x%x flags 0x%x wpcseq 0x%x forkseq 0x%x",
3417 MAJOR(__entry->dev), MINOR(__entry->dev),
3427 #define DEFINE_WB_INVALID_EVENT(name) \
3428 DEFINE_EVENT(xfs_wb_invalid_class, name, \
3429 TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap, unsigned int wpcseq, int whichfork), \
3430 TP_ARGS(ip, iomap, wpcseq, whichfork))
3431 DEFINE_WB_INVALID_EVENT(xfs_wb_cow_iomap_invalid);
3432 DEFINE_WB_INVALID_EVENT(xfs_wb_data_iomap_invalid);
3434 DECLARE_EVENT_CLASS(xfs_iomap_invalid_class,
3435 TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap),
3439 __field(xfs_ino_t, ino)
3441 __field(loff_t, pos)
3443 __field(u64, validity_cookie)
3444 __field(u64, inodeseq)
3449 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3450 __entry->ino = ip->i_ino;
3451 __entry->addr = iomap->addr;
3452 __entry->pos = iomap->offset;
3453 __entry->len = iomap->length;
3454 __entry->validity_cookie = iomap->validity_cookie;
3455 __entry->type = iomap->type;
3456 __entry->flags = iomap->flags;
3457 __entry->inodeseq = xfs_iomap_inode_sequence(ip, iomap->flags);
3459 TP_printk("dev %d:%d ino 0x%llx pos 0x%llx addr 0x%llx bytecount 0x%llx type 0x%x flags 0x%x validity_cookie 0x%llx inodeseq 0x%llx",
3460 MAJOR(__entry->dev), MINOR(__entry->dev),
3467 __entry->validity_cookie,
3470 #define DEFINE_IOMAP_INVALID_EVENT(name) \
3471 DEFINE_EVENT(xfs_iomap_invalid_class, name, \
3472 TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap), \
3474 DEFINE_IOMAP_INVALID_EVENT(xfs_iomap_invalid);
3476 /* refcount/reflink tracepoint definitions */
3478 /* reflink tracepoints */
3479 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3480 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3481 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3482 TRACE_EVENT(xfs_reflink_remap_blocks,
3483 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3484 xfs_filblks_t len, struct xfs_inode *dest,
3485 xfs_fileoff_t doffset),
3486 TP_ARGS(src, soffset, len, dest, doffset),
3489 __field(xfs_ino_t, src_ino)
3490 __field(xfs_fileoff_t, src_lblk)
3491 __field(xfs_filblks_t, len)
3492 __field(xfs_ino_t, dest_ino)
3493 __field(xfs_fileoff_t, dest_lblk)
3496 __entry->dev = VFS_I(src)->i_sb->s_dev;
3497 __entry->src_ino = src->i_ino;
3498 __entry->src_lblk = soffset;
3500 __entry->dest_ino = dest->i_ino;
3501 __entry->dest_lblk = doffset;
3503 TP_printk("dev %d:%d fsbcount 0x%llx "
3504 "ino 0x%llx fileoff 0x%llx -> ino 0x%llx fileoff 0x%llx",
3505 MAJOR(__entry->dev), MINOR(__entry->dev),
3512 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3513 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3514 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3515 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
3516 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3517 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3518 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
3519 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
3521 /* dedupe tracepoints */
3522 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3523 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3525 /* ioctl tracepoints */
3526 TRACE_EVENT(xfs_ioctl_clone,
3527 TP_PROTO(struct inode *src, struct inode *dest),
3531 __field(unsigned long, src_ino)
3532 __field(loff_t, src_isize)
3533 __field(unsigned long, dest_ino)
3534 __field(loff_t, dest_isize)
3537 __entry->dev = src->i_sb->s_dev;
3538 __entry->src_ino = src->i_ino;
3539 __entry->src_isize = i_size_read(src);
3540 __entry->dest_ino = dest->i_ino;
3541 __entry->dest_isize = i_size_read(dest);
3543 TP_printk("dev %d:%d ino 0x%lx isize 0x%llx -> ino 0x%lx isize 0x%llx",
3544 MAJOR(__entry->dev), MINOR(__entry->dev),
3548 __entry->dest_isize)
3551 /* unshare tracepoints */
3552 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
3553 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
3556 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
3557 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3558 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
3559 DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
3561 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3562 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3563 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_from);
3564 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_to);
3566 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3567 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3570 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
3572 /* rmap swapext tracepoints */
3573 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3574 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3575 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3578 DECLARE_EVENT_CLASS(xfs_fsmap_class,
3579 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3580 const struct xfs_rmap_irec *rmap),
3581 TP_ARGS(mp, keydev, agno, rmap),
3584 __field(dev_t, keydev)
3585 __field(xfs_agnumber_t, agno)
3586 __field(xfs_fsblock_t, bno)
3587 __field(xfs_filblks_t, len)
3588 __field(uint64_t, owner)
3589 __field(uint64_t, offset)
3590 __field(unsigned int, flags)
3593 __entry->dev = mp->m_super->s_dev;
3594 __entry->keydev = new_decode_dev(keydev);
3595 __entry->agno = agno;
3596 __entry->bno = rmap->rm_startblock;
3597 __entry->len = rmap->rm_blockcount;
3598 __entry->owner = rmap->rm_owner;
3599 __entry->offset = rmap->rm_offset;
3600 __entry->flags = rmap->rm_flags;
3602 TP_printk("dev %d:%d keydev %d:%d agno 0x%x startblock 0x%llx fsbcount 0x%llx owner 0x%llx fileoff 0x%llx flags 0x%x",
3603 MAJOR(__entry->dev), MINOR(__entry->dev),
3604 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3612 #define DEFINE_FSMAP_EVENT(name) \
3613 DEFINE_EVENT(xfs_fsmap_class, name, \
3614 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3615 const struct xfs_rmap_irec *rmap), \
3616 TP_ARGS(mp, keydev, agno, rmap))
3617 DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3618 DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3619 DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3621 DECLARE_EVENT_CLASS(xfs_fsmap_linear_class,
3622 TP_PROTO(struct xfs_mount *mp, u32 keydev, uint64_t bno),
3623 TP_ARGS(mp, keydev, bno),
3626 __field(dev_t, keydev)
3627 __field(xfs_fsblock_t, bno)
3630 __entry->dev = mp->m_super->s_dev;
3631 __entry->keydev = new_decode_dev(keydev);
3634 TP_printk("dev %d:%d keydev %d:%d bno 0x%llx",
3635 MAJOR(__entry->dev), MINOR(__entry->dev),
3636 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3639 #define DEFINE_FSMAP_LINEAR_EVENT(name) \
3640 DEFINE_EVENT(xfs_fsmap_linear_class, name, \
3641 TP_PROTO(struct xfs_mount *mp, u32 keydev, uint64_t bno), \
3642 TP_ARGS(mp, keydev, bno))
3643 DEFINE_FSMAP_LINEAR_EVENT(xfs_fsmap_low_key_linear);
3644 DEFINE_FSMAP_LINEAR_EVENT(xfs_fsmap_high_key_linear);
3646 DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3647 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3651 __field(dev_t, keydev)
3652 __field(xfs_daddr_t, block)
3653 __field(xfs_daddr_t, len)
3654 __field(uint64_t, owner)
3655 __field(uint64_t, offset)
3656 __field(uint64_t, flags)
3659 __entry->dev = mp->m_super->s_dev;
3660 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3661 __entry->block = fsmap->fmr_physical;
3662 __entry->len = fsmap->fmr_length;
3663 __entry->owner = fsmap->fmr_owner;
3664 __entry->offset = fsmap->fmr_offset;
3665 __entry->flags = fsmap->fmr_flags;
3667 TP_printk("dev %d:%d keydev %d:%d daddr 0x%llx bbcount 0x%llx owner 0x%llx fileoff_daddr 0x%llx flags 0x%llx",
3668 MAJOR(__entry->dev), MINOR(__entry->dev),
3669 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3676 #define DEFINE_GETFSMAP_EVENT(name) \
3677 DEFINE_EVENT(xfs_getfsmap_class, name, \
3678 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3680 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3681 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3682 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3684 DECLARE_EVENT_CLASS(xfs_trans_resv_class,
3685 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3686 struct xfs_trans_res *res),
3687 TP_ARGS(mp, type, res),
3691 __field(uint, logres)
3692 __field(int, logcount)
3693 __field(int, logflags)
3696 __entry->dev = mp->m_super->s_dev;
3697 __entry->type = type;
3698 __entry->logres = res->tr_logres;
3699 __entry->logcount = res->tr_logcount;
3700 __entry->logflags = res->tr_logflags;
3702 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3703 MAJOR(__entry->dev), MINOR(__entry->dev),
3710 #define DEFINE_TRANS_RESV_EVENT(name) \
3711 DEFINE_EVENT(xfs_trans_resv_class, name, \
3712 TP_PROTO(struct xfs_mount *mp, unsigned int type, \
3713 struct xfs_trans_res *res), \
3714 TP_ARGS(mp, type, res))
3715 DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc);
3716 DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc_minlogsize);
3718 TRACE_EVENT(xfs_log_get_max_trans_res,
3719 TP_PROTO(struct xfs_mount *mp, const struct xfs_trans_res *res),
3723 __field(uint, logres)
3724 __field(int, logcount)
3727 __entry->dev = mp->m_super->s_dev;
3728 __entry->logres = res->tr_logres;
3729 __entry->logcount = res->tr_logcount;
3731 TP_printk("dev %d:%d logres %u logcount %d",
3732 MAJOR(__entry->dev), MINOR(__entry->dev),
3737 DECLARE_EVENT_CLASS(xfs_trans_class,
3738 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3739 TP_ARGS(tp, caller_ip),
3742 __field(uint32_t, tid)
3743 __field(uint32_t, flags)
3744 __field(unsigned long, caller_ip)
3747 __entry->dev = tp->t_mountp->m_super->s_dev;
3750 __entry->tid = tp->t_ticket->t_tid;
3751 __entry->flags = tp->t_flags;
3752 __entry->caller_ip = caller_ip;
3754 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3755 MAJOR(__entry->dev), MINOR(__entry->dev),
3758 (char *)__entry->caller_ip)
3761 #define DEFINE_TRANS_EVENT(name) \
3762 DEFINE_EVENT(xfs_trans_class, name, \
3763 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3764 TP_ARGS(tp, caller_ip))
3765 DEFINE_TRANS_EVENT(xfs_trans_alloc);
3766 DEFINE_TRANS_EVENT(xfs_trans_cancel);
3767 DEFINE_TRANS_EVENT(xfs_trans_commit);
3768 DEFINE_TRANS_EVENT(xfs_trans_dup);
3769 DEFINE_TRANS_EVENT(xfs_trans_free);
3770 DEFINE_TRANS_EVENT(xfs_trans_roll);
3771 DEFINE_TRANS_EVENT(xfs_trans_add_item);
3772 DEFINE_TRANS_EVENT(xfs_trans_commit_items);
3773 DEFINE_TRANS_EVENT(xfs_trans_free_items);
3775 TRACE_EVENT(xfs_iunlink_update_bucket,
3776 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3777 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3778 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3781 __field(xfs_agnumber_t, agno)
3782 __field(unsigned int, bucket)
3783 __field(xfs_agino_t, old_ptr)
3784 __field(xfs_agino_t, new_ptr)
3787 __entry->dev = mp->m_super->s_dev;
3788 __entry->agno = agno;
3789 __entry->bucket = bucket;
3790 __entry->old_ptr = old_ptr;
3791 __entry->new_ptr = new_ptr;
3793 TP_printk("dev %d:%d agno 0x%x bucket %u old 0x%x new 0x%x",
3794 MAJOR(__entry->dev), MINOR(__entry->dev),
3801 TRACE_EVENT(xfs_iunlink_update_dinode,
3802 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3803 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3804 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3807 __field(xfs_agnumber_t, agno)
3808 __field(xfs_agino_t, agino)
3809 __field(xfs_agino_t, old_ptr)
3810 __field(xfs_agino_t, new_ptr)
3813 __entry->dev = mp->m_super->s_dev;
3814 __entry->agno = agno;
3815 __entry->agino = agino;
3816 __entry->old_ptr = old_ptr;
3817 __entry->new_ptr = new_ptr;
3819 TP_printk("dev %d:%d agno 0x%x agino 0x%x old 0x%x new 0x%x",
3820 MAJOR(__entry->dev), MINOR(__entry->dev),
3827 TRACE_EVENT(xfs_iunlink_reload_next,
3828 TP_PROTO(struct xfs_inode *ip),
3832 __field(xfs_agnumber_t, agno)
3833 __field(xfs_agino_t, agino)
3834 __field(xfs_agino_t, prev_agino)
3835 __field(xfs_agino_t, next_agino)
3838 __entry->dev = ip->i_mount->m_super->s_dev;
3839 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3840 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3841 __entry->prev_agino = ip->i_prev_unlinked;
3842 __entry->next_agino = ip->i_next_unlinked;
3844 TP_printk("dev %d:%d agno 0x%x agino 0x%x prev_unlinked 0x%x next_unlinked 0x%x",
3845 MAJOR(__entry->dev), MINOR(__entry->dev),
3848 __entry->prev_agino,
3849 __entry->next_agino)
3852 TRACE_EVENT(xfs_inode_reload_unlinked_bucket,
3853 TP_PROTO(struct xfs_inode *ip),
3857 __field(xfs_agnumber_t, agno)
3858 __field(xfs_agino_t, agino)
3861 __entry->dev = ip->i_mount->m_super->s_dev;
3862 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3863 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3865 TP_printk("dev %d:%d agno 0x%x agino 0x%x bucket %u",
3866 MAJOR(__entry->dev), MINOR(__entry->dev),
3869 __entry->agino % XFS_AGI_UNLINKED_BUCKETS)
3872 DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3873 TP_PROTO(struct xfs_inode *ip),
3877 __field(xfs_agnumber_t, agno)
3878 __field(xfs_agino_t, agino)
3881 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3882 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3883 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3885 TP_printk("dev %d:%d agno 0x%x agino 0x%x",
3886 MAJOR(__entry->dev), MINOR(__entry->dev),
3887 __entry->agno, __entry->agino)
3890 #define DEFINE_AGINODE_EVENT(name) \
3891 DEFINE_EVENT(xfs_ag_inode_class, name, \
3892 TP_PROTO(struct xfs_inode *ip), \
3894 DEFINE_AGINODE_EVENT(xfs_iunlink);
3895 DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
3897 DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3898 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3902 __field(unsigned int, flags)
3905 __entry->dev = mp->m_super->s_dev;
3906 __entry->flags = flags;
3908 TP_printk("dev %d:%d flags 0x%x",
3909 MAJOR(__entry->dev), MINOR(__entry->dev),
3912 #define DEFINE_FS_CORRUPT_EVENT(name) \
3913 DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3914 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3916 DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3917 DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
3918 DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
3919 DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3920 DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
3921 DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
3923 DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3924 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3925 TP_ARGS(mp, agno, flags),
3928 __field(xfs_agnumber_t, agno)
3929 __field(unsigned int, flags)
3932 __entry->dev = mp->m_super->s_dev;
3933 __entry->agno = agno;
3934 __entry->flags = flags;
3936 TP_printk("dev %d:%d agno 0x%x flags 0x%x",
3937 MAJOR(__entry->dev), MINOR(__entry->dev),
3938 __entry->agno, __entry->flags)
3940 #define DEFINE_AG_CORRUPT_EVENT(name) \
3941 DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3942 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3943 unsigned int flags), \
3944 TP_ARGS(mp, agno, flags))
3945 DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3946 DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
3947 DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
3949 DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3950 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3954 __field(xfs_ino_t, ino)
3955 __field(unsigned int, flags)
3958 __entry->dev = ip->i_mount->m_super->s_dev;
3959 __entry->ino = ip->i_ino;
3960 __entry->flags = flags;
3962 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3963 MAJOR(__entry->dev), MINOR(__entry->dev),
3964 __entry->ino, __entry->flags)
3966 #define DEFINE_INODE_CORRUPT_EVENT(name) \
3967 DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3968 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3970 DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3971 DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3973 TRACE_EVENT(xfs_iwalk_ag,
3974 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3975 xfs_agino_t startino),
3976 TP_ARGS(mp, agno, startino),
3979 __field(xfs_agnumber_t, agno)
3980 __field(xfs_agino_t, startino)
3983 __entry->dev = mp->m_super->s_dev;
3984 __entry->agno = agno;
3985 __entry->startino = startino;
3987 TP_printk("dev %d:%d agno 0x%x startino 0x%x",
3988 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3992 TRACE_EVENT(xfs_iwalk_ag_rec,
3993 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3994 struct xfs_inobt_rec_incore *irec),
3995 TP_ARGS(mp, agno, irec),
3998 __field(xfs_agnumber_t, agno)
3999 __field(xfs_agino_t, startino)
4000 __field(uint64_t, freemask)
4003 __entry->dev = mp->m_super->s_dev;
4004 __entry->agno = agno;
4005 __entry->startino = irec->ir_startino;
4006 __entry->freemask = irec->ir_free;
4008 TP_printk("dev %d:%d agno 0x%x startino 0x%x freemask 0x%llx",
4009 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
4010 __entry->startino, __entry->freemask)
4013 TRACE_EVENT(xfs_pwork_init,
4014 TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
4015 TP_ARGS(mp, nr_threads, pid),
4018 __field(unsigned int, nr_threads)
4022 __entry->dev = mp->m_super->s_dev;
4023 __entry->nr_threads = nr_threads;
4026 TP_printk("dev %d:%d nr_threads %u pid %u",
4027 MAJOR(__entry->dev), MINOR(__entry->dev),
4028 __entry->nr_threads, __entry->pid)
4031 DECLARE_EVENT_CLASS(xfs_kmem_class,
4032 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
4033 TP_ARGS(size, flags, caller_ip),
4035 __field(ssize_t, size)
4037 __field(unsigned long, caller_ip)
4040 __entry->size = size;
4041 __entry->flags = flags;
4042 __entry->caller_ip = caller_ip;
4044 TP_printk("size %zd flags 0x%x caller %pS",
4047 (char *)__entry->caller_ip)
4050 #define DEFINE_KMEM_EVENT(name) \
4051 DEFINE_EVENT(xfs_kmem_class, name, \
4052 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
4053 TP_ARGS(size, flags, caller_ip))
4054 DEFINE_KMEM_EVENT(kmem_alloc);
4056 TRACE_EVENT(xfs_check_new_dalign,
4057 TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
4058 TP_ARGS(mp, new_dalign, calc_rootino),
4061 __field(int, new_dalign)
4062 __field(xfs_ino_t, sb_rootino)
4063 __field(xfs_ino_t, calc_rootino)
4066 __entry->dev = mp->m_super->s_dev;
4067 __entry->new_dalign = new_dalign;
4068 __entry->sb_rootino = mp->m_sb.sb_rootino;
4069 __entry->calc_rootino = calc_rootino;
4071 TP_printk("dev %d:%d new_dalign %d sb_rootino 0x%llx calc_rootino 0x%llx",
4072 MAJOR(__entry->dev), MINOR(__entry->dev),
4073 __entry->new_dalign, __entry->sb_rootino,
4074 __entry->calc_rootino)
4077 TRACE_EVENT(xfs_btree_commit_afakeroot,
4078 TP_PROTO(struct xfs_btree_cur *cur),
4082 __field(xfs_btnum_t, btnum)
4083 __field(xfs_agnumber_t, agno)
4084 __field(xfs_agblock_t, agbno)
4085 __field(unsigned int, levels)
4086 __field(unsigned int, blocks)
4089 __entry->dev = cur->bc_mp->m_super->s_dev;
4090 __entry->btnum = cur->bc_btnum;
4091 __entry->agno = cur->bc_ag.pag->pag_agno;
4092 __entry->agbno = cur->bc_ag.afake->af_root;
4093 __entry->levels = cur->bc_ag.afake->af_levels;
4094 __entry->blocks = cur->bc_ag.afake->af_blocks;
4096 TP_printk("dev %d:%d btree %s agno 0x%x levels %u blocks %u root %u",
4097 MAJOR(__entry->dev), MINOR(__entry->dev),
4098 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
4105 TRACE_EVENT(xfs_btree_commit_ifakeroot,
4106 TP_PROTO(struct xfs_btree_cur *cur),
4110 __field(xfs_btnum_t, btnum)
4111 __field(xfs_agnumber_t, agno)
4112 __field(xfs_agino_t, agino)
4113 __field(unsigned int, levels)
4114 __field(unsigned int, blocks)
4115 __field(int, whichfork)
4118 __entry->dev = cur->bc_mp->m_super->s_dev;
4119 __entry->btnum = cur->bc_btnum;
4120 __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp,
4121 cur->bc_ino.ip->i_ino);
4122 __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp,
4123 cur->bc_ino.ip->i_ino);
4124 __entry->levels = cur->bc_ino.ifake->if_levels;
4125 __entry->blocks = cur->bc_ino.ifake->if_blocks;
4126 __entry->whichfork = cur->bc_ino.whichfork;
4128 TP_printk("dev %d:%d btree %s agno 0x%x agino 0x%x whichfork %s levels %u blocks %u",
4129 MAJOR(__entry->dev), MINOR(__entry->dev),
4130 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
4133 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
4138 TRACE_EVENT(xfs_btree_bload_level_geometry,
4139 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
4140 uint64_t nr_this_level, unsigned int nr_per_block,
4141 unsigned int desired_npb, uint64_t blocks,
4142 uint64_t blocks_with_extra),
4143 TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks,
4147 __field(xfs_btnum_t, btnum)
4148 __field(unsigned int, level)
4149 __field(unsigned int, nlevels)
4150 __field(uint64_t, nr_this_level)
4151 __field(unsigned int, nr_per_block)
4152 __field(unsigned int, desired_npb)
4153 __field(unsigned long long, blocks)
4154 __field(unsigned long long, blocks_with_extra)
4157 __entry->dev = cur->bc_mp->m_super->s_dev;
4158 __entry->btnum = cur->bc_btnum;
4159 __entry->level = level;
4160 __entry->nlevels = cur->bc_nlevels;
4161 __entry->nr_this_level = nr_this_level;
4162 __entry->nr_per_block = nr_per_block;
4163 __entry->desired_npb = desired_npb;
4164 __entry->blocks = blocks;
4165 __entry->blocks_with_extra = blocks_with_extra;
4167 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",
4168 MAJOR(__entry->dev), MINOR(__entry->dev),
4169 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
4172 __entry->nr_this_level,
4173 __entry->nr_per_block,
4174 __entry->desired_npb,
4176 __entry->blocks_with_extra)
4179 TRACE_EVENT(xfs_btree_bload_block,
4180 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
4181 uint64_t block_idx, uint64_t nr_blocks,
4182 union xfs_btree_ptr *ptr, unsigned int nr_records),
4183 TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records),
4186 __field(xfs_btnum_t, btnum)
4187 __field(unsigned int, level)
4188 __field(unsigned long long, block_idx)
4189 __field(unsigned long long, nr_blocks)
4190 __field(xfs_agnumber_t, agno)
4191 __field(xfs_agblock_t, agbno)
4192 __field(unsigned int, nr_records)
4195 __entry->dev = cur->bc_mp->m_super->s_dev;
4196 __entry->btnum = cur->bc_btnum;
4197 __entry->level = level;
4198 __entry->block_idx = block_idx;
4199 __entry->nr_blocks = nr_blocks;
4200 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
4201 xfs_fsblock_t fsb = be64_to_cpu(ptr->l);
4203 __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb);
4204 __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb);
4206 __entry->agno = cur->bc_ag.pag->pag_agno;
4207 __entry->agbno = be32_to_cpu(ptr->s);
4209 __entry->nr_records = nr_records;
4211 TP_printk("dev %d:%d btree %s level %u block %llu/%llu agno 0x%x agbno 0x%x recs %u",
4212 MAJOR(__entry->dev), MINOR(__entry->dev),
4213 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
4219 __entry->nr_records)
4222 DECLARE_EVENT_CLASS(xfs_timestamp_range_class,
4223 TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max),
4224 TP_ARGS(mp, min, max),
4227 __field(long long, min)
4228 __field(long long, max)
4231 __entry->dev = mp->m_super->s_dev;
4235 TP_printk("dev %d:%d min %lld max %lld",
4236 MAJOR(__entry->dev), MINOR(__entry->dev),
4241 #define DEFINE_TIMESTAMP_RANGE_EVENT(name) \
4242 DEFINE_EVENT(xfs_timestamp_range_class, name, \
4243 TP_PROTO(struct xfs_mount *mp, long long min, long long max), \
4244 TP_ARGS(mp, min, max))
4245 DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range);
4246 DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range);
4248 DECLARE_EVENT_CLASS(xfs_icwalk_class,
4249 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw,
4250 unsigned long caller_ip),
4251 TP_ARGS(mp, icw, caller_ip),
4254 __field(__u32, flags)
4255 __field(uint32_t, uid)
4256 __field(uint32_t, gid)
4257 __field(prid_t, prid)
4258 __field(__u64, min_file_size)
4259 __field(long, scan_limit)
4260 __field(unsigned long, caller_ip)
4263 __entry->dev = mp->m_super->s_dev;
4264 __entry->flags = icw ? icw->icw_flags : 0;
4265 __entry->uid = icw ? from_kuid(mp->m_super->s_user_ns,
4267 __entry->gid = icw ? from_kgid(mp->m_super->s_user_ns,
4269 __entry->prid = icw ? icw->icw_prid : 0;
4270 __entry->min_file_size = icw ? icw->icw_min_file_size : 0;
4271 __entry->scan_limit = icw ? icw->icw_scan_limit : 0;
4272 __entry->caller_ip = caller_ip;
4274 TP_printk("dev %d:%d flags 0x%x uid %u gid %u prid %u minsize %llu scan_limit %ld caller %pS",
4275 MAJOR(__entry->dev), MINOR(__entry->dev),
4280 __entry->min_file_size,
4281 __entry->scan_limit,
4282 (char *)__entry->caller_ip)
4284 #define DEFINE_ICWALK_EVENT(name) \
4285 DEFINE_EVENT(xfs_icwalk_class, name, \
4286 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw, \
4287 unsigned long caller_ip), \
4288 TP_ARGS(mp, icw, caller_ip))
4289 DEFINE_ICWALK_EVENT(xfs_ioc_free_eofblocks);
4290 DEFINE_ICWALK_EVENT(xfs_blockgc_free_space);
4292 TRACE_DEFINE_ENUM(XLOG_STATE_ACTIVE);
4293 TRACE_DEFINE_ENUM(XLOG_STATE_WANT_SYNC);
4294 TRACE_DEFINE_ENUM(XLOG_STATE_SYNCING);
4295 TRACE_DEFINE_ENUM(XLOG_STATE_DONE_SYNC);
4296 TRACE_DEFINE_ENUM(XLOG_STATE_CALLBACK);
4297 TRACE_DEFINE_ENUM(XLOG_STATE_DIRTY);
4299 DECLARE_EVENT_CLASS(xlog_iclog_class,
4300 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip),
4301 TP_ARGS(iclog, caller_ip),
4304 __field(uint32_t, state)
4305 __field(int32_t, refcount)
4306 __field(uint32_t, offset)
4307 __field(uint32_t, flags)
4308 __field(unsigned long long, lsn)
4309 __field(unsigned long, caller_ip)
4312 __entry->dev = iclog->ic_log->l_mp->m_super->s_dev;
4313 __entry->state = iclog->ic_state;
4314 __entry->refcount = atomic_read(&iclog->ic_refcnt);
4315 __entry->offset = iclog->ic_offset;
4316 __entry->flags = iclog->ic_flags;
4317 __entry->lsn = be64_to_cpu(iclog->ic_header.h_lsn);
4318 __entry->caller_ip = caller_ip;
4320 TP_printk("dev %d:%d state %s refcnt %d offset %u lsn 0x%llx flags %s caller %pS",
4321 MAJOR(__entry->dev), MINOR(__entry->dev),
4322 __print_symbolic(__entry->state, XLOG_STATE_STRINGS),
4326 __print_flags(__entry->flags, "|", XLOG_ICL_STRINGS),
4327 (char *)__entry->caller_ip)
4331 #define DEFINE_ICLOG_EVENT(name) \
4332 DEFINE_EVENT(xlog_iclog_class, name, \
4333 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip), \
4334 TP_ARGS(iclog, caller_ip))
4336 DEFINE_ICLOG_EVENT(xlog_iclog_activate);
4337 DEFINE_ICLOG_EVENT(xlog_iclog_clean);
4338 DEFINE_ICLOG_EVENT(xlog_iclog_callback);
4339 DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_start);
4340 DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_done);
4341 DEFINE_ICLOG_EVENT(xlog_iclog_force);
4342 DEFINE_ICLOG_EVENT(xlog_iclog_force_lsn);
4343 DEFINE_ICLOG_EVENT(xlog_iclog_get_space);
4344 DEFINE_ICLOG_EVENT(xlog_iclog_release);
4345 DEFINE_ICLOG_EVENT(xlog_iclog_switch);
4346 DEFINE_ICLOG_EVENT(xlog_iclog_sync);
4347 DEFINE_ICLOG_EVENT(xlog_iclog_syncing);
4348 DEFINE_ICLOG_EVENT(xlog_iclog_sync_done);
4349 DEFINE_ICLOG_EVENT(xlog_iclog_want_sync);
4350 DEFINE_ICLOG_EVENT(xlog_iclog_wait_on);
4351 DEFINE_ICLOG_EVENT(xlog_iclog_write);
4353 TRACE_DEFINE_ENUM(XFS_DAS_UNINIT);
4354 TRACE_DEFINE_ENUM(XFS_DAS_SF_ADD);
4355 TRACE_DEFINE_ENUM(XFS_DAS_SF_REMOVE);
4356 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ADD);
4357 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE);
4358 TRACE_DEFINE_ENUM(XFS_DAS_NODE_ADD);
4359 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE);
4360 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_SET_RMT);
4361 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ALLOC_RMT);
4362 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REPLACE);
4363 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_OLD);
4364 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_RMT);
4365 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_ATTR);
4366 TRACE_DEFINE_ENUM(XFS_DAS_NODE_SET_RMT);
4367 TRACE_DEFINE_ENUM(XFS_DAS_NODE_ALLOC_RMT);
4368 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REPLACE);
4369 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_OLD);
4370 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_RMT);
4371 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_ATTR);
4372 TRACE_DEFINE_ENUM(XFS_DAS_DONE);
4374 DECLARE_EVENT_CLASS(xfs_das_state_class,
4375 TP_PROTO(int das, struct xfs_inode *ip),
4379 __field(xfs_ino_t, ino)
4383 __entry->ino = ip->i_ino;
4385 TP_printk("state change %s ino 0x%llx",
4386 __print_symbolic(__entry->das, XFS_DAS_STRINGS),
4390 #define DEFINE_DAS_STATE_EVENT(name) \
4391 DEFINE_EVENT(xfs_das_state_class, name, \
4392 TP_PROTO(int das, struct xfs_inode *ip), \
4394 DEFINE_DAS_STATE_EVENT(xfs_attr_sf_addname_return);
4395 DEFINE_DAS_STATE_EVENT(xfs_attr_set_iter_return);
4396 DEFINE_DAS_STATE_EVENT(xfs_attr_leaf_addname_return);
4397 DEFINE_DAS_STATE_EVENT(xfs_attr_node_addname_return);
4398 DEFINE_DAS_STATE_EVENT(xfs_attr_remove_iter_return);
4399 DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_alloc);
4400 DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_remove_return);
4401 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_add);
4402 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_replace);
4403 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_remove);
4406 TRACE_EVENT(xfs_force_shutdown,
4407 TP_PROTO(struct xfs_mount *mp, int ptag, int flags, const char *fname,
4409 TP_ARGS(mp, ptag, flags, fname, line_num),
4414 __string(fname, fname)
4415 __field(int, line_num)
4418 __entry->dev = mp->m_super->s_dev;
4419 __entry->ptag = ptag;
4420 __entry->flags = flags;
4421 __assign_str(fname, fname);
4422 __entry->line_num = line_num;
4424 TP_printk("dev %d:%d tag %s flags %s file %s line_num %d",
4425 MAJOR(__entry->dev), MINOR(__entry->dev),
4426 __print_flags(__entry->ptag, "|", XFS_PTAG_STRINGS),
4427 __print_flags(__entry->flags, "|", XFS_SHUTDOWN_STRINGS),
4432 #ifdef CONFIG_XFS_DRAIN_INTENTS
4433 DECLARE_EVENT_CLASS(xfs_perag_intents_class,
4434 TP_PROTO(struct xfs_perag *pag, void *caller_ip),
4435 TP_ARGS(pag, caller_ip),
4438 __field(xfs_agnumber_t, agno)
4439 __field(long, nr_intents)
4440 __field(void *, caller_ip)
4443 __entry->dev = pag->pag_mount->m_super->s_dev;
4444 __entry->agno = pag->pag_agno;
4445 __entry->nr_intents = atomic_read(&pag->pag_intents_drain.dr_count);
4446 __entry->caller_ip = caller_ip;
4448 TP_printk("dev %d:%d agno 0x%x intents %ld caller %pS",
4449 MAJOR(__entry->dev), MINOR(__entry->dev),
4451 __entry->nr_intents,
4455 #define DEFINE_PERAG_INTENTS_EVENT(name) \
4456 DEFINE_EVENT(xfs_perag_intents_class, name, \
4457 TP_PROTO(struct xfs_perag *pag, void *caller_ip), \
4458 TP_ARGS(pag, caller_ip))
4459 DEFINE_PERAG_INTENTS_EVENT(xfs_perag_intent_hold);
4460 DEFINE_PERAG_INTENTS_EVENT(xfs_perag_intent_rele);
4461 DEFINE_PERAG_INTENTS_EVENT(xfs_perag_wait_intents);
4463 #endif /* CONFIG_XFS_DRAIN_INTENTS */
4465 #endif /* _TRACE_XFS_H */
4467 #undef TRACE_INCLUDE_PATH
4468 #define TRACE_INCLUDE_PATH .
4469 #define TRACE_INCLUDE_FILE xfs_trace
4470 #include <trace/define_trace.h>