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_EVENT(xfs_filemap_fault,
803 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
805 TP_ARGS(ip, pe_size, write_fault),
808 __field(xfs_ino_t, ino)
809 __field(enum page_entry_size, pe_size)
810 __field(bool, write_fault)
813 __entry->dev = VFS_I(ip)->i_sb->s_dev;
814 __entry->ino = ip->i_ino;
815 __entry->pe_size = pe_size;
816 __entry->write_fault = write_fault;
818 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
819 MAJOR(__entry->dev), MINOR(__entry->dev),
821 __print_symbolic(__entry->pe_size,
822 { PE_SIZE_PTE, "PTE" },
823 { PE_SIZE_PMD, "PMD" },
824 { PE_SIZE_PUD, "PUD" }),
825 __entry->write_fault)
828 DECLARE_EVENT_CLASS(xfs_iref_class,
829 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
830 TP_ARGS(ip, caller_ip),
833 __field(xfs_ino_t, ino)
835 __field(int, pincount)
836 __field(unsigned long, caller_ip)
839 __entry->dev = VFS_I(ip)->i_sb->s_dev;
840 __entry->ino = ip->i_ino;
841 __entry->count = atomic_read(&VFS_I(ip)->i_count);
842 __entry->pincount = atomic_read(&ip->i_pincount);
843 __entry->caller_ip = caller_ip;
845 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
846 MAJOR(__entry->dev), MINOR(__entry->dev),
850 (char *)__entry->caller_ip)
853 TRACE_EVENT(xfs_iomap_prealloc_size,
854 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
855 unsigned int writeio_blocks),
856 TP_ARGS(ip, blocks, shift, writeio_blocks),
859 __field(xfs_ino_t, ino)
860 __field(xfs_fsblock_t, blocks)
862 __field(unsigned int, writeio_blocks)
865 __entry->dev = VFS_I(ip)->i_sb->s_dev;
866 __entry->ino = ip->i_ino;
867 __entry->blocks = blocks;
868 __entry->shift = shift;
869 __entry->writeio_blocks = writeio_blocks;
871 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
872 "m_allocsize_blocks %u",
873 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
874 __entry->blocks, __entry->shift, __entry->writeio_blocks)
877 TRACE_EVENT(xfs_irec_merge_pre,
878 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
879 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
880 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
883 __field(xfs_agnumber_t, agno)
884 __field(xfs_agino_t, agino)
885 __field(uint16_t, holemask)
886 __field(xfs_agino_t, nagino)
887 __field(uint16_t, nholemask)
890 __entry->dev = mp->m_super->s_dev;
891 __entry->agno = agno;
892 __entry->agino = agino;
893 __entry->holemask = holemask;
894 __entry->nagino = nagino;
895 __entry->nholemask = holemask;
897 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x",
898 MAJOR(__entry->dev), MINOR(__entry->dev),
906 TRACE_EVENT(xfs_irec_merge_post,
907 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
909 TP_ARGS(mp, agno, agino, holemask),
912 __field(xfs_agnumber_t, agno)
913 __field(xfs_agino_t, agino)
914 __field(uint16_t, holemask)
917 __entry->dev = mp->m_super->s_dev;
918 __entry->agno = agno;
919 __entry->agino = agino;
920 __entry->holemask = holemask;
922 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x",
930 #define DEFINE_IREF_EVENT(name) \
931 DEFINE_EVENT(xfs_iref_class, name, \
932 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
933 TP_ARGS(ip, caller_ip))
934 DEFINE_IREF_EVENT(xfs_irele);
935 DEFINE_IREF_EVENT(xfs_inode_pin);
936 DEFINE_IREF_EVENT(xfs_inode_unpin);
937 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
939 DECLARE_EVENT_CLASS(xfs_namespace_class,
940 TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name),
944 __field(xfs_ino_t, dp_ino)
945 __field(int, namelen)
946 __dynamic_array(char, name, name->len)
949 __entry->dev = VFS_I(dp)->i_sb->s_dev;
950 __entry->dp_ino = dp->i_ino;
951 __entry->namelen = name->len;
952 memcpy(__get_str(name), name->name, name->len);
954 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
955 MAJOR(__entry->dev), MINOR(__entry->dev),
961 #define DEFINE_NAMESPACE_EVENT(name) \
962 DEFINE_EVENT(xfs_namespace_class, name, \
963 TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name), \
965 DEFINE_NAMESPACE_EVENT(xfs_remove);
966 DEFINE_NAMESPACE_EVENT(xfs_link);
967 DEFINE_NAMESPACE_EVENT(xfs_lookup);
968 DEFINE_NAMESPACE_EVENT(xfs_create);
969 DEFINE_NAMESPACE_EVENT(xfs_symlink);
971 TRACE_EVENT(xfs_rename,
972 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
973 struct xfs_name *src_name, struct xfs_name *target_name),
974 TP_ARGS(src_dp, target_dp, src_name, target_name),
977 __field(xfs_ino_t, src_dp_ino)
978 __field(xfs_ino_t, target_dp_ino)
979 __field(int, src_namelen)
980 __field(int, target_namelen)
981 __dynamic_array(char, src_name, src_name->len)
982 __dynamic_array(char, target_name, target_name->len)
985 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
986 __entry->src_dp_ino = src_dp->i_ino;
987 __entry->target_dp_ino = target_dp->i_ino;
988 __entry->src_namelen = src_name->len;
989 __entry->target_namelen = target_name->len;
990 memcpy(__get_str(src_name), src_name->name, src_name->len);
991 memcpy(__get_str(target_name), target_name->name,
994 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
995 " src name %.*s target name %.*s",
996 MAJOR(__entry->dev), MINOR(__entry->dev),
998 __entry->target_dp_ino,
999 __entry->src_namelen,
1000 __get_str(src_name),
1001 __entry->target_namelen,
1002 __get_str(target_name))
1005 DECLARE_EVENT_CLASS(xfs_dquot_class,
1006 TP_PROTO(struct xfs_dquot *dqp),
1011 __field(xfs_dqtype_t, type)
1012 __field(unsigned, flags)
1013 __field(unsigned, nrefs)
1014 __field(unsigned long long, res_bcount)
1015 __field(unsigned long long, res_rtbcount)
1016 __field(unsigned long long, res_icount)
1018 __field(unsigned long long, bcount)
1019 __field(unsigned long long, rtbcount)
1020 __field(unsigned long long, icount)
1022 __field(unsigned long long, blk_hardlimit)
1023 __field(unsigned long long, blk_softlimit)
1024 __field(unsigned long long, rtb_hardlimit)
1025 __field(unsigned long long, rtb_softlimit)
1026 __field(unsigned long long, ino_hardlimit)
1027 __field(unsigned long long, ino_softlimit)
1030 __entry->dev = dqp->q_mount->m_super->s_dev;
1031 __entry->id = dqp->q_id;
1032 __entry->type = dqp->q_type;
1033 __entry->flags = dqp->q_flags;
1034 __entry->nrefs = dqp->q_nrefs;
1036 __entry->res_bcount = dqp->q_blk.reserved;
1037 __entry->res_rtbcount = dqp->q_rtb.reserved;
1038 __entry->res_icount = dqp->q_ino.reserved;
1040 __entry->bcount = dqp->q_blk.count;
1041 __entry->rtbcount = dqp->q_rtb.count;
1042 __entry->icount = dqp->q_ino.count;
1044 __entry->blk_hardlimit = dqp->q_blk.hardlimit;
1045 __entry->blk_softlimit = dqp->q_blk.softlimit;
1046 __entry->rtb_hardlimit = dqp->q_rtb.hardlimit;
1047 __entry->rtb_softlimit = dqp->q_rtb.softlimit;
1048 __entry->ino_hardlimit = dqp->q_ino.hardlimit;
1049 __entry->ino_softlimit = dqp->q_ino.softlimit;
1051 TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u "
1052 "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx "
1053 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
1054 "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx "
1055 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
1056 MAJOR(__entry->dev), MINOR(__entry->dev),
1058 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1059 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1061 __entry->res_bcount,
1062 __entry->res_rtbcount,
1063 __entry->res_icount,
1065 __entry->blk_hardlimit,
1066 __entry->blk_softlimit,
1068 __entry->rtb_hardlimit,
1069 __entry->rtb_softlimit,
1071 __entry->ino_hardlimit,
1072 __entry->ino_softlimit)
1075 #define DEFINE_DQUOT_EVENT(name) \
1076 DEFINE_EVENT(xfs_dquot_class, name, \
1077 TP_PROTO(struct xfs_dquot *dqp), \
1079 DEFINE_DQUOT_EVENT(xfs_dqadjust);
1080 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
1081 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
1082 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
1083 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
1084 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
1085 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
1086 DEFINE_DQUOT_EVENT(xfs_dqalloc);
1087 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
1088 DEFINE_DQUOT_EVENT(xfs_dqread);
1089 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
1090 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
1091 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
1092 DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
1093 DEFINE_DQUOT_EVENT(xfs_dqget_dup);
1094 DEFINE_DQUOT_EVENT(xfs_dqput);
1095 DEFINE_DQUOT_EVENT(xfs_dqput_free);
1096 DEFINE_DQUOT_EVENT(xfs_dqrele);
1097 DEFINE_DQUOT_EVENT(xfs_dqflush);
1098 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
1099 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
1100 DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
1101 DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
1103 TRACE_EVENT(xfs_trans_mod_dquot,
1104 TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
1105 unsigned int field, int64_t delta),
1106 TP_ARGS(tp, dqp, field, delta),
1109 __field(xfs_dqtype_t, type)
1110 __field(unsigned int, flags)
1111 __field(unsigned int, dqid)
1112 __field(unsigned int, field)
1113 __field(int64_t, delta)
1116 __entry->dev = tp->t_mountp->m_super->s_dev;
1117 __entry->type = dqp->q_type;
1118 __entry->flags = dqp->q_flags;
1119 __entry->dqid = dqp->q_id;
1120 __entry->field = field;
1121 __entry->delta = delta;
1123 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s field %s delta %lld",
1124 MAJOR(__entry->dev), MINOR(__entry->dev),
1126 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1127 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1128 __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS),
1132 DECLARE_EVENT_CLASS(xfs_dqtrx_class,
1133 TP_PROTO(struct xfs_dqtrx *qtrx),
1137 __field(xfs_dqtype_t, type)
1138 __field(unsigned int, flags)
1141 __field(uint64_t, blk_res)
1142 __field(int64_t, bcount_delta)
1143 __field(int64_t, delbcnt_delta)
1145 __field(uint64_t, rtblk_res)
1146 __field(uint64_t, rtblk_res_used)
1147 __field(int64_t, rtbcount_delta)
1148 __field(int64_t, delrtb_delta)
1150 __field(uint64_t, ino_res)
1151 __field(uint64_t, ino_res_used)
1152 __field(int64_t, icount_delta)
1155 __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev;
1156 __entry->type = qtrx->qt_dquot->q_type;
1157 __entry->flags = qtrx->qt_dquot->q_flags;
1158 __entry->dqid = qtrx->qt_dquot->q_id;
1160 __entry->blk_res = qtrx->qt_blk_res;
1161 __entry->bcount_delta = qtrx->qt_bcount_delta;
1162 __entry->delbcnt_delta = qtrx->qt_delbcnt_delta;
1164 __entry->rtblk_res = qtrx->qt_rtblk_res;
1165 __entry->rtblk_res_used = qtrx->qt_rtblk_res_used;
1166 __entry->rtbcount_delta = qtrx->qt_rtbcount_delta;
1167 __entry->delrtb_delta = qtrx->qt_delrtb_delta;
1169 __entry->ino_res = qtrx->qt_ino_res;
1170 __entry->ino_res_used = qtrx->qt_ino_res_used;
1171 __entry->icount_delta = qtrx->qt_icount_delta;
1173 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s"
1174 "blk_res %llu bcount_delta %lld delbcnt_delta %lld "
1175 "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld "
1176 "ino_res %llu ino_res_used %llu icount_delta %lld",
1177 MAJOR(__entry->dev), MINOR(__entry->dev),
1179 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1180 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1183 __entry->bcount_delta,
1184 __entry->delbcnt_delta,
1187 __entry->rtblk_res_used,
1188 __entry->rtbcount_delta,
1189 __entry->delrtb_delta,
1192 __entry->ino_res_used,
1193 __entry->icount_delta)
1196 #define DEFINE_DQTRX_EVENT(name) \
1197 DEFINE_EVENT(xfs_dqtrx_class, name, \
1198 TP_PROTO(struct xfs_dqtrx *qtrx), \
1200 DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas);
1201 DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before);
1202 DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after);
1204 DECLARE_EVENT_CLASS(xfs_loggrant_class,
1205 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
1211 __field(int, curr_res)
1212 __field(int, unit_res)
1213 __field(unsigned int, flags)
1214 __field(int, reserveq)
1215 __field(int, writeq)
1216 __field(int, grant_reserve_cycle)
1217 __field(int, grant_reserve_bytes)
1218 __field(int, grant_write_cycle)
1219 __field(int, grant_write_bytes)
1220 __field(int, curr_cycle)
1221 __field(int, curr_block)
1222 __field(xfs_lsn_t, tail_lsn)
1225 __entry->dev = log->l_mp->m_super->s_dev;
1226 __entry->ocnt = tic->t_ocnt;
1227 __entry->cnt = tic->t_cnt;
1228 __entry->curr_res = tic->t_curr_res;
1229 __entry->unit_res = tic->t_unit_res;
1230 __entry->flags = tic->t_flags;
1231 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
1232 __entry->writeq = list_empty(&log->l_write_head.waiters);
1233 xlog_crack_grant_head(&log->l_reserve_head.grant,
1234 &__entry->grant_reserve_cycle,
1235 &__entry->grant_reserve_bytes);
1236 xlog_crack_grant_head(&log->l_write_head.grant,
1237 &__entry->grant_write_cycle,
1238 &__entry->grant_write_bytes);
1239 __entry->curr_cycle = log->l_curr_cycle;
1240 __entry->curr_block = log->l_curr_block;
1241 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
1243 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
1244 "t_unit_res %u t_flags %s reserveq %s "
1245 "writeq %s grant_reserve_cycle %d "
1246 "grant_reserve_bytes %d grant_write_cycle %d "
1247 "grant_write_bytes %d curr_cycle %d curr_block %d "
1248 "tail_cycle %d tail_block %d",
1249 MAJOR(__entry->dev), MINOR(__entry->dev),
1254 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
1255 __entry->reserveq ? "empty" : "active",
1256 __entry->writeq ? "empty" : "active",
1257 __entry->grant_reserve_cycle,
1258 __entry->grant_reserve_bytes,
1259 __entry->grant_write_cycle,
1260 __entry->grant_write_bytes,
1261 __entry->curr_cycle,
1262 __entry->curr_block,
1263 CYCLE_LSN(__entry->tail_lsn),
1264 BLOCK_LSN(__entry->tail_lsn)
1268 #define DEFINE_LOGGRANT_EVENT(name) \
1269 DEFINE_EVENT(xfs_loggrant_class, name, \
1270 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1272 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1273 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1274 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1275 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1276 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1277 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1278 DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1279 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1280 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant);
1281 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit);
1282 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub);
1283 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant);
1284 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub);
1285 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit);
1286 DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait);
1288 DECLARE_EVENT_CLASS(xfs_log_item_class,
1289 TP_PROTO(struct xfs_log_item *lip),
1293 __field(void *, lip)
1295 __field(unsigned long, flags)
1296 __field(xfs_lsn_t, lsn)
1299 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
1301 __entry->type = lip->li_type;
1302 __entry->flags = lip->li_flags;
1303 __entry->lsn = lip->li_lsn;
1305 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
1306 MAJOR(__entry->dev), MINOR(__entry->dev),
1308 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1309 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1310 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1313 TRACE_EVENT(xfs_log_force,
1314 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1315 TP_ARGS(mp, lsn, caller_ip),
1318 __field(xfs_lsn_t, lsn)
1319 __field(unsigned long, caller_ip)
1322 __entry->dev = mp->m_super->s_dev;
1324 __entry->caller_ip = caller_ip;
1326 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
1327 MAJOR(__entry->dev), MINOR(__entry->dev),
1328 __entry->lsn, (void *)__entry->caller_ip)
1331 #define DEFINE_LOG_ITEM_EVENT(name) \
1332 DEFINE_EVENT(xfs_log_item_class, name, \
1333 TP_PROTO(struct xfs_log_item *lip), \
1335 DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1336 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1337 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1338 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1339 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_mark);
1340 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_skip);
1341 DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_unpin);
1343 DECLARE_EVENT_CLASS(xfs_ail_class,
1344 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1345 TP_ARGS(lip, old_lsn, new_lsn),
1348 __field(void *, lip)
1350 __field(unsigned long, flags)
1351 __field(xfs_lsn_t, old_lsn)
1352 __field(xfs_lsn_t, new_lsn)
1355 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
1357 __entry->type = lip->li_type;
1358 __entry->flags = lip->li_flags;
1359 __entry->old_lsn = old_lsn;
1360 __entry->new_lsn = new_lsn;
1362 TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s",
1363 MAJOR(__entry->dev), MINOR(__entry->dev),
1365 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1366 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1367 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1368 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1371 #define DEFINE_AIL_EVENT(name) \
1372 DEFINE_EVENT(xfs_ail_class, name, \
1373 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1374 TP_ARGS(lip, old_lsn, new_lsn))
1375 DEFINE_AIL_EVENT(xfs_ail_insert);
1376 DEFINE_AIL_EVENT(xfs_ail_move);
1377 DEFINE_AIL_EVENT(xfs_ail_delete);
1379 TRACE_EVENT(xfs_log_assign_tail_lsn,
1380 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1381 TP_ARGS(log, new_lsn),
1384 __field(xfs_lsn_t, new_lsn)
1385 __field(xfs_lsn_t, old_lsn)
1386 __field(xfs_lsn_t, last_sync_lsn)
1389 __entry->dev = log->l_mp->m_super->s_dev;
1390 __entry->new_lsn = new_lsn;
1391 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1392 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1394 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1395 MAJOR(__entry->dev), MINOR(__entry->dev),
1396 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1397 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1398 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1401 DECLARE_EVENT_CLASS(xfs_file_class,
1402 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter),
1403 TP_ARGS(iocb, iter),
1406 __field(xfs_ino_t, ino)
1407 __field(xfs_fsize_t, size)
1408 __field(loff_t, offset)
1409 __field(size_t, count)
1412 __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
1413 __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
1414 __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size;
1415 __entry->offset = iocb->ki_pos;
1416 __entry->count = iov_iter_count(iter);
1418 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx",
1419 MAJOR(__entry->dev), MINOR(__entry->dev),
1426 #define DEFINE_RW_EVENT(name) \
1427 DEFINE_EVENT(xfs_file_class, name, \
1428 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), \
1429 TP_ARGS(iocb, iter))
1430 DEFINE_RW_EVENT(xfs_file_buffered_read);
1431 DEFINE_RW_EVENT(xfs_file_direct_read);
1432 DEFINE_RW_EVENT(xfs_file_dax_read);
1433 DEFINE_RW_EVENT(xfs_file_buffered_write);
1434 DEFINE_RW_EVENT(xfs_file_direct_write);
1435 DEFINE_RW_EVENT(xfs_file_dax_write);
1436 DEFINE_RW_EVENT(xfs_reflink_bounce_dio_write);
1439 DECLARE_EVENT_CLASS(xfs_imap_class,
1440 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1441 int whichfork, struct xfs_bmbt_irec *irec),
1442 TP_ARGS(ip, offset, count, whichfork, irec),
1445 __field(xfs_ino_t, ino)
1446 __field(loff_t, size)
1447 __field(loff_t, offset)
1448 __field(size_t, count)
1449 __field(int, whichfork)
1450 __field(xfs_fileoff_t, startoff)
1451 __field(xfs_fsblock_t, startblock)
1452 __field(xfs_filblks_t, blockcount)
1455 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1456 __entry->ino = ip->i_ino;
1457 __entry->size = ip->i_disk_size;
1458 __entry->offset = offset;
1459 __entry->count = count;
1460 __entry->whichfork = whichfork;
1461 __entry->startoff = irec ? irec->br_startoff : 0;
1462 __entry->startblock = irec ? irec->br_startblock : 0;
1463 __entry->blockcount = irec ? irec->br_blockcount : 0;
1465 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx "
1466 "fork %s startoff 0x%llx startblock 0x%llx fsbcount 0x%llx",
1467 MAJOR(__entry->dev), MINOR(__entry->dev),
1472 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
1474 (int64_t)__entry->startblock,
1475 __entry->blockcount)
1478 #define DEFINE_IMAP_EVENT(name) \
1479 DEFINE_EVENT(xfs_imap_class, name, \
1480 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1481 int whichfork, struct xfs_bmbt_irec *irec), \
1482 TP_ARGS(ip, offset, count, whichfork, irec))
1483 DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1484 DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1485 DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1486 DEFINE_IMAP_EVENT(xfs_iomap_found);
1488 DECLARE_EVENT_CLASS(xfs_simple_io_class,
1489 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1490 TP_ARGS(ip, offset, count),
1493 __field(xfs_ino_t, ino)
1494 __field(loff_t, isize)
1495 __field(loff_t, disize)
1496 __field(loff_t, offset)
1497 __field(size_t, count)
1500 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1501 __entry->ino = ip->i_ino;
1502 __entry->isize = VFS_I(ip)->i_size;
1503 __entry->disize = ip->i_disk_size;
1504 __entry->offset = offset;
1505 __entry->count = count;
1507 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1508 "pos 0x%llx bytecount 0x%zx",
1509 MAJOR(__entry->dev), MINOR(__entry->dev),
1517 #define DEFINE_SIMPLE_IO_EVENT(name) \
1518 DEFINE_EVENT(xfs_simple_io_class, name, \
1519 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1520 TP_ARGS(ip, offset, count))
1521 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1522 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1523 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1524 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1525 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1526 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1527 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1529 DECLARE_EVENT_CLASS(xfs_itrunc_class,
1530 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1531 TP_ARGS(ip, new_size),
1534 __field(xfs_ino_t, ino)
1535 __field(xfs_fsize_t, size)
1536 __field(xfs_fsize_t, new_size)
1539 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1540 __entry->ino = ip->i_ino;
1541 __entry->size = ip->i_disk_size;
1542 __entry->new_size = new_size;
1544 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx new_size 0x%llx",
1545 MAJOR(__entry->dev), MINOR(__entry->dev),
1551 #define DEFINE_ITRUNC_EVENT(name) \
1552 DEFINE_EVENT(xfs_itrunc_class, name, \
1553 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1554 TP_ARGS(ip, new_size))
1555 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1556 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1558 TRACE_EVENT(xfs_pagecache_inval,
1559 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1560 TP_ARGS(ip, start, finish),
1563 __field(xfs_ino_t, ino)
1564 __field(xfs_fsize_t, size)
1565 __field(xfs_off_t, start)
1566 __field(xfs_off_t, finish)
1569 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1570 __entry->ino = ip->i_ino;
1571 __entry->size = ip->i_disk_size;
1572 __entry->start = start;
1573 __entry->finish = finish;
1575 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx start 0x%llx finish 0x%llx",
1576 MAJOR(__entry->dev), MINOR(__entry->dev),
1583 TRACE_EVENT(xfs_bunmap,
1584 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t fileoff, xfs_filblks_t len,
1585 int flags, unsigned long caller_ip),
1586 TP_ARGS(ip, fileoff, len, flags, caller_ip),
1589 __field(xfs_ino_t, ino)
1590 __field(xfs_fsize_t, size)
1591 __field(xfs_fileoff_t, fileoff)
1592 __field(xfs_filblks_t, len)
1593 __field(unsigned long, caller_ip)
1597 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1598 __entry->ino = ip->i_ino;
1599 __entry->size = ip->i_disk_size;
1600 __entry->fileoff = fileoff;
1602 __entry->caller_ip = caller_ip;
1603 __entry->flags = flags;
1605 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx fileoff 0x%llx fsbcount 0x%llx"
1606 "flags %s caller %pS",
1607 MAJOR(__entry->dev), MINOR(__entry->dev),
1612 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1613 (void *)__entry->caller_ip)
1617 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1618 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1619 xfs_agblock_t agbno, xfs_extlen_t len),
1620 TP_ARGS(mp, agno, agbno, len),
1623 __field(xfs_agnumber_t, agno)
1624 __field(xfs_agblock_t, agbno)
1625 __field(xfs_extlen_t, len)
1628 __entry->dev = mp->m_super->s_dev;
1629 __entry->agno = agno;
1630 __entry->agbno = agbno;
1633 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
1634 MAJOR(__entry->dev), MINOR(__entry->dev),
1639 #define DEFINE_BUSY_EVENT(name) \
1640 DEFINE_EVENT(xfs_extent_busy_class, name, \
1641 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1642 xfs_agblock_t agbno, xfs_extlen_t len), \
1643 TP_ARGS(mp, agno, agbno, len))
1644 DEFINE_BUSY_EVENT(xfs_extent_busy);
1645 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1646 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1647 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1648 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1650 TRACE_EVENT(xfs_extent_busy_trim,
1651 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1652 xfs_agblock_t agbno, xfs_extlen_t len,
1653 xfs_agblock_t tbno, xfs_extlen_t tlen),
1654 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1657 __field(xfs_agnumber_t, agno)
1658 __field(xfs_agblock_t, agbno)
1659 __field(xfs_extlen_t, len)
1660 __field(xfs_agblock_t, tbno)
1661 __field(xfs_extlen_t, tlen)
1664 __entry->dev = mp->m_super->s_dev;
1665 __entry->agno = agno;
1666 __entry->agbno = agbno;
1668 __entry->tbno = tbno;
1669 __entry->tlen = tlen;
1671 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
1672 MAJOR(__entry->dev), MINOR(__entry->dev),
1680 DECLARE_EVENT_CLASS(xfs_agf_class,
1681 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1682 unsigned long caller_ip),
1683 TP_ARGS(mp, agf, flags, caller_ip),
1686 __field(xfs_agnumber_t, agno)
1688 __field(__u32, length)
1689 __field(__u32, bno_root)
1690 __field(__u32, cnt_root)
1691 __field(__u32, bno_level)
1692 __field(__u32, cnt_level)
1693 __field(__u32, flfirst)
1694 __field(__u32, fllast)
1695 __field(__u32, flcount)
1696 __field(__u32, freeblks)
1697 __field(__u32, longest)
1698 __field(unsigned long, caller_ip)
1701 __entry->dev = mp->m_super->s_dev;
1702 __entry->agno = be32_to_cpu(agf->agf_seqno),
1703 __entry->flags = flags;
1704 __entry->length = be32_to_cpu(agf->agf_length),
1705 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1706 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1707 __entry->bno_level =
1708 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1709 __entry->cnt_level =
1710 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1711 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1712 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1713 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1714 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1715 __entry->longest = be32_to_cpu(agf->agf_longest);
1716 __entry->caller_ip = caller_ip;
1718 TP_printk("dev %d:%d agno 0x%x flags %s length %u roots b %u c %u "
1719 "levels b %u c %u flfirst %u fllast %u flcount %u "
1720 "freeblks %u longest %u caller %pS",
1721 MAJOR(__entry->dev), MINOR(__entry->dev),
1723 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1734 (void *)__entry->caller_ip)
1736 #define DEFINE_AGF_EVENT(name) \
1737 DEFINE_EVENT(xfs_agf_class, name, \
1738 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1739 unsigned long caller_ip), \
1740 TP_ARGS(mp, agf, flags, caller_ip))
1741 DEFINE_AGF_EVENT(xfs_agf);
1742 DEFINE_AGF_EVENT(xfs_agfl_reset);
1744 TRACE_EVENT(xfs_free_extent,
1745 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1746 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1748 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
1751 __field(xfs_agnumber_t, agno)
1752 __field(xfs_agblock_t, agbno)
1753 __field(xfs_extlen_t, len)
1755 __field(int, haveleft)
1756 __field(int, haveright)
1759 __entry->dev = mp->m_super->s_dev;
1760 __entry->agno = agno;
1761 __entry->agbno = agbno;
1763 __entry->resv = resv;
1764 __entry->haveleft = haveleft;
1765 __entry->haveright = haveright;
1767 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x resv %d %s",
1768 MAJOR(__entry->dev), MINOR(__entry->dev),
1774 (__entry->haveright ? "both" : "left") :
1775 (__entry->haveright ? "right" : "none"))
1779 DECLARE_EVENT_CLASS(xfs_alloc_class,
1780 TP_PROTO(struct xfs_alloc_arg *args),
1784 __field(xfs_agnumber_t, agno)
1785 __field(xfs_agblock_t, agbno)
1786 __field(xfs_extlen_t, minlen)
1787 __field(xfs_extlen_t, maxlen)
1788 __field(xfs_extlen_t, mod)
1789 __field(xfs_extlen_t, prod)
1790 __field(xfs_extlen_t, minleft)
1791 __field(xfs_extlen_t, total)
1792 __field(xfs_extlen_t, alignment)
1793 __field(xfs_extlen_t, minalignslop)
1794 __field(xfs_extlen_t, len)
1795 __field(short, type)
1796 __field(short, otype)
1797 __field(char, wasdel)
1798 __field(char, wasfromfl)
1800 __field(int, datatype)
1801 __field(xfs_fsblock_t, firstblock)
1804 __entry->dev = args->mp->m_super->s_dev;
1805 __entry->agno = args->agno;
1806 __entry->agbno = args->agbno;
1807 __entry->minlen = args->minlen;
1808 __entry->maxlen = args->maxlen;
1809 __entry->mod = args->mod;
1810 __entry->prod = args->prod;
1811 __entry->minleft = args->minleft;
1812 __entry->total = args->total;
1813 __entry->alignment = args->alignment;
1814 __entry->minalignslop = args->minalignslop;
1815 __entry->len = args->len;
1816 __entry->type = args->type;
1817 __entry->otype = args->otype;
1818 __entry->wasdel = args->wasdel;
1819 __entry->wasfromfl = args->wasfromfl;
1820 __entry->resv = args->resv;
1821 __entry->datatype = args->datatype;
1822 __entry->firstblock = args->tp->t_firstblock;
1824 TP_printk("dev %d:%d agno 0x%x agbno 0x%x minlen %u maxlen %u mod %u "
1825 "prod %u minleft %u total %u alignment %u minalignslop %u "
1826 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1827 "datatype 0x%x firstblock 0x%llx",
1828 MAJOR(__entry->dev), MINOR(__entry->dev),
1838 __entry->minalignslop,
1840 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1841 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1846 (unsigned long long)__entry->firstblock)
1849 #define DEFINE_ALLOC_EVENT(name) \
1850 DEFINE_EVENT(xfs_alloc_class, name, \
1851 TP_PROTO(struct xfs_alloc_arg *args), \
1853 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1854 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1855 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1856 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1857 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1858 DEFINE_ALLOC_EVENT(xfs_alloc_cur);
1859 DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
1860 DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
1861 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
1862 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
1863 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1864 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1865 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1866 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1867 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1868 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1869 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1870 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1871 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1872 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1873 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1874 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1875 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1876 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1877 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1878 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1879 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1880 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1882 TRACE_EVENT(xfs_alloc_cur_check,
1883 TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
1884 xfs_extlen_t len, xfs_extlen_t diff, bool new),
1885 TP_ARGS(mp, btnum, bno, len, diff, new),
1888 __field(xfs_btnum_t, btnum)
1889 __field(xfs_agblock_t, bno)
1890 __field(xfs_extlen_t, len)
1891 __field(xfs_extlen_t, diff)
1895 __entry->dev = mp->m_super->s_dev;
1896 __entry->btnum = btnum;
1899 __entry->diff = diff;
1902 TP_printk("dev %d:%d btree %s agbno 0x%x fsbcount 0x%x diff 0x%x new %d",
1903 MAJOR(__entry->dev), MINOR(__entry->dev),
1904 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
1905 __entry->bno, __entry->len, __entry->diff, __entry->new)
1908 DECLARE_EVENT_CLASS(xfs_da_class,
1909 TP_PROTO(struct xfs_da_args *args),
1913 __field(xfs_ino_t, ino)
1914 __dynamic_array(char, name, args->namelen)
1915 __field(int, namelen)
1916 __field(xfs_dahash_t, hashval)
1917 __field(xfs_ino_t, inumber)
1918 __field(uint32_t, op_flags)
1921 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1922 __entry->ino = args->dp->i_ino;
1924 memcpy(__get_str(name), args->name, args->namelen);
1925 __entry->namelen = args->namelen;
1926 __entry->hashval = args->hashval;
1927 __entry->inumber = args->inumber;
1928 __entry->op_flags = args->op_flags;
1930 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1931 "inumber 0x%llx op_flags %s",
1932 MAJOR(__entry->dev), MINOR(__entry->dev),
1935 __entry->namelen ? __get_str(name) : NULL,
1939 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1942 #define DEFINE_DIR2_EVENT(name) \
1943 DEFINE_EVENT(xfs_da_class, name, \
1944 TP_PROTO(struct xfs_da_args *args), \
1946 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1947 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1948 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1949 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1950 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1951 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1952 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1953 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1954 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1955 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1956 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1957 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1958 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1959 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1960 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1961 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1962 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1963 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1964 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1965 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1966 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1967 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1968 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1969 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1970 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1972 DECLARE_EVENT_CLASS(xfs_attr_class,
1973 TP_PROTO(struct xfs_da_args *args),
1977 __field(xfs_ino_t, ino)
1978 __dynamic_array(char, name, args->namelen)
1979 __field(int, namelen)
1980 __field(int, valuelen)
1981 __field(xfs_dahash_t, hashval)
1982 __field(unsigned int, attr_filter)
1983 __field(unsigned int, attr_flags)
1984 __field(uint32_t, op_flags)
1987 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1988 __entry->ino = args->dp->i_ino;
1990 memcpy(__get_str(name), args->name, args->namelen);
1991 __entry->namelen = args->namelen;
1992 __entry->valuelen = args->valuelen;
1993 __entry->hashval = args->hashval;
1994 __entry->attr_filter = args->attr_filter;
1995 __entry->attr_flags = args->attr_flags;
1996 __entry->op_flags = args->op_flags;
1998 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1999 "hashval 0x%x filter %s flags %s op_flags %s",
2000 MAJOR(__entry->dev), MINOR(__entry->dev),
2003 __entry->namelen ? __get_str(name) : NULL,
2007 __print_flags(__entry->attr_filter, "|",
2008 XFS_ATTR_FILTER_FLAGS),
2009 __print_flags(__entry->attr_flags, "|",
2010 { XATTR_CREATE, "CREATE" },
2011 { XATTR_REPLACE, "REPLACE" }),
2012 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
2015 #define DEFINE_ATTR_EVENT(name) \
2016 DEFINE_EVENT(xfs_attr_class, name, \
2017 TP_PROTO(struct xfs_da_args *args), \
2019 DEFINE_ATTR_EVENT(xfs_attr_sf_add);
2020 DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
2021 DEFINE_ATTR_EVENT(xfs_attr_sf_create);
2022 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
2023 DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
2024 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
2026 DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
2027 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
2028 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
2029 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
2030 DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
2031 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
2032 DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
2033 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
2034 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
2035 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
2036 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
2037 DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
2038 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
2039 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
2040 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
2041 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
2042 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
2043 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
2044 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
2045 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
2046 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
2047 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
2049 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
2050 DEFINE_ATTR_EVENT(xfs_attr_node_get);
2051 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
2052 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
2054 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
2055 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
2057 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
2058 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
2060 #define DEFINE_DA_EVENT(name) \
2061 DEFINE_EVENT(xfs_da_class, name, \
2062 TP_PROTO(struct xfs_da_args *args), \
2064 DEFINE_DA_EVENT(xfs_da_split);
2065 DEFINE_DA_EVENT(xfs_da_join);
2066 DEFINE_DA_EVENT(xfs_da_link_before);
2067 DEFINE_DA_EVENT(xfs_da_link_after);
2068 DEFINE_DA_EVENT(xfs_da_unlink_back);
2069 DEFINE_DA_EVENT(xfs_da_unlink_forward);
2070 DEFINE_DA_EVENT(xfs_da_root_split);
2071 DEFINE_DA_EVENT(xfs_da_root_join);
2072 DEFINE_DA_EVENT(xfs_da_node_add);
2073 DEFINE_DA_EVENT(xfs_da_node_create);
2074 DEFINE_DA_EVENT(xfs_da_node_split);
2075 DEFINE_DA_EVENT(xfs_da_node_remove);
2076 DEFINE_DA_EVENT(xfs_da_node_rebalance);
2077 DEFINE_DA_EVENT(xfs_da_node_unbalance);
2078 DEFINE_DA_EVENT(xfs_da_node_toosmall);
2079 DEFINE_DA_EVENT(xfs_da_swap_lastblock);
2080 DEFINE_DA_EVENT(xfs_da_grow_inode);
2081 DEFINE_DA_EVENT(xfs_da_shrink_inode);
2082 DEFINE_DA_EVENT(xfs_da_fixhashpath);
2083 DEFINE_DA_EVENT(xfs_da_path_shift);
2085 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
2086 TP_PROTO(struct xfs_da_args *args, int idx),
2090 __field(xfs_ino_t, ino)
2091 __field(uint32_t, op_flags)
2095 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2096 __entry->ino = args->dp->i_ino;
2097 __entry->op_flags = args->op_flags;
2100 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
2101 MAJOR(__entry->dev), MINOR(__entry->dev),
2103 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2107 #define DEFINE_DIR2_SPACE_EVENT(name) \
2108 DEFINE_EVENT(xfs_dir2_space_class, name, \
2109 TP_PROTO(struct xfs_da_args *args, int idx), \
2111 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
2112 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
2113 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
2114 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
2116 TRACE_EVENT(xfs_dir2_leafn_moveents,
2117 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
2118 TP_ARGS(args, src_idx, dst_idx, count),
2121 __field(xfs_ino_t, ino)
2122 __field(uint32_t, op_flags)
2123 __field(int, src_idx)
2124 __field(int, dst_idx)
2128 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2129 __entry->ino = args->dp->i_ino;
2130 __entry->op_flags = args->op_flags;
2131 __entry->src_idx = src_idx;
2132 __entry->dst_idx = dst_idx;
2133 __entry->count = count;
2135 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
2136 "src_idx %d dst_idx %d count %d",
2137 MAJOR(__entry->dev), MINOR(__entry->dev),
2139 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2145 #define XFS_SWAPEXT_INODES \
2149 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
2150 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
2151 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
2152 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
2153 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
2155 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
2156 TP_PROTO(struct xfs_inode *ip, int which),
2161 __field(xfs_ino_t, ino)
2162 __field(int, format)
2163 __field(xfs_extnum_t, nex)
2164 __field(int, broot_size)
2165 __field(int, fork_off)
2168 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2169 __entry->which = which;
2170 __entry->ino = ip->i_ino;
2171 __entry->format = ip->i_df.if_format;
2172 __entry->nex = ip->i_df.if_nextents;
2173 __entry->broot_size = ip->i_df.if_broot_bytes;
2174 __entry->fork_off = xfs_inode_fork_boff(ip);
2176 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %llu, "
2177 "broot size %d, forkoff 0x%x",
2178 MAJOR(__entry->dev), MINOR(__entry->dev),
2180 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
2181 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
2183 __entry->broot_size,
2187 #define DEFINE_SWAPEXT_EVENT(name) \
2188 DEFINE_EVENT(xfs_swap_extent_class, name, \
2189 TP_PROTO(struct xfs_inode *ip, int which), \
2192 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
2193 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
2195 TRACE_EVENT(xfs_log_recover,
2196 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
2197 TP_ARGS(log, headblk, tailblk),
2200 __field(xfs_daddr_t, headblk)
2201 __field(xfs_daddr_t, tailblk)
2204 __entry->dev = log->l_mp->m_super->s_dev;
2205 __entry->headblk = headblk;
2206 __entry->tailblk = tailblk;
2208 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2209 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2213 TRACE_EVENT(xfs_log_recover_record,
2214 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2215 TP_ARGS(log, rhead, pass),
2218 __field(xfs_lsn_t, lsn)
2220 __field(int, num_logops)
2224 __entry->dev = log->l_mp->m_super->s_dev;
2225 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2226 __entry->len = be32_to_cpu(rhead->h_len);
2227 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2228 __entry->pass = pass;
2230 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2231 MAJOR(__entry->dev), MINOR(__entry->dev),
2232 __entry->lsn, __entry->len, __entry->num_logops,
2236 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2237 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2238 struct xlog_recover_item *item, int pass),
2239 TP_ARGS(log, trans, item, pass),
2242 __field(unsigned long, item)
2243 __field(xlog_tid_t, tid)
2244 __field(xfs_lsn_t, lsn)
2251 __entry->dev = log->l_mp->m_super->s_dev;
2252 __entry->item = (unsigned long)item;
2253 __entry->tid = trans->r_log_tid;
2254 __entry->lsn = trans->r_lsn;
2255 __entry->type = ITEM_TYPE(item);
2256 __entry->pass = pass;
2257 __entry->count = item->ri_cnt;
2258 __entry->total = item->ri_total;
2260 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
2261 "item type %s item region count/total %d/%d",
2262 MAJOR(__entry->dev), MINOR(__entry->dev),
2266 (void *)__entry->item,
2267 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2272 #define DEFINE_LOG_RECOVER_ITEM(name) \
2273 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2274 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2275 struct xlog_recover_item *item, int pass), \
2276 TP_ARGS(log, trans, item, pass))
2278 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2279 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2280 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2281 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2282 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2284 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2285 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2286 TP_ARGS(log, buf_f),
2289 __field(int64_t, blkno)
2290 __field(unsigned short, len)
2291 __field(unsigned short, flags)
2292 __field(unsigned short, size)
2293 __field(unsigned int, map_size)
2296 __entry->dev = log->l_mp->m_super->s_dev;
2297 __entry->blkno = buf_f->blf_blkno;
2298 __entry->len = buf_f->blf_len;
2299 __entry->flags = buf_f->blf_flags;
2300 __entry->size = buf_f->blf_size;
2301 __entry->map_size = buf_f->blf_map_size;
2303 TP_printk("dev %d:%d daddr 0x%llx, bbcount 0x%x, flags 0x%x, size %d, "
2305 MAJOR(__entry->dev), MINOR(__entry->dev),
2313 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2314 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2315 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2316 TP_ARGS(log, buf_f))
2318 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2319 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2320 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2321 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2322 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2323 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2324 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2325 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2326 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2328 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2329 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2333 __field(xfs_ino_t, ino)
2334 __field(unsigned short, size)
2335 __field(int, fields)
2336 __field(unsigned short, asize)
2337 __field(unsigned short, dsize)
2338 __field(int64_t, blkno)
2340 __field(int, boffset)
2343 __entry->dev = log->l_mp->m_super->s_dev;
2344 __entry->ino = in_f->ilf_ino;
2345 __entry->size = in_f->ilf_size;
2346 __entry->fields = in_f->ilf_fields;
2347 __entry->asize = in_f->ilf_asize;
2348 __entry->dsize = in_f->ilf_dsize;
2349 __entry->blkno = in_f->ilf_blkno;
2350 __entry->len = in_f->ilf_len;
2351 __entry->boffset = in_f->ilf_boffset;
2353 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2354 "dsize %d, daddr 0x%llx, bbcount 0x%x, boffset %d",
2355 MAJOR(__entry->dev), MINOR(__entry->dev),
2365 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2366 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2367 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2370 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2371 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2372 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2374 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2375 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2379 __field(xfs_agnumber_t, agno)
2380 __field(xfs_agblock_t, agbno)
2381 __field(unsigned int, count)
2382 __field(unsigned int, isize)
2383 __field(xfs_agblock_t, length)
2384 __field(unsigned int, gen)
2387 __entry->dev = log->l_mp->m_super->s_dev;
2388 __entry->agno = be32_to_cpu(in_f->icl_ag);
2389 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2390 __entry->count = be32_to_cpu(in_f->icl_count);
2391 __entry->isize = be32_to_cpu(in_f->icl_isize);
2392 __entry->length = be32_to_cpu(in_f->icl_length);
2393 __entry->gen = be32_to_cpu(in_f->icl_gen);
2395 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x ireccount %u isize %u gen 0x%x",
2396 MAJOR(__entry->dev), MINOR(__entry->dev),
2404 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2405 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2406 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2409 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2410 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2412 DECLARE_EVENT_CLASS(xfs_discard_class,
2413 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2414 xfs_agblock_t agbno, xfs_extlen_t len),
2415 TP_ARGS(mp, agno, agbno, len),
2418 __field(xfs_agnumber_t, agno)
2419 __field(xfs_agblock_t, agbno)
2420 __field(xfs_extlen_t, len)
2423 __entry->dev = mp->m_super->s_dev;
2424 __entry->agno = agno;
2425 __entry->agbno = agbno;
2428 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
2429 MAJOR(__entry->dev), MINOR(__entry->dev),
2435 #define DEFINE_DISCARD_EVENT(name) \
2436 DEFINE_EVENT(xfs_discard_class, name, \
2437 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2438 xfs_agblock_t agbno, xfs_extlen_t len), \
2439 TP_ARGS(mp, agno, agbno, len))
2440 DEFINE_DISCARD_EVENT(xfs_discard_extent);
2441 DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2442 DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2443 DEFINE_DISCARD_EVENT(xfs_discard_busy);
2445 /* btree cursor events */
2446 TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2447 TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2448 TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2449 TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2450 TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2451 TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2452 TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2454 DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2455 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2456 TP_ARGS(cur, level, bp),
2459 __field(xfs_btnum_t, btnum)
2461 __field(int, nlevels)
2463 __field(xfs_daddr_t, daddr)
2466 __entry->dev = cur->bc_mp->m_super->s_dev;
2467 __entry->btnum = cur->bc_btnum;
2468 __entry->level = level;
2469 __entry->nlevels = cur->bc_nlevels;
2470 __entry->ptr = cur->bc_levels[level].ptr;
2471 __entry->daddr = bp ? xfs_buf_daddr(bp) : -1;
2473 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
2474 MAJOR(__entry->dev), MINOR(__entry->dev),
2475 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
2479 (unsigned long long)__entry->daddr)
2482 #define DEFINE_BTREE_CUR_EVENT(name) \
2483 DEFINE_EVENT(xfs_btree_cur_class, name, \
2484 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2485 TP_ARGS(cur, level, bp))
2486 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2487 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2490 struct xfs_defer_pending;
2492 DECLARE_EVENT_CLASS(xfs_defer_class,
2493 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2494 TP_ARGS(tp, caller_ip),
2497 __field(struct xfs_trans *, tp)
2498 __field(char, committed)
2499 __field(unsigned long, caller_ip)
2502 __entry->dev = tp->t_mountp->m_super->s_dev;
2504 __entry->caller_ip = caller_ip;
2506 TP_printk("dev %d:%d tp %p caller %pS",
2507 MAJOR(__entry->dev), MINOR(__entry->dev),
2509 (char *)__entry->caller_ip)
2511 #define DEFINE_DEFER_EVENT(name) \
2512 DEFINE_EVENT(xfs_defer_class, name, \
2513 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2514 TP_ARGS(tp, caller_ip))
2516 DECLARE_EVENT_CLASS(xfs_defer_error_class,
2517 TP_PROTO(struct xfs_trans *tp, int error),
2521 __field(struct xfs_trans *, tp)
2522 __field(char, committed)
2526 __entry->dev = tp->t_mountp->m_super->s_dev;
2528 __entry->error = error;
2530 TP_printk("dev %d:%d tp %p err %d",
2531 MAJOR(__entry->dev), MINOR(__entry->dev),
2535 #define DEFINE_DEFER_ERROR_EVENT(name) \
2536 DEFINE_EVENT(xfs_defer_error_class, name, \
2537 TP_PROTO(struct xfs_trans *tp, int error), \
2540 DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2541 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2546 __field(void *, intent)
2547 __field(char, committed)
2551 __entry->dev = mp ? mp->m_super->s_dev : 0;
2552 __entry->type = dfp->dfp_type;
2553 __entry->intent = dfp->dfp_intent;
2554 __entry->committed = dfp->dfp_done != NULL;
2555 __entry->nr = dfp->dfp_count;
2557 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
2558 MAJOR(__entry->dev), MINOR(__entry->dev),
2564 #define DEFINE_DEFER_PENDING_EVENT(name) \
2565 DEFINE_EVENT(xfs_defer_pending_class, name, \
2566 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2569 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2570 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2571 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2572 TP_ARGS(mp, agno, type, agbno, len),
2575 __field(xfs_agnumber_t, agno)
2577 __field(xfs_agblock_t, agbno)
2578 __field(xfs_extlen_t, len)
2581 __entry->dev = mp->m_super->s_dev;
2582 __entry->agno = agno;
2583 __entry->type = type;
2584 __entry->agbno = agbno;
2587 TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x fsbcount 0x%x",
2588 MAJOR(__entry->dev), MINOR(__entry->dev),
2594 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2595 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2596 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2598 xfs_agblock_t bno, \
2599 xfs_extlen_t len), \
2600 TP_ARGS(mp, agno, type, bno, len))
2602 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2603 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2605 xfs_agblock_t agbno,
2608 xfs_fileoff_t offset,
2610 xfs_exntst_t state),
2611 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2614 __field(xfs_agnumber_t, agno)
2615 __field(xfs_ino_t, ino)
2616 __field(xfs_agblock_t, agbno)
2617 __field(int, whichfork)
2618 __field(xfs_fileoff_t, l_loff)
2619 __field(xfs_filblks_t, l_len)
2620 __field(xfs_exntst_t, l_state)
2624 __entry->dev = mp->m_super->s_dev;
2625 __entry->agno = agno;
2627 __entry->agbno = agbno;
2628 __entry->whichfork = whichfork;
2629 __entry->l_loff = offset;
2630 __entry->l_len = len;
2631 __entry->l_state = state;
2634 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",
2635 MAJOR(__entry->dev), MINOR(__entry->dev),
2640 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
2645 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2646 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2647 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2649 xfs_agblock_t agbno, \
2652 xfs_fileoff_t offset, \
2653 xfs_filblks_t len, \
2654 xfs_exntst_t state), \
2655 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2657 DEFINE_DEFER_EVENT(xfs_defer_cancel);
2658 DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2659 DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2660 DEFINE_DEFER_EVENT(xfs_defer_finish);
2661 DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2663 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2664 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2666 DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2667 DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
2668 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2669 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2670 DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent);
2672 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2673 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2674 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2675 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2676 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
2678 /* rmap tracepoints */
2679 DECLARE_EVENT_CLASS(xfs_rmap_class,
2680 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2681 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2682 const struct xfs_owner_info *oinfo),
2683 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2686 __field(xfs_agnumber_t, agno)
2687 __field(xfs_agblock_t, agbno)
2688 __field(xfs_extlen_t, len)
2689 __field(uint64_t, owner)
2690 __field(uint64_t, offset)
2691 __field(unsigned long, flags)
2694 __entry->dev = mp->m_super->s_dev;
2695 __entry->agno = agno;
2696 __entry->agbno = agbno;
2698 __entry->owner = oinfo->oi_owner;
2699 __entry->offset = oinfo->oi_offset;
2700 __entry->flags = oinfo->oi_flags;
2702 __entry->flags |= XFS_RMAP_UNWRITTEN;
2704 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%lx",
2705 MAJOR(__entry->dev), MINOR(__entry->dev),
2713 #define DEFINE_RMAP_EVENT(name) \
2714 DEFINE_EVENT(xfs_rmap_class, name, \
2715 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2716 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2717 const struct xfs_owner_info *oinfo), \
2718 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2720 /* simple AG-based error/%ip tracepoint class */
2721 DECLARE_EVENT_CLASS(xfs_ag_error_class,
2722 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2723 unsigned long caller_ip),
2724 TP_ARGS(mp, agno, error, caller_ip),
2727 __field(xfs_agnumber_t, agno)
2729 __field(unsigned long, caller_ip)
2732 __entry->dev = mp->m_super->s_dev;
2733 __entry->agno = agno;
2734 __entry->error = error;
2735 __entry->caller_ip = caller_ip;
2737 TP_printk("dev %d:%d agno 0x%x error %d caller %pS",
2738 MAJOR(__entry->dev), MINOR(__entry->dev),
2741 (char *)__entry->caller_ip)
2744 #define DEFINE_AG_ERROR_EVENT(name) \
2745 DEFINE_EVENT(xfs_ag_error_class, name, \
2746 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2747 unsigned long caller_ip), \
2748 TP_ARGS(mp, agno, error, caller_ip))
2750 DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2751 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2752 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2753 DEFINE_RMAP_EVENT(xfs_rmap_map);
2754 DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2755 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2756 DEFINE_RMAP_EVENT(xfs_rmap_convert);
2757 DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2758 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2759 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
2761 DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2762 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2763 xfs_agblock_t agbno, xfs_extlen_t len,
2764 uint64_t owner, uint64_t offset, unsigned int flags),
2765 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2768 __field(xfs_agnumber_t, agno)
2769 __field(xfs_agblock_t, agbno)
2770 __field(xfs_extlen_t, len)
2771 __field(uint64_t, owner)
2772 __field(uint64_t, offset)
2773 __field(unsigned int, flags)
2776 __entry->dev = mp->m_super->s_dev;
2777 __entry->agno = agno;
2778 __entry->agbno = agbno;
2780 __entry->owner = owner;
2781 __entry->offset = offset;
2782 __entry->flags = flags;
2784 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
2785 MAJOR(__entry->dev), MINOR(__entry->dev),
2793 #define DEFINE_RMAPBT_EVENT(name) \
2794 DEFINE_EVENT(xfs_rmapbt_class, name, \
2795 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2796 xfs_agblock_t agbno, xfs_extlen_t len, \
2797 uint64_t owner, uint64_t offset, unsigned int flags), \
2798 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2800 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2801 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2802 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2804 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2805 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
2806 DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2807 DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2808 DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2809 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2810 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2811 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
2813 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2814 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2815 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2816 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
2817 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2818 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
2819 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
2821 /* deferred bmbt updates */
2822 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2823 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2824 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2826 /* per-AG reservation */
2827 DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2828 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2830 TP_ARGS(pag, resv, len),
2833 __field(xfs_agnumber_t, agno)
2835 __field(xfs_extlen_t, freeblks)
2836 __field(xfs_extlen_t, flcount)
2837 __field(xfs_extlen_t, reserved)
2838 __field(xfs_extlen_t, asked)
2839 __field(xfs_extlen_t, len)
2842 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2844 __entry->dev = pag->pag_mount->m_super->s_dev;
2845 __entry->agno = pag->pag_agno;
2846 __entry->resv = resv;
2847 __entry->freeblks = pag->pagf_freeblks;
2848 __entry->flcount = pag->pagf_flcount;
2849 __entry->reserved = r ? r->ar_reserved : 0;
2850 __entry->asked = r ? r->ar_asked : 0;
2853 TP_printk("dev %d:%d agno 0x%x resv %d freeblks %u flcount %u "
2854 "resv %u ask %u len %u",
2855 MAJOR(__entry->dev), MINOR(__entry->dev),
2864 #define DEFINE_AG_RESV_EVENT(name) \
2865 DEFINE_EVENT(xfs_ag_resv_class, name, \
2866 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2867 xfs_extlen_t len), \
2868 TP_ARGS(pag, type, len))
2870 /* per-AG reservation tracepoints */
2871 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2872 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2873 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2874 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2875 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2876 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2878 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2879 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2881 /* refcount tracepoint classes */
2883 /* reuse the discard trace class for agbno/aglen-based traces */
2884 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2886 /* ag btree lookup tracepoint class */
2887 TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2888 TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2889 TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
2890 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2891 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2892 xfs_agblock_t agbno, xfs_lookup_t dir),
2893 TP_ARGS(mp, agno, agbno, dir),
2896 __field(xfs_agnumber_t, agno)
2897 __field(xfs_agblock_t, agbno)
2898 __field(xfs_lookup_t, dir)
2901 __entry->dev = mp->m_super->s_dev;
2902 __entry->agno = agno;
2903 __entry->agbno = agbno;
2906 TP_printk("dev %d:%d agno 0x%x agbno 0x%x cmp %s(%d)",
2907 MAJOR(__entry->dev), MINOR(__entry->dev),
2910 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2914 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2915 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2916 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2917 xfs_agblock_t agbno, xfs_lookup_t dir), \
2918 TP_ARGS(mp, agno, agbno, dir))
2920 /* single-rcext tracepoint class */
2921 DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2922 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2923 struct xfs_refcount_irec *irec),
2924 TP_ARGS(mp, agno, irec),
2927 __field(xfs_agnumber_t, agno)
2928 __field(xfs_agblock_t, startblock)
2929 __field(xfs_extlen_t, blockcount)
2930 __field(xfs_nlink_t, refcount)
2933 __entry->dev = mp->m_super->s_dev;
2934 __entry->agno = agno;
2935 __entry->startblock = irec->rc_startblock;
2936 __entry->blockcount = irec->rc_blockcount;
2937 __entry->refcount = irec->rc_refcount;
2939 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u",
2940 MAJOR(__entry->dev), MINOR(__entry->dev),
2942 __entry->startblock,
2943 __entry->blockcount,
2947 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2948 DEFINE_EVENT(xfs_refcount_extent_class, name, \
2949 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2950 struct xfs_refcount_irec *irec), \
2951 TP_ARGS(mp, agno, irec))
2953 /* single-rcext and an agbno tracepoint class */
2954 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2955 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2956 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2957 TP_ARGS(mp, agno, irec, agbno),
2960 __field(xfs_agnumber_t, agno)
2961 __field(xfs_agblock_t, startblock)
2962 __field(xfs_extlen_t, blockcount)
2963 __field(xfs_nlink_t, refcount)
2964 __field(xfs_agblock_t, agbno)
2967 __entry->dev = mp->m_super->s_dev;
2968 __entry->agno = agno;
2969 __entry->startblock = irec->rc_startblock;
2970 __entry->blockcount = irec->rc_blockcount;
2971 __entry->refcount = irec->rc_refcount;
2972 __entry->agbno = agbno;
2974 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
2975 MAJOR(__entry->dev), MINOR(__entry->dev),
2977 __entry->startblock,
2978 __entry->blockcount,
2983 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2984 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2985 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2986 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2987 TP_ARGS(mp, agno, irec, agbno))
2989 /* double-rcext tracepoint class */
2990 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2991 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2992 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2993 TP_ARGS(mp, agno, i1, i2),
2996 __field(xfs_agnumber_t, agno)
2997 __field(xfs_agblock_t, i1_startblock)
2998 __field(xfs_extlen_t, i1_blockcount)
2999 __field(xfs_nlink_t, i1_refcount)
3000 __field(xfs_agblock_t, i2_startblock)
3001 __field(xfs_extlen_t, i2_blockcount)
3002 __field(xfs_nlink_t, i2_refcount)
3005 __entry->dev = mp->m_super->s_dev;
3006 __entry->agno = agno;
3007 __entry->i1_startblock = i1->rc_startblock;
3008 __entry->i1_blockcount = i1->rc_blockcount;
3009 __entry->i1_refcount = i1->rc_refcount;
3010 __entry->i2_startblock = i2->rc_startblock;
3011 __entry->i2_blockcount = i2->rc_blockcount;
3012 __entry->i2_refcount = i2->rc_refcount;
3014 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- "
3015 "agbno 0x%x fsbcount 0x%x refcount %u",
3016 MAJOR(__entry->dev), MINOR(__entry->dev),
3018 __entry->i1_startblock,
3019 __entry->i1_blockcount,
3020 __entry->i1_refcount,
3021 __entry->i2_startblock,
3022 __entry->i2_blockcount,
3023 __entry->i2_refcount)
3026 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
3027 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
3028 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3029 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
3030 TP_ARGS(mp, agno, i1, i2))
3032 /* double-rcext and an agbno tracepoint class */
3033 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
3034 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3035 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3036 xfs_agblock_t agbno),
3037 TP_ARGS(mp, agno, i1, i2, agbno),
3040 __field(xfs_agnumber_t, agno)
3041 __field(xfs_agblock_t, i1_startblock)
3042 __field(xfs_extlen_t, i1_blockcount)
3043 __field(xfs_nlink_t, i1_refcount)
3044 __field(xfs_agblock_t, i2_startblock)
3045 __field(xfs_extlen_t, i2_blockcount)
3046 __field(xfs_nlink_t, i2_refcount)
3047 __field(xfs_agblock_t, agbno)
3050 __entry->dev = mp->m_super->s_dev;
3051 __entry->agno = agno;
3052 __entry->i1_startblock = i1->rc_startblock;
3053 __entry->i1_blockcount = i1->rc_blockcount;
3054 __entry->i1_refcount = i1->rc_refcount;
3055 __entry->i2_startblock = i2->rc_startblock;
3056 __entry->i2_blockcount = i2->rc_blockcount;
3057 __entry->i2_refcount = i2->rc_refcount;
3058 __entry->agbno = agbno;
3060 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- "
3061 "agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
3062 MAJOR(__entry->dev), MINOR(__entry->dev),
3064 __entry->i1_startblock,
3065 __entry->i1_blockcount,
3066 __entry->i1_refcount,
3067 __entry->i2_startblock,
3068 __entry->i2_blockcount,
3069 __entry->i2_refcount,
3073 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
3074 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
3075 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3076 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3077 xfs_agblock_t agbno), \
3078 TP_ARGS(mp, agno, i1, i2, agbno))
3080 /* triple-rcext tracepoint class */
3081 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
3082 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3083 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3084 struct xfs_refcount_irec *i3),
3085 TP_ARGS(mp, agno, i1, i2, i3),
3088 __field(xfs_agnumber_t, agno)
3089 __field(xfs_agblock_t, i1_startblock)
3090 __field(xfs_extlen_t, i1_blockcount)
3091 __field(xfs_nlink_t, i1_refcount)
3092 __field(xfs_agblock_t, i2_startblock)
3093 __field(xfs_extlen_t, i2_blockcount)
3094 __field(xfs_nlink_t, i2_refcount)
3095 __field(xfs_agblock_t, i3_startblock)
3096 __field(xfs_extlen_t, i3_blockcount)
3097 __field(xfs_nlink_t, i3_refcount)
3100 __entry->dev = mp->m_super->s_dev;
3101 __entry->agno = agno;
3102 __entry->i1_startblock = i1->rc_startblock;
3103 __entry->i1_blockcount = i1->rc_blockcount;
3104 __entry->i1_refcount = i1->rc_refcount;
3105 __entry->i2_startblock = i2->rc_startblock;
3106 __entry->i2_blockcount = i2->rc_blockcount;
3107 __entry->i2_refcount = i2->rc_refcount;
3108 __entry->i3_startblock = i3->rc_startblock;
3109 __entry->i3_blockcount = i3->rc_blockcount;
3110 __entry->i3_refcount = i3->rc_refcount;
3112 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- "
3113 "agbno 0x%x fsbcount 0x%x refcount %u -- "
3114 "agbno 0x%x fsbcount 0x%x refcount %u",
3115 MAJOR(__entry->dev), MINOR(__entry->dev),
3117 __entry->i1_startblock,
3118 __entry->i1_blockcount,
3119 __entry->i1_refcount,
3120 __entry->i2_startblock,
3121 __entry->i2_blockcount,
3122 __entry->i2_refcount,
3123 __entry->i3_startblock,
3124 __entry->i3_blockcount,
3125 __entry->i3_refcount)
3128 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
3129 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
3130 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3131 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3132 struct xfs_refcount_irec *i3), \
3133 TP_ARGS(mp, agno, i1, i2, i3))
3135 /* refcount btree tracepoints */
3136 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
3137 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
3138 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
3139 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
3140 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
3141 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
3142 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
3143 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
3144 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
3145 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
3147 /* refcount adjustment tracepoints */
3148 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
3149 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
3150 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
3151 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
3152 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
3153 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
3154 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
3155 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
3156 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
3157 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
3158 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
3159 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
3160 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
3161 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
3162 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
3163 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
3164 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
3165 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
3166 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
3167 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
3168 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
3170 /* reflink helpers */
3171 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
3172 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
3173 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
3174 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
3175 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
3176 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
3178 TRACE_EVENT(xfs_refcount_finish_one_leftover,
3179 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3180 int type, xfs_agblock_t agbno, xfs_extlen_t len,
3181 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
3182 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
3185 __field(xfs_agnumber_t, agno)
3187 __field(xfs_agblock_t, agbno)
3188 __field(xfs_extlen_t, len)
3189 __field(xfs_agblock_t, new_agbno)
3190 __field(xfs_extlen_t, new_len)
3193 __entry->dev = mp->m_super->s_dev;
3194 __entry->agno = agno;
3195 __entry->type = type;
3196 __entry->agbno = agbno;
3198 __entry->new_agbno = new_agbno;
3199 __entry->new_len = new_len;
3201 TP_printk("dev %d:%d type %d agno 0x%x agbno 0x%x fsbcount 0x%x new_agbno 0x%x new_fsbcount 0x%x",
3202 MAJOR(__entry->dev), MINOR(__entry->dev),
3211 /* simple inode-based error/%ip tracepoint class */
3212 DECLARE_EVENT_CLASS(xfs_inode_error_class,
3213 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3214 TP_ARGS(ip, error, caller_ip),
3217 __field(xfs_ino_t, ino)
3219 __field(unsigned long, caller_ip)
3222 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3223 __entry->ino = ip->i_ino;
3224 __entry->error = error;
3225 __entry->caller_ip = caller_ip;
3227 TP_printk("dev %d:%d ino 0x%llx error %d caller %pS",
3228 MAJOR(__entry->dev), MINOR(__entry->dev),
3231 (char *)__entry->caller_ip)
3234 #define DEFINE_INODE_ERROR_EVENT(name) \
3235 DEFINE_EVENT(xfs_inode_error_class, name, \
3236 TP_PROTO(struct xfs_inode *ip, int error, \
3237 unsigned long caller_ip), \
3238 TP_ARGS(ip, error, caller_ip))
3240 /* reflink tracepoint classes */
3242 /* two-file io tracepoint class */
3243 DECLARE_EVENT_CLASS(xfs_double_io_class,
3244 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3245 struct xfs_inode *dest, xfs_off_t doffset),
3246 TP_ARGS(src, soffset, len, dest, doffset),
3249 __field(xfs_ino_t, src_ino)
3250 __field(loff_t, src_isize)
3251 __field(loff_t, src_disize)
3252 __field(loff_t, src_offset)
3253 __field(long long, len)
3254 __field(xfs_ino_t, dest_ino)
3255 __field(loff_t, dest_isize)
3256 __field(loff_t, dest_disize)
3257 __field(loff_t, dest_offset)
3260 __entry->dev = VFS_I(src)->i_sb->s_dev;
3261 __entry->src_ino = src->i_ino;
3262 __entry->src_isize = VFS_I(src)->i_size;
3263 __entry->src_disize = src->i_disk_size;
3264 __entry->src_offset = soffset;
3266 __entry->dest_ino = dest->i_ino;
3267 __entry->dest_isize = VFS_I(dest)->i_size;
3268 __entry->dest_disize = dest->i_disk_size;
3269 __entry->dest_offset = doffset;
3271 TP_printk("dev %d:%d bytecount 0x%llx "
3272 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx -> "
3273 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx",
3274 MAJOR(__entry->dev), MINOR(__entry->dev),
3278 __entry->src_disize,
3279 __entry->src_offset,
3281 __entry->dest_isize,
3282 __entry->dest_disize,
3283 __entry->dest_offset)
3286 #define DEFINE_DOUBLE_IO_EVENT(name) \
3287 DEFINE_EVENT(xfs_double_io_class, name, \
3288 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3289 struct xfs_inode *dest, xfs_off_t doffset), \
3290 TP_ARGS(src, soffset, len, dest, doffset))
3292 /* inode/irec events */
3293 DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3294 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3298 __field(xfs_ino_t, ino)
3299 __field(xfs_fileoff_t, lblk)
3300 __field(xfs_extlen_t, len)
3301 __field(xfs_fsblock_t, pblk)
3305 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3306 __entry->ino = ip->i_ino;
3307 __entry->lblk = irec->br_startoff;
3308 __entry->len = irec->br_blockcount;
3309 __entry->pblk = irec->br_startblock;
3310 __entry->state = irec->br_state;
3312 TP_printk("dev %d:%d ino 0x%llx fileoff 0x%llx fsbcount 0x%x startblock 0x%llx st %d",
3313 MAJOR(__entry->dev), MINOR(__entry->dev),
3320 #define DEFINE_INODE_IREC_EVENT(name) \
3321 DEFINE_EVENT(xfs_inode_irec_class, name, \
3322 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3325 /* refcount/reflink tracepoint definitions */
3327 /* reflink tracepoints */
3328 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3329 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3330 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3331 TRACE_EVENT(xfs_reflink_remap_blocks,
3332 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3333 xfs_filblks_t len, struct xfs_inode *dest,
3334 xfs_fileoff_t doffset),
3335 TP_ARGS(src, soffset, len, dest, doffset),
3338 __field(xfs_ino_t, src_ino)
3339 __field(xfs_fileoff_t, src_lblk)
3340 __field(xfs_filblks_t, len)
3341 __field(xfs_ino_t, dest_ino)
3342 __field(xfs_fileoff_t, dest_lblk)
3345 __entry->dev = VFS_I(src)->i_sb->s_dev;
3346 __entry->src_ino = src->i_ino;
3347 __entry->src_lblk = soffset;
3349 __entry->dest_ino = dest->i_ino;
3350 __entry->dest_lblk = doffset;
3352 TP_printk("dev %d:%d fsbcount 0x%llx "
3353 "ino 0x%llx fileoff 0x%llx -> ino 0x%llx fileoff 0x%llx",
3354 MAJOR(__entry->dev), MINOR(__entry->dev),
3361 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3362 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3363 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3364 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
3365 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3366 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3367 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
3368 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
3370 /* dedupe tracepoints */
3371 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3372 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3374 /* ioctl tracepoints */
3375 TRACE_EVENT(xfs_ioctl_clone,
3376 TP_PROTO(struct inode *src, struct inode *dest),
3380 __field(unsigned long, src_ino)
3381 __field(loff_t, src_isize)
3382 __field(unsigned long, dest_ino)
3383 __field(loff_t, dest_isize)
3386 __entry->dev = src->i_sb->s_dev;
3387 __entry->src_ino = src->i_ino;
3388 __entry->src_isize = i_size_read(src);
3389 __entry->dest_ino = dest->i_ino;
3390 __entry->dest_isize = i_size_read(dest);
3392 TP_printk("dev %d:%d ino 0x%lx isize 0x%llx -> ino 0x%lx isize 0x%llx",
3393 MAJOR(__entry->dev), MINOR(__entry->dev),
3397 __entry->dest_isize)
3400 /* unshare tracepoints */
3401 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
3402 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
3405 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
3406 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3407 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
3408 DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
3410 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3411 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3412 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_from);
3413 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_to);
3415 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3416 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3419 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
3421 /* rmap swapext tracepoints */
3422 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3423 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3424 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3427 DECLARE_EVENT_CLASS(xfs_fsmap_class,
3428 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3429 const struct xfs_rmap_irec *rmap),
3430 TP_ARGS(mp, keydev, agno, rmap),
3433 __field(dev_t, keydev)
3434 __field(xfs_agnumber_t, agno)
3435 __field(xfs_fsblock_t, bno)
3436 __field(xfs_filblks_t, len)
3437 __field(uint64_t, owner)
3438 __field(uint64_t, offset)
3439 __field(unsigned int, flags)
3442 __entry->dev = mp->m_super->s_dev;
3443 __entry->keydev = new_decode_dev(keydev);
3444 __entry->agno = agno;
3445 __entry->bno = rmap->rm_startblock;
3446 __entry->len = rmap->rm_blockcount;
3447 __entry->owner = rmap->rm_owner;
3448 __entry->offset = rmap->rm_offset;
3449 __entry->flags = rmap->rm_flags;
3451 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",
3452 MAJOR(__entry->dev), MINOR(__entry->dev),
3453 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3461 #define DEFINE_FSMAP_EVENT(name) \
3462 DEFINE_EVENT(xfs_fsmap_class, name, \
3463 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3464 const struct xfs_rmap_irec *rmap), \
3465 TP_ARGS(mp, keydev, agno, rmap))
3466 DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3467 DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3468 DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3470 DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3471 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3475 __field(dev_t, keydev)
3476 __field(xfs_daddr_t, block)
3477 __field(xfs_daddr_t, len)
3478 __field(uint64_t, owner)
3479 __field(uint64_t, offset)
3480 __field(uint64_t, flags)
3483 __entry->dev = mp->m_super->s_dev;
3484 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3485 __entry->block = fsmap->fmr_physical;
3486 __entry->len = fsmap->fmr_length;
3487 __entry->owner = fsmap->fmr_owner;
3488 __entry->offset = fsmap->fmr_offset;
3489 __entry->flags = fsmap->fmr_flags;
3491 TP_printk("dev %d:%d keydev %d:%d daddr 0x%llx bbcount 0x%llx owner 0x%llx fileoff_daddr 0x%llx flags 0x%llx",
3492 MAJOR(__entry->dev), MINOR(__entry->dev),
3493 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3500 #define DEFINE_GETFSMAP_EVENT(name) \
3501 DEFINE_EVENT(xfs_getfsmap_class, name, \
3502 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3504 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3505 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3506 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3508 DECLARE_EVENT_CLASS(xfs_trans_resv_class,
3509 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3510 struct xfs_trans_res *res),
3511 TP_ARGS(mp, type, res),
3515 __field(uint, logres)
3516 __field(int, logcount)
3517 __field(int, logflags)
3520 __entry->dev = mp->m_super->s_dev;
3521 __entry->type = type;
3522 __entry->logres = res->tr_logres;
3523 __entry->logcount = res->tr_logcount;
3524 __entry->logflags = res->tr_logflags;
3526 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3527 MAJOR(__entry->dev), MINOR(__entry->dev),
3534 #define DEFINE_TRANS_RESV_EVENT(name) \
3535 DEFINE_EVENT(xfs_trans_resv_class, name, \
3536 TP_PROTO(struct xfs_mount *mp, unsigned int type, \
3537 struct xfs_trans_res *res), \
3538 TP_ARGS(mp, type, res))
3539 DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc);
3540 DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc_minlogsize);
3542 TRACE_EVENT(xfs_log_get_max_trans_res,
3543 TP_PROTO(struct xfs_mount *mp, const struct xfs_trans_res *res),
3547 __field(uint, logres)
3548 __field(int, logcount)
3551 __entry->dev = mp->m_super->s_dev;
3552 __entry->logres = res->tr_logres;
3553 __entry->logcount = res->tr_logcount;
3555 TP_printk("dev %d:%d logres %u logcount %d",
3556 MAJOR(__entry->dev), MINOR(__entry->dev),
3561 DECLARE_EVENT_CLASS(xfs_trans_class,
3562 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3563 TP_ARGS(tp, caller_ip),
3566 __field(uint32_t, tid)
3567 __field(uint32_t, flags)
3568 __field(unsigned long, caller_ip)
3571 __entry->dev = tp->t_mountp->m_super->s_dev;
3574 __entry->tid = tp->t_ticket->t_tid;
3575 __entry->flags = tp->t_flags;
3576 __entry->caller_ip = caller_ip;
3578 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3579 MAJOR(__entry->dev), MINOR(__entry->dev),
3582 (char *)__entry->caller_ip)
3585 #define DEFINE_TRANS_EVENT(name) \
3586 DEFINE_EVENT(xfs_trans_class, name, \
3587 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3588 TP_ARGS(tp, caller_ip))
3589 DEFINE_TRANS_EVENT(xfs_trans_alloc);
3590 DEFINE_TRANS_EVENT(xfs_trans_cancel);
3591 DEFINE_TRANS_EVENT(xfs_trans_commit);
3592 DEFINE_TRANS_EVENT(xfs_trans_dup);
3593 DEFINE_TRANS_EVENT(xfs_trans_free);
3594 DEFINE_TRANS_EVENT(xfs_trans_roll);
3595 DEFINE_TRANS_EVENT(xfs_trans_add_item);
3596 DEFINE_TRANS_EVENT(xfs_trans_commit_items);
3597 DEFINE_TRANS_EVENT(xfs_trans_free_items);
3599 TRACE_EVENT(xfs_iunlink_update_bucket,
3600 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3601 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3602 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3605 __field(xfs_agnumber_t, agno)
3606 __field(unsigned int, bucket)
3607 __field(xfs_agino_t, old_ptr)
3608 __field(xfs_agino_t, new_ptr)
3611 __entry->dev = mp->m_super->s_dev;
3612 __entry->agno = agno;
3613 __entry->bucket = bucket;
3614 __entry->old_ptr = old_ptr;
3615 __entry->new_ptr = new_ptr;
3617 TP_printk("dev %d:%d agno 0x%x bucket %u old 0x%x new 0x%x",
3618 MAJOR(__entry->dev), MINOR(__entry->dev),
3625 TRACE_EVENT(xfs_iunlink_update_dinode,
3626 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3627 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3628 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3631 __field(xfs_agnumber_t, agno)
3632 __field(xfs_agino_t, agino)
3633 __field(xfs_agino_t, old_ptr)
3634 __field(xfs_agino_t, new_ptr)
3637 __entry->dev = mp->m_super->s_dev;
3638 __entry->agno = agno;
3639 __entry->agino = agino;
3640 __entry->old_ptr = old_ptr;
3641 __entry->new_ptr = new_ptr;
3643 TP_printk("dev %d:%d agno 0x%x agino 0x%x old 0x%x new 0x%x",
3644 MAJOR(__entry->dev), MINOR(__entry->dev),
3651 DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3652 TP_PROTO(struct xfs_inode *ip),
3656 __field(xfs_agnumber_t, agno)
3657 __field(xfs_agino_t, agino)
3660 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3661 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3662 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3664 TP_printk("dev %d:%d agno 0x%x agino 0x%x",
3665 MAJOR(__entry->dev), MINOR(__entry->dev),
3666 __entry->agno, __entry->agino)
3669 #define DEFINE_AGINODE_EVENT(name) \
3670 DEFINE_EVENT(xfs_ag_inode_class, name, \
3671 TP_PROTO(struct xfs_inode *ip), \
3673 DEFINE_AGINODE_EVENT(xfs_iunlink);
3674 DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
3676 DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3677 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3681 __field(unsigned int, flags)
3684 __entry->dev = mp->m_super->s_dev;
3685 __entry->flags = flags;
3687 TP_printk("dev %d:%d flags 0x%x",
3688 MAJOR(__entry->dev), MINOR(__entry->dev),
3691 #define DEFINE_FS_CORRUPT_EVENT(name) \
3692 DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3693 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3695 DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3696 DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
3697 DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
3698 DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3699 DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
3700 DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
3702 DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3703 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3704 TP_ARGS(mp, agno, flags),
3707 __field(xfs_agnumber_t, agno)
3708 __field(unsigned int, flags)
3711 __entry->dev = mp->m_super->s_dev;
3712 __entry->agno = agno;
3713 __entry->flags = flags;
3715 TP_printk("dev %d:%d agno 0x%x flags 0x%x",
3716 MAJOR(__entry->dev), MINOR(__entry->dev),
3717 __entry->agno, __entry->flags)
3719 #define DEFINE_AG_CORRUPT_EVENT(name) \
3720 DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3721 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3722 unsigned int flags), \
3723 TP_ARGS(mp, agno, flags))
3724 DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3725 DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
3726 DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
3728 DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3729 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3733 __field(xfs_ino_t, ino)
3734 __field(unsigned int, flags)
3737 __entry->dev = ip->i_mount->m_super->s_dev;
3738 __entry->ino = ip->i_ino;
3739 __entry->flags = flags;
3741 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3742 MAJOR(__entry->dev), MINOR(__entry->dev),
3743 __entry->ino, __entry->flags)
3745 #define DEFINE_INODE_CORRUPT_EVENT(name) \
3746 DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3747 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3749 DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3750 DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3752 TRACE_EVENT(xfs_iwalk_ag,
3753 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3754 xfs_agino_t startino),
3755 TP_ARGS(mp, agno, startino),
3758 __field(xfs_agnumber_t, agno)
3759 __field(xfs_agino_t, startino)
3762 __entry->dev = mp->m_super->s_dev;
3763 __entry->agno = agno;
3764 __entry->startino = startino;
3766 TP_printk("dev %d:%d agno 0x%x startino 0x%x",
3767 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3771 TRACE_EVENT(xfs_iwalk_ag_rec,
3772 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3773 struct xfs_inobt_rec_incore *irec),
3774 TP_ARGS(mp, agno, irec),
3777 __field(xfs_agnumber_t, agno)
3778 __field(xfs_agino_t, startino)
3779 __field(uint64_t, freemask)
3782 __entry->dev = mp->m_super->s_dev;
3783 __entry->agno = agno;
3784 __entry->startino = irec->ir_startino;
3785 __entry->freemask = irec->ir_free;
3787 TP_printk("dev %d:%d agno 0x%x startino 0x%x freemask 0x%llx",
3788 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3789 __entry->startino, __entry->freemask)
3792 TRACE_EVENT(xfs_pwork_init,
3793 TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
3794 TP_ARGS(mp, nr_threads, pid),
3797 __field(unsigned int, nr_threads)
3801 __entry->dev = mp->m_super->s_dev;
3802 __entry->nr_threads = nr_threads;
3805 TP_printk("dev %d:%d nr_threads %u pid %u",
3806 MAJOR(__entry->dev), MINOR(__entry->dev),
3807 __entry->nr_threads, __entry->pid)
3810 DECLARE_EVENT_CLASS(xfs_kmem_class,
3811 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
3812 TP_ARGS(size, flags, caller_ip),
3814 __field(ssize_t, size)
3816 __field(unsigned long, caller_ip)
3819 __entry->size = size;
3820 __entry->flags = flags;
3821 __entry->caller_ip = caller_ip;
3823 TP_printk("size %zd flags 0x%x caller %pS",
3826 (char *)__entry->caller_ip)
3829 #define DEFINE_KMEM_EVENT(name) \
3830 DEFINE_EVENT(xfs_kmem_class, name, \
3831 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
3832 TP_ARGS(size, flags, caller_ip))
3833 DEFINE_KMEM_EVENT(kmem_alloc);
3835 TRACE_EVENT(xfs_check_new_dalign,
3836 TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
3837 TP_ARGS(mp, new_dalign, calc_rootino),
3840 __field(int, new_dalign)
3841 __field(xfs_ino_t, sb_rootino)
3842 __field(xfs_ino_t, calc_rootino)
3845 __entry->dev = mp->m_super->s_dev;
3846 __entry->new_dalign = new_dalign;
3847 __entry->sb_rootino = mp->m_sb.sb_rootino;
3848 __entry->calc_rootino = calc_rootino;
3850 TP_printk("dev %d:%d new_dalign %d sb_rootino 0x%llx calc_rootino 0x%llx",
3851 MAJOR(__entry->dev), MINOR(__entry->dev),
3852 __entry->new_dalign, __entry->sb_rootino,
3853 __entry->calc_rootino)
3856 TRACE_EVENT(xfs_btree_commit_afakeroot,
3857 TP_PROTO(struct xfs_btree_cur *cur),
3861 __field(xfs_btnum_t, btnum)
3862 __field(xfs_agnumber_t, agno)
3863 __field(xfs_agblock_t, agbno)
3864 __field(unsigned int, levels)
3865 __field(unsigned int, blocks)
3868 __entry->dev = cur->bc_mp->m_super->s_dev;
3869 __entry->btnum = cur->bc_btnum;
3870 __entry->agno = cur->bc_ag.pag->pag_agno;
3871 __entry->agbno = cur->bc_ag.afake->af_root;
3872 __entry->levels = cur->bc_ag.afake->af_levels;
3873 __entry->blocks = cur->bc_ag.afake->af_blocks;
3875 TP_printk("dev %d:%d btree %s agno 0x%x levels %u blocks %u root %u",
3876 MAJOR(__entry->dev), MINOR(__entry->dev),
3877 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3884 TRACE_EVENT(xfs_btree_commit_ifakeroot,
3885 TP_PROTO(struct xfs_btree_cur *cur),
3889 __field(xfs_btnum_t, btnum)
3890 __field(xfs_agnumber_t, agno)
3891 __field(xfs_agino_t, agino)
3892 __field(unsigned int, levels)
3893 __field(unsigned int, blocks)
3894 __field(int, whichfork)
3897 __entry->dev = cur->bc_mp->m_super->s_dev;
3898 __entry->btnum = cur->bc_btnum;
3899 __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp,
3900 cur->bc_ino.ip->i_ino);
3901 __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp,
3902 cur->bc_ino.ip->i_ino);
3903 __entry->levels = cur->bc_ino.ifake->if_levels;
3904 __entry->blocks = cur->bc_ino.ifake->if_blocks;
3905 __entry->whichfork = cur->bc_ino.whichfork;
3907 TP_printk("dev %d:%d btree %s agno 0x%x agino 0x%x whichfork %s levels %u blocks %u",
3908 MAJOR(__entry->dev), MINOR(__entry->dev),
3909 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3912 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
3917 TRACE_EVENT(xfs_btree_bload_level_geometry,
3918 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3919 uint64_t nr_this_level, unsigned int nr_per_block,
3920 unsigned int desired_npb, uint64_t blocks,
3921 uint64_t blocks_with_extra),
3922 TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks,
3926 __field(xfs_btnum_t, btnum)
3927 __field(unsigned int, level)
3928 __field(unsigned int, nlevels)
3929 __field(uint64_t, nr_this_level)
3930 __field(unsigned int, nr_per_block)
3931 __field(unsigned int, desired_npb)
3932 __field(unsigned long long, blocks)
3933 __field(unsigned long long, blocks_with_extra)
3936 __entry->dev = cur->bc_mp->m_super->s_dev;
3937 __entry->btnum = cur->bc_btnum;
3938 __entry->level = level;
3939 __entry->nlevels = cur->bc_nlevels;
3940 __entry->nr_this_level = nr_this_level;
3941 __entry->nr_per_block = nr_per_block;
3942 __entry->desired_npb = desired_npb;
3943 __entry->blocks = blocks;
3944 __entry->blocks_with_extra = blocks_with_extra;
3946 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",
3947 MAJOR(__entry->dev), MINOR(__entry->dev),
3948 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3951 __entry->nr_this_level,
3952 __entry->nr_per_block,
3953 __entry->desired_npb,
3955 __entry->blocks_with_extra)
3958 TRACE_EVENT(xfs_btree_bload_block,
3959 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3960 uint64_t block_idx, uint64_t nr_blocks,
3961 union xfs_btree_ptr *ptr, unsigned int nr_records),
3962 TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records),
3965 __field(xfs_btnum_t, btnum)
3966 __field(unsigned int, level)
3967 __field(unsigned long long, block_idx)
3968 __field(unsigned long long, nr_blocks)
3969 __field(xfs_agnumber_t, agno)
3970 __field(xfs_agblock_t, agbno)
3971 __field(unsigned int, nr_records)
3974 __entry->dev = cur->bc_mp->m_super->s_dev;
3975 __entry->btnum = cur->bc_btnum;
3976 __entry->level = level;
3977 __entry->block_idx = block_idx;
3978 __entry->nr_blocks = nr_blocks;
3979 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
3980 xfs_fsblock_t fsb = be64_to_cpu(ptr->l);
3982 __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb);
3983 __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb);
3985 __entry->agno = cur->bc_ag.pag->pag_agno;
3986 __entry->agbno = be32_to_cpu(ptr->s);
3988 __entry->nr_records = nr_records;
3990 TP_printk("dev %d:%d btree %s level %u block %llu/%llu agno 0x%x agbno 0x%x recs %u",
3991 MAJOR(__entry->dev), MINOR(__entry->dev),
3992 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3998 __entry->nr_records)
4001 DECLARE_EVENT_CLASS(xfs_timestamp_range_class,
4002 TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max),
4003 TP_ARGS(mp, min, max),
4006 __field(long long, min)
4007 __field(long long, max)
4010 __entry->dev = mp->m_super->s_dev;
4014 TP_printk("dev %d:%d min %lld max %lld",
4015 MAJOR(__entry->dev), MINOR(__entry->dev),
4020 #define DEFINE_TIMESTAMP_RANGE_EVENT(name) \
4021 DEFINE_EVENT(xfs_timestamp_range_class, name, \
4022 TP_PROTO(struct xfs_mount *mp, long long min, long long max), \
4023 TP_ARGS(mp, min, max))
4024 DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range);
4025 DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range);
4027 DECLARE_EVENT_CLASS(xfs_icwalk_class,
4028 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw,
4029 unsigned long caller_ip),
4030 TP_ARGS(mp, icw, caller_ip),
4033 __field(__u32, flags)
4034 __field(uint32_t, uid)
4035 __field(uint32_t, gid)
4036 __field(prid_t, prid)
4037 __field(__u64, min_file_size)
4038 __field(long, scan_limit)
4039 __field(unsigned long, caller_ip)
4042 __entry->dev = mp->m_super->s_dev;
4043 __entry->flags = icw ? icw->icw_flags : 0;
4044 __entry->uid = icw ? from_kuid(mp->m_super->s_user_ns,
4046 __entry->gid = icw ? from_kgid(mp->m_super->s_user_ns,
4048 __entry->prid = icw ? icw->icw_prid : 0;
4049 __entry->min_file_size = icw ? icw->icw_min_file_size : 0;
4050 __entry->scan_limit = icw ? icw->icw_scan_limit : 0;
4051 __entry->caller_ip = caller_ip;
4053 TP_printk("dev %d:%d flags 0x%x uid %u gid %u prid %u minsize %llu scan_limit %ld caller %pS",
4054 MAJOR(__entry->dev), MINOR(__entry->dev),
4059 __entry->min_file_size,
4060 __entry->scan_limit,
4061 (char *)__entry->caller_ip)
4063 #define DEFINE_ICWALK_EVENT(name) \
4064 DEFINE_EVENT(xfs_icwalk_class, name, \
4065 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw, \
4066 unsigned long caller_ip), \
4067 TP_ARGS(mp, icw, caller_ip))
4068 DEFINE_ICWALK_EVENT(xfs_ioc_free_eofblocks);
4069 DEFINE_ICWALK_EVENT(xfs_blockgc_free_space);
4071 TRACE_DEFINE_ENUM(XLOG_STATE_ACTIVE);
4072 TRACE_DEFINE_ENUM(XLOG_STATE_WANT_SYNC);
4073 TRACE_DEFINE_ENUM(XLOG_STATE_SYNCING);
4074 TRACE_DEFINE_ENUM(XLOG_STATE_DONE_SYNC);
4075 TRACE_DEFINE_ENUM(XLOG_STATE_CALLBACK);
4076 TRACE_DEFINE_ENUM(XLOG_STATE_DIRTY);
4078 DECLARE_EVENT_CLASS(xlog_iclog_class,
4079 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip),
4080 TP_ARGS(iclog, caller_ip),
4083 __field(uint32_t, state)
4084 __field(int32_t, refcount)
4085 __field(uint32_t, offset)
4086 __field(uint32_t, flags)
4087 __field(unsigned long long, lsn)
4088 __field(unsigned long, caller_ip)
4091 __entry->dev = iclog->ic_log->l_mp->m_super->s_dev;
4092 __entry->state = iclog->ic_state;
4093 __entry->refcount = atomic_read(&iclog->ic_refcnt);
4094 __entry->offset = iclog->ic_offset;
4095 __entry->flags = iclog->ic_flags;
4096 __entry->lsn = be64_to_cpu(iclog->ic_header.h_lsn);
4097 __entry->caller_ip = caller_ip;
4099 TP_printk("dev %d:%d state %s refcnt %d offset %u lsn 0x%llx flags %s caller %pS",
4100 MAJOR(__entry->dev), MINOR(__entry->dev),
4101 __print_symbolic(__entry->state, XLOG_STATE_STRINGS),
4105 __print_flags(__entry->flags, "|", XLOG_ICL_STRINGS),
4106 (char *)__entry->caller_ip)
4110 #define DEFINE_ICLOG_EVENT(name) \
4111 DEFINE_EVENT(xlog_iclog_class, name, \
4112 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip), \
4113 TP_ARGS(iclog, caller_ip))
4115 DEFINE_ICLOG_EVENT(xlog_iclog_activate);
4116 DEFINE_ICLOG_EVENT(xlog_iclog_clean);
4117 DEFINE_ICLOG_EVENT(xlog_iclog_callback);
4118 DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_start);
4119 DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_done);
4120 DEFINE_ICLOG_EVENT(xlog_iclog_force);
4121 DEFINE_ICLOG_EVENT(xlog_iclog_force_lsn);
4122 DEFINE_ICLOG_EVENT(xlog_iclog_get_space);
4123 DEFINE_ICLOG_EVENT(xlog_iclog_release);
4124 DEFINE_ICLOG_EVENT(xlog_iclog_switch);
4125 DEFINE_ICLOG_EVENT(xlog_iclog_sync);
4126 DEFINE_ICLOG_EVENT(xlog_iclog_syncing);
4127 DEFINE_ICLOG_EVENT(xlog_iclog_sync_done);
4128 DEFINE_ICLOG_EVENT(xlog_iclog_want_sync);
4129 DEFINE_ICLOG_EVENT(xlog_iclog_wait_on);
4130 DEFINE_ICLOG_EVENT(xlog_iclog_write);
4132 TRACE_DEFINE_ENUM(XFS_DAS_UNINIT);
4133 TRACE_DEFINE_ENUM(XFS_DAS_SF_ADD);
4134 TRACE_DEFINE_ENUM(XFS_DAS_SF_REMOVE);
4135 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ADD);
4136 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE);
4137 TRACE_DEFINE_ENUM(XFS_DAS_NODE_ADD);
4138 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE);
4139 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_SET_RMT);
4140 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ALLOC_RMT);
4141 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REPLACE);
4142 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_OLD);
4143 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_RMT);
4144 TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_ATTR);
4145 TRACE_DEFINE_ENUM(XFS_DAS_NODE_SET_RMT);
4146 TRACE_DEFINE_ENUM(XFS_DAS_NODE_ALLOC_RMT);
4147 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REPLACE);
4148 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_OLD);
4149 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_RMT);
4150 TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_ATTR);
4151 TRACE_DEFINE_ENUM(XFS_DAS_DONE);
4153 DECLARE_EVENT_CLASS(xfs_das_state_class,
4154 TP_PROTO(int das, struct xfs_inode *ip),
4158 __field(xfs_ino_t, ino)
4162 __entry->ino = ip->i_ino;
4164 TP_printk("state change %s ino 0x%llx",
4165 __print_symbolic(__entry->das, XFS_DAS_STRINGS),
4169 #define DEFINE_DAS_STATE_EVENT(name) \
4170 DEFINE_EVENT(xfs_das_state_class, name, \
4171 TP_PROTO(int das, struct xfs_inode *ip), \
4173 DEFINE_DAS_STATE_EVENT(xfs_attr_sf_addname_return);
4174 DEFINE_DAS_STATE_EVENT(xfs_attr_set_iter_return);
4175 DEFINE_DAS_STATE_EVENT(xfs_attr_leaf_addname_return);
4176 DEFINE_DAS_STATE_EVENT(xfs_attr_node_addname_return);
4177 DEFINE_DAS_STATE_EVENT(xfs_attr_remove_iter_return);
4178 DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_alloc);
4179 DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_remove_return);
4180 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_add);
4181 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_replace);
4182 DEFINE_DAS_STATE_EVENT(xfs_attr_defer_remove);
4185 TRACE_EVENT(xfs_force_shutdown,
4186 TP_PROTO(struct xfs_mount *mp, int ptag, int flags, const char *fname,
4188 TP_ARGS(mp, ptag, flags, fname, line_num),
4193 __string(fname, fname)
4194 __field(int, line_num)
4197 __entry->dev = mp->m_super->s_dev;
4198 __entry->ptag = ptag;
4199 __entry->flags = flags;
4200 __assign_str(fname, fname);
4201 __entry->line_num = line_num;
4203 TP_printk("dev %d:%d tag %s flags %s file %s line_num %d",
4204 MAJOR(__entry->dev), MINOR(__entry->dev),
4205 __print_flags(__entry->ptag, "|", XFS_PTAG_STRINGS),
4206 __print_flags(__entry->flags, "|", XFS_SHUTDOWN_STRINGS),
4211 #endif /* _TRACE_XFS_H */
4213 #undef TRACE_INCLUDE_PATH
4214 #define TRACE_INCLUDE_PATH .
4215 #define TRACE_INCLUDE_FILE xfs_trace
4216 #include <trace/define_trace.h>