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 * owner: reverse-mapping owner, usually inodes
27 * fileoff: file offset, in fs blocks
28 * pos: file offset, in bytes
29 * bytecount: number of bytes
31 * disize: ondisk file size, in bytes
32 * isize: incore file size, in bytes
34 * forkoff: inode fork offset, in bytes
36 * ireccount: number of inode records
38 * Numbers describing space allocations (blocks, extents, inodes) should be
39 * formatted in hexadecimal.
42 #define TRACE_SYSTEM xfs
44 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
47 #include <linux/tracepoint.h>
51 struct xfs_attr_list_context;
52 struct xfs_buf_log_item;
54 struct xfs_da_node_entry;
60 struct xlog_recover_item;
61 struct xlog_rec_header;
63 struct xfs_buf_log_format;
64 struct xfs_inode_log_format;
67 struct xfs_refcount_irec;
70 struct xfs_icreate_log;
71 struct xfs_owner_info;
73 struct xfs_inobt_rec_incore;
78 #define XFS_ATTR_FILTER_FLAGS \
79 { XFS_ATTR_ROOT, "ROOT" }, \
80 { XFS_ATTR_SECURE, "SECURE" }, \
81 { XFS_ATTR_INCOMPLETE, "INCOMPLETE" }
83 DECLARE_EVENT_CLASS(xfs_attr_list_class,
84 TP_PROTO(struct xfs_attr_list_context *ctx),
88 __field(xfs_ino_t, ino)
92 __field(void *, buffer)
97 __field(unsigned int, attr_filter)
100 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
101 __entry->ino = ctx->dp->i_ino;
102 __entry->hashval = ctx->cursor.hashval;
103 __entry->blkno = ctx->cursor.blkno;
104 __entry->offset = ctx->cursor.offset;
105 __entry->buffer = ctx->buffer;
106 __entry->bufsize = ctx->bufsize;
107 __entry->count = ctx->count;
108 __entry->firstu = ctx->firstu;
109 __entry->attr_filter = ctx->attr_filter;
111 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
112 "buffer %p size %u count %u firstu %u filter %s",
113 MAJOR(__entry->dev), MINOR(__entry->dev),
123 __print_flags(__entry->attr_filter, "|",
124 XFS_ATTR_FILTER_FLAGS)
128 #define DEFINE_ATTR_LIST_EVENT(name) \
129 DEFINE_EVENT(xfs_attr_list_class, name, \
130 TP_PROTO(struct xfs_attr_list_context *ctx), \
132 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
133 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
134 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
135 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
136 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
137 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
138 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
139 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
140 DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
141 DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
143 TRACE_EVENT(xlog_intent_recovery_failed,
144 TP_PROTO(struct xfs_mount *mp, int error, void *function),
145 TP_ARGS(mp, error, function),
149 __field(void *, function)
152 __entry->dev = mp->m_super->s_dev;
153 __entry->error = error;
154 __entry->function = function;
156 TP_printk("dev %d:%d error %d function %pS",
157 MAJOR(__entry->dev), MINOR(__entry->dev),
158 __entry->error, __entry->function)
161 DECLARE_EVENT_CLASS(xfs_perag_class,
162 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
163 unsigned long caller_ip),
164 TP_ARGS(mp, agno, refcount, caller_ip),
167 __field(xfs_agnumber_t, agno)
168 __field(int, refcount)
169 __field(unsigned long, caller_ip)
172 __entry->dev = mp->m_super->s_dev;
173 __entry->agno = agno;
174 __entry->refcount = refcount;
175 __entry->caller_ip = caller_ip;
177 TP_printk("dev %d:%d agno 0x%x refcount %d caller %pS",
178 MAJOR(__entry->dev), MINOR(__entry->dev),
181 (char *)__entry->caller_ip)
184 #define DEFINE_PERAG_REF_EVENT(name) \
185 DEFINE_EVENT(xfs_perag_class, name, \
186 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
187 unsigned long caller_ip), \
188 TP_ARGS(mp, agno, refcount, caller_ip))
189 DEFINE_PERAG_REF_EVENT(xfs_perag_get);
190 DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
191 DEFINE_PERAG_REF_EVENT(xfs_perag_put);
192 DEFINE_PERAG_REF_EVENT(xfs_perag_set_inode_tag);
193 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_inode_tag);
195 TRACE_EVENT(xfs_inodegc_worker,
196 TP_PROTO(struct xfs_mount *mp, unsigned int shrinker_hits),
197 TP_ARGS(mp, shrinker_hits),
200 __field(unsigned int, shrinker_hits)
203 __entry->dev = mp->m_super->s_dev;
204 __entry->shrinker_hits = shrinker_hits;
206 TP_printk("dev %d:%d shrinker_hits %u",
207 MAJOR(__entry->dev), MINOR(__entry->dev),
208 __entry->shrinker_hits)
211 DECLARE_EVENT_CLASS(xfs_fs_class,
212 TP_PROTO(struct xfs_mount *mp, void *caller_ip),
213 TP_ARGS(mp, caller_ip),
216 __field(unsigned long long, mflags)
217 __field(unsigned long, opstate)
218 __field(unsigned long, sbflags)
219 __field(void *, caller_ip)
223 __entry->dev = mp->m_super->s_dev;
224 __entry->mflags = mp->m_features;
225 __entry->opstate = mp->m_opstate;
226 __entry->sbflags = mp->m_super->s_flags;
228 __entry->caller_ip = caller_ip;
230 TP_printk("dev %d:%d m_features 0x%llx opstate (%s) s_flags 0x%lx caller %pS",
231 MAJOR(__entry->dev), MINOR(__entry->dev),
233 __print_flags(__entry->opstate, "|", XFS_OPSTATE_STRINGS),
238 #define DEFINE_FS_EVENT(name) \
239 DEFINE_EVENT(xfs_fs_class, name, \
240 TP_PROTO(struct xfs_mount *mp, void *caller_ip), \
241 TP_ARGS(mp, caller_ip))
242 DEFINE_FS_EVENT(xfs_inodegc_flush);
243 DEFINE_FS_EVENT(xfs_inodegc_push);
244 DEFINE_FS_EVENT(xfs_inodegc_start);
245 DEFINE_FS_EVENT(xfs_inodegc_stop);
246 DEFINE_FS_EVENT(xfs_inodegc_queue);
247 DEFINE_FS_EVENT(xfs_inodegc_throttle);
248 DEFINE_FS_EVENT(xfs_fs_sync_fs);
249 DEFINE_FS_EVENT(xfs_blockgc_start);
250 DEFINE_FS_EVENT(xfs_blockgc_stop);
251 DEFINE_FS_EVENT(xfs_blockgc_worker);
252 DEFINE_FS_EVENT(xfs_blockgc_flush_all);
254 TRACE_EVENT(xfs_inodegc_shrinker_scan,
255 TP_PROTO(struct xfs_mount *mp, struct shrink_control *sc,
257 TP_ARGS(mp, sc, caller_ip),
260 __field(unsigned long, nr_to_scan)
261 __field(void *, caller_ip)
264 __entry->dev = mp->m_super->s_dev;
265 __entry->nr_to_scan = sc->nr_to_scan;
266 __entry->caller_ip = caller_ip;
268 TP_printk("dev %d:%d nr_to_scan %lu caller %pS",
269 MAJOR(__entry->dev), MINOR(__entry->dev),
274 DECLARE_EVENT_CLASS(xfs_ag_class,
275 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
279 __field(xfs_agnumber_t, agno)
282 __entry->dev = mp->m_super->s_dev;
283 __entry->agno = agno;
285 TP_printk("dev %d:%d agno 0x%x",
286 MAJOR(__entry->dev), MINOR(__entry->dev),
289 #define DEFINE_AG_EVENT(name) \
290 DEFINE_EVENT(xfs_ag_class, name, \
291 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
294 DEFINE_AG_EVENT(xfs_read_agf);
295 DEFINE_AG_EVENT(xfs_alloc_read_agf);
296 DEFINE_AG_EVENT(xfs_read_agi);
297 DEFINE_AG_EVENT(xfs_ialloc_read_agi);
299 TRACE_EVENT(xfs_attr_list_node_descend,
300 TP_PROTO(struct xfs_attr_list_context *ctx,
301 struct xfs_da_node_entry *btree),
305 __field(xfs_ino_t, ino)
306 __field(u32, hashval)
309 __field(void *, buffer)
310 __field(int, bufsize)
314 __field(unsigned int, attr_filter)
315 __field(u32, bt_hashval)
316 __field(u32, bt_before)
319 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
320 __entry->ino = ctx->dp->i_ino;
321 __entry->hashval = ctx->cursor.hashval;
322 __entry->blkno = ctx->cursor.blkno;
323 __entry->offset = ctx->cursor.offset;
324 __entry->buffer = ctx->buffer;
325 __entry->bufsize = ctx->bufsize;
326 __entry->count = ctx->count;
327 __entry->firstu = ctx->firstu;
328 __entry->attr_filter = ctx->attr_filter;
329 __entry->bt_hashval = be32_to_cpu(btree->hashval);
330 __entry->bt_before = be32_to_cpu(btree->before);
332 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
333 "buffer %p size %u count %u firstu %u filter %s "
334 "node hashval %u, node before %u",
335 MAJOR(__entry->dev), MINOR(__entry->dev),
345 __print_flags(__entry->attr_filter, "|",
346 XFS_ATTR_FILTER_FLAGS),
351 DECLARE_EVENT_CLASS(xfs_bmap_class,
352 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
353 unsigned long caller_ip),
354 TP_ARGS(ip, cur, state, caller_ip),
357 __field(xfs_ino_t, ino)
358 __field(void *, leaf)
360 __field(xfs_fileoff_t, startoff)
361 __field(xfs_fsblock_t, startblock)
362 __field(xfs_filblks_t, blockcount)
363 __field(xfs_exntst_t, state)
364 __field(int, bmap_state)
365 __field(unsigned long, caller_ip)
368 struct xfs_ifork *ifp;
369 struct xfs_bmbt_irec r;
371 ifp = xfs_iext_state_to_fork(ip, state);
372 xfs_iext_get_extent(ifp, cur, &r);
373 __entry->dev = VFS_I(ip)->i_sb->s_dev;
374 __entry->ino = ip->i_ino;
375 __entry->leaf = cur->leaf;
376 __entry->pos = cur->pos;
377 __entry->startoff = r.br_startoff;
378 __entry->startblock = r.br_startblock;
379 __entry->blockcount = r.br_blockcount;
380 __entry->state = r.br_state;
381 __entry->bmap_state = state;
382 __entry->caller_ip = caller_ip;
384 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
385 "fileoff 0x%llx startblock 0x%llx fsbcount 0x%llx flag %d caller %pS",
386 MAJOR(__entry->dev), MINOR(__entry->dev),
388 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
392 (int64_t)__entry->startblock,
395 (char *)__entry->caller_ip)
398 #define DEFINE_BMAP_EVENT(name) \
399 DEFINE_EVENT(xfs_bmap_class, name, \
400 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
401 unsigned long caller_ip), \
402 TP_ARGS(ip, cur, state, caller_ip))
403 DEFINE_BMAP_EVENT(xfs_iext_insert);
404 DEFINE_BMAP_EVENT(xfs_iext_remove);
405 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
406 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
407 DEFINE_BMAP_EVENT(xfs_read_extent);
408 DEFINE_BMAP_EVENT(xfs_write_extent);
410 DECLARE_EVENT_CLASS(xfs_buf_class,
411 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
412 TP_ARGS(bp, caller_ip),
415 __field(xfs_daddr_t, bno)
418 __field(int, pincount)
419 __field(unsigned, lockval)
420 __field(unsigned, flags)
421 __field(unsigned long, caller_ip)
422 __field(const void *, buf_ops)
425 __entry->dev = bp->b_target->bt_dev;
426 __entry->bno = xfs_buf_daddr(bp);
427 __entry->nblks = bp->b_length;
428 __entry->hold = atomic_read(&bp->b_hold);
429 __entry->pincount = atomic_read(&bp->b_pin_count);
430 __entry->lockval = bp->b_sema.count;
431 __entry->flags = bp->b_flags;
432 __entry->caller_ip = caller_ip;
433 __entry->buf_ops = bp->b_ops;
435 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
436 "lock %d flags %s bufops %pS caller %pS",
437 MAJOR(__entry->dev), MINOR(__entry->dev),
438 (unsigned long long)__entry->bno,
443 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
445 (void *)__entry->caller_ip)
448 #define DEFINE_BUF_EVENT(name) \
449 DEFINE_EVENT(xfs_buf_class, name, \
450 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
451 TP_ARGS(bp, caller_ip))
452 DEFINE_BUF_EVENT(xfs_buf_init);
453 DEFINE_BUF_EVENT(xfs_buf_free);
454 DEFINE_BUF_EVENT(xfs_buf_hold);
455 DEFINE_BUF_EVENT(xfs_buf_rele);
456 DEFINE_BUF_EVENT(xfs_buf_iodone);
457 DEFINE_BUF_EVENT(xfs_buf_submit);
458 DEFINE_BUF_EVENT(xfs_buf_lock);
459 DEFINE_BUF_EVENT(xfs_buf_lock_done);
460 DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
461 DEFINE_BUF_EVENT(xfs_buf_trylock);
462 DEFINE_BUF_EVENT(xfs_buf_unlock);
463 DEFINE_BUF_EVENT(xfs_buf_iowait);
464 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
465 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
466 DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
467 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
468 DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
469 DEFINE_BUF_EVENT(xfs_buf_get_uncached);
470 DEFINE_BUF_EVENT(xfs_buf_item_relse);
471 DEFINE_BUF_EVENT(xfs_buf_iodone_async);
472 DEFINE_BUF_EVENT(xfs_buf_error_relse);
473 DEFINE_BUF_EVENT(xfs_buf_drain_buftarg);
474 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
476 /* not really buffer traces, but the buf provides useful information */
477 DEFINE_BUF_EVENT(xfs_btree_corrupt);
478 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
480 /* pass flags explicitly */
481 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
482 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
483 TP_ARGS(bp, flags, caller_ip),
486 __field(xfs_daddr_t, bno)
487 __field(unsigned int, length)
489 __field(int, pincount)
490 __field(unsigned, lockval)
491 __field(unsigned, flags)
492 __field(unsigned long, caller_ip)
495 __entry->dev = bp->b_target->bt_dev;
496 __entry->bno = xfs_buf_daddr(bp);
497 __entry->length = bp->b_length;
498 __entry->flags = flags;
499 __entry->hold = atomic_read(&bp->b_hold);
500 __entry->pincount = atomic_read(&bp->b_pin_count);
501 __entry->lockval = bp->b_sema.count;
502 __entry->caller_ip = caller_ip;
504 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
505 "lock %d flags %s caller %pS",
506 MAJOR(__entry->dev), MINOR(__entry->dev),
507 (unsigned long long)__entry->bno,
512 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
513 (void *)__entry->caller_ip)
516 #define DEFINE_BUF_FLAGS_EVENT(name) \
517 DEFINE_EVENT(xfs_buf_flags_class, name, \
518 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
519 TP_ARGS(bp, flags, caller_ip))
520 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
521 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
522 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
524 TRACE_EVENT(xfs_buf_ioerror,
525 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
526 TP_ARGS(bp, error, caller_ip),
529 __field(xfs_daddr_t, bno)
530 __field(unsigned int, length)
531 __field(unsigned, flags)
533 __field(int, pincount)
534 __field(unsigned, lockval)
536 __field(xfs_failaddr_t, caller_ip)
539 __entry->dev = bp->b_target->bt_dev;
540 __entry->bno = xfs_buf_daddr(bp);
541 __entry->length = bp->b_length;
542 __entry->hold = atomic_read(&bp->b_hold);
543 __entry->pincount = atomic_read(&bp->b_pin_count);
544 __entry->lockval = bp->b_sema.count;
545 __entry->error = error;
546 __entry->flags = bp->b_flags;
547 __entry->caller_ip = caller_ip;
549 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
550 "lock %d error %d flags %s caller %pS",
551 MAJOR(__entry->dev), MINOR(__entry->dev),
552 (unsigned long long)__entry->bno,
558 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
559 (void *)__entry->caller_ip)
562 DECLARE_EVENT_CLASS(xfs_buf_item_class,
563 TP_PROTO(struct xfs_buf_log_item *bip),
567 __field(xfs_daddr_t, buf_bno)
568 __field(unsigned int, buf_len)
569 __field(int, buf_hold)
570 __field(int, buf_pincount)
571 __field(int, buf_lockval)
572 __field(unsigned, buf_flags)
573 __field(unsigned, bli_recur)
574 __field(int, bli_refcount)
575 __field(unsigned, bli_flags)
576 __field(unsigned long, li_flags)
579 __entry->dev = bip->bli_buf->b_target->bt_dev;
580 __entry->bli_flags = bip->bli_flags;
581 __entry->bli_recur = bip->bli_recur;
582 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
583 __entry->buf_bno = xfs_buf_daddr(bip->bli_buf);
584 __entry->buf_len = bip->bli_buf->b_length;
585 __entry->buf_flags = bip->bli_buf->b_flags;
586 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
587 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
588 __entry->buf_lockval = bip->bli_buf->b_sema.count;
589 __entry->li_flags = bip->bli_item.li_flags;
591 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
592 "lock %d flags %s recur %d refcount %d bliflags %s "
594 MAJOR(__entry->dev), MINOR(__entry->dev),
595 (unsigned long long)__entry->buf_bno,
598 __entry->buf_pincount,
599 __entry->buf_lockval,
600 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
602 __entry->bli_refcount,
603 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
604 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
607 #define DEFINE_BUF_ITEM_EVENT(name) \
608 DEFINE_EVENT(xfs_buf_item_class, name, \
609 TP_PROTO(struct xfs_buf_log_item *bip), \
611 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
612 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
613 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
614 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
615 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
616 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
617 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
618 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
619 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
620 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release);
621 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
622 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
623 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
624 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
625 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
626 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
627 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
628 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
629 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
630 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
631 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
632 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
633 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
634 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
636 DECLARE_EVENT_CLASS(xfs_filestream_class,
637 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno),
638 TP_ARGS(mp, ino, agno),
641 __field(xfs_ino_t, ino)
642 __field(xfs_agnumber_t, agno)
643 __field(int, streams)
646 __entry->dev = mp->m_super->s_dev;
648 __entry->agno = agno;
649 __entry->streams = xfs_filestream_peek_ag(mp, agno);
651 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d",
652 MAJOR(__entry->dev), MINOR(__entry->dev),
657 #define DEFINE_FILESTREAM_EVENT(name) \
658 DEFINE_EVENT(xfs_filestream_class, name, \
659 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \
660 TP_ARGS(mp, ino, agno))
661 DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
662 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
663 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
665 TRACE_EVENT(xfs_filestream_pick,
666 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
667 xfs_extlen_t free, int nscan),
668 TP_ARGS(ip, agno, free, nscan),
671 __field(xfs_ino_t, ino)
672 __field(xfs_agnumber_t, agno)
673 __field(int, streams)
674 __field(xfs_extlen_t, free)
678 __entry->dev = VFS_I(ip)->i_sb->s_dev;
679 __entry->ino = ip->i_ino;
680 __entry->agno = agno;
681 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
682 __entry->free = free;
683 __entry->nscan = nscan;
685 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d nscan %d",
686 MAJOR(__entry->dev), MINOR(__entry->dev),
694 DECLARE_EVENT_CLASS(xfs_lock_class,
695 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
696 unsigned long caller_ip),
697 TP_ARGS(ip, lock_flags, caller_ip),
700 __field(xfs_ino_t, ino)
701 __field(int, lock_flags)
702 __field(unsigned long, caller_ip)
705 __entry->dev = VFS_I(ip)->i_sb->s_dev;
706 __entry->ino = ip->i_ino;
707 __entry->lock_flags = lock_flags;
708 __entry->caller_ip = caller_ip;
710 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
711 MAJOR(__entry->dev), MINOR(__entry->dev),
713 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
714 (void *)__entry->caller_ip)
717 #define DEFINE_LOCK_EVENT(name) \
718 DEFINE_EVENT(xfs_lock_class, name, \
719 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
720 unsigned long caller_ip), \
721 TP_ARGS(ip, lock_flags, caller_ip))
722 DEFINE_LOCK_EVENT(xfs_ilock);
723 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
724 DEFINE_LOCK_EVENT(xfs_ilock_demote);
725 DEFINE_LOCK_EVENT(xfs_iunlock);
727 DECLARE_EVENT_CLASS(xfs_inode_class,
728 TP_PROTO(struct xfs_inode *ip),
732 __field(xfs_ino_t, ino)
733 __field(unsigned long, iflags)
736 __entry->dev = VFS_I(ip)->i_sb->s_dev;
737 __entry->ino = ip->i_ino;
738 __entry->iflags = ip->i_flags;
740 TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx",
741 MAJOR(__entry->dev), MINOR(__entry->dev),
746 #define DEFINE_INODE_EVENT(name) \
747 DEFINE_EVENT(xfs_inode_class, name, \
748 TP_PROTO(struct xfs_inode *ip), \
750 DEFINE_INODE_EVENT(xfs_iget_skip);
751 DEFINE_INODE_EVENT(xfs_iget_recycle);
752 DEFINE_INODE_EVENT(xfs_iget_recycle_fail);
753 DEFINE_INODE_EVENT(xfs_iget_hit);
754 DEFINE_INODE_EVENT(xfs_iget_miss);
756 DEFINE_INODE_EVENT(xfs_getattr);
757 DEFINE_INODE_EVENT(xfs_setattr);
758 DEFINE_INODE_EVENT(xfs_readlink);
759 DEFINE_INODE_EVENT(xfs_inactive_symlink);
760 DEFINE_INODE_EVENT(xfs_alloc_file_space);
761 DEFINE_INODE_EVENT(xfs_free_file_space);
762 DEFINE_INODE_EVENT(xfs_zero_file_space);
763 DEFINE_INODE_EVENT(xfs_collapse_file_space);
764 DEFINE_INODE_EVENT(xfs_insert_file_space);
765 DEFINE_INODE_EVENT(xfs_readdir);
766 #ifdef CONFIG_XFS_POSIX_ACL
767 DEFINE_INODE_EVENT(xfs_get_acl);
769 DEFINE_INODE_EVENT(xfs_vm_bmap);
770 DEFINE_INODE_EVENT(xfs_file_ioctl);
771 DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
772 DEFINE_INODE_EVENT(xfs_ioctl_setattr);
773 DEFINE_INODE_EVENT(xfs_dir_fsync);
774 DEFINE_INODE_EVENT(xfs_file_fsync);
775 DEFINE_INODE_EVENT(xfs_destroy_inode);
776 DEFINE_INODE_EVENT(xfs_update_time);
778 DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
779 DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
781 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
782 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
783 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
784 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
785 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
786 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
787 DEFINE_INODE_EVENT(xfs_inode_set_reclaimable);
788 DEFINE_INODE_EVENT(xfs_inode_reclaiming);
789 DEFINE_INODE_EVENT(xfs_inode_set_need_inactive);
790 DEFINE_INODE_EVENT(xfs_inode_inactivating);
793 * ftrace's __print_symbolic requires that all enum values be wrapped in the
794 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
795 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
798 TRACE_DEFINE_ENUM(PE_SIZE_PTE);
799 TRACE_DEFINE_ENUM(PE_SIZE_PMD);
800 TRACE_DEFINE_ENUM(PE_SIZE_PUD);
802 TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_SHARED);
803 TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_COW);
805 TRACE_EVENT(xfs_filemap_fault,
806 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
808 TP_ARGS(ip, pe_size, write_fault),
811 __field(xfs_ino_t, ino)
812 __field(enum page_entry_size, pe_size)
813 __field(bool, write_fault)
816 __entry->dev = VFS_I(ip)->i_sb->s_dev;
817 __entry->ino = ip->i_ino;
818 __entry->pe_size = pe_size;
819 __entry->write_fault = write_fault;
821 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
822 MAJOR(__entry->dev), MINOR(__entry->dev),
824 __print_symbolic(__entry->pe_size,
825 { PE_SIZE_PTE, "PTE" },
826 { PE_SIZE_PMD, "PMD" },
827 { PE_SIZE_PUD, "PUD" }),
828 __entry->write_fault)
831 DECLARE_EVENT_CLASS(xfs_iref_class,
832 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
833 TP_ARGS(ip, caller_ip),
836 __field(xfs_ino_t, ino)
838 __field(int, pincount)
839 __field(unsigned long, caller_ip)
842 __entry->dev = VFS_I(ip)->i_sb->s_dev;
843 __entry->ino = ip->i_ino;
844 __entry->count = atomic_read(&VFS_I(ip)->i_count);
845 __entry->pincount = atomic_read(&ip->i_pincount);
846 __entry->caller_ip = caller_ip;
848 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
849 MAJOR(__entry->dev), MINOR(__entry->dev),
853 (char *)__entry->caller_ip)
856 TRACE_EVENT(xfs_iomap_prealloc_size,
857 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
858 unsigned int writeio_blocks),
859 TP_ARGS(ip, blocks, shift, writeio_blocks),
862 __field(xfs_ino_t, ino)
863 __field(xfs_fsblock_t, blocks)
865 __field(unsigned int, writeio_blocks)
868 __entry->dev = VFS_I(ip)->i_sb->s_dev;
869 __entry->ino = ip->i_ino;
870 __entry->blocks = blocks;
871 __entry->shift = shift;
872 __entry->writeio_blocks = writeio_blocks;
874 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
875 "m_allocsize_blocks %u",
876 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
877 __entry->blocks, __entry->shift, __entry->writeio_blocks)
880 TRACE_EVENT(xfs_irec_merge_pre,
881 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
882 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
883 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
886 __field(xfs_agnumber_t, agno)
887 __field(xfs_agino_t, agino)
888 __field(uint16_t, holemask)
889 __field(xfs_agino_t, nagino)
890 __field(uint16_t, nholemask)
893 __entry->dev = mp->m_super->s_dev;
894 __entry->agno = agno;
895 __entry->agino = agino;
896 __entry->holemask = holemask;
897 __entry->nagino = nagino;
898 __entry->nholemask = holemask;
900 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x",
901 MAJOR(__entry->dev), MINOR(__entry->dev),
909 TRACE_EVENT(xfs_irec_merge_post,
910 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
912 TP_ARGS(mp, agno, agino, holemask),
915 __field(xfs_agnumber_t, agno)
916 __field(xfs_agino_t, agino)
917 __field(uint16_t, holemask)
920 __entry->dev = mp->m_super->s_dev;
921 __entry->agno = agno;
922 __entry->agino = agino;
923 __entry->holemask = holemask;
925 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x",
933 #define DEFINE_IREF_EVENT(name) \
934 DEFINE_EVENT(xfs_iref_class, name, \
935 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
936 TP_ARGS(ip, caller_ip))
937 DEFINE_IREF_EVENT(xfs_irele);
938 DEFINE_IREF_EVENT(xfs_inode_pin);
939 DEFINE_IREF_EVENT(xfs_inode_unpin);
940 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
942 DECLARE_EVENT_CLASS(xfs_namespace_class,
943 TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name),
947 __field(xfs_ino_t, dp_ino)
948 __field(int, namelen)
949 __dynamic_array(char, name, name->len)
952 __entry->dev = VFS_I(dp)->i_sb->s_dev;
953 __entry->dp_ino = dp->i_ino;
954 __entry->namelen = name->len;
955 memcpy(__get_str(name), name->name, name->len);
957 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
958 MAJOR(__entry->dev), MINOR(__entry->dev),
964 #define DEFINE_NAMESPACE_EVENT(name) \
965 DEFINE_EVENT(xfs_namespace_class, name, \
966 TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name), \
968 DEFINE_NAMESPACE_EVENT(xfs_remove);
969 DEFINE_NAMESPACE_EVENT(xfs_link);
970 DEFINE_NAMESPACE_EVENT(xfs_lookup);
971 DEFINE_NAMESPACE_EVENT(xfs_create);
972 DEFINE_NAMESPACE_EVENT(xfs_symlink);
974 TRACE_EVENT(xfs_rename,
975 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
976 struct xfs_name *src_name, struct xfs_name *target_name),
977 TP_ARGS(src_dp, target_dp, src_name, target_name),
980 __field(xfs_ino_t, src_dp_ino)
981 __field(xfs_ino_t, target_dp_ino)
982 __field(int, src_namelen)
983 __field(int, target_namelen)
984 __dynamic_array(char, src_name, src_name->len)
985 __dynamic_array(char, target_name, target_name->len)
988 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
989 __entry->src_dp_ino = src_dp->i_ino;
990 __entry->target_dp_ino = target_dp->i_ino;
991 __entry->src_namelen = src_name->len;
992 __entry->target_namelen = target_name->len;
993 memcpy(__get_str(src_name), src_name->name, src_name->len);
994 memcpy(__get_str(target_name), target_name->name,
997 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
998 " src name %.*s target name %.*s",
999 MAJOR(__entry->dev), MINOR(__entry->dev),
1000 __entry->src_dp_ino,
1001 __entry->target_dp_ino,
1002 __entry->src_namelen,
1003 __get_str(src_name),
1004 __entry->target_namelen,
1005 __get_str(target_name))
1008 DECLARE_EVENT_CLASS(xfs_dquot_class,
1009 TP_PROTO(struct xfs_dquot *dqp),
1014 __field(xfs_dqtype_t, type)
1015 __field(unsigned, flags)
1016 __field(unsigned, nrefs)
1017 __field(unsigned long long, res_bcount)
1018 __field(unsigned long long, res_rtbcount)
1019 __field(unsigned long long, res_icount)
1021 __field(unsigned long long, bcount)
1022 __field(unsigned long long, rtbcount)
1023 __field(unsigned long long, icount)
1025 __field(unsigned long long, blk_hardlimit)
1026 __field(unsigned long long, blk_softlimit)
1027 __field(unsigned long long, rtb_hardlimit)
1028 __field(unsigned long long, rtb_softlimit)
1029 __field(unsigned long long, ino_hardlimit)
1030 __field(unsigned long long, ino_softlimit)
1033 __entry->dev = dqp->q_mount->m_super->s_dev;
1034 __entry->id = dqp->q_id;
1035 __entry->type = dqp->q_type;
1036 __entry->flags = dqp->q_flags;
1037 __entry->nrefs = dqp->q_nrefs;
1039 __entry->res_bcount = dqp->q_blk.reserved;
1040 __entry->res_rtbcount = dqp->q_rtb.reserved;
1041 __entry->res_icount = dqp->q_ino.reserved;
1043 __entry->bcount = dqp->q_blk.count;
1044 __entry->rtbcount = dqp->q_rtb.count;
1045 __entry->icount = dqp->q_ino.count;
1047 __entry->blk_hardlimit = dqp->q_blk.hardlimit;
1048 __entry->blk_softlimit = dqp->q_blk.softlimit;
1049 __entry->rtb_hardlimit = dqp->q_rtb.hardlimit;
1050 __entry->rtb_softlimit = dqp->q_rtb.softlimit;
1051 __entry->ino_hardlimit = dqp->q_ino.hardlimit;
1052 __entry->ino_softlimit = dqp->q_ino.softlimit;
1054 TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u "
1055 "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx "
1056 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
1057 "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx "
1058 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
1059 MAJOR(__entry->dev), MINOR(__entry->dev),
1061 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1062 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1064 __entry->res_bcount,
1065 __entry->res_rtbcount,
1066 __entry->res_icount,
1068 __entry->blk_hardlimit,
1069 __entry->blk_softlimit,
1071 __entry->rtb_hardlimit,
1072 __entry->rtb_softlimit,
1074 __entry->ino_hardlimit,
1075 __entry->ino_softlimit)
1078 #define DEFINE_DQUOT_EVENT(name) \
1079 DEFINE_EVENT(xfs_dquot_class, name, \
1080 TP_PROTO(struct xfs_dquot *dqp), \
1082 DEFINE_DQUOT_EVENT(xfs_dqadjust);
1083 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
1084 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
1085 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
1086 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
1087 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
1088 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
1089 DEFINE_DQUOT_EVENT(xfs_dqalloc);
1090 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
1091 DEFINE_DQUOT_EVENT(xfs_dqread);
1092 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
1093 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
1094 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
1095 DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
1096 DEFINE_DQUOT_EVENT(xfs_dqget_dup);
1097 DEFINE_DQUOT_EVENT(xfs_dqput);
1098 DEFINE_DQUOT_EVENT(xfs_dqput_free);
1099 DEFINE_DQUOT_EVENT(xfs_dqrele);
1100 DEFINE_DQUOT_EVENT(xfs_dqflush);
1101 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
1102 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
1103 DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
1104 DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
1106 TRACE_EVENT(xfs_trans_mod_dquot,
1107 TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
1108 unsigned int field, int64_t delta),
1109 TP_ARGS(tp, dqp, field, delta),
1112 __field(xfs_dqtype_t, type)
1113 __field(unsigned int, flags)
1114 __field(unsigned int, dqid)
1115 __field(unsigned int, field)
1116 __field(int64_t, delta)
1119 __entry->dev = tp->t_mountp->m_super->s_dev;
1120 __entry->type = dqp->q_type;
1121 __entry->flags = dqp->q_flags;
1122 __entry->dqid = dqp->q_id;
1123 __entry->field = field;
1124 __entry->delta = delta;
1126 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s field %s delta %lld",
1127 MAJOR(__entry->dev), MINOR(__entry->dev),
1129 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1130 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1131 __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS),
1135 DECLARE_EVENT_CLASS(xfs_dqtrx_class,
1136 TP_PROTO(struct xfs_dqtrx *qtrx),
1140 __field(xfs_dqtype_t, type)
1141 __field(unsigned int, flags)
1144 __field(uint64_t, blk_res)
1145 __field(int64_t, bcount_delta)
1146 __field(int64_t, delbcnt_delta)
1148 __field(uint64_t, rtblk_res)
1149 __field(uint64_t, rtblk_res_used)
1150 __field(int64_t, rtbcount_delta)
1151 __field(int64_t, delrtb_delta)
1153 __field(uint64_t, ino_res)
1154 __field(uint64_t, ino_res_used)
1155 __field(int64_t, icount_delta)
1158 __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev;
1159 __entry->type = qtrx->qt_dquot->q_type;
1160 __entry->flags = qtrx->qt_dquot->q_flags;
1161 __entry->dqid = qtrx->qt_dquot->q_id;
1163 __entry->blk_res = qtrx->qt_blk_res;
1164 __entry->bcount_delta = qtrx->qt_bcount_delta;
1165 __entry->delbcnt_delta = qtrx->qt_delbcnt_delta;
1167 __entry->rtblk_res = qtrx->qt_rtblk_res;
1168 __entry->rtblk_res_used = qtrx->qt_rtblk_res_used;
1169 __entry->rtbcount_delta = qtrx->qt_rtbcount_delta;
1170 __entry->delrtb_delta = qtrx->qt_delrtb_delta;
1172 __entry->ino_res = qtrx->qt_ino_res;
1173 __entry->ino_res_used = qtrx->qt_ino_res_used;
1174 __entry->icount_delta = qtrx->qt_icount_delta;
1176 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s "
1177 "blk_res %llu bcount_delta %lld delbcnt_delta %lld "
1178 "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld "
1179 "ino_res %llu ino_res_used %llu icount_delta %lld",
1180 MAJOR(__entry->dev), MINOR(__entry->dev),
1182 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1183 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1186 __entry->bcount_delta,
1187 __entry->delbcnt_delta,
1190 __entry->rtblk_res_used,
1191 __entry->rtbcount_delta,
1192 __entry->delrtb_delta,
1195 __entry->ino_res_used,
1196 __entry->icount_delta)
1199 #define DEFINE_DQTRX_EVENT(name) \
1200 DEFINE_EVENT(xfs_dqtrx_class, name, \
1201 TP_PROTO(struct xfs_dqtrx *qtrx), \
1203 DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas);
1204 DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before);
1205 DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after);
1207 DECLARE_EVENT_CLASS(xfs_loggrant_class,
1208 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
1214 __field(int, curr_res)
1215 __field(int, unit_res)
1216 __field(unsigned int, flags)
1217 __field(int, reserveq)
1218 __field(int, writeq)
1219 __field(int, grant_reserve_cycle)
1220 __field(int, grant_reserve_bytes)
1221 __field(int, grant_write_cycle)
1222 __field(int, grant_write_bytes)
1223 __field(int, curr_cycle)
1224 __field(int, curr_block)
1225 __field(xfs_lsn_t, tail_lsn)
1228 __entry->dev = log->l_mp->m_super->s_dev;
1229 __entry->ocnt = tic->t_ocnt;
1230 __entry->cnt = tic->t_cnt;
1231 __entry->curr_res = tic->t_curr_res;
1232 __entry->unit_res = tic->t_unit_res;
1233 __entry->flags = tic->t_flags;
1234 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
1235 __entry->writeq = list_empty(&log->l_write_head.waiters);
1236 xlog_crack_grant_head(&log->l_reserve_head.grant,
1237 &__entry->grant_reserve_cycle,
1238 &__entry->grant_reserve_bytes);
1239 xlog_crack_grant_head(&log->l_write_head.grant,
1240 &__entry->grant_write_cycle,
1241 &__entry->grant_write_bytes);
1242 __entry->curr_cycle = log->l_curr_cycle;
1243 __entry->curr_block = log->l_curr_block;
1244 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
1246 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
1247 "t_unit_res %u t_flags %s reserveq %s "
1248 "writeq %s grant_reserve_cycle %d "
1249 "grant_reserve_bytes %d grant_write_cycle %d "
1250 "grant_write_bytes %d curr_cycle %d curr_block %d "
1251 "tail_cycle %d tail_block %d",
1252 MAJOR(__entry->dev), MINOR(__entry->dev),
1257 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
1258 __entry->reserveq ? "empty" : "active",
1259 __entry->writeq ? "empty" : "active",
1260 __entry->grant_reserve_cycle,
1261 __entry->grant_reserve_bytes,
1262 __entry->grant_write_cycle,
1263 __entry->grant_write_bytes,
1264 __entry->curr_cycle,
1265 __entry->curr_block,
1266 CYCLE_LSN(__entry->tail_lsn),
1267 BLOCK_LSN(__entry->tail_lsn)
1271 #define DEFINE_LOGGRANT_EVENT(name) \
1272 DEFINE_EVENT(xfs_loggrant_class, name, \
1273 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1275 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1276 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1277 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1278 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1279 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1280 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1281 DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1282 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1283 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant);
1284 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit);
1285 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub);
1286 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant);
1287 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub);
1288 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit);
1289 DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait);
1291 DECLARE_EVENT_CLASS(xfs_log_item_class,
1292 TP_PROTO(struct xfs_log_item *lip),
1296 __field(void *, lip)
1298 __field(unsigned long, flags)
1299 __field(xfs_lsn_t, lsn)
1302 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
1304 __entry->type = lip->li_type;
1305 __entry->flags = lip->li_flags;
1306 __entry->lsn = lip->li_lsn;
1308 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
1309 MAJOR(__entry->dev), MINOR(__entry->dev),
1311 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1312 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1313 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1316 TRACE_EVENT(xfs_log_force,
1317 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1318 TP_ARGS(mp, lsn, caller_ip),
1321 __field(xfs_lsn_t, lsn)
1322 __field(unsigned long, caller_ip)
1325 __entry->dev = mp->m_super->s_dev;
1327 __entry->caller_ip = caller_ip;
1329 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
1330 MAJOR(__entry->dev), MINOR(__entry->dev),
1331 __entry->lsn, (void *)__entry->caller_ip)
1334 #define DEFINE_LOG_ITEM_EVENT(name) \
1335 DEFINE_EVENT(xfs_log_item_class, name, \
1336 TP_PROTO(struct xfs_log_item *lip), \
1338 DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1339 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1340 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1341 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1342 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_mark);
1343 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_skip);
1344 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_unpin);
1346 DECLARE_EVENT_CLASS(xfs_ail_class,
1347 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1348 TP_ARGS(lip, old_lsn, new_lsn),
1351 __field(void *, lip)
1353 __field(unsigned long, flags)
1354 __field(xfs_lsn_t, old_lsn)
1355 __field(xfs_lsn_t, new_lsn)
1358 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
1360 __entry->type = lip->li_type;
1361 __entry->flags = lip->li_flags;
1362 __entry->old_lsn = old_lsn;
1363 __entry->new_lsn = new_lsn;
1365 TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s",
1366 MAJOR(__entry->dev), MINOR(__entry->dev),
1368 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1369 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1370 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1371 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1374 #define DEFINE_AIL_EVENT(name) \
1375 DEFINE_EVENT(xfs_ail_class, name, \
1376 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1377 TP_ARGS(lip, old_lsn, new_lsn))
1378 DEFINE_AIL_EVENT(xfs_ail_insert);
1379 DEFINE_AIL_EVENT(xfs_ail_move);
1380 DEFINE_AIL_EVENT(xfs_ail_delete);
1382 TRACE_EVENT(xfs_log_assign_tail_lsn,
1383 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1384 TP_ARGS(log, new_lsn),
1387 __field(xfs_lsn_t, new_lsn)
1388 __field(xfs_lsn_t, old_lsn)
1389 __field(xfs_lsn_t, last_sync_lsn)
1392 __entry->dev = log->l_mp->m_super->s_dev;
1393 __entry->new_lsn = new_lsn;
1394 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1395 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1397 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1398 MAJOR(__entry->dev), MINOR(__entry->dev),
1399 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1400 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1401 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1404 DECLARE_EVENT_CLASS(xfs_file_class,
1405 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter),
1406 TP_ARGS(iocb, iter),
1409 __field(xfs_ino_t, ino)
1410 __field(xfs_fsize_t, size)
1411 __field(loff_t, offset)
1412 __field(size_t, count)
1415 __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
1416 __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
1417 __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size;
1418 __entry->offset = iocb->ki_pos;
1419 __entry->count = iov_iter_count(iter);
1421 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx",
1422 MAJOR(__entry->dev), MINOR(__entry->dev),
1429 #define DEFINE_RW_EVENT(name) \
1430 DEFINE_EVENT(xfs_file_class, name, \
1431 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), \
1432 TP_ARGS(iocb, iter))
1433 DEFINE_RW_EVENT(xfs_file_buffered_read);
1434 DEFINE_RW_EVENT(xfs_file_direct_read);
1435 DEFINE_RW_EVENT(xfs_file_dax_read);
1436 DEFINE_RW_EVENT(xfs_file_buffered_write);
1437 DEFINE_RW_EVENT(xfs_file_direct_write);
1438 DEFINE_RW_EVENT(xfs_file_dax_write);
1439 DEFINE_RW_EVENT(xfs_reflink_bounce_dio_write);
1442 DECLARE_EVENT_CLASS(xfs_imap_class,
1443 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1444 int whichfork, struct xfs_bmbt_irec *irec),
1445 TP_ARGS(ip, offset, count, whichfork, irec),
1448 __field(xfs_ino_t, ino)
1449 __field(loff_t, size)
1450 __field(loff_t, offset)
1451 __field(size_t, count)
1452 __field(int, whichfork)
1453 __field(xfs_fileoff_t, startoff)
1454 __field(xfs_fsblock_t, startblock)
1455 __field(xfs_filblks_t, blockcount)
1458 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1459 __entry->ino = ip->i_ino;
1460 __entry->size = ip->i_disk_size;
1461 __entry->offset = offset;
1462 __entry->count = count;
1463 __entry->whichfork = whichfork;
1464 __entry->startoff = irec ? irec->br_startoff : 0;
1465 __entry->startblock = irec ? irec->br_startblock : 0;
1466 __entry->blockcount = irec ? irec->br_blockcount : 0;
1468 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx "
1469 "fork %s startoff 0x%llx startblock 0x%llx fsbcount 0x%llx",
1470 MAJOR(__entry->dev), MINOR(__entry->dev),
1475 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
1477 (int64_t)__entry->startblock,
1478 __entry->blockcount)
1481 #define DEFINE_IMAP_EVENT(name) \
1482 DEFINE_EVENT(xfs_imap_class, name, \
1483 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1484 int whichfork, struct xfs_bmbt_irec *irec), \
1485 TP_ARGS(ip, offset, count, whichfork, irec))
1486 DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1487 DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1488 DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1489 DEFINE_IMAP_EVENT(xfs_iomap_found);
1491 DECLARE_EVENT_CLASS(xfs_simple_io_class,
1492 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1493 TP_ARGS(ip, offset, count),
1496 __field(xfs_ino_t, ino)
1497 __field(loff_t, isize)
1498 __field(loff_t, disize)
1499 __field(loff_t, offset)
1500 __field(size_t, count)
1503 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1504 __entry->ino = ip->i_ino;
1505 __entry->isize = VFS_I(ip)->i_size;
1506 __entry->disize = ip->i_disk_size;
1507 __entry->offset = offset;
1508 __entry->count = count;
1510 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1511 "pos 0x%llx bytecount 0x%zx",
1512 MAJOR(__entry->dev), MINOR(__entry->dev),
1520 #define DEFINE_SIMPLE_IO_EVENT(name) \
1521 DEFINE_EVENT(xfs_simple_io_class, name, \
1522 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1523 TP_ARGS(ip, offset, count))
1524 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1525 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1526 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1527 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1528 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1529 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1530 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1532 DECLARE_EVENT_CLASS(xfs_itrunc_class,
1533 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1534 TP_ARGS(ip, new_size),
1537 __field(xfs_ino_t, ino)
1538 __field(xfs_fsize_t, size)
1539 __field(xfs_fsize_t, new_size)
1542 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1543 __entry->ino = ip->i_ino;
1544 __entry->size = ip->i_disk_size;
1545 __entry->new_size = new_size;
1547 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx new_size 0x%llx",
1548 MAJOR(__entry->dev), MINOR(__entry->dev),
1554 #define DEFINE_ITRUNC_EVENT(name) \
1555 DEFINE_EVENT(xfs_itrunc_class, name, \
1556 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1557 TP_ARGS(ip, new_size))
1558 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1559 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1561 TRACE_EVENT(xfs_pagecache_inval,
1562 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1563 TP_ARGS(ip, start, finish),
1566 __field(xfs_ino_t, ino)
1567 __field(xfs_fsize_t, size)
1568 __field(xfs_off_t, start)
1569 __field(xfs_off_t, finish)
1572 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1573 __entry->ino = ip->i_ino;
1574 __entry->size = ip->i_disk_size;
1575 __entry->start = start;
1576 __entry->finish = finish;
1578 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx start 0x%llx finish 0x%llx",
1579 MAJOR(__entry->dev), MINOR(__entry->dev),
1586 TRACE_EVENT(xfs_bunmap,
1587 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t fileoff, xfs_filblks_t len,
1588 int flags, unsigned long caller_ip),
1589 TP_ARGS(ip, fileoff, len, flags, caller_ip),
1592 __field(xfs_ino_t, ino)
1593 __field(xfs_fsize_t, size)
1594 __field(xfs_fileoff_t, fileoff)
1595 __field(xfs_filblks_t, len)
1596 __field(unsigned long, caller_ip)
1600 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1601 __entry->ino = ip->i_ino;
1602 __entry->size = ip->i_disk_size;
1603 __entry->fileoff = fileoff;
1605 __entry->caller_ip = caller_ip;
1606 __entry->flags = flags;
1608 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx fileoff 0x%llx fsbcount 0x%llx "
1609 "flags %s caller %pS",
1610 MAJOR(__entry->dev), MINOR(__entry->dev),
1615 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1616 (void *)__entry->caller_ip)
1620 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1621 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1622 xfs_agblock_t agbno, xfs_extlen_t len),
1623 TP_ARGS(mp, agno, agbno, len),
1626 __field(xfs_agnumber_t, agno)
1627 __field(xfs_agblock_t, agbno)
1628 __field(xfs_extlen_t, len)
1631 __entry->dev = mp->m_super->s_dev;
1632 __entry->agno = agno;
1633 __entry->agbno = agbno;
1636 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
1637 MAJOR(__entry->dev), MINOR(__entry->dev),
1642 #define DEFINE_BUSY_EVENT(name) \
1643 DEFINE_EVENT(xfs_extent_busy_class, name, \
1644 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1645 xfs_agblock_t agbno, xfs_extlen_t len), \
1646 TP_ARGS(mp, agno, agbno, len))
1647 DEFINE_BUSY_EVENT(xfs_extent_busy);
1648 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1649 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1650 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1651 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1653 TRACE_EVENT(xfs_extent_busy_trim,
1654 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1655 xfs_agblock_t agbno, xfs_extlen_t len,
1656 xfs_agblock_t tbno, xfs_extlen_t tlen),
1657 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1660 __field(xfs_agnumber_t, agno)
1661 __field(xfs_agblock_t, agbno)
1662 __field(xfs_extlen_t, len)
1663 __field(xfs_agblock_t, tbno)
1664 __field(xfs_extlen_t, tlen)
1667 __entry->dev = mp->m_super->s_dev;
1668 __entry->agno = agno;
1669 __entry->agbno = agbno;
1671 __entry->tbno = tbno;
1672 __entry->tlen = tlen;
1674 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
1675 MAJOR(__entry->dev), MINOR(__entry->dev),
1683 DECLARE_EVENT_CLASS(xfs_agf_class,
1684 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1685 unsigned long caller_ip),
1686 TP_ARGS(mp, agf, flags, caller_ip),
1689 __field(xfs_agnumber_t, agno)
1691 __field(__u32, length)
1692 __field(__u32, bno_root)
1693 __field(__u32, cnt_root)
1694 __field(__u32, bno_level)
1695 __field(__u32, cnt_level)
1696 __field(__u32, flfirst)
1697 __field(__u32, fllast)
1698 __field(__u32, flcount)
1699 __field(__u32, freeblks)
1700 __field(__u32, longest)
1701 __field(unsigned long, caller_ip)
1704 __entry->dev = mp->m_super->s_dev;
1705 __entry->agno = be32_to_cpu(agf->agf_seqno),
1706 __entry->flags = flags;
1707 __entry->length = be32_to_cpu(agf->agf_length),
1708 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1709 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1710 __entry->bno_level =
1711 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1712 __entry->cnt_level =
1713 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1714 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1715 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1716 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1717 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1718 __entry->longest = be32_to_cpu(agf->agf_longest);
1719 __entry->caller_ip = caller_ip;
1721 TP_printk("dev %d:%d agno 0x%x flags %s length %u roots b %u c %u "
1722 "levels b %u c %u flfirst %u fllast %u flcount %u "
1723 "freeblks %u longest %u caller %pS",
1724 MAJOR(__entry->dev), MINOR(__entry->dev),
1726 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1737 (void *)__entry->caller_ip)
1739 #define DEFINE_AGF_EVENT(name) \
1740 DEFINE_EVENT(xfs_agf_class, name, \
1741 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1742 unsigned long caller_ip), \
1743 TP_ARGS(mp, agf, flags, caller_ip))
1744 DEFINE_AGF_EVENT(xfs_agf);
1745 DEFINE_AGF_EVENT(xfs_agfl_reset);
1747 TRACE_EVENT(xfs_free_extent,
1748 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1749 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1751 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
1754 __field(xfs_agnumber_t, agno)
1755 __field(xfs_agblock_t, agbno)
1756 __field(xfs_extlen_t, len)
1758 __field(int, haveleft)
1759 __field(int, haveright)
1762 __entry->dev = mp->m_super->s_dev;
1763 __entry->agno = agno;
1764 __entry->agbno = agbno;
1766 __entry->resv = resv;
1767 __entry->haveleft = haveleft;
1768 __entry->haveright = haveright;
1770 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x resv %d %s",
1771 MAJOR(__entry->dev), MINOR(__entry->dev),
1777 (__entry->haveright ? "both" : "left") :
1778 (__entry->haveright ? "right" : "none"))
1782 DECLARE_EVENT_CLASS(xfs_alloc_class,
1783 TP_PROTO(struct xfs_alloc_arg *args),
1787 __field(xfs_agnumber_t, agno)
1788 __field(xfs_agblock_t, agbno)
1789 __field(xfs_extlen_t, minlen)
1790 __field(xfs_extlen_t, maxlen)
1791 __field(xfs_extlen_t, mod)
1792 __field(xfs_extlen_t, prod)
1793 __field(xfs_extlen_t, minleft)
1794 __field(xfs_extlen_t, total)
1795 __field(xfs_extlen_t, alignment)
1796 __field(xfs_extlen_t, minalignslop)
1797 __field(xfs_extlen_t, len)
1798 __field(short, type)
1799 __field(short, otype)
1800 __field(char, wasdel)
1801 __field(char, wasfromfl)
1803 __field(int, datatype)
1804 __field(xfs_fsblock_t, firstblock)
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->type = args->type;
1820 __entry->otype = args->otype;
1821 __entry->wasdel = args->wasdel;
1822 __entry->wasfromfl = args->wasfromfl;
1823 __entry->resv = args->resv;
1824 __entry->datatype = args->datatype;
1825 __entry->firstblock = args->tp->t_firstblock;
1827 TP_printk("dev %d:%d agno 0x%x agbno 0x%x minlen %u maxlen %u mod %u "
1828 "prod %u minleft %u total %u alignment %u minalignslop %u "
1829 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1830 "datatype 0x%x firstblock 0x%llx",
1831 MAJOR(__entry->dev), MINOR(__entry->dev),
1841 __entry->minalignslop,
1843 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1844 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1849 (unsigned long long)__entry->firstblock)
1852 #define DEFINE_ALLOC_EVENT(name) \
1853 DEFINE_EVENT(xfs_alloc_class, name, \
1854 TP_PROTO(struct xfs_alloc_arg *args), \
1856 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1857 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1858 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1859 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1860 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1861 DEFINE_ALLOC_EVENT(xfs_alloc_cur);
1862 DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
1863 DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
1864 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
1865 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
1866 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1867 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1868 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1869 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1870 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1871 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1872 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1873 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1874 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1875 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1876 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1877 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1878 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1879 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1880 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1881 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1882 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1883 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1885 TRACE_EVENT(xfs_alloc_cur_check,
1886 TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
1887 xfs_extlen_t len, xfs_extlen_t diff, bool new),
1888 TP_ARGS(mp, btnum, bno, len, diff, new),
1891 __field(xfs_btnum_t, btnum)
1892 __field(xfs_agblock_t, bno)
1893 __field(xfs_extlen_t, len)
1894 __field(xfs_extlen_t, diff)
1898 __entry->dev = mp->m_super->s_dev;
1899 __entry->btnum = btnum;
1902 __entry->diff = diff;
1905 TP_printk("dev %d:%d btree %s agbno 0x%x fsbcount 0x%x diff 0x%x new %d",
1906 MAJOR(__entry->dev), MINOR(__entry->dev),
1907 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
1908 __entry->bno, __entry->len, __entry->diff, __entry->new)
1911 DECLARE_EVENT_CLASS(xfs_da_class,
1912 TP_PROTO(struct xfs_da_args *args),
1916 __field(xfs_ino_t, ino)
1917 __dynamic_array(char, name, args->namelen)
1918 __field(int, namelen)
1919 __field(xfs_dahash_t, hashval)
1920 __field(xfs_ino_t, inumber)
1921 __field(uint32_t, op_flags)
1924 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1925 __entry->ino = args->dp->i_ino;
1927 memcpy(__get_str(name), args->name, args->namelen);
1928 __entry->namelen = args->namelen;
1929 __entry->hashval = args->hashval;
1930 __entry->inumber = args->inumber;
1931 __entry->op_flags = args->op_flags;
1933 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1934 "inumber 0x%llx op_flags %s",
1935 MAJOR(__entry->dev), MINOR(__entry->dev),
1938 __entry->namelen ? __get_str(name) : NULL,
1942 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1945 #define DEFINE_DIR2_EVENT(name) \
1946 DEFINE_EVENT(xfs_da_class, name, \
1947 TP_PROTO(struct xfs_da_args *args), \
1949 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1950 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1951 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1952 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1953 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1954 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1955 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1956 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1957 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1958 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1959 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1960 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1961 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1962 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1963 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1964 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1965 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1966 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1967 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1968 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1969 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1970 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1971 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1972 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1973 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1975 DECLARE_EVENT_CLASS(xfs_attr_class,
1976 TP_PROTO(struct xfs_da_args *args),
1980 __field(xfs_ino_t, ino)
1981 __dynamic_array(char, name, args->namelen)
1982 __field(int, namelen)
1983 __field(int, valuelen)
1984 __field(xfs_dahash_t, hashval)
1985 __field(unsigned int, attr_filter)
1986 __field(unsigned int, attr_flags)
1987 __field(uint32_t, op_flags)
1990 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1991 __entry->ino = args->dp->i_ino;
1993 memcpy(__get_str(name), args->name, args->namelen);
1994 __entry->namelen = args->namelen;
1995 __entry->valuelen = args->valuelen;
1996 __entry->hashval = args->hashval;
1997 __entry->attr_filter = args->attr_filter;
1998 __entry->attr_flags = args->attr_flags;
1999 __entry->op_flags = args->op_flags;
2001 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
2002 "hashval 0x%x filter %s flags %s op_flags %s",
2003 MAJOR(__entry->dev), MINOR(__entry->dev),
2006 __entry->namelen ? __get_str(name) : NULL,
2010 __print_flags(__entry->attr_filter, "|",
2011 XFS_ATTR_FILTER_FLAGS),
2012 __print_flags(__entry->attr_flags, "|",
2013 { XATTR_CREATE, "CREATE" },
2014 { XATTR_REPLACE, "REPLACE" }),
2015 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
2018 #define DEFINE_ATTR_EVENT(name) \
2019 DEFINE_EVENT(xfs_attr_class, name, \
2020 TP_PROTO(struct xfs_da_args *args), \
2022 DEFINE_ATTR_EVENT(xfs_attr_sf_add);
2023 DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
2024 DEFINE_ATTR_EVENT(xfs_attr_sf_create);
2025 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
2026 DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
2027 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
2029 DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
2030 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
2031 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
2032 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
2033 DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
2034 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
2035 DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
2036 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
2037 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
2038 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
2039 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
2040 DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
2041 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
2042 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
2043 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
2044 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
2045 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
2046 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
2047 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
2048 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
2049 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
2050 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
2052 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
2053 DEFINE_ATTR_EVENT(xfs_attr_node_get);
2054 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
2055 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
2057 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
2058 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
2060 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
2061 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
2063 #define DEFINE_DA_EVENT(name) \
2064 DEFINE_EVENT(xfs_da_class, name, \
2065 TP_PROTO(struct xfs_da_args *args), \
2067 DEFINE_DA_EVENT(xfs_da_split);
2068 DEFINE_DA_EVENT(xfs_da_join);
2069 DEFINE_DA_EVENT(xfs_da_link_before);
2070 DEFINE_DA_EVENT(xfs_da_link_after);
2071 DEFINE_DA_EVENT(xfs_da_unlink_back);
2072 DEFINE_DA_EVENT(xfs_da_unlink_forward);
2073 DEFINE_DA_EVENT(xfs_da_root_split);
2074 DEFINE_DA_EVENT(xfs_da_root_join);
2075 DEFINE_DA_EVENT(xfs_da_node_add);
2076 DEFINE_DA_EVENT(xfs_da_node_create);
2077 DEFINE_DA_EVENT(xfs_da_node_split);
2078 DEFINE_DA_EVENT(xfs_da_node_remove);
2079 DEFINE_DA_EVENT(xfs_da_node_rebalance);
2080 DEFINE_DA_EVENT(xfs_da_node_unbalance);
2081 DEFINE_DA_EVENT(xfs_da_node_toosmall);
2082 DEFINE_DA_EVENT(xfs_da_swap_lastblock);
2083 DEFINE_DA_EVENT(xfs_da_grow_inode);
2084 DEFINE_DA_EVENT(xfs_da_shrink_inode);
2085 DEFINE_DA_EVENT(xfs_da_fixhashpath);
2086 DEFINE_DA_EVENT(xfs_da_path_shift);
2088 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
2089 TP_PROTO(struct xfs_da_args *args, int idx),
2093 __field(xfs_ino_t, ino)
2094 __field(uint32_t, op_flags)
2098 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2099 __entry->ino = args->dp->i_ino;
2100 __entry->op_flags = args->op_flags;
2103 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
2104 MAJOR(__entry->dev), MINOR(__entry->dev),
2106 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2110 #define DEFINE_DIR2_SPACE_EVENT(name) \
2111 DEFINE_EVENT(xfs_dir2_space_class, name, \
2112 TP_PROTO(struct xfs_da_args *args, int idx), \
2114 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
2115 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
2116 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
2117 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
2119 TRACE_EVENT(xfs_dir2_leafn_moveents,
2120 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
2121 TP_ARGS(args, src_idx, dst_idx, count),
2124 __field(xfs_ino_t, ino)
2125 __field(uint32_t, op_flags)
2126 __field(int, src_idx)
2127 __field(int, dst_idx)
2131 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2132 __entry->ino = args->dp->i_ino;
2133 __entry->op_flags = args->op_flags;
2134 __entry->src_idx = src_idx;
2135 __entry->dst_idx = dst_idx;
2136 __entry->count = count;
2138 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
2139 "src_idx %d dst_idx %d count %d",
2140 MAJOR(__entry->dev), MINOR(__entry->dev),
2142 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2148 #define XFS_SWAPEXT_INODES \
2152 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
2153 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
2154 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
2155 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
2156 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
2158 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
2159 TP_PROTO(struct xfs_inode *ip, int which),
2164 __field(xfs_ino_t, ino)
2165 __field(int, format)
2166 __field(xfs_extnum_t, nex)
2167 __field(int, broot_size)
2168 __field(int, fork_off)
2171 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2172 __entry->which = which;
2173 __entry->ino = ip->i_ino;
2174 __entry->format = ip->i_df.if_format;
2175 __entry->nex = ip->i_df.if_nextents;
2176 __entry->broot_size = ip->i_df.if_broot_bytes;
2177 __entry->fork_off = xfs_inode_fork_boff(ip);
2179 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %llu, "
2180 "broot size %d, forkoff 0x%x",
2181 MAJOR(__entry->dev), MINOR(__entry->dev),
2183 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
2184 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
2186 __entry->broot_size,
2190 #define DEFINE_SWAPEXT_EVENT(name) \
2191 DEFINE_EVENT(xfs_swap_extent_class, name, \
2192 TP_PROTO(struct xfs_inode *ip, int which), \
2195 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
2196 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
2198 TRACE_EVENT(xfs_log_recover,
2199 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
2200 TP_ARGS(log, headblk, tailblk),
2203 __field(xfs_daddr_t, headblk)
2204 __field(xfs_daddr_t, tailblk)
2207 __entry->dev = log->l_mp->m_super->s_dev;
2208 __entry->headblk = headblk;
2209 __entry->tailblk = tailblk;
2211 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2212 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2216 TRACE_EVENT(xfs_log_recover_record,
2217 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2218 TP_ARGS(log, rhead, pass),
2221 __field(xfs_lsn_t, lsn)
2223 __field(int, num_logops)
2227 __entry->dev = log->l_mp->m_super->s_dev;
2228 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2229 __entry->len = be32_to_cpu(rhead->h_len);
2230 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2231 __entry->pass = pass;
2233 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2234 MAJOR(__entry->dev), MINOR(__entry->dev),
2235 __entry->lsn, __entry->len, __entry->num_logops,
2239 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2240 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2241 struct xlog_recover_item *item, int pass),
2242 TP_ARGS(log, trans, item, pass),
2245 __field(unsigned long, item)
2246 __field(xlog_tid_t, tid)
2247 __field(xfs_lsn_t, lsn)
2254 __entry->dev = log->l_mp->m_super->s_dev;
2255 __entry->item = (unsigned long)item;
2256 __entry->tid = trans->r_log_tid;
2257 __entry->lsn = trans->r_lsn;
2258 __entry->type = ITEM_TYPE(item);
2259 __entry->pass = pass;
2260 __entry->count = item->ri_cnt;
2261 __entry->total = item->ri_total;
2263 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
2264 "item type %s item region count/total %d/%d",
2265 MAJOR(__entry->dev), MINOR(__entry->dev),
2269 (void *)__entry->item,
2270 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2275 #define DEFINE_LOG_RECOVER_ITEM(name) \
2276 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2277 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2278 struct xlog_recover_item *item, int pass), \
2279 TP_ARGS(log, trans, item, pass))
2281 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2282 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2283 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2284 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2285 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2287 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2288 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2289 TP_ARGS(log, buf_f),
2292 __field(int64_t, blkno)
2293 __field(unsigned short, len)
2294 __field(unsigned short, flags)
2295 __field(unsigned short, size)
2296 __field(unsigned int, map_size)
2299 __entry->dev = log->l_mp->m_super->s_dev;
2300 __entry->blkno = buf_f->blf_blkno;
2301 __entry->len = buf_f->blf_len;
2302 __entry->flags = buf_f->blf_flags;
2303 __entry->size = buf_f->blf_size;
2304 __entry->map_size = buf_f->blf_map_size;
2306 TP_printk("dev %d:%d daddr 0x%llx, bbcount 0x%x, flags 0x%x, size %d, "
2308 MAJOR(__entry->dev), MINOR(__entry->dev),
2316 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2317 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2318 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2319 TP_ARGS(log, buf_f))
2321 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2322 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2323 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2324 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2325 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2326 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2327 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2328 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2329 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2331 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2332 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2336 __field(xfs_ino_t, ino)
2337 __field(unsigned short, size)
2338 __field(int, fields)
2339 __field(unsigned short, asize)
2340 __field(unsigned short, dsize)
2341 __field(int64_t, blkno)
2343 __field(int, boffset)
2346 __entry->dev = log->l_mp->m_super->s_dev;
2347 __entry->ino = in_f->ilf_ino;
2348 __entry->size = in_f->ilf_size;
2349 __entry->fields = in_f->ilf_fields;
2350 __entry->asize = in_f->ilf_asize;
2351 __entry->dsize = in_f->ilf_dsize;
2352 __entry->blkno = in_f->ilf_blkno;
2353 __entry->len = in_f->ilf_len;
2354 __entry->boffset = in_f->ilf_boffset;
2356 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2357 "dsize %d, daddr 0x%llx, bbcount 0x%x, boffset %d",
2358 MAJOR(__entry->dev), MINOR(__entry->dev),
2368 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2369 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2370 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2373 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2374 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2375 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2377 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2378 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2382 __field(xfs_agnumber_t, agno)
2383 __field(xfs_agblock_t, agbno)
2384 __field(unsigned int, count)
2385 __field(unsigned int, isize)
2386 __field(xfs_agblock_t, length)
2387 __field(unsigned int, gen)
2390 __entry->dev = log->l_mp->m_super->s_dev;
2391 __entry->agno = be32_to_cpu(in_f->icl_ag);
2392 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2393 __entry->count = be32_to_cpu(in_f->icl_count);
2394 __entry->isize = be32_to_cpu(in_f->icl_isize);
2395 __entry->length = be32_to_cpu(in_f->icl_length);
2396 __entry->gen = be32_to_cpu(in_f->icl_gen);
2398 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x ireccount %u isize %u gen 0x%x",
2399 MAJOR(__entry->dev), MINOR(__entry->dev),
2407 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2408 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2409 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2412 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2413 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2415 DECLARE_EVENT_CLASS(xfs_discard_class,
2416 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2417 xfs_agblock_t agbno, xfs_extlen_t len),
2418 TP_ARGS(mp, agno, agbno, len),
2421 __field(xfs_agnumber_t, agno)
2422 __field(xfs_agblock_t, agbno)
2423 __field(xfs_extlen_t, len)
2426 __entry->dev = mp->m_super->s_dev;
2427 __entry->agno = agno;
2428 __entry->agbno = agbno;
2431 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
2432 MAJOR(__entry->dev), MINOR(__entry->dev),
2438 #define DEFINE_DISCARD_EVENT(name) \
2439 DEFINE_EVENT(xfs_discard_class, name, \
2440 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2441 xfs_agblock_t agbno, xfs_extlen_t len), \
2442 TP_ARGS(mp, agno, agbno, len))
2443 DEFINE_DISCARD_EVENT(xfs_discard_extent);
2444 DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2445 DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2446 DEFINE_DISCARD_EVENT(xfs_discard_busy);
2448 /* btree cursor events */
2449 TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2450 TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2451 TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2452 TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2453 TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2454 TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2455 TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2457 DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2458 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2459 TP_ARGS(cur, level, bp),
2462 __field(xfs_btnum_t, btnum)
2464 __field(int, nlevels)
2466 __field(xfs_daddr_t, daddr)
2469 __entry->dev = cur->bc_mp->m_super->s_dev;
2470 __entry->btnum = cur->bc_btnum;
2471 __entry->level = level;
2472 __entry->nlevels = cur->bc_nlevels;
2473 __entry->ptr = cur->bc_levels[level].ptr;
2474 __entry->daddr = bp ? xfs_buf_daddr(bp) : -1;
2476 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
2477 MAJOR(__entry->dev), MINOR(__entry->dev),
2478 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
2482 (unsigned long long)__entry->daddr)
2485 #define DEFINE_BTREE_CUR_EVENT(name) \
2486 DEFINE_EVENT(xfs_btree_cur_class, name, \
2487 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2488 TP_ARGS(cur, level, bp))
2489 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2490 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2493 struct xfs_defer_pending;
2495 DECLARE_EVENT_CLASS(xfs_defer_class,
2496 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2497 TP_ARGS(tp, caller_ip),
2500 __field(struct xfs_trans *, tp)
2501 __field(char, committed)
2502 __field(unsigned long, caller_ip)
2505 __entry->dev = tp->t_mountp->m_super->s_dev;
2507 __entry->caller_ip = caller_ip;
2509 TP_printk("dev %d:%d tp %p caller %pS",
2510 MAJOR(__entry->dev), MINOR(__entry->dev),
2512 (char *)__entry->caller_ip)
2514 #define DEFINE_DEFER_EVENT(name) \
2515 DEFINE_EVENT(xfs_defer_class, name, \
2516 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2517 TP_ARGS(tp, caller_ip))
2519 DECLARE_EVENT_CLASS(xfs_defer_error_class,
2520 TP_PROTO(struct xfs_trans *tp, int error),
2524 __field(struct xfs_trans *, tp)
2525 __field(char, committed)
2529 __entry->dev = tp->t_mountp->m_super->s_dev;
2531 __entry->error = error;
2533 TP_printk("dev %d:%d tp %p err %d",
2534 MAJOR(__entry->dev), MINOR(__entry->dev),
2538 #define DEFINE_DEFER_ERROR_EVENT(name) \
2539 DEFINE_EVENT(xfs_defer_error_class, name, \
2540 TP_PROTO(struct xfs_trans *tp, int error), \
2543 DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2544 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2549 __field(void *, intent)
2550 __field(char, committed)
2554 __entry->dev = mp ? mp->m_super->s_dev : 0;
2555 __entry->type = dfp->dfp_type;
2556 __entry->intent = dfp->dfp_intent;
2557 __entry->committed = dfp->dfp_done != NULL;
2558 __entry->nr = dfp->dfp_count;
2560 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
2561 MAJOR(__entry->dev), MINOR(__entry->dev),
2567 #define DEFINE_DEFER_PENDING_EVENT(name) \
2568 DEFINE_EVENT(xfs_defer_pending_class, name, \
2569 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2572 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2573 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2574 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2575 TP_ARGS(mp, agno, type, agbno, len),
2578 __field(xfs_agnumber_t, agno)
2580 __field(xfs_agblock_t, agbno)
2581 __field(xfs_extlen_t, len)
2584 __entry->dev = mp->m_super->s_dev;
2585 __entry->agno = agno;
2586 __entry->type = type;
2587 __entry->agbno = agbno;
2590 TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x fsbcount 0x%x",
2591 MAJOR(__entry->dev), MINOR(__entry->dev),
2597 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2598 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2599 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2601 xfs_agblock_t bno, \
2602 xfs_extlen_t len), \
2603 TP_ARGS(mp, agno, type, bno, len))
2605 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2606 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2608 xfs_agblock_t agbno,
2611 xfs_fileoff_t offset,
2613 xfs_exntst_t state),
2614 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2617 __field(xfs_agnumber_t, agno)
2618 __field(xfs_ino_t, ino)
2619 __field(xfs_agblock_t, agbno)
2620 __field(int, whichfork)
2621 __field(xfs_fileoff_t, l_loff)
2622 __field(xfs_filblks_t, l_len)
2623 __field(xfs_exntst_t, l_state)
2627 __entry->dev = mp->m_super->s_dev;
2628 __entry->agno = agno;
2630 __entry->agbno = agbno;
2631 __entry->whichfork = whichfork;
2632 __entry->l_loff = offset;
2633 __entry->l_len = len;
2634 __entry->l_state = state;
2637 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",
2638 MAJOR(__entry->dev), MINOR(__entry->dev),
2643 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
2648 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2649 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2650 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2652 xfs_agblock_t agbno, \
2655 xfs_fileoff_t offset, \
2656 xfs_filblks_t len, \
2657 xfs_exntst_t state), \
2658 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2660 DEFINE_DEFER_EVENT(xfs_defer_cancel);
2661 DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2662 DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2663 DEFINE_DEFER_EVENT(xfs_defer_finish);
2664 DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2666 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2667 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2669 DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2670 DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
2671 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2672 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2673 DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent);
2675 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2676 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2677 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2678 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2679 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
2681 /* rmap tracepoints */
2682 DECLARE_EVENT_CLASS(xfs_rmap_class,
2683 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2684 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2685 const struct xfs_owner_info *oinfo),
2686 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2689 __field(xfs_agnumber_t, agno)
2690 __field(xfs_agblock_t, agbno)
2691 __field(xfs_extlen_t, len)
2692 __field(uint64_t, owner)
2693 __field(uint64_t, offset)
2694 __field(unsigned long, flags)
2697 __entry->dev = mp->m_super->s_dev;
2698 __entry->agno = agno;
2699 __entry->agbno = agbno;
2701 __entry->owner = oinfo->oi_owner;
2702 __entry->offset = oinfo->oi_offset;
2703 __entry->flags = oinfo->oi_flags;
2705 __entry->flags |= XFS_RMAP_UNWRITTEN;
2707 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%lx",
2708 MAJOR(__entry->dev), MINOR(__entry->dev),
2716 #define DEFINE_RMAP_EVENT(name) \
2717 DEFINE_EVENT(xfs_rmap_class, name, \
2718 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2719 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2720 const struct xfs_owner_info *oinfo), \
2721 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2723 /* simple AG-based error/%ip tracepoint class */
2724 DECLARE_EVENT_CLASS(xfs_ag_error_class,
2725 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2726 unsigned long caller_ip),
2727 TP_ARGS(mp, agno, error, caller_ip),
2730 __field(xfs_agnumber_t, agno)
2732 __field(unsigned long, caller_ip)
2735 __entry->dev = mp->m_super->s_dev;
2736 __entry->agno = agno;
2737 __entry->error = error;
2738 __entry->caller_ip = caller_ip;
2740 TP_printk("dev %d:%d agno 0x%x error %d caller %pS",
2741 MAJOR(__entry->dev), MINOR(__entry->dev),
2744 (char *)__entry->caller_ip)
2747 #define DEFINE_AG_ERROR_EVENT(name) \
2748 DEFINE_EVENT(xfs_ag_error_class, name, \
2749 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2750 unsigned long caller_ip), \
2751 TP_ARGS(mp, agno, error, caller_ip))
2753 DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2754 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2755 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2756 DEFINE_RMAP_EVENT(xfs_rmap_map);
2757 DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2758 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2759 DEFINE_RMAP_EVENT(xfs_rmap_convert);
2760 DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2761 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2762 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
2764 DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2765 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2766 xfs_agblock_t agbno, xfs_extlen_t len,
2767 uint64_t owner, uint64_t offset, unsigned int flags),
2768 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2771 __field(xfs_agnumber_t, agno)
2772 __field(xfs_agblock_t, agbno)
2773 __field(xfs_extlen_t, len)
2774 __field(uint64_t, owner)
2775 __field(uint64_t, offset)
2776 __field(unsigned int, flags)
2779 __entry->dev = mp->m_super->s_dev;
2780 __entry->agno = agno;
2781 __entry->agbno = agbno;
2783 __entry->owner = owner;
2784 __entry->offset = offset;
2785 __entry->flags = flags;
2787 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
2788 MAJOR(__entry->dev), MINOR(__entry->dev),
2796 #define DEFINE_RMAPBT_EVENT(name) \
2797 DEFINE_EVENT(xfs_rmapbt_class, name, \
2798 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2799 xfs_agblock_t agbno, xfs_extlen_t len, \
2800 uint64_t owner, uint64_t offset, unsigned int flags), \
2801 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2803 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2804 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2805 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2807 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2808 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
2809 DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2810 DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2811 DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2812 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2813 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2814 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
2816 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2817 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2818 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2819 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
2820 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2821 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
2822 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
2824 /* deferred bmbt updates */
2825 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2826 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2827 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2829 /* per-AG reservation */
2830 DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2831 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2833 TP_ARGS(pag, resv, len),
2836 __field(xfs_agnumber_t, agno)
2838 __field(xfs_extlen_t, freeblks)
2839 __field(xfs_extlen_t, flcount)
2840 __field(xfs_extlen_t, reserved)
2841 __field(xfs_extlen_t, asked)
2842 __field(xfs_extlen_t, len)
2845 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2847 __entry->dev = pag->pag_mount->m_super->s_dev;
2848 __entry->agno = pag->pag_agno;
2849 __entry->resv = resv;
2850 __entry->freeblks = pag->pagf_freeblks;
2851 __entry->flcount = pag->pagf_flcount;
2852 __entry->reserved = r ? r->ar_reserved : 0;
2853 __entry->asked = r ? r->ar_asked : 0;
2856 TP_printk("dev %d:%d agno 0x%x resv %d freeblks %u flcount %u "
2857 "resv %u ask %u len %u",
2858 MAJOR(__entry->dev), MINOR(__entry->dev),
2867 #define DEFINE_AG_RESV_EVENT(name) \
2868 DEFINE_EVENT(xfs_ag_resv_class, name, \
2869 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2870 xfs_extlen_t len), \
2871 TP_ARGS(pag, type, len))
2873 /* per-AG reservation tracepoints */
2874 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2875 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2876 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2877 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2878 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2879 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2881 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2882 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2884 /* refcount tracepoint classes */
2886 /* reuse the discard trace class for agbno/aglen-based traces */
2887 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2889 /* ag btree lookup tracepoint class */
2890 TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2891 TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2892 TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
2893 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2894 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2895 xfs_agblock_t agbno, xfs_lookup_t dir),
2896 TP_ARGS(mp, agno, agbno, dir),
2899 __field(xfs_agnumber_t, agno)
2900 __field(xfs_agblock_t, agbno)
2901 __field(xfs_lookup_t, dir)
2904 __entry->dev = mp->m_super->s_dev;
2905 __entry->agno = agno;
2906 __entry->agbno = agbno;
2909 TP_printk("dev %d:%d agno 0x%x agbno 0x%x cmp %s(%d)",
2910 MAJOR(__entry->dev), MINOR(__entry->dev),
2913 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2917 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2918 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2919 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2920 xfs_agblock_t agbno, xfs_lookup_t dir), \
2921 TP_ARGS(mp, agno, agbno, dir))
2923 /* single-rcext tracepoint class */
2924 DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2925 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2926 struct xfs_refcount_irec *irec),
2927 TP_ARGS(mp, agno, irec),
2930 __field(xfs_agnumber_t, agno)
2931 __field(enum xfs_refc_domain, domain)
2932 __field(xfs_agblock_t, startblock)
2933 __field(xfs_extlen_t, blockcount)
2934 __field(xfs_nlink_t, refcount)
2937 __entry->dev = mp->m_super->s_dev;
2938 __entry->agno = agno;
2939 __entry->domain = irec->rc_domain;
2940 __entry->startblock = irec->rc_startblock;
2941 __entry->blockcount = irec->rc_blockcount;
2942 __entry->refcount = irec->rc_refcount;
2944 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u",
2945 MAJOR(__entry->dev), MINOR(__entry->dev),
2947 __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
2948 __entry->startblock,
2949 __entry->blockcount,
2953 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2954 DEFINE_EVENT(xfs_refcount_extent_class, name, \
2955 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2956 struct xfs_refcount_irec *irec), \
2957 TP_ARGS(mp, agno, irec))
2959 /* single-rcext and an agbno tracepoint class */
2960 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2961 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2962 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2963 TP_ARGS(mp, agno, irec, agbno),
2966 __field(xfs_agnumber_t, agno)
2967 __field(enum xfs_refc_domain, domain)
2968 __field(xfs_agblock_t, startblock)
2969 __field(xfs_extlen_t, blockcount)
2970 __field(xfs_nlink_t, refcount)
2971 __field(xfs_agblock_t, agbno)
2974 __entry->dev = mp->m_super->s_dev;
2975 __entry->agno = agno;
2976 __entry->domain = irec->rc_domain;
2977 __entry->startblock = irec->rc_startblock;
2978 __entry->blockcount = irec->rc_blockcount;
2979 __entry->refcount = irec->rc_refcount;
2980 __entry->agbno = agbno;
2982 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
2983 MAJOR(__entry->dev), MINOR(__entry->dev),
2985 __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
2986 __entry->startblock,
2987 __entry->blockcount,
2992 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2993 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2994 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2995 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2996 TP_ARGS(mp, agno, irec, agbno))
2998 /* double-rcext tracepoint class */
2999 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
3000 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3001 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
3002 TP_ARGS(mp, agno, i1, i2),
3005 __field(xfs_agnumber_t, agno)
3006 __field(enum xfs_refc_domain, i1_domain)
3007 __field(xfs_agblock_t, i1_startblock)
3008 __field(xfs_extlen_t, i1_blockcount)
3009 __field(xfs_nlink_t, i1_refcount)
3010 __field(enum xfs_refc_domain, i2_domain)
3011 __field(xfs_agblock_t, i2_startblock)
3012 __field(xfs_extlen_t, i2_blockcount)
3013 __field(xfs_nlink_t, i2_refcount)
3016 __entry->dev = mp->m_super->s_dev;
3017 __entry->agno = agno;
3018 __entry->i1_domain = i1->rc_domain;
3019 __entry->i1_startblock = i1->rc_startblock;
3020 __entry->i1_blockcount = i1->rc_blockcount;
3021 __entry->i1_refcount = i1->rc_refcount;
3022 __entry->i2_domain = i2->rc_domain;
3023 __entry->i2_startblock = i2->rc_startblock;
3024 __entry->i2_blockcount = i2->rc_blockcount;
3025 __entry->i2_refcount = i2->rc_refcount;
3027 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3028 "dom %s agbno 0x%x fsbcount 0x%x refcount %u",
3029 MAJOR(__entry->dev), MINOR(__entry->dev),
3031 __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
3032 __entry->i1_startblock,
3033 __entry->i1_blockcount,
3034 __entry->i1_refcount,
3035 __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
3036 __entry->i2_startblock,
3037 __entry->i2_blockcount,
3038 __entry->i2_refcount)
3041 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
3042 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
3043 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3044 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
3045 TP_ARGS(mp, agno, i1, i2))
3047 /* double-rcext and an agbno tracepoint class */
3048 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
3049 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3050 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3051 xfs_agblock_t agbno),
3052 TP_ARGS(mp, agno, i1, i2, agbno),
3055 __field(xfs_agnumber_t, agno)
3056 __field(enum xfs_refc_domain, i1_domain)
3057 __field(xfs_agblock_t, i1_startblock)
3058 __field(xfs_extlen_t, i1_blockcount)
3059 __field(xfs_nlink_t, i1_refcount)
3060 __field(enum xfs_refc_domain, i2_domain)
3061 __field(xfs_agblock_t, i2_startblock)
3062 __field(xfs_extlen_t, i2_blockcount)
3063 __field(xfs_nlink_t, i2_refcount)
3064 __field(xfs_agblock_t, agbno)
3067 __entry->dev = mp->m_super->s_dev;
3068 __entry->agno = agno;
3069 __entry->i1_domain = i1->rc_domain;
3070 __entry->i1_startblock = i1->rc_startblock;
3071 __entry->i1_blockcount = i1->rc_blockcount;
3072 __entry->i1_refcount = i1->rc_refcount;
3073 __entry->i2_domain = i2->rc_domain;
3074 __entry->i2_startblock = i2->rc_startblock;
3075 __entry->i2_blockcount = i2->rc_blockcount;
3076 __entry->i2_refcount = i2->rc_refcount;
3077 __entry->agbno = agbno;
3079 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3080 "dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
3081 MAJOR(__entry->dev), MINOR(__entry->dev),
3083 __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
3084 __entry->i1_startblock,
3085 __entry->i1_blockcount,
3086 __entry->i1_refcount,
3087 __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
3088 __entry->i2_startblock,
3089 __entry->i2_blockcount,
3090 __entry->i2_refcount,
3094 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
3095 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
3096 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3097 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3098 xfs_agblock_t agbno), \
3099 TP_ARGS(mp, agno, i1, i2, agbno))
3101 /* triple-rcext tracepoint class */
3102 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
3103 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3104 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3105 struct xfs_refcount_irec *i3),
3106 TP_ARGS(mp, agno, i1, i2, i3),
3109 __field(xfs_agnumber_t, agno)
3110 __field(enum xfs_refc_domain, i1_domain)
3111 __field(xfs_agblock_t, i1_startblock)
3112 __field(xfs_extlen_t, i1_blockcount)
3113 __field(xfs_nlink_t, i1_refcount)
3114 __field(enum xfs_refc_domain, i2_domain)
3115 __field(xfs_agblock_t, i2_startblock)
3116 __field(xfs_extlen_t, i2_blockcount)
3117 __field(xfs_nlink_t, i2_refcount)
3118 __field(enum xfs_refc_domain, i3_domain)
3119 __field(xfs_agblock_t, i3_startblock)
3120 __field(xfs_extlen_t, i3_blockcount)
3121 __field(xfs_nlink_t, i3_refcount)
3124 __entry->dev = mp->m_super->s_dev;
3125 __entry->agno = agno;
3126 __entry->i1_domain = i1->rc_domain;
3127 __entry->i1_startblock = i1->rc_startblock;
3128 __entry->i1_blockcount = i1->rc_blockcount;
3129 __entry->i1_refcount = i1->rc_refcount;
3130 __entry->i2_domain = i2->rc_domain;
3131 __entry->i2_startblock = i2->rc_startblock;
3132 __entry->i2_blockcount = i2->rc_blockcount;
3133 __entry->i2_refcount = i2->rc_refcount;
3134 __entry->i3_domain = i3->rc_domain;
3135 __entry->i3_startblock = i3->rc_startblock;
3136 __entry->i3_blockcount = i3->rc_blockcount;
3137 __entry->i3_refcount = i3->rc_refcount;
3139 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3140 "dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3141 "dom %s agbno 0x%x fsbcount 0x%x refcount %u",
3142 MAJOR(__entry->dev), MINOR(__entry->dev),
3144 __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
3145 __entry->i1_startblock,
3146 __entry->i1_blockcount,
3147 __entry->i1_refcount,
3148 __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
3149 __entry->i2_startblock,
3150 __entry->i2_blockcount,
3151 __entry->i2_refcount,
3152 __print_symbolic(__entry->i3_domain, XFS_REFC_DOMAIN_STRINGS),
3153 __entry->i3_startblock,
3154 __entry->i3_blockcount,
3155 __entry->i3_refcount)
3158 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
3159 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
3160 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3161 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3162 struct xfs_refcount_irec *i3), \
3163 TP_ARGS(mp, agno, i1, i2, i3))
3165 /* refcount btree tracepoints */
3166 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
3167 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
3168 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
3169 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
3170 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
3171 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
3172 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
3173 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
3174 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
3175 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
3177 /* refcount adjustment tracepoints */
3178 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
3179 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
3180 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
3181 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
3182 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
3183 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
3184 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
3185 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
3186 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
3187 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
3188 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
3189 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
3190 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
3191 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
3192 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
3193 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
3194 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
3195 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
3196 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
3197 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
3198 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
3200 /* reflink helpers */
3201 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
3202 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
3203 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
3204 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
3205 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
3206 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
3208 TRACE_EVENT(xfs_refcount_finish_one_leftover,
3209 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3210 int type, xfs_agblock_t agbno, xfs_extlen_t len,
3211 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
3212 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
3215 __field(xfs_agnumber_t, agno)
3217 __field(xfs_agblock_t, agbno)
3218 __field(xfs_extlen_t, len)
3219 __field(xfs_agblock_t, new_agbno)
3220 __field(xfs_extlen_t, new_len)
3223 __entry->dev = mp->m_super->s_dev;
3224 __entry->agno = agno;
3225 __entry->type = type;
3226 __entry->agbno = agbno;
3228 __entry->new_agbno = new_agbno;
3229 __entry->new_len = new_len;
3231 TP_printk("dev %d:%d type %d agno 0x%x agbno 0x%x fsbcount 0x%x new_agbno 0x%x new_fsbcount 0x%x",
3232 MAJOR(__entry->dev), MINOR(__entry->dev),
3241 /* simple inode-based error/%ip tracepoint class */
3242 DECLARE_EVENT_CLASS(xfs_inode_error_class,
3243 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3244 TP_ARGS(ip, error, caller_ip),
3247 __field(xfs_ino_t, ino)
3249 __field(unsigned long, caller_ip)
3252 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3253 __entry->ino = ip->i_ino;
3254 __entry->error = error;
3255 __entry->caller_ip = caller_ip;
3257 TP_printk("dev %d:%d ino 0x%llx error %d caller %pS",
3258 MAJOR(__entry->dev), MINOR(__entry->dev),
3261 (char *)__entry->caller_ip)
3264 #define DEFINE_INODE_ERROR_EVENT(name) \
3265 DEFINE_EVENT(xfs_inode_error_class, name, \
3266 TP_PROTO(struct xfs_inode *ip, int error, \
3267 unsigned long caller_ip), \
3268 TP_ARGS(ip, error, caller_ip))
3270 /* reflink tracepoint classes */
3272 /* two-file io tracepoint class */
3273 DECLARE_EVENT_CLASS(xfs_double_io_class,
3274 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3275 struct xfs_inode *dest, xfs_off_t doffset),
3276 TP_ARGS(src, soffset, len, dest, doffset),
3279 __field(xfs_ino_t, src_ino)
3280 __field(loff_t, src_isize)
3281 __field(loff_t, src_disize)
3282 __field(loff_t, src_offset)
3283 __field(long long, len)
3284 __field(xfs_ino_t, dest_ino)
3285 __field(loff_t, dest_isize)
3286 __field(loff_t, dest_disize)
3287 __field(loff_t, dest_offset)
3290 __entry->dev = VFS_I(src)->i_sb->s_dev;
3291 __entry->src_ino = src->i_ino;
3292 __entry->src_isize = VFS_I(src)->i_size;
3293 __entry->src_disize = src->i_disk_size;
3294 __entry->src_offset = soffset;
3296 __entry->dest_ino = dest->i_ino;
3297 __entry->dest_isize = VFS_I(dest)->i_size;
3298 __entry->dest_disize = dest->i_disk_size;
3299 __entry->dest_offset = doffset;
3301 TP_printk("dev %d:%d bytecount 0x%llx "
3302 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx -> "
3303 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx",
3304 MAJOR(__entry->dev), MINOR(__entry->dev),
3308 __entry->src_disize,
3309 __entry->src_offset,
3311 __entry->dest_isize,
3312 __entry->dest_disize,
3313 __entry->dest_offset)
3316 #define DEFINE_DOUBLE_IO_EVENT(name) \
3317 DEFINE_EVENT(xfs_double_io_class, name, \
3318 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3319 struct xfs_inode *dest, xfs_off_t doffset), \
3320 TP_ARGS(src, soffset, len, dest, doffset))
3322 /* inode/irec events */
3323 DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3324 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3328 __field(xfs_ino_t, ino)
3329 __field(xfs_fileoff_t, lblk)
3330 __field(xfs_extlen_t, len)
3331 __field(xfs_fsblock_t, pblk)
3335 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3336 __entry->ino = ip->i_ino;
3337 __entry->lblk = irec->br_startoff;
3338 __entry->len = irec->br_blockcount;
3339 __entry->pblk = irec->br_startblock;
3340 __entry->state = irec->br_state;
3342 TP_printk("dev %d:%d ino 0x%llx fileoff 0x%llx fsbcount 0x%x startblock 0x%llx st %d",
3343 MAJOR(__entry->dev), MINOR(__entry->dev),
3350 #define DEFINE_INODE_IREC_EVENT(name) \
3351 DEFINE_EVENT(xfs_inode_irec_class, name, \
3352 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3355 /* refcount/reflink tracepoint definitions */
3357 /* reflink tracepoints */
3358 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3359 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3360 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3361 TRACE_EVENT(xfs_reflink_remap_blocks,
3362 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3363 xfs_filblks_t len, struct xfs_inode *dest,
3364 xfs_fileoff_t doffset),
3365 TP_ARGS(src, soffset, len, dest, doffset),
3368 __field(xfs_ino_t, src_ino)
3369 __field(xfs_fileoff_t, src_lblk)
3370 __field(xfs_filblks_t, len)
3371 __field(xfs_ino_t, dest_ino)
3372 __field(xfs_fileoff_t, dest_lblk)
3375 __entry->dev = VFS_I(src)->i_sb->s_dev;
3376 __entry->src_ino = src->i_ino;
3377 __entry->src_lblk = soffset;
3379 __entry->dest_ino = dest->i_ino;
3380 __entry->dest_lblk = doffset;
3382 TP_printk("dev %d:%d fsbcount 0x%llx "
3383 "ino 0x%llx fileoff 0x%llx -> ino 0x%llx fileoff 0x%llx",
3384 MAJOR(__entry->dev), MINOR(__entry->dev),
3391 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3392 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3393 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3394 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
3395 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3396 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3397 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
3398 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
3400 /* dedupe tracepoints */
3401 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3402 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3404 /* ioctl tracepoints */
3405 TRACE_EVENT(xfs_ioctl_clone,
3406 TP_PROTO(struct inode *src, struct inode *dest),
3410 __field(unsigned long, src_ino)
3411 __field(loff_t, src_isize)
3412 __field(unsigned long, dest_ino)
3413 __field(loff_t, dest_isize)
3416 __entry->dev = src->i_sb->s_dev;
3417 __entry->src_ino = src->i_ino;
3418 __entry->src_isize = i_size_read(src);
3419 __entry->dest_ino = dest->i_ino;
3420 __entry->dest_isize = i_size_read(dest);
3422 TP_printk("dev %d:%d ino 0x%lx isize 0x%llx -> ino 0x%lx isize 0x%llx",
3423 MAJOR(__entry->dev), MINOR(__entry->dev),
3427 __entry->dest_isize)
3430 /* unshare tracepoints */
3431 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
3432 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
3435 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
3436 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3437 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
3438 DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
3440 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3441 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3442 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_from);
3443 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_to);
3445 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3446 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3449 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
3451 /* rmap swapext tracepoints */
3452 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3453 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3454 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3457 DECLARE_EVENT_CLASS(xfs_fsmap_class,
3458 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3459 const struct xfs_rmap_irec *rmap),
3460 TP_ARGS(mp, keydev, agno, rmap),
3463 __field(dev_t, keydev)
3464 __field(xfs_agnumber_t, agno)
3465 __field(xfs_fsblock_t, bno)
3466 __field(xfs_filblks_t, len)
3467 __field(uint64_t, owner)
3468 __field(uint64_t, offset)
3469 __field(unsigned int, flags)
3472 __entry->dev = mp->m_super->s_dev;
3473 __entry->keydev = new_decode_dev(keydev);
3474 __entry->agno = agno;
3475 __entry->bno = rmap->rm_startblock;
3476 __entry->len = rmap->rm_blockcount;
3477 __entry->owner = rmap->rm_owner;
3478 __entry->offset = rmap->rm_offset;
3479 __entry->flags = rmap->rm_flags;
3481 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",
3482 MAJOR(__entry->dev), MINOR(__entry->dev),
3483 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3491 #define DEFINE_FSMAP_EVENT(name) \
3492 DEFINE_EVENT(xfs_fsmap_class, name, \
3493 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3494 const struct xfs_rmap_irec *rmap), \
3495 TP_ARGS(mp, keydev, agno, rmap))
3496 DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3497 DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3498 DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3500 DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3501 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3505 __field(dev_t, keydev)
3506 __field(xfs_daddr_t, block)
3507 __field(xfs_daddr_t, len)
3508 __field(uint64_t, owner)
3509 __field(uint64_t, offset)
3510 __field(uint64_t, flags)
3513 __entry->dev = mp->m_super->s_dev;
3514 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3515 __entry->block = fsmap->fmr_physical;
3516 __entry->len = fsmap->fmr_length;
3517 __entry->owner = fsmap->fmr_owner;
3518 __entry->offset = fsmap->fmr_offset;
3519 __entry->flags = fsmap->fmr_flags;
3521 TP_printk("dev %d:%d keydev %d:%d daddr 0x%llx bbcount 0x%llx owner 0x%llx fileoff_daddr 0x%llx flags 0x%llx",
3522 MAJOR(__entry->dev), MINOR(__entry->dev),
3523 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3530 #define DEFINE_GETFSMAP_EVENT(name) \
3531 DEFINE_EVENT(xfs_getfsmap_class, name, \
3532 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3534 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3535 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3536 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3538 DECLARE_EVENT_CLASS(xfs_trans_resv_class,
3539 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3540 struct xfs_trans_res *res),
3541 TP_ARGS(mp, type, res),
3545 __field(uint, logres)
3546 __field(int, logcount)
3547 __field(int, logflags)
3550 __entry->dev = mp->m_super->s_dev;
3551 __entry->type = type;
3552 __entry->logres = res->tr_logres;
3553 __entry->logcount = res->tr_logcount;
3554 __entry->logflags = res->tr_logflags;
3556 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3557 MAJOR(__entry->dev), MINOR(__entry->dev),
3564 #define DEFINE_TRANS_RESV_EVENT(name) \
3565 DEFINE_EVENT(xfs_trans_resv_class, name, \
3566 TP_PROTO(struct xfs_mount *mp, unsigned int type, \
3567 struct xfs_trans_res *res), \
3568 TP_ARGS(mp, type, res))
3569 DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc);
3570 DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc_minlogsize);
3572 TRACE_EVENT(xfs_log_get_max_trans_res,
3573 TP_PROTO(struct xfs_mount *mp, const struct xfs_trans_res *res),
3577 __field(uint, logres)
3578 __field(int, logcount)
3581 __entry->dev = mp->m_super->s_dev;
3582 __entry->logres = res->tr_logres;
3583 __entry->logcount = res->tr_logcount;
3585 TP_printk("dev %d:%d logres %u logcount %d",
3586 MAJOR(__entry->dev), MINOR(__entry->dev),
3591 DECLARE_EVENT_CLASS(xfs_trans_class,
3592 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3593 TP_ARGS(tp, caller_ip),
3596 __field(uint32_t, tid)
3597 __field(uint32_t, flags)
3598 __field(unsigned long, caller_ip)
3601 __entry->dev = tp->t_mountp->m_super->s_dev;
3604 __entry->tid = tp->t_ticket->t_tid;
3605 __entry->flags = tp->t_flags;
3606 __entry->caller_ip = caller_ip;
3608 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3609 MAJOR(__entry->dev), MINOR(__entry->dev),
3612 (char *)__entry->caller_ip)
3615 #define DEFINE_TRANS_EVENT(name) \
3616 DEFINE_EVENT(xfs_trans_class, name, \
3617 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3618 TP_ARGS(tp, caller_ip))
3619 DEFINE_TRANS_EVENT(xfs_trans_alloc);
3620 DEFINE_TRANS_EVENT(xfs_trans_cancel);
3621 DEFINE_TRANS_EVENT(xfs_trans_commit);
3622 DEFINE_TRANS_EVENT(xfs_trans_dup);
3623 DEFINE_TRANS_EVENT(xfs_trans_free);
3624 DEFINE_TRANS_EVENT(xfs_trans_roll);
3625 DEFINE_TRANS_EVENT(xfs_trans_add_item);
3626 DEFINE_TRANS_EVENT(xfs_trans_commit_items);
3627 DEFINE_TRANS_EVENT(xfs_trans_free_items);
3629 TRACE_EVENT(xfs_iunlink_update_bucket,
3630 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3631 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3632 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3635 __field(xfs_agnumber_t, agno)
3636 __field(unsigned int, bucket)
3637 __field(xfs_agino_t, old_ptr)
3638 __field(xfs_agino_t, new_ptr)
3641 __entry->dev = mp->m_super->s_dev;
3642 __entry->agno = agno;
3643 __entry->bucket = bucket;
3644 __entry->old_ptr = old_ptr;
3645 __entry->new_ptr = new_ptr;
3647 TP_printk("dev %d:%d agno 0x%x bucket %u old 0x%x new 0x%x",
3648 MAJOR(__entry->dev), MINOR(__entry->dev),
3655 TRACE_EVENT(xfs_iunlink_update_dinode,
3656 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3657 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3658 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3661 __field(xfs_agnumber_t, agno)
3662 __field(xfs_agino_t, agino)
3663 __field(xfs_agino_t, old_ptr)
3664 __field(xfs_agino_t, new_ptr)
3667 __entry->dev = mp->m_super->s_dev;
3668 __entry->agno = agno;
3669 __entry->agino = agino;
3670 __entry->old_ptr = old_ptr;
3671 __entry->new_ptr = new_ptr;
3673 TP_printk("dev %d:%d agno 0x%x agino 0x%x old 0x%x new 0x%x",
3674 MAJOR(__entry->dev), MINOR(__entry->dev),
3681 DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3682 TP_PROTO(struct xfs_inode *ip),
3686 __field(xfs_agnumber_t, agno)
3687 __field(xfs_agino_t, agino)
3690 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3691 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3692 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3694 TP_printk("dev %d:%d agno 0x%x agino 0x%x",
3695 MAJOR(__entry->dev), MINOR(__entry->dev),
3696 __entry->agno, __entry->agino)
3699 #define DEFINE_AGINODE_EVENT(name) \
3700 DEFINE_EVENT(xfs_ag_inode_class, name, \
3701 TP_PROTO(struct xfs_inode *ip), \
3703 DEFINE_AGINODE_EVENT(xfs_iunlink);
3704 DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
3706 DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3707 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3711 __field(unsigned int, flags)
3714 __entry->dev = mp->m_super->s_dev;
3715 __entry->flags = flags;
3717 TP_printk("dev %d:%d flags 0x%x",
3718 MAJOR(__entry->dev), MINOR(__entry->dev),
3721 #define DEFINE_FS_CORRUPT_EVENT(name) \
3722 DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3723 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3725 DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3726 DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
3727 DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
3728 DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3729 DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
3730 DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
3732 DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3733 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3734 TP_ARGS(mp, agno, flags),
3737 __field(xfs_agnumber_t, agno)
3738 __field(unsigned int, flags)
3741 __entry->dev = mp->m_super->s_dev;
3742 __entry->agno = agno;
3743 __entry->flags = flags;
3745 TP_printk("dev %d:%d agno 0x%x flags 0x%x",
3746 MAJOR(__entry->dev), MINOR(__entry->dev),
3747 __entry->agno, __entry->flags)
3749 #define DEFINE_AG_CORRUPT_EVENT(name) \
3750 DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3751 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3752 unsigned int flags), \
3753 TP_ARGS(mp, agno, flags))
3754 DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3755 DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
3756 DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
3758 DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3759 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3763 __field(xfs_ino_t, ino)
3764 __field(unsigned int, flags)
3767 __entry->dev = ip->i_mount->m_super->s_dev;
3768 __entry->ino = ip->i_ino;
3769 __entry->flags = flags;
3771 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3772 MAJOR(__entry->dev), MINOR(__entry->dev),
3773 __entry->ino, __entry->flags)
3775 #define DEFINE_INODE_CORRUPT_EVENT(name) \
3776 DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3777 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3779 DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3780 DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3782 TRACE_EVENT(xfs_iwalk_ag,
3783 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3784 xfs_agino_t startino),
3785 TP_ARGS(mp, agno, startino),
3788 __field(xfs_agnumber_t, agno)
3789 __field(xfs_agino_t, startino)
3792 __entry->dev = mp->m_super->s_dev;
3793 __entry->agno = agno;
3794 __entry->startino = startino;
3796 TP_printk("dev %d:%d agno 0x%x startino 0x%x",
3797 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3801 TRACE_EVENT(xfs_iwalk_ag_rec,
3802 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3803 struct xfs_inobt_rec_incore *irec),
3804 TP_ARGS(mp, agno, irec),
3807 __field(xfs_agnumber_t, agno)
3808 __field(xfs_agino_t, startino)
3809 __field(uint64_t, freemask)
3812 __entry->dev = mp->m_super->s_dev;
3813 __entry->agno = agno;
3814 __entry->startino = irec->ir_startino;
3815 __entry->freemask = irec->ir_free;
3817 TP_printk("dev %d:%d agno 0x%x startino 0x%x freemask 0x%llx",
3818 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3819 __entry->startino, __entry->freemask)
3822 TRACE_EVENT(xfs_pwork_init,
3823 TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
3824 TP_ARGS(mp, nr_threads, pid),
3827 __field(unsigned int, nr_threads)
3831 __entry->dev = mp->m_super->s_dev;
3832 __entry->nr_threads = nr_threads;
3835 TP_printk("dev %d:%d nr_threads %u pid %u",
3836 MAJOR(__entry->dev), MINOR(__entry->dev),
3837 __entry->nr_threads, __entry->pid)
3840 DECLARE_EVENT_CLASS(xfs_kmem_class,
3841 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
3842 TP_ARGS(size, flags, caller_ip),
3844 __field(ssize_t, size)
3846 __field(unsigned long, caller_ip)
3849 __entry->size = size;
3850 __entry->flags = flags;
3851 __entry->caller_ip = caller_ip;
3853 TP_printk("size %zd flags 0x%x caller %pS",
3856 (char *)__entry->caller_ip)
3859 #define DEFINE_KMEM_EVENT(name) \
3860 DEFINE_EVENT(xfs_kmem_class, name, \
3861 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
3862 TP_ARGS(size, flags, caller_ip))
3863 DEFINE_KMEM_EVENT(kmem_alloc);
3865 TRACE_EVENT(xfs_check_new_dalign,
3866 TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
3867 TP_ARGS(mp, new_dalign, calc_rootino),
3870 __field(int, new_dalign)
3871 __field(xfs_ino_t, sb_rootino)
3872 __field(xfs_ino_t, calc_rootino)
3875 __entry->dev = mp->m_super->s_dev;
3876 __entry->new_dalign = new_dalign;
3877 __entry->sb_rootino = mp->m_sb.sb_rootino;
3878 __entry->calc_rootino = calc_rootino;
3880 TP_printk("dev %d:%d new_dalign %d sb_rootino 0x%llx calc_rootino 0x%llx",
3881 MAJOR(__entry->dev), MINOR(__entry->dev),
3882 __entry->new_dalign, __entry->sb_rootino,
3883 __entry->calc_rootino)
3886 TRACE_EVENT(xfs_btree_commit_afakeroot,
3887 TP_PROTO(struct xfs_btree_cur *cur),
3891 __field(xfs_btnum_t, btnum)
3892 __field(xfs_agnumber_t, agno)
3893 __field(xfs_agblock_t, agbno)
3894 __field(unsigned int, levels)
3895 __field(unsigned int, blocks)
3898 __entry->dev = cur->bc_mp->m_super->s_dev;
3899 __entry->btnum = cur->bc_btnum;
3900 __entry->agno = cur->bc_ag.pag->pag_agno;
3901 __entry->agbno = cur->bc_ag.afake->af_root;
3902 __entry->levels = cur->bc_ag.afake->af_levels;
3903 __entry->blocks = cur->bc_ag.afake->af_blocks;
3905 TP_printk("dev %d:%d btree %s agno 0x%x levels %u blocks %u root %u",
3906 MAJOR(__entry->dev), MINOR(__entry->dev),
3907 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3914 TRACE_EVENT(xfs_btree_commit_ifakeroot,
3915 TP_PROTO(struct xfs_btree_cur *cur),
3919 __field(xfs_btnum_t, btnum)
3920 __field(xfs_agnumber_t, agno)
3921 __field(xfs_agino_t, agino)
3922 __field(unsigned int, levels)
3923 __field(unsigned int, blocks)
3924 __field(int, whichfork)
3927 __entry->dev = cur->bc_mp->m_super->s_dev;
3928 __entry->btnum = cur->bc_btnum;
3929 __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp,
3930 cur->bc_ino.ip->i_ino);
3931 __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp,
3932 cur->bc_ino.ip->i_ino);
3933 __entry->levels = cur->bc_ino.ifake->if_levels;
3934 __entry->blocks = cur->bc_ino.ifake->if_blocks;
3935 __entry->whichfork = cur->bc_ino.whichfork;
3937 TP_printk("dev %d:%d btree %s agno 0x%x agino 0x%x whichfork %s levels %u blocks %u",
3938 MAJOR(__entry->dev), MINOR(__entry->dev),
3939 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3942 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
3947 TRACE_EVENT(xfs_btree_bload_level_geometry,
3948 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3949 uint64_t nr_this_level, unsigned int nr_per_block,
3950 unsigned int desired_npb, uint64_t blocks,
3951 uint64_t blocks_with_extra),
3952 TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks,
3956 __field(xfs_btnum_t, btnum)
3957 __field(unsigned int, level)
3958 __field(unsigned int, nlevels)
3959 __field(uint64_t, nr_this_level)
3960 __field(unsigned int, nr_per_block)
3961 __field(unsigned int, desired_npb)
3962 __field(unsigned long long, blocks)
3963 __field(unsigned long long, blocks_with_extra)
3966 __entry->dev = cur->bc_mp->m_super->s_dev;
3967 __entry->btnum = cur->bc_btnum;
3968 __entry->level = level;
3969 __entry->nlevels = cur->bc_nlevels;
3970 __entry->nr_this_level = nr_this_level;
3971 __entry->nr_per_block = nr_per_block;
3972 __entry->desired_npb = desired_npb;
3973 __entry->blocks = blocks;
3974 __entry->blocks_with_extra = blocks_with_extra;
3976 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",
3977 MAJOR(__entry->dev), MINOR(__entry->dev),
3978 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3981 __entry->nr_this_level,
3982 __entry->nr_per_block,
3983 __entry->desired_npb,
3985 __entry->blocks_with_extra)
3988 TRACE_EVENT(xfs_btree_bload_block,
3989 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3990 uint64_t block_idx, uint64_t nr_blocks,
3991 union xfs_btree_ptr *ptr, unsigned int nr_records),
3992 TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records),
3995 __field(xfs_btnum_t, btnum)
3996 __field(unsigned int, level)
3997 __field(unsigned long long, block_idx)
3998 __field(unsigned long long, nr_blocks)
3999 __field(xfs_agnumber_t, agno)
4000 __field(xfs_agblock_t, agbno)
4001 __field(unsigned int, nr_records)
4004 __entry->dev = cur->bc_mp->m_super->s_dev;
4005 __entry->btnum = cur->bc_btnum;
4006 __entry->level = level;
4007 __entry->block_idx = block_idx;
4008 __entry->nr_blocks = nr_blocks;
4009 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
4010 xfs_fsblock_t fsb = be64_to_cpu(ptr->l);
4012 __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb);
4013 __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb);
4015 __entry->agno = cur->bc_ag.pag->pag_agno;
4016 __entry->agbno = be32_to_cpu(ptr->s);
4018 __entry->nr_records = nr_records;
4020 TP_printk("dev %d:%d btree %s level %u block %llu/%llu agno 0x%x agbno 0x%x recs %u",
4021 MAJOR(__entry->dev), MINOR(__entry->dev),
4022 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
4028 __entry->nr_records)
4031 DECLARE_EVENT_CLASS(xfs_timestamp_range_class,
4032 TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max),
4033 TP_ARGS(mp, min, max),
4036 __field(long long, min)
4037 __field(long long, max)
4040 __entry->dev = mp->m_super->s_dev;
4044 TP_printk("dev %d:%d min %lld max %lld",
4045 MAJOR(__entry->dev), MINOR(__entry->dev),
4050 #define DEFINE_TIMESTAMP_RANGE_EVENT(name) \
4051 DEFINE_EVENT(xfs_timestamp_range_class, name, \
4052 TP_PROTO(struct xfs_mount *mp, long long min, long long max), \
4053 TP_ARGS(mp, min, max))
4054 DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range);
4055 DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range);
4057 DECLARE_EVENT_CLASS(xfs_icwalk_class,
4058 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw,
4059 unsigned long caller_ip),
4060 TP_ARGS(mp, icw, caller_ip),
4063 __field(__u32, flags)
4064 __field(uint32_t, uid)
4065 __field(uint32_t, gid)
4066 __field(prid_t, prid)
4067 __field(__u64, min_file_size)
4068 __field(long, scan_limit)
4069 __field(unsigned long, caller_ip)
4072 __entry->dev = mp->m_super->s_dev;
4073 __entry->flags = icw ? icw->icw_flags : 0;
4074 __entry->uid = icw ? from_kuid(mp->m_super->s_user_ns,
4076 __entry->gid = icw ? from_kgid(mp->m_super->s_user_ns,
4078 __entry->prid = icw ? icw->icw_prid : 0;
4079 __entry->min_file_size = icw ? icw->icw_min_file_size : 0;
4080 __entry->scan_limit = icw ? icw->icw_scan_limit : 0;
4081 __entry->caller_ip = caller_ip;
4083 TP_printk("dev %d:%d flags 0x%x uid %u gid %u prid %u minsize %llu scan_limit %ld caller %pS",
4084 MAJOR(__entry->dev), MINOR(__entry->dev),
4089 __entry->min_file_size,
4090 __entry->scan_limit,
4091 (char *)__entry->caller_ip)
4093 #define DEFINE_ICWALK_EVENT(name) \
4094 DEFINE_EVENT(xfs_icwalk_class, name, \
4095 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw, \
4096 unsigned long caller_ip), \
4097 TP_ARGS(mp, icw, caller_ip))
4098 DEFINE_ICWALK_EVENT(xfs_ioc_free_eofblocks);
4099 DEFINE_ICWALK_EVENT(xfs_blockgc_free_space);
4101 TRACE_DEFINE_ENUM(XLOG_STATE_ACTIVE);
4102 TRACE_DEFINE_ENUM(XLOG_STATE_WANT_SYNC);
4103 TRACE_DEFINE_ENUM(XLOG_STATE_SYNCING);
4104 TRACE_DEFINE_ENUM(XLOG_STATE_DONE_SYNC);
4105 TRACE_DEFINE_ENUM(XLOG_STATE_CALLBACK);
4106 TRACE_DEFINE_ENUM(XLOG_STATE_DIRTY);
4108 DECLARE_EVENT_CLASS(xlog_iclog_class,
4109 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip),
4110 TP_ARGS(iclog, caller_ip),
4113 __field(uint32_t, state)
4114 __field(int32_t, refcount)
4115 __field(uint32_t, offset)
4116 __field(uint32_t, flags)
4117 __field(unsigned long long, lsn)
4118 __field(unsigned long, caller_ip)
4121 __entry->dev = iclog->ic_log->l_mp->m_super->s_dev;
4122 __entry->state = iclog->ic_state;
4123 __entry->refcount = atomic_read(&iclog->ic_refcnt);
4124 __entry->offset = iclog->ic_offset;
4125 __entry->flags = iclog->ic_flags;
4126 __entry->lsn = be64_to_cpu(iclog->ic_header.h_lsn);
4127 __entry->caller_ip = caller_ip;
4129 TP_printk("dev %d:%d state %s refcnt %d offset %u lsn 0x%llx flags %s caller %pS",
4130 MAJOR(__entry->dev), MINOR(__entry->dev),
4131 __print_symbolic(__entry->state, XLOG_STATE_STRINGS),
4135 __print_flags(__entry->flags, "|", XLOG_ICL_STRINGS),
4136 (char *)__entry->caller_ip)
4140 #define DEFINE_ICLOG_EVENT(name) \
4141 DEFINE_EVENT(xlog_iclog_class, name, \
4142 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip), \
4143 TP_ARGS(iclog, caller_ip))
4145 DEFINE_ICLOG_EVENT(xlog_iclog_activate);
4146 DEFINE_ICLOG_EVENT(xlog_iclog_clean);
4147 DEFINE_ICLOG_EVENT(xlog_iclog_callback);
4148 DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_start);
4149 DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_done);
4150 DEFINE_ICLOG_EVENT(xlog_iclog_force);
4151 DEFINE_ICLOG_EVENT(xlog_iclog_force_lsn);
4152 DEFINE_ICLOG_EVENT(xlog_iclog_get_space);
4153 DEFINE_ICLOG_EVENT(xlog_iclog_release);
4154 DEFINE_ICLOG_EVENT(xlog_iclog_switch);
4155 DEFINE_ICLOG_EVENT(xlog_iclog_sync);
4156 DEFINE_ICLOG_EVENT(xlog_iclog_syncing);
4157 DEFINE_ICLOG_EVENT(xlog_iclog_sync_done);
4158 DEFINE_ICLOG_EVENT(xlog_iclog_want_sync);
4159 DEFINE_ICLOG_EVENT(xlog_iclog_wait_on);
4160 DEFINE_ICLOG_EVENT(xlog_iclog_write);
4162 TRACE_DEFINE_ENUM(XFS_DAS_UNINIT);
4163 TRACE_DEFINE_ENUM(XFS_DAS_SF_ADD);
4164 TRACE_DEFINE_ENUM(XFS_DAS_SF_REMOVE);
4165 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ADD);
4166 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE);
4167 TRACE_DEFINE_ENUM(XFS_DAS_NODE_ADD);
4168 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE);
4169 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_SET_RMT);
4170 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ALLOC_RMT);
4171 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REPLACE);
4172 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_OLD);
4173 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_RMT);
4174 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_ATTR);
4175 TRACE_DEFINE_ENUM(XFS_DAS_NODE_SET_RMT);
4176 TRACE_DEFINE_ENUM(XFS_DAS_NODE_ALLOC_RMT);
4177 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REPLACE);
4178 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_OLD);
4179 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_RMT);
4180 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_ATTR);
4181 TRACE_DEFINE_ENUM(XFS_DAS_DONE);
4183 DECLARE_EVENT_CLASS(xfs_das_state_class,
4184 TP_PROTO(int das, struct xfs_inode *ip),
4188 __field(xfs_ino_t, ino)
4192 __entry->ino = ip->i_ino;
4194 TP_printk("state change %s ino 0x%llx",
4195 __print_symbolic(__entry->das, XFS_DAS_STRINGS),
4199 #define DEFINE_DAS_STATE_EVENT(name) \
4200 DEFINE_EVENT(xfs_das_state_class, name, \
4201 TP_PROTO(int das, struct xfs_inode *ip), \
4203 DEFINE_DAS_STATE_EVENT(xfs_attr_sf_addname_return);
4204 DEFINE_DAS_STATE_EVENT(xfs_attr_set_iter_return);
4205 DEFINE_DAS_STATE_EVENT(xfs_attr_leaf_addname_return);
4206 DEFINE_DAS_STATE_EVENT(xfs_attr_node_addname_return);
4207 DEFINE_DAS_STATE_EVENT(xfs_attr_remove_iter_return);
4208 DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_alloc);
4209 DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_remove_return);
4210 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_add);
4211 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_replace);
4212 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_remove);
4215 TRACE_EVENT(xfs_force_shutdown,
4216 TP_PROTO(struct xfs_mount *mp, int ptag, int flags, const char *fname,
4218 TP_ARGS(mp, ptag, flags, fname, line_num),
4223 __string(fname, fname)
4224 __field(int, line_num)
4227 __entry->dev = mp->m_super->s_dev;
4228 __entry->ptag = ptag;
4229 __entry->flags = flags;
4230 __assign_str(fname, fname);
4231 __entry->line_num = line_num;
4233 TP_printk("dev %d:%d tag %s flags %s file %s line_num %d",
4234 MAJOR(__entry->dev), MINOR(__entry->dev),
4235 __print_flags(__entry->ptag, "|", XFS_PTAG_STRINGS),
4236 __print_flags(__entry->flags, "|", XFS_SHUTDOWN_STRINGS),
4241 #endif /* _TRACE_XFS_H */
4243 #undef TRACE_INCLUDE_PATH
4244 #define TRACE_INCLUDE_PATH .
4245 #define TRACE_INCLUDE_FILE xfs_trace
4246 #include <trace/define_trace.h>