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_start);
244 DEFINE_FS_EVENT(xfs_inodegc_stop);
245 DEFINE_FS_EVENT(xfs_inodegc_queue);
246 DEFINE_FS_EVENT(xfs_inodegc_throttle);
247 DEFINE_FS_EVENT(xfs_fs_sync_fs);
248 DEFINE_FS_EVENT(xfs_blockgc_start);
249 DEFINE_FS_EVENT(xfs_blockgc_stop);
250 DEFINE_FS_EVENT(xfs_blockgc_worker);
251 DEFINE_FS_EVENT(xfs_blockgc_flush_all);
253 TRACE_EVENT(xfs_inodegc_shrinker_scan,
254 TP_PROTO(struct xfs_mount *mp, struct shrink_control *sc,
256 TP_ARGS(mp, sc, caller_ip),
259 __field(unsigned long, nr_to_scan)
260 __field(void *, caller_ip)
263 __entry->dev = mp->m_super->s_dev;
264 __entry->nr_to_scan = sc->nr_to_scan;
265 __entry->caller_ip = caller_ip;
267 TP_printk("dev %d:%d nr_to_scan %lu caller %pS",
268 MAJOR(__entry->dev), MINOR(__entry->dev),
273 DECLARE_EVENT_CLASS(xfs_ag_class,
274 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
278 __field(xfs_agnumber_t, agno)
281 __entry->dev = mp->m_super->s_dev;
282 __entry->agno = agno;
284 TP_printk("dev %d:%d agno 0x%x",
285 MAJOR(__entry->dev), MINOR(__entry->dev),
288 #define DEFINE_AG_EVENT(name) \
289 DEFINE_EVENT(xfs_ag_class, name, \
290 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
293 DEFINE_AG_EVENT(xfs_read_agf);
294 DEFINE_AG_EVENT(xfs_alloc_read_agf);
295 DEFINE_AG_EVENT(xfs_read_agi);
296 DEFINE_AG_EVENT(xfs_ialloc_read_agi);
298 TRACE_EVENT(xfs_attr_list_node_descend,
299 TP_PROTO(struct xfs_attr_list_context *ctx,
300 struct xfs_da_node_entry *btree),
304 __field(xfs_ino_t, ino)
305 __field(u32, hashval)
308 __field(void *, buffer)
309 __field(int, bufsize)
313 __field(unsigned int, attr_filter)
314 __field(u32, bt_hashval)
315 __field(u32, bt_before)
318 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
319 __entry->ino = ctx->dp->i_ino;
320 __entry->hashval = ctx->cursor.hashval;
321 __entry->blkno = ctx->cursor.blkno;
322 __entry->offset = ctx->cursor.offset;
323 __entry->buffer = ctx->buffer;
324 __entry->bufsize = ctx->bufsize;
325 __entry->count = ctx->count;
326 __entry->firstu = ctx->firstu;
327 __entry->attr_filter = ctx->attr_filter;
328 __entry->bt_hashval = be32_to_cpu(btree->hashval);
329 __entry->bt_before = be32_to_cpu(btree->before);
331 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
332 "buffer %p size %u count %u firstu %u filter %s "
333 "node hashval %u, node before %u",
334 MAJOR(__entry->dev), MINOR(__entry->dev),
344 __print_flags(__entry->attr_filter, "|",
345 XFS_ATTR_FILTER_FLAGS),
350 DECLARE_EVENT_CLASS(xfs_bmap_class,
351 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
352 unsigned long caller_ip),
353 TP_ARGS(ip, cur, state, caller_ip),
356 __field(xfs_ino_t, ino)
357 __field(void *, leaf)
359 __field(xfs_fileoff_t, startoff)
360 __field(xfs_fsblock_t, startblock)
361 __field(xfs_filblks_t, blockcount)
362 __field(xfs_exntst_t, state)
363 __field(int, bmap_state)
364 __field(unsigned long, caller_ip)
367 struct xfs_ifork *ifp;
368 struct xfs_bmbt_irec r;
370 ifp = xfs_iext_state_to_fork(ip, state);
371 xfs_iext_get_extent(ifp, cur, &r);
372 __entry->dev = VFS_I(ip)->i_sb->s_dev;
373 __entry->ino = ip->i_ino;
374 __entry->leaf = cur->leaf;
375 __entry->pos = cur->pos;
376 __entry->startoff = r.br_startoff;
377 __entry->startblock = r.br_startblock;
378 __entry->blockcount = r.br_blockcount;
379 __entry->state = r.br_state;
380 __entry->bmap_state = state;
381 __entry->caller_ip = caller_ip;
383 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
384 "fileoff 0x%llx startblock 0x%llx fsbcount 0x%llx flag %d caller %pS",
385 MAJOR(__entry->dev), MINOR(__entry->dev),
387 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
391 (int64_t)__entry->startblock,
394 (char *)__entry->caller_ip)
397 #define DEFINE_BMAP_EVENT(name) \
398 DEFINE_EVENT(xfs_bmap_class, name, \
399 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
400 unsigned long caller_ip), \
401 TP_ARGS(ip, cur, state, caller_ip))
402 DEFINE_BMAP_EVENT(xfs_iext_insert);
403 DEFINE_BMAP_EVENT(xfs_iext_remove);
404 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
405 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
406 DEFINE_BMAP_EVENT(xfs_read_extent);
407 DEFINE_BMAP_EVENT(xfs_write_extent);
409 DECLARE_EVENT_CLASS(xfs_buf_class,
410 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
411 TP_ARGS(bp, caller_ip),
414 __field(xfs_daddr_t, bno)
417 __field(int, pincount)
418 __field(unsigned, lockval)
419 __field(unsigned, flags)
420 __field(unsigned long, caller_ip)
423 __entry->dev = bp->b_target->bt_dev;
424 __entry->bno = xfs_buf_daddr(bp);
425 __entry->nblks = bp->b_length;
426 __entry->hold = atomic_read(&bp->b_hold);
427 __entry->pincount = atomic_read(&bp->b_pin_count);
428 __entry->lockval = bp->b_sema.count;
429 __entry->flags = bp->b_flags;
430 __entry->caller_ip = caller_ip;
432 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
433 "lock %d flags %s caller %pS",
434 MAJOR(__entry->dev), MINOR(__entry->dev),
435 (unsigned long long)__entry->bno,
440 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
441 (void *)__entry->caller_ip)
444 #define DEFINE_BUF_EVENT(name) \
445 DEFINE_EVENT(xfs_buf_class, name, \
446 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
447 TP_ARGS(bp, caller_ip))
448 DEFINE_BUF_EVENT(xfs_buf_init);
449 DEFINE_BUF_EVENT(xfs_buf_free);
450 DEFINE_BUF_EVENT(xfs_buf_hold);
451 DEFINE_BUF_EVENT(xfs_buf_rele);
452 DEFINE_BUF_EVENT(xfs_buf_iodone);
453 DEFINE_BUF_EVENT(xfs_buf_submit);
454 DEFINE_BUF_EVENT(xfs_buf_lock);
455 DEFINE_BUF_EVENT(xfs_buf_lock_done);
456 DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
457 DEFINE_BUF_EVENT(xfs_buf_trylock);
458 DEFINE_BUF_EVENT(xfs_buf_unlock);
459 DEFINE_BUF_EVENT(xfs_buf_iowait);
460 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
461 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
462 DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
463 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
464 DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
465 DEFINE_BUF_EVENT(xfs_buf_get_uncached);
466 DEFINE_BUF_EVENT(xfs_buf_item_relse);
467 DEFINE_BUF_EVENT(xfs_buf_iodone_async);
468 DEFINE_BUF_EVENT(xfs_buf_error_relse);
469 DEFINE_BUF_EVENT(xfs_buf_drain_buftarg);
470 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
472 /* not really buffer traces, but the buf provides useful information */
473 DEFINE_BUF_EVENT(xfs_btree_corrupt);
474 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
476 /* pass flags explicitly */
477 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
478 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
479 TP_ARGS(bp, flags, caller_ip),
482 __field(xfs_daddr_t, bno)
483 __field(unsigned int, length)
485 __field(int, pincount)
486 __field(unsigned, lockval)
487 __field(unsigned, flags)
488 __field(unsigned long, caller_ip)
491 __entry->dev = bp->b_target->bt_dev;
492 __entry->bno = xfs_buf_daddr(bp);
493 __entry->length = bp->b_length;
494 __entry->flags = flags;
495 __entry->hold = atomic_read(&bp->b_hold);
496 __entry->pincount = atomic_read(&bp->b_pin_count);
497 __entry->lockval = bp->b_sema.count;
498 __entry->caller_ip = caller_ip;
500 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
501 "lock %d flags %s caller %pS",
502 MAJOR(__entry->dev), MINOR(__entry->dev),
503 (unsigned long long)__entry->bno,
508 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
509 (void *)__entry->caller_ip)
512 #define DEFINE_BUF_FLAGS_EVENT(name) \
513 DEFINE_EVENT(xfs_buf_flags_class, name, \
514 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
515 TP_ARGS(bp, flags, caller_ip))
516 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
517 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
518 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
520 TRACE_EVENT(xfs_buf_ioerror,
521 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
522 TP_ARGS(bp, error, caller_ip),
525 __field(xfs_daddr_t, bno)
526 __field(unsigned int, length)
527 __field(unsigned, flags)
529 __field(int, pincount)
530 __field(unsigned, lockval)
532 __field(xfs_failaddr_t, caller_ip)
535 __entry->dev = bp->b_target->bt_dev;
536 __entry->bno = xfs_buf_daddr(bp);
537 __entry->length = bp->b_length;
538 __entry->hold = atomic_read(&bp->b_hold);
539 __entry->pincount = atomic_read(&bp->b_pin_count);
540 __entry->lockval = bp->b_sema.count;
541 __entry->error = error;
542 __entry->flags = bp->b_flags;
543 __entry->caller_ip = caller_ip;
545 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
546 "lock %d error %d flags %s caller %pS",
547 MAJOR(__entry->dev), MINOR(__entry->dev),
548 (unsigned long long)__entry->bno,
554 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
555 (void *)__entry->caller_ip)
558 DECLARE_EVENT_CLASS(xfs_buf_item_class,
559 TP_PROTO(struct xfs_buf_log_item *bip),
563 __field(xfs_daddr_t, buf_bno)
564 __field(unsigned int, buf_len)
565 __field(int, buf_hold)
566 __field(int, buf_pincount)
567 __field(int, buf_lockval)
568 __field(unsigned, buf_flags)
569 __field(unsigned, bli_recur)
570 __field(int, bli_refcount)
571 __field(unsigned, bli_flags)
572 __field(unsigned long, li_flags)
575 __entry->dev = bip->bli_buf->b_target->bt_dev;
576 __entry->bli_flags = bip->bli_flags;
577 __entry->bli_recur = bip->bli_recur;
578 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
579 __entry->buf_bno = xfs_buf_daddr(bip->bli_buf);
580 __entry->buf_len = bip->bli_buf->b_length;
581 __entry->buf_flags = bip->bli_buf->b_flags;
582 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
583 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
584 __entry->buf_lockval = bip->bli_buf->b_sema.count;
585 __entry->li_flags = bip->bli_item.li_flags;
587 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
588 "lock %d flags %s recur %d refcount %d bliflags %s "
590 MAJOR(__entry->dev), MINOR(__entry->dev),
591 (unsigned long long)__entry->buf_bno,
594 __entry->buf_pincount,
595 __entry->buf_lockval,
596 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
598 __entry->bli_refcount,
599 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
600 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
603 #define DEFINE_BUF_ITEM_EVENT(name) \
604 DEFINE_EVENT(xfs_buf_item_class, name, \
605 TP_PROTO(struct xfs_buf_log_item *bip), \
607 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
608 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
609 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
610 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
611 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
612 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
613 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
614 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
615 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
616 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release);
617 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
618 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
619 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
620 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
621 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
622 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
623 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
624 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
625 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
626 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
627 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
628 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
629 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
630 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
632 DECLARE_EVENT_CLASS(xfs_filestream_class,
633 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno),
634 TP_ARGS(mp, ino, agno),
637 __field(xfs_ino_t, ino)
638 __field(xfs_agnumber_t, agno)
639 __field(int, streams)
642 __entry->dev = mp->m_super->s_dev;
644 __entry->agno = agno;
645 __entry->streams = xfs_filestream_peek_ag(mp, agno);
647 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d",
648 MAJOR(__entry->dev), MINOR(__entry->dev),
653 #define DEFINE_FILESTREAM_EVENT(name) \
654 DEFINE_EVENT(xfs_filestream_class, name, \
655 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \
656 TP_ARGS(mp, ino, agno))
657 DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
658 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
659 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
661 TRACE_EVENT(xfs_filestream_pick,
662 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
663 xfs_extlen_t free, int nscan),
664 TP_ARGS(ip, agno, free, nscan),
667 __field(xfs_ino_t, ino)
668 __field(xfs_agnumber_t, agno)
669 __field(int, streams)
670 __field(xfs_extlen_t, free)
674 __entry->dev = VFS_I(ip)->i_sb->s_dev;
675 __entry->ino = ip->i_ino;
676 __entry->agno = agno;
677 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
678 __entry->free = free;
679 __entry->nscan = nscan;
681 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d nscan %d",
682 MAJOR(__entry->dev), MINOR(__entry->dev),
690 DECLARE_EVENT_CLASS(xfs_lock_class,
691 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
692 unsigned long caller_ip),
693 TP_ARGS(ip, lock_flags, caller_ip),
696 __field(xfs_ino_t, ino)
697 __field(int, lock_flags)
698 __field(unsigned long, caller_ip)
701 __entry->dev = VFS_I(ip)->i_sb->s_dev;
702 __entry->ino = ip->i_ino;
703 __entry->lock_flags = lock_flags;
704 __entry->caller_ip = caller_ip;
706 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
707 MAJOR(__entry->dev), MINOR(__entry->dev),
709 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
710 (void *)__entry->caller_ip)
713 #define DEFINE_LOCK_EVENT(name) \
714 DEFINE_EVENT(xfs_lock_class, name, \
715 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
716 unsigned long caller_ip), \
717 TP_ARGS(ip, lock_flags, caller_ip))
718 DEFINE_LOCK_EVENT(xfs_ilock);
719 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
720 DEFINE_LOCK_EVENT(xfs_ilock_demote);
721 DEFINE_LOCK_EVENT(xfs_iunlock);
723 DECLARE_EVENT_CLASS(xfs_inode_class,
724 TP_PROTO(struct xfs_inode *ip),
728 __field(xfs_ino_t, ino)
729 __field(unsigned long, iflags)
732 __entry->dev = VFS_I(ip)->i_sb->s_dev;
733 __entry->ino = ip->i_ino;
734 __entry->iflags = ip->i_flags;
736 TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx",
737 MAJOR(__entry->dev), MINOR(__entry->dev),
742 #define DEFINE_INODE_EVENT(name) \
743 DEFINE_EVENT(xfs_inode_class, name, \
744 TP_PROTO(struct xfs_inode *ip), \
746 DEFINE_INODE_EVENT(xfs_iget_skip);
747 DEFINE_INODE_EVENT(xfs_iget_recycle);
748 DEFINE_INODE_EVENT(xfs_iget_recycle_fail);
749 DEFINE_INODE_EVENT(xfs_iget_hit);
750 DEFINE_INODE_EVENT(xfs_iget_miss);
752 DEFINE_INODE_EVENT(xfs_getattr);
753 DEFINE_INODE_EVENT(xfs_setattr);
754 DEFINE_INODE_EVENT(xfs_readlink);
755 DEFINE_INODE_EVENT(xfs_inactive_symlink);
756 DEFINE_INODE_EVENT(xfs_alloc_file_space);
757 DEFINE_INODE_EVENT(xfs_free_file_space);
758 DEFINE_INODE_EVENT(xfs_zero_file_space);
759 DEFINE_INODE_EVENT(xfs_collapse_file_space);
760 DEFINE_INODE_EVENT(xfs_insert_file_space);
761 DEFINE_INODE_EVENT(xfs_readdir);
762 #ifdef CONFIG_XFS_POSIX_ACL
763 DEFINE_INODE_EVENT(xfs_get_acl);
765 DEFINE_INODE_EVENT(xfs_vm_bmap);
766 DEFINE_INODE_EVENT(xfs_file_ioctl);
767 DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
768 DEFINE_INODE_EVENT(xfs_ioctl_setattr);
769 DEFINE_INODE_EVENT(xfs_dir_fsync);
770 DEFINE_INODE_EVENT(xfs_file_fsync);
771 DEFINE_INODE_EVENT(xfs_destroy_inode);
772 DEFINE_INODE_EVENT(xfs_update_time);
774 DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
775 DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
777 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
778 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
779 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
780 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
781 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
782 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
783 DEFINE_INODE_EVENT(xfs_inode_set_reclaimable);
784 DEFINE_INODE_EVENT(xfs_inode_reclaiming);
785 DEFINE_INODE_EVENT(xfs_inode_set_need_inactive);
786 DEFINE_INODE_EVENT(xfs_inode_inactivating);
789 * ftrace's __print_symbolic requires that all enum values be wrapped in the
790 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
791 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
794 TRACE_DEFINE_ENUM(PE_SIZE_PTE);
795 TRACE_DEFINE_ENUM(PE_SIZE_PMD);
796 TRACE_DEFINE_ENUM(PE_SIZE_PUD);
798 TRACE_EVENT(xfs_filemap_fault,
799 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
801 TP_ARGS(ip, pe_size, write_fault),
804 __field(xfs_ino_t, ino)
805 __field(enum page_entry_size, pe_size)
806 __field(bool, write_fault)
809 __entry->dev = VFS_I(ip)->i_sb->s_dev;
810 __entry->ino = ip->i_ino;
811 __entry->pe_size = pe_size;
812 __entry->write_fault = write_fault;
814 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
815 MAJOR(__entry->dev), MINOR(__entry->dev),
817 __print_symbolic(__entry->pe_size,
818 { PE_SIZE_PTE, "PTE" },
819 { PE_SIZE_PMD, "PMD" },
820 { PE_SIZE_PUD, "PUD" }),
821 __entry->write_fault)
824 DECLARE_EVENT_CLASS(xfs_iref_class,
825 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
826 TP_ARGS(ip, caller_ip),
829 __field(xfs_ino_t, ino)
831 __field(int, pincount)
832 __field(unsigned long, caller_ip)
835 __entry->dev = VFS_I(ip)->i_sb->s_dev;
836 __entry->ino = ip->i_ino;
837 __entry->count = atomic_read(&VFS_I(ip)->i_count);
838 __entry->pincount = atomic_read(&ip->i_pincount);
839 __entry->caller_ip = caller_ip;
841 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
842 MAJOR(__entry->dev), MINOR(__entry->dev),
846 (char *)__entry->caller_ip)
849 TRACE_EVENT(xfs_iomap_prealloc_size,
850 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
851 unsigned int writeio_blocks),
852 TP_ARGS(ip, blocks, shift, writeio_blocks),
855 __field(xfs_ino_t, ino)
856 __field(xfs_fsblock_t, blocks)
858 __field(unsigned int, writeio_blocks)
861 __entry->dev = VFS_I(ip)->i_sb->s_dev;
862 __entry->ino = ip->i_ino;
863 __entry->blocks = blocks;
864 __entry->shift = shift;
865 __entry->writeio_blocks = writeio_blocks;
867 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
868 "m_allocsize_blocks %u",
869 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
870 __entry->blocks, __entry->shift, __entry->writeio_blocks)
873 TRACE_EVENT(xfs_irec_merge_pre,
874 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
875 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
876 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
879 __field(xfs_agnumber_t, agno)
880 __field(xfs_agino_t, agino)
881 __field(uint16_t, holemask)
882 __field(xfs_agino_t, nagino)
883 __field(uint16_t, nholemask)
886 __entry->dev = mp->m_super->s_dev;
887 __entry->agno = agno;
888 __entry->agino = agino;
889 __entry->holemask = holemask;
890 __entry->nagino = nagino;
891 __entry->nholemask = holemask;
893 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x",
894 MAJOR(__entry->dev), MINOR(__entry->dev),
902 TRACE_EVENT(xfs_irec_merge_post,
903 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
905 TP_ARGS(mp, agno, agino, holemask),
908 __field(xfs_agnumber_t, agno)
909 __field(xfs_agino_t, agino)
910 __field(uint16_t, holemask)
913 __entry->dev = mp->m_super->s_dev;
914 __entry->agno = agno;
915 __entry->agino = agino;
916 __entry->holemask = holemask;
918 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x",
926 #define DEFINE_IREF_EVENT(name) \
927 DEFINE_EVENT(xfs_iref_class, name, \
928 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
929 TP_ARGS(ip, caller_ip))
930 DEFINE_IREF_EVENT(xfs_irele);
931 DEFINE_IREF_EVENT(xfs_inode_pin);
932 DEFINE_IREF_EVENT(xfs_inode_unpin);
933 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
935 DECLARE_EVENT_CLASS(xfs_namespace_class,
936 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
940 __field(xfs_ino_t, dp_ino)
941 __field(int, namelen)
942 __dynamic_array(char, name, name->len)
945 __entry->dev = VFS_I(dp)->i_sb->s_dev;
946 __entry->dp_ino = dp->i_ino;
947 __entry->namelen = name->len;
948 memcpy(__get_str(name), name->name, name->len);
950 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
951 MAJOR(__entry->dev), MINOR(__entry->dev),
957 #define DEFINE_NAMESPACE_EVENT(name) \
958 DEFINE_EVENT(xfs_namespace_class, name, \
959 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
961 DEFINE_NAMESPACE_EVENT(xfs_remove);
962 DEFINE_NAMESPACE_EVENT(xfs_link);
963 DEFINE_NAMESPACE_EVENT(xfs_lookup);
964 DEFINE_NAMESPACE_EVENT(xfs_create);
965 DEFINE_NAMESPACE_EVENT(xfs_symlink);
967 TRACE_EVENT(xfs_rename,
968 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
969 struct xfs_name *src_name, struct xfs_name *target_name),
970 TP_ARGS(src_dp, target_dp, src_name, target_name),
973 __field(xfs_ino_t, src_dp_ino)
974 __field(xfs_ino_t, target_dp_ino)
975 __field(int, src_namelen)
976 __field(int, target_namelen)
977 __dynamic_array(char, src_name, src_name->len)
978 __dynamic_array(char, target_name, target_name->len)
981 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
982 __entry->src_dp_ino = src_dp->i_ino;
983 __entry->target_dp_ino = target_dp->i_ino;
984 __entry->src_namelen = src_name->len;
985 __entry->target_namelen = target_name->len;
986 memcpy(__get_str(src_name), src_name->name, src_name->len);
987 memcpy(__get_str(target_name), target_name->name,
990 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
991 " src name %.*s target name %.*s",
992 MAJOR(__entry->dev), MINOR(__entry->dev),
994 __entry->target_dp_ino,
995 __entry->src_namelen,
997 __entry->target_namelen,
998 __get_str(target_name))
1001 DECLARE_EVENT_CLASS(xfs_dquot_class,
1002 TP_PROTO(struct xfs_dquot *dqp),
1007 __field(xfs_dqtype_t, type)
1008 __field(unsigned, flags)
1009 __field(unsigned, nrefs)
1010 __field(unsigned long long, res_bcount)
1011 __field(unsigned long long, res_rtbcount)
1012 __field(unsigned long long, res_icount)
1014 __field(unsigned long long, bcount)
1015 __field(unsigned long long, rtbcount)
1016 __field(unsigned long long, icount)
1018 __field(unsigned long long, blk_hardlimit)
1019 __field(unsigned long long, blk_softlimit)
1020 __field(unsigned long long, rtb_hardlimit)
1021 __field(unsigned long long, rtb_softlimit)
1022 __field(unsigned long long, ino_hardlimit)
1023 __field(unsigned long long, ino_softlimit)
1026 __entry->dev = dqp->q_mount->m_super->s_dev;
1027 __entry->id = dqp->q_id;
1028 __entry->type = dqp->q_type;
1029 __entry->flags = dqp->q_flags;
1030 __entry->nrefs = dqp->q_nrefs;
1032 __entry->res_bcount = dqp->q_blk.reserved;
1033 __entry->res_rtbcount = dqp->q_rtb.reserved;
1034 __entry->res_icount = dqp->q_ino.reserved;
1036 __entry->bcount = dqp->q_blk.count;
1037 __entry->rtbcount = dqp->q_rtb.count;
1038 __entry->icount = dqp->q_ino.count;
1040 __entry->blk_hardlimit = dqp->q_blk.hardlimit;
1041 __entry->blk_softlimit = dqp->q_blk.softlimit;
1042 __entry->rtb_hardlimit = dqp->q_rtb.hardlimit;
1043 __entry->rtb_softlimit = dqp->q_rtb.softlimit;
1044 __entry->ino_hardlimit = dqp->q_ino.hardlimit;
1045 __entry->ino_softlimit = dqp->q_ino.softlimit;
1047 TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u "
1048 "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx "
1049 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
1050 "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx "
1051 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
1052 MAJOR(__entry->dev), MINOR(__entry->dev),
1054 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1055 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1057 __entry->res_bcount,
1058 __entry->res_rtbcount,
1059 __entry->res_icount,
1061 __entry->blk_hardlimit,
1062 __entry->blk_softlimit,
1064 __entry->rtb_hardlimit,
1065 __entry->rtb_softlimit,
1067 __entry->ino_hardlimit,
1068 __entry->ino_softlimit)
1071 #define DEFINE_DQUOT_EVENT(name) \
1072 DEFINE_EVENT(xfs_dquot_class, name, \
1073 TP_PROTO(struct xfs_dquot *dqp), \
1075 DEFINE_DQUOT_EVENT(xfs_dqadjust);
1076 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
1077 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
1078 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
1079 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
1080 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
1081 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
1082 DEFINE_DQUOT_EVENT(xfs_dqalloc);
1083 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
1084 DEFINE_DQUOT_EVENT(xfs_dqread);
1085 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
1086 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
1087 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
1088 DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
1089 DEFINE_DQUOT_EVENT(xfs_dqget_dup);
1090 DEFINE_DQUOT_EVENT(xfs_dqput);
1091 DEFINE_DQUOT_EVENT(xfs_dqput_free);
1092 DEFINE_DQUOT_EVENT(xfs_dqrele);
1093 DEFINE_DQUOT_EVENT(xfs_dqflush);
1094 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
1095 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
1096 DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
1097 DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
1099 #define XFS_QMOPT_FLAGS \
1100 { XFS_QMOPT_UQUOTA, "UQUOTA" }, \
1101 { XFS_QMOPT_PQUOTA, "PQUOTA" }, \
1102 { XFS_QMOPT_FORCE_RES, "FORCE_RES" }, \
1103 { XFS_QMOPT_SBVERSION, "SBVERSION" }, \
1104 { XFS_QMOPT_GQUOTA, "GQUOTA" }, \
1105 { XFS_QMOPT_INHERIT, "INHERIT" }, \
1106 { XFS_QMOPT_RES_REGBLKS, "RES_REGBLKS" }, \
1107 { XFS_QMOPT_RES_RTBLKS, "RES_RTBLKS" }, \
1108 { XFS_QMOPT_BCOUNT, "BCOUNT" }, \
1109 { XFS_QMOPT_ICOUNT, "ICOUNT" }, \
1110 { XFS_QMOPT_RTBCOUNT, "RTBCOUNT" }, \
1111 { XFS_QMOPT_DELBCOUNT, "DELBCOUNT" }, \
1112 { XFS_QMOPT_DELRTBCOUNT, "DELRTBCOUNT" }, \
1113 { XFS_QMOPT_RES_INOS, "RES_INOS" }
1115 TRACE_EVENT(xfs_trans_mod_dquot,
1116 TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
1117 unsigned int field, int64_t delta),
1118 TP_ARGS(tp, dqp, field, delta),
1121 __field(xfs_dqtype_t, type)
1122 __field(unsigned int, flags)
1123 __field(unsigned int, dqid)
1124 __field(unsigned int, field)
1125 __field(int64_t, delta)
1128 __entry->dev = tp->t_mountp->m_super->s_dev;
1129 __entry->type = dqp->q_type;
1130 __entry->flags = dqp->q_flags;
1131 __entry->dqid = dqp->q_id;
1132 __entry->field = field;
1133 __entry->delta = delta;
1135 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s field %s delta %lld",
1136 MAJOR(__entry->dev), MINOR(__entry->dev),
1138 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1139 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1140 __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS),
1144 DECLARE_EVENT_CLASS(xfs_dqtrx_class,
1145 TP_PROTO(struct xfs_dqtrx *qtrx),
1149 __field(xfs_dqtype_t, type)
1150 __field(unsigned int, flags)
1153 __field(uint64_t, blk_res)
1154 __field(int64_t, bcount_delta)
1155 __field(int64_t, delbcnt_delta)
1157 __field(uint64_t, rtblk_res)
1158 __field(uint64_t, rtblk_res_used)
1159 __field(int64_t, rtbcount_delta)
1160 __field(int64_t, delrtb_delta)
1162 __field(uint64_t, ino_res)
1163 __field(uint64_t, ino_res_used)
1164 __field(int64_t, icount_delta)
1167 __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev;
1168 __entry->type = qtrx->qt_dquot->q_type;
1169 __entry->flags = qtrx->qt_dquot->q_flags;
1170 __entry->dqid = qtrx->qt_dquot->q_id;
1172 __entry->blk_res = qtrx->qt_blk_res;
1173 __entry->bcount_delta = qtrx->qt_bcount_delta;
1174 __entry->delbcnt_delta = qtrx->qt_delbcnt_delta;
1176 __entry->rtblk_res = qtrx->qt_rtblk_res;
1177 __entry->rtblk_res_used = qtrx->qt_rtblk_res_used;
1178 __entry->rtbcount_delta = qtrx->qt_rtbcount_delta;
1179 __entry->delrtb_delta = qtrx->qt_delrtb_delta;
1181 __entry->ino_res = qtrx->qt_ino_res;
1182 __entry->ino_res_used = qtrx->qt_ino_res_used;
1183 __entry->icount_delta = qtrx->qt_icount_delta;
1185 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s"
1186 "blk_res %llu bcount_delta %lld delbcnt_delta %lld "
1187 "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld "
1188 "ino_res %llu ino_res_used %llu icount_delta %lld",
1189 MAJOR(__entry->dev), MINOR(__entry->dev),
1191 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1192 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1195 __entry->bcount_delta,
1196 __entry->delbcnt_delta,
1199 __entry->rtblk_res_used,
1200 __entry->rtbcount_delta,
1201 __entry->delrtb_delta,
1204 __entry->ino_res_used,
1205 __entry->icount_delta)
1208 #define DEFINE_DQTRX_EVENT(name) \
1209 DEFINE_EVENT(xfs_dqtrx_class, name, \
1210 TP_PROTO(struct xfs_dqtrx *qtrx), \
1212 DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas);
1213 DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before);
1214 DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after);
1216 DECLARE_EVENT_CLASS(xfs_loggrant_class,
1217 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
1223 __field(int, curr_res)
1224 __field(int, unit_res)
1225 __field(unsigned int, flags)
1226 __field(int, reserveq)
1227 __field(int, writeq)
1228 __field(int, grant_reserve_cycle)
1229 __field(int, grant_reserve_bytes)
1230 __field(int, grant_write_cycle)
1231 __field(int, grant_write_bytes)
1232 __field(int, curr_cycle)
1233 __field(int, curr_block)
1234 __field(xfs_lsn_t, tail_lsn)
1237 __entry->dev = log->l_mp->m_super->s_dev;
1238 __entry->ocnt = tic->t_ocnt;
1239 __entry->cnt = tic->t_cnt;
1240 __entry->curr_res = tic->t_curr_res;
1241 __entry->unit_res = tic->t_unit_res;
1242 __entry->flags = tic->t_flags;
1243 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
1244 __entry->writeq = list_empty(&log->l_write_head.waiters);
1245 xlog_crack_grant_head(&log->l_reserve_head.grant,
1246 &__entry->grant_reserve_cycle,
1247 &__entry->grant_reserve_bytes);
1248 xlog_crack_grant_head(&log->l_write_head.grant,
1249 &__entry->grant_write_cycle,
1250 &__entry->grant_write_bytes);
1251 __entry->curr_cycle = log->l_curr_cycle;
1252 __entry->curr_block = log->l_curr_block;
1253 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
1255 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
1256 "t_unit_res %u t_flags %s reserveq %s "
1257 "writeq %s grant_reserve_cycle %d "
1258 "grant_reserve_bytes %d grant_write_cycle %d "
1259 "grant_write_bytes %d curr_cycle %d curr_block %d "
1260 "tail_cycle %d tail_block %d",
1261 MAJOR(__entry->dev), MINOR(__entry->dev),
1266 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
1267 __entry->reserveq ? "empty" : "active",
1268 __entry->writeq ? "empty" : "active",
1269 __entry->grant_reserve_cycle,
1270 __entry->grant_reserve_bytes,
1271 __entry->grant_write_cycle,
1272 __entry->grant_write_bytes,
1273 __entry->curr_cycle,
1274 __entry->curr_block,
1275 CYCLE_LSN(__entry->tail_lsn),
1276 BLOCK_LSN(__entry->tail_lsn)
1280 #define DEFINE_LOGGRANT_EVENT(name) \
1281 DEFINE_EVENT(xfs_loggrant_class, name, \
1282 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1284 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1285 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1286 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1287 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1288 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1289 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1290 DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1291 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1292 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant);
1293 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit);
1294 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub);
1295 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant);
1296 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub);
1297 DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit);
1298 DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait);
1300 DECLARE_EVENT_CLASS(xfs_log_item_class,
1301 TP_PROTO(struct xfs_log_item *lip),
1305 __field(void *, lip)
1307 __field(unsigned long, flags)
1308 __field(xfs_lsn_t, lsn)
1311 __entry->dev = lip->li_mountp->m_super->s_dev;
1313 __entry->type = lip->li_type;
1314 __entry->flags = lip->li_flags;
1315 __entry->lsn = lip->li_lsn;
1317 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
1318 MAJOR(__entry->dev), MINOR(__entry->dev),
1320 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1321 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1322 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1325 TRACE_EVENT(xfs_log_force,
1326 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1327 TP_ARGS(mp, lsn, caller_ip),
1330 __field(xfs_lsn_t, lsn)
1331 __field(unsigned long, caller_ip)
1334 __entry->dev = mp->m_super->s_dev;
1336 __entry->caller_ip = caller_ip;
1338 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
1339 MAJOR(__entry->dev), MINOR(__entry->dev),
1340 __entry->lsn, (void *)__entry->caller_ip)
1343 #define DEFINE_LOG_ITEM_EVENT(name) \
1344 DEFINE_EVENT(xfs_log_item_class, name, \
1345 TP_PROTO(struct xfs_log_item *lip), \
1347 DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1348 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1349 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1350 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1352 DECLARE_EVENT_CLASS(xfs_ail_class,
1353 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1354 TP_ARGS(lip, old_lsn, new_lsn),
1357 __field(void *, lip)
1359 __field(unsigned long, flags)
1360 __field(xfs_lsn_t, old_lsn)
1361 __field(xfs_lsn_t, new_lsn)
1364 __entry->dev = lip->li_mountp->m_super->s_dev;
1366 __entry->type = lip->li_type;
1367 __entry->flags = lip->li_flags;
1368 __entry->old_lsn = old_lsn;
1369 __entry->new_lsn = new_lsn;
1371 TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s",
1372 MAJOR(__entry->dev), MINOR(__entry->dev),
1374 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1375 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1376 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1377 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1380 #define DEFINE_AIL_EVENT(name) \
1381 DEFINE_EVENT(xfs_ail_class, name, \
1382 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1383 TP_ARGS(lip, old_lsn, new_lsn))
1384 DEFINE_AIL_EVENT(xfs_ail_insert);
1385 DEFINE_AIL_EVENT(xfs_ail_move);
1386 DEFINE_AIL_EVENT(xfs_ail_delete);
1388 TRACE_EVENT(xfs_log_assign_tail_lsn,
1389 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1390 TP_ARGS(log, new_lsn),
1393 __field(xfs_lsn_t, new_lsn)
1394 __field(xfs_lsn_t, old_lsn)
1395 __field(xfs_lsn_t, last_sync_lsn)
1398 __entry->dev = log->l_mp->m_super->s_dev;
1399 __entry->new_lsn = new_lsn;
1400 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1401 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1403 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1404 MAJOR(__entry->dev), MINOR(__entry->dev),
1405 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1406 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1407 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1410 DECLARE_EVENT_CLASS(xfs_file_class,
1411 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter),
1412 TP_ARGS(iocb, iter),
1415 __field(xfs_ino_t, ino)
1416 __field(xfs_fsize_t, size)
1417 __field(loff_t, offset)
1418 __field(size_t, count)
1421 __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
1422 __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
1423 __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size;
1424 __entry->offset = iocb->ki_pos;
1425 __entry->count = iov_iter_count(iter);
1427 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx",
1428 MAJOR(__entry->dev), MINOR(__entry->dev),
1435 #define DEFINE_RW_EVENT(name) \
1436 DEFINE_EVENT(xfs_file_class, name, \
1437 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), \
1438 TP_ARGS(iocb, iter))
1439 DEFINE_RW_EVENT(xfs_file_buffered_read);
1440 DEFINE_RW_EVENT(xfs_file_direct_read);
1441 DEFINE_RW_EVENT(xfs_file_dax_read);
1442 DEFINE_RW_EVENT(xfs_file_buffered_write);
1443 DEFINE_RW_EVENT(xfs_file_direct_write);
1444 DEFINE_RW_EVENT(xfs_file_dax_write);
1445 DEFINE_RW_EVENT(xfs_reflink_bounce_dio_write);
1448 DECLARE_EVENT_CLASS(xfs_imap_class,
1449 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1450 int whichfork, struct xfs_bmbt_irec *irec),
1451 TP_ARGS(ip, offset, count, whichfork, irec),
1454 __field(xfs_ino_t, ino)
1455 __field(loff_t, size)
1456 __field(loff_t, offset)
1457 __field(size_t, count)
1458 __field(int, whichfork)
1459 __field(xfs_fileoff_t, startoff)
1460 __field(xfs_fsblock_t, startblock)
1461 __field(xfs_filblks_t, blockcount)
1464 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1465 __entry->ino = ip->i_ino;
1466 __entry->size = ip->i_disk_size;
1467 __entry->offset = offset;
1468 __entry->count = count;
1469 __entry->whichfork = whichfork;
1470 __entry->startoff = irec ? irec->br_startoff : 0;
1471 __entry->startblock = irec ? irec->br_startblock : 0;
1472 __entry->blockcount = irec ? irec->br_blockcount : 0;
1474 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx "
1475 "fork %s startoff 0x%llx startblock 0x%llx fsbcount 0x%llx",
1476 MAJOR(__entry->dev), MINOR(__entry->dev),
1481 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
1483 (int64_t)__entry->startblock,
1484 __entry->blockcount)
1487 #define DEFINE_IMAP_EVENT(name) \
1488 DEFINE_EVENT(xfs_imap_class, name, \
1489 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1490 int whichfork, struct xfs_bmbt_irec *irec), \
1491 TP_ARGS(ip, offset, count, whichfork, irec))
1492 DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1493 DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1494 DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1495 DEFINE_IMAP_EVENT(xfs_iomap_found);
1497 DECLARE_EVENT_CLASS(xfs_simple_io_class,
1498 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1499 TP_ARGS(ip, offset, count),
1502 __field(xfs_ino_t, ino)
1503 __field(loff_t, isize)
1504 __field(loff_t, disize)
1505 __field(loff_t, offset)
1506 __field(size_t, count)
1509 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1510 __entry->ino = ip->i_ino;
1511 __entry->isize = VFS_I(ip)->i_size;
1512 __entry->disize = ip->i_disk_size;
1513 __entry->offset = offset;
1514 __entry->count = count;
1516 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1517 "pos 0x%llx bytecount 0x%zx",
1518 MAJOR(__entry->dev), MINOR(__entry->dev),
1526 #define DEFINE_SIMPLE_IO_EVENT(name) \
1527 DEFINE_EVENT(xfs_simple_io_class, name, \
1528 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1529 TP_ARGS(ip, offset, count))
1530 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1531 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1532 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1533 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1534 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1535 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1536 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1538 DECLARE_EVENT_CLASS(xfs_itrunc_class,
1539 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1540 TP_ARGS(ip, new_size),
1543 __field(xfs_ino_t, ino)
1544 __field(xfs_fsize_t, size)
1545 __field(xfs_fsize_t, new_size)
1548 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1549 __entry->ino = ip->i_ino;
1550 __entry->size = ip->i_disk_size;
1551 __entry->new_size = new_size;
1553 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx new_size 0x%llx",
1554 MAJOR(__entry->dev), MINOR(__entry->dev),
1560 #define DEFINE_ITRUNC_EVENT(name) \
1561 DEFINE_EVENT(xfs_itrunc_class, name, \
1562 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1563 TP_ARGS(ip, new_size))
1564 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1565 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1567 TRACE_EVENT(xfs_pagecache_inval,
1568 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1569 TP_ARGS(ip, start, finish),
1572 __field(xfs_ino_t, ino)
1573 __field(xfs_fsize_t, size)
1574 __field(xfs_off_t, start)
1575 __field(xfs_off_t, finish)
1578 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1579 __entry->ino = ip->i_ino;
1580 __entry->size = ip->i_disk_size;
1581 __entry->start = start;
1582 __entry->finish = finish;
1584 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx start 0x%llx finish 0x%llx",
1585 MAJOR(__entry->dev), MINOR(__entry->dev),
1592 TRACE_EVENT(xfs_bunmap,
1593 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t fileoff, xfs_filblks_t len,
1594 int flags, unsigned long caller_ip),
1595 TP_ARGS(ip, fileoff, len, flags, caller_ip),
1598 __field(xfs_ino_t, ino)
1599 __field(xfs_fsize_t, size)
1600 __field(xfs_fileoff_t, fileoff)
1601 __field(xfs_filblks_t, len)
1602 __field(unsigned long, caller_ip)
1606 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1607 __entry->ino = ip->i_ino;
1608 __entry->size = ip->i_disk_size;
1609 __entry->fileoff = fileoff;
1611 __entry->caller_ip = caller_ip;
1612 __entry->flags = flags;
1614 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx fileoff 0x%llx fsbcount 0x%llx"
1615 "flags %s caller %pS",
1616 MAJOR(__entry->dev), MINOR(__entry->dev),
1621 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1622 (void *)__entry->caller_ip)
1626 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1627 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1628 xfs_agblock_t agbno, xfs_extlen_t len),
1629 TP_ARGS(mp, agno, agbno, len),
1632 __field(xfs_agnumber_t, agno)
1633 __field(xfs_agblock_t, agbno)
1634 __field(xfs_extlen_t, len)
1637 __entry->dev = mp->m_super->s_dev;
1638 __entry->agno = agno;
1639 __entry->agbno = agbno;
1642 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
1643 MAJOR(__entry->dev), MINOR(__entry->dev),
1648 #define DEFINE_BUSY_EVENT(name) \
1649 DEFINE_EVENT(xfs_extent_busy_class, name, \
1650 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1651 xfs_agblock_t agbno, xfs_extlen_t len), \
1652 TP_ARGS(mp, agno, agbno, len))
1653 DEFINE_BUSY_EVENT(xfs_extent_busy);
1654 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1655 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1656 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1657 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1659 TRACE_EVENT(xfs_extent_busy_trim,
1660 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1661 xfs_agblock_t agbno, xfs_extlen_t len,
1662 xfs_agblock_t tbno, xfs_extlen_t tlen),
1663 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1666 __field(xfs_agnumber_t, agno)
1667 __field(xfs_agblock_t, agbno)
1668 __field(xfs_extlen_t, len)
1669 __field(xfs_agblock_t, tbno)
1670 __field(xfs_extlen_t, tlen)
1673 __entry->dev = mp->m_super->s_dev;
1674 __entry->agno = agno;
1675 __entry->agbno = agbno;
1677 __entry->tbno = tbno;
1678 __entry->tlen = tlen;
1680 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
1681 MAJOR(__entry->dev), MINOR(__entry->dev),
1689 DECLARE_EVENT_CLASS(xfs_agf_class,
1690 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1691 unsigned long caller_ip),
1692 TP_ARGS(mp, agf, flags, caller_ip),
1695 __field(xfs_agnumber_t, agno)
1697 __field(__u32, length)
1698 __field(__u32, bno_root)
1699 __field(__u32, cnt_root)
1700 __field(__u32, bno_level)
1701 __field(__u32, cnt_level)
1702 __field(__u32, flfirst)
1703 __field(__u32, fllast)
1704 __field(__u32, flcount)
1705 __field(__u32, freeblks)
1706 __field(__u32, longest)
1707 __field(unsigned long, caller_ip)
1710 __entry->dev = mp->m_super->s_dev;
1711 __entry->agno = be32_to_cpu(agf->agf_seqno),
1712 __entry->flags = flags;
1713 __entry->length = be32_to_cpu(agf->agf_length),
1714 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1715 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1716 __entry->bno_level =
1717 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1718 __entry->cnt_level =
1719 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1720 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1721 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1722 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1723 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1724 __entry->longest = be32_to_cpu(agf->agf_longest);
1725 __entry->caller_ip = caller_ip;
1727 TP_printk("dev %d:%d agno 0x%x flags %s length %u roots b %u c %u "
1728 "levels b %u c %u flfirst %u fllast %u flcount %u "
1729 "freeblks %u longest %u caller %pS",
1730 MAJOR(__entry->dev), MINOR(__entry->dev),
1732 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1743 (void *)__entry->caller_ip)
1745 #define DEFINE_AGF_EVENT(name) \
1746 DEFINE_EVENT(xfs_agf_class, name, \
1747 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1748 unsigned long caller_ip), \
1749 TP_ARGS(mp, agf, flags, caller_ip))
1750 DEFINE_AGF_EVENT(xfs_agf);
1751 DEFINE_AGF_EVENT(xfs_agfl_reset);
1753 TRACE_EVENT(xfs_free_extent,
1754 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1755 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1757 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
1760 __field(xfs_agnumber_t, agno)
1761 __field(xfs_agblock_t, agbno)
1762 __field(xfs_extlen_t, len)
1764 __field(int, haveleft)
1765 __field(int, haveright)
1768 __entry->dev = mp->m_super->s_dev;
1769 __entry->agno = agno;
1770 __entry->agbno = agbno;
1772 __entry->resv = resv;
1773 __entry->haveleft = haveleft;
1774 __entry->haveright = haveright;
1776 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x resv %d %s",
1777 MAJOR(__entry->dev), MINOR(__entry->dev),
1783 (__entry->haveright ? "both" : "left") :
1784 (__entry->haveright ? "right" : "none"))
1788 DECLARE_EVENT_CLASS(xfs_alloc_class,
1789 TP_PROTO(struct xfs_alloc_arg *args),
1793 __field(xfs_agnumber_t, agno)
1794 __field(xfs_agblock_t, agbno)
1795 __field(xfs_extlen_t, minlen)
1796 __field(xfs_extlen_t, maxlen)
1797 __field(xfs_extlen_t, mod)
1798 __field(xfs_extlen_t, prod)
1799 __field(xfs_extlen_t, minleft)
1800 __field(xfs_extlen_t, total)
1801 __field(xfs_extlen_t, alignment)
1802 __field(xfs_extlen_t, minalignslop)
1803 __field(xfs_extlen_t, len)
1804 __field(short, type)
1805 __field(short, otype)
1806 __field(char, wasdel)
1807 __field(char, wasfromfl)
1809 __field(int, datatype)
1810 __field(xfs_fsblock_t, firstblock)
1813 __entry->dev = args->mp->m_super->s_dev;
1814 __entry->agno = args->agno;
1815 __entry->agbno = args->agbno;
1816 __entry->minlen = args->minlen;
1817 __entry->maxlen = args->maxlen;
1818 __entry->mod = args->mod;
1819 __entry->prod = args->prod;
1820 __entry->minleft = args->minleft;
1821 __entry->total = args->total;
1822 __entry->alignment = args->alignment;
1823 __entry->minalignslop = args->minalignslop;
1824 __entry->len = args->len;
1825 __entry->type = args->type;
1826 __entry->otype = args->otype;
1827 __entry->wasdel = args->wasdel;
1828 __entry->wasfromfl = args->wasfromfl;
1829 __entry->resv = args->resv;
1830 __entry->datatype = args->datatype;
1831 __entry->firstblock = args->tp->t_firstblock;
1833 TP_printk("dev %d:%d agno 0x%x agbno 0x%x minlen %u maxlen %u mod %u "
1834 "prod %u minleft %u total %u alignment %u minalignslop %u "
1835 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1836 "datatype 0x%x firstblock 0x%llx",
1837 MAJOR(__entry->dev), MINOR(__entry->dev),
1847 __entry->minalignslop,
1849 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1850 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1855 (unsigned long long)__entry->firstblock)
1858 #define DEFINE_ALLOC_EVENT(name) \
1859 DEFINE_EVENT(xfs_alloc_class, name, \
1860 TP_PROTO(struct xfs_alloc_arg *args), \
1862 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1863 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1864 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1865 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1866 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1867 DEFINE_ALLOC_EVENT(xfs_alloc_cur);
1868 DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
1869 DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
1870 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
1871 DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
1872 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1873 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1874 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1875 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1876 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1877 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1878 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1879 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1880 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1881 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1882 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1883 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1884 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1885 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1886 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1887 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1888 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1889 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1891 TRACE_EVENT(xfs_alloc_cur_check,
1892 TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
1893 xfs_extlen_t len, xfs_extlen_t diff, bool new),
1894 TP_ARGS(mp, btnum, bno, len, diff, new),
1897 __field(xfs_btnum_t, btnum)
1898 __field(xfs_agblock_t, bno)
1899 __field(xfs_extlen_t, len)
1900 __field(xfs_extlen_t, diff)
1904 __entry->dev = mp->m_super->s_dev;
1905 __entry->btnum = btnum;
1908 __entry->diff = diff;
1911 TP_printk("dev %d:%d btree %s agbno 0x%x fsbcount 0x%x diff 0x%x new %d",
1912 MAJOR(__entry->dev), MINOR(__entry->dev),
1913 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
1914 __entry->bno, __entry->len, __entry->diff, __entry->new)
1917 DECLARE_EVENT_CLASS(xfs_da_class,
1918 TP_PROTO(struct xfs_da_args *args),
1922 __field(xfs_ino_t, ino)
1923 __dynamic_array(char, name, args->namelen)
1924 __field(int, namelen)
1925 __field(xfs_dahash_t, hashval)
1926 __field(xfs_ino_t, inumber)
1927 __field(int, op_flags)
1930 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1931 __entry->ino = args->dp->i_ino;
1933 memcpy(__get_str(name), args->name, args->namelen);
1934 __entry->namelen = args->namelen;
1935 __entry->hashval = args->hashval;
1936 __entry->inumber = args->inumber;
1937 __entry->op_flags = args->op_flags;
1939 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1940 "inumber 0x%llx op_flags %s",
1941 MAJOR(__entry->dev), MINOR(__entry->dev),
1944 __entry->namelen ? __get_str(name) : NULL,
1948 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1951 #define DEFINE_DIR2_EVENT(name) \
1952 DEFINE_EVENT(xfs_da_class, name, \
1953 TP_PROTO(struct xfs_da_args *args), \
1955 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1956 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1957 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1958 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1959 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1960 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1961 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1962 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1963 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1964 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1965 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1966 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1967 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1968 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1969 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1970 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1971 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1972 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1973 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1974 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1975 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1976 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1977 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1978 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1979 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1981 DECLARE_EVENT_CLASS(xfs_attr_class,
1982 TP_PROTO(struct xfs_da_args *args),
1986 __field(xfs_ino_t, ino)
1987 __dynamic_array(char, name, args->namelen)
1988 __field(int, namelen)
1989 __field(int, valuelen)
1990 __field(xfs_dahash_t, hashval)
1991 __field(unsigned int, attr_filter)
1992 __field(unsigned int, attr_flags)
1993 __field(int, op_flags)
1996 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1997 __entry->ino = args->dp->i_ino;
1999 memcpy(__get_str(name), args->name, args->namelen);
2000 __entry->namelen = args->namelen;
2001 __entry->valuelen = args->valuelen;
2002 __entry->hashval = args->hashval;
2003 __entry->attr_filter = args->attr_filter;
2004 __entry->attr_flags = args->attr_flags;
2005 __entry->op_flags = args->op_flags;
2007 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
2008 "hashval 0x%x filter %s flags %s op_flags %s",
2009 MAJOR(__entry->dev), MINOR(__entry->dev),
2012 __entry->namelen ? __get_str(name) : NULL,
2016 __print_flags(__entry->attr_filter, "|",
2017 XFS_ATTR_FILTER_FLAGS),
2018 __print_flags(__entry->attr_flags, "|",
2019 { XATTR_CREATE, "CREATE" },
2020 { XATTR_REPLACE, "REPLACE" }),
2021 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
2024 #define DEFINE_ATTR_EVENT(name) \
2025 DEFINE_EVENT(xfs_attr_class, name, \
2026 TP_PROTO(struct xfs_da_args *args), \
2028 DEFINE_ATTR_EVENT(xfs_attr_sf_add);
2029 DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
2030 DEFINE_ATTR_EVENT(xfs_attr_sf_create);
2031 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
2032 DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
2033 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
2035 DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
2036 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
2037 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
2038 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
2039 DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
2040 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
2041 DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
2042 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
2043 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
2044 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
2045 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
2046 DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
2047 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
2048 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
2049 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
2050 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
2051 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
2052 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
2053 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
2054 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
2055 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
2056 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
2058 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
2059 DEFINE_ATTR_EVENT(xfs_attr_node_get);
2060 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
2061 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
2063 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
2064 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
2066 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
2067 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
2069 #define DEFINE_DA_EVENT(name) \
2070 DEFINE_EVENT(xfs_da_class, name, \
2071 TP_PROTO(struct xfs_da_args *args), \
2073 DEFINE_DA_EVENT(xfs_da_split);
2074 DEFINE_DA_EVENT(xfs_da_join);
2075 DEFINE_DA_EVENT(xfs_da_link_before);
2076 DEFINE_DA_EVENT(xfs_da_link_after);
2077 DEFINE_DA_EVENT(xfs_da_unlink_back);
2078 DEFINE_DA_EVENT(xfs_da_unlink_forward);
2079 DEFINE_DA_EVENT(xfs_da_root_split);
2080 DEFINE_DA_EVENT(xfs_da_root_join);
2081 DEFINE_DA_EVENT(xfs_da_node_add);
2082 DEFINE_DA_EVENT(xfs_da_node_create);
2083 DEFINE_DA_EVENT(xfs_da_node_split);
2084 DEFINE_DA_EVENT(xfs_da_node_remove);
2085 DEFINE_DA_EVENT(xfs_da_node_rebalance);
2086 DEFINE_DA_EVENT(xfs_da_node_unbalance);
2087 DEFINE_DA_EVENT(xfs_da_node_toosmall);
2088 DEFINE_DA_EVENT(xfs_da_swap_lastblock);
2089 DEFINE_DA_EVENT(xfs_da_grow_inode);
2090 DEFINE_DA_EVENT(xfs_da_shrink_inode);
2091 DEFINE_DA_EVENT(xfs_da_fixhashpath);
2092 DEFINE_DA_EVENT(xfs_da_path_shift);
2094 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
2095 TP_PROTO(struct xfs_da_args *args, int idx),
2099 __field(xfs_ino_t, ino)
2100 __field(int, op_flags)
2104 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2105 __entry->ino = args->dp->i_ino;
2106 __entry->op_flags = args->op_flags;
2109 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
2110 MAJOR(__entry->dev), MINOR(__entry->dev),
2112 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2116 #define DEFINE_DIR2_SPACE_EVENT(name) \
2117 DEFINE_EVENT(xfs_dir2_space_class, name, \
2118 TP_PROTO(struct xfs_da_args *args, int idx), \
2120 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
2121 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
2122 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
2123 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
2125 TRACE_EVENT(xfs_dir2_leafn_moveents,
2126 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
2127 TP_ARGS(args, src_idx, dst_idx, count),
2130 __field(xfs_ino_t, ino)
2131 __field(int, op_flags)
2132 __field(int, src_idx)
2133 __field(int, dst_idx)
2137 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2138 __entry->ino = args->dp->i_ino;
2139 __entry->op_flags = args->op_flags;
2140 __entry->src_idx = src_idx;
2141 __entry->dst_idx = dst_idx;
2142 __entry->count = count;
2144 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
2145 "src_idx %d dst_idx %d count %d",
2146 MAJOR(__entry->dev), MINOR(__entry->dev),
2148 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2154 #define XFS_SWAPEXT_INODES \
2158 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
2159 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
2160 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
2161 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
2162 TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
2164 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
2165 TP_PROTO(struct xfs_inode *ip, int which),
2170 __field(xfs_ino_t, ino)
2171 __field(int, format)
2173 __field(int, broot_size)
2174 __field(int, fork_off)
2177 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2178 __entry->which = which;
2179 __entry->ino = ip->i_ino;
2180 __entry->format = ip->i_df.if_format;
2181 __entry->nex = ip->i_df.if_nextents;
2182 __entry->broot_size = ip->i_df.if_broot_bytes;
2183 __entry->fork_off = XFS_IFORK_BOFF(ip);
2185 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
2186 "broot size %d, forkoff 0x%x",
2187 MAJOR(__entry->dev), MINOR(__entry->dev),
2189 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
2190 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
2192 __entry->broot_size,
2196 #define DEFINE_SWAPEXT_EVENT(name) \
2197 DEFINE_EVENT(xfs_swap_extent_class, name, \
2198 TP_PROTO(struct xfs_inode *ip, int which), \
2201 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
2202 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
2204 TRACE_EVENT(xfs_log_recover,
2205 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
2206 TP_ARGS(log, headblk, tailblk),
2209 __field(xfs_daddr_t, headblk)
2210 __field(xfs_daddr_t, tailblk)
2213 __entry->dev = log->l_mp->m_super->s_dev;
2214 __entry->headblk = headblk;
2215 __entry->tailblk = tailblk;
2217 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2218 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2222 TRACE_EVENT(xfs_log_recover_record,
2223 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2224 TP_ARGS(log, rhead, pass),
2227 __field(xfs_lsn_t, lsn)
2229 __field(int, num_logops)
2233 __entry->dev = log->l_mp->m_super->s_dev;
2234 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2235 __entry->len = be32_to_cpu(rhead->h_len);
2236 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2237 __entry->pass = pass;
2239 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2240 MAJOR(__entry->dev), MINOR(__entry->dev),
2241 __entry->lsn, __entry->len, __entry->num_logops,
2245 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2246 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2247 struct xlog_recover_item *item, int pass),
2248 TP_ARGS(log, trans, item, pass),
2251 __field(unsigned long, item)
2252 __field(xlog_tid_t, tid)
2253 __field(xfs_lsn_t, lsn)
2260 __entry->dev = log->l_mp->m_super->s_dev;
2261 __entry->item = (unsigned long)item;
2262 __entry->tid = trans->r_log_tid;
2263 __entry->lsn = trans->r_lsn;
2264 __entry->type = ITEM_TYPE(item);
2265 __entry->pass = pass;
2266 __entry->count = item->ri_cnt;
2267 __entry->total = item->ri_total;
2269 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
2270 "item type %s item region count/total %d/%d",
2271 MAJOR(__entry->dev), MINOR(__entry->dev),
2275 (void *)__entry->item,
2276 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2281 #define DEFINE_LOG_RECOVER_ITEM(name) \
2282 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2283 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2284 struct xlog_recover_item *item, int pass), \
2285 TP_ARGS(log, trans, item, pass))
2287 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2288 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2289 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2290 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2291 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2293 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2294 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2295 TP_ARGS(log, buf_f),
2298 __field(int64_t, blkno)
2299 __field(unsigned short, len)
2300 __field(unsigned short, flags)
2301 __field(unsigned short, size)
2302 __field(unsigned int, map_size)
2305 __entry->dev = log->l_mp->m_super->s_dev;
2306 __entry->blkno = buf_f->blf_blkno;
2307 __entry->len = buf_f->blf_len;
2308 __entry->flags = buf_f->blf_flags;
2309 __entry->size = buf_f->blf_size;
2310 __entry->map_size = buf_f->blf_map_size;
2312 TP_printk("dev %d:%d daddr 0x%llx, bbcount 0x%x, flags 0x%x, size %d, "
2314 MAJOR(__entry->dev), MINOR(__entry->dev),
2322 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2323 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2324 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2325 TP_ARGS(log, buf_f))
2327 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2328 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2329 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2330 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2331 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2332 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2333 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2334 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2335 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2337 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2338 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2342 __field(xfs_ino_t, ino)
2343 __field(unsigned short, size)
2344 __field(int, fields)
2345 __field(unsigned short, asize)
2346 __field(unsigned short, dsize)
2347 __field(int64_t, blkno)
2349 __field(int, boffset)
2352 __entry->dev = log->l_mp->m_super->s_dev;
2353 __entry->ino = in_f->ilf_ino;
2354 __entry->size = in_f->ilf_size;
2355 __entry->fields = in_f->ilf_fields;
2356 __entry->asize = in_f->ilf_asize;
2357 __entry->dsize = in_f->ilf_dsize;
2358 __entry->blkno = in_f->ilf_blkno;
2359 __entry->len = in_f->ilf_len;
2360 __entry->boffset = in_f->ilf_boffset;
2362 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2363 "dsize %d, daddr 0x%llx, bbcount 0x%x, boffset %d",
2364 MAJOR(__entry->dev), MINOR(__entry->dev),
2374 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2375 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2376 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2379 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2380 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2381 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2383 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2384 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2388 __field(xfs_agnumber_t, agno)
2389 __field(xfs_agblock_t, agbno)
2390 __field(unsigned int, count)
2391 __field(unsigned int, isize)
2392 __field(xfs_agblock_t, length)
2393 __field(unsigned int, gen)
2396 __entry->dev = log->l_mp->m_super->s_dev;
2397 __entry->agno = be32_to_cpu(in_f->icl_ag);
2398 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2399 __entry->count = be32_to_cpu(in_f->icl_count);
2400 __entry->isize = be32_to_cpu(in_f->icl_isize);
2401 __entry->length = be32_to_cpu(in_f->icl_length);
2402 __entry->gen = be32_to_cpu(in_f->icl_gen);
2404 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x ireccount %u isize %u gen 0x%x",
2405 MAJOR(__entry->dev), MINOR(__entry->dev),
2413 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2414 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2415 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2418 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2419 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2421 DECLARE_EVENT_CLASS(xfs_discard_class,
2422 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2423 xfs_agblock_t agbno, xfs_extlen_t len),
2424 TP_ARGS(mp, agno, agbno, len),
2427 __field(xfs_agnumber_t, agno)
2428 __field(xfs_agblock_t, agbno)
2429 __field(xfs_extlen_t, len)
2432 __entry->dev = mp->m_super->s_dev;
2433 __entry->agno = agno;
2434 __entry->agbno = agbno;
2437 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
2438 MAJOR(__entry->dev), MINOR(__entry->dev),
2444 #define DEFINE_DISCARD_EVENT(name) \
2445 DEFINE_EVENT(xfs_discard_class, name, \
2446 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2447 xfs_agblock_t agbno, xfs_extlen_t len), \
2448 TP_ARGS(mp, agno, agbno, len))
2449 DEFINE_DISCARD_EVENT(xfs_discard_extent);
2450 DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2451 DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2452 DEFINE_DISCARD_EVENT(xfs_discard_busy);
2454 /* btree cursor events */
2455 TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2456 TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2457 TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2458 TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2459 TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2460 TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2461 TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2463 DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2464 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2465 TP_ARGS(cur, level, bp),
2468 __field(xfs_btnum_t, btnum)
2470 __field(int, nlevels)
2472 __field(xfs_daddr_t, daddr)
2475 __entry->dev = cur->bc_mp->m_super->s_dev;
2476 __entry->btnum = cur->bc_btnum;
2477 __entry->level = level;
2478 __entry->nlevels = cur->bc_nlevels;
2479 __entry->ptr = cur->bc_levels[level].ptr;
2480 __entry->daddr = bp ? xfs_buf_daddr(bp) : -1;
2482 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
2483 MAJOR(__entry->dev), MINOR(__entry->dev),
2484 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
2488 (unsigned long long)__entry->daddr)
2491 #define DEFINE_BTREE_CUR_EVENT(name) \
2492 DEFINE_EVENT(xfs_btree_cur_class, name, \
2493 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2494 TP_ARGS(cur, level, bp))
2495 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2496 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2499 struct xfs_defer_pending;
2501 DECLARE_EVENT_CLASS(xfs_defer_class,
2502 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2503 TP_ARGS(tp, caller_ip),
2506 __field(struct xfs_trans *, tp)
2507 __field(char, committed)
2508 __field(unsigned long, caller_ip)
2511 __entry->dev = tp->t_mountp->m_super->s_dev;
2513 __entry->caller_ip = caller_ip;
2515 TP_printk("dev %d:%d tp %p caller %pS",
2516 MAJOR(__entry->dev), MINOR(__entry->dev),
2518 (char *)__entry->caller_ip)
2520 #define DEFINE_DEFER_EVENT(name) \
2521 DEFINE_EVENT(xfs_defer_class, name, \
2522 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2523 TP_ARGS(tp, caller_ip))
2525 DECLARE_EVENT_CLASS(xfs_defer_error_class,
2526 TP_PROTO(struct xfs_trans *tp, int error),
2530 __field(struct xfs_trans *, tp)
2531 __field(char, committed)
2535 __entry->dev = tp->t_mountp->m_super->s_dev;
2537 __entry->error = error;
2539 TP_printk("dev %d:%d tp %p err %d",
2540 MAJOR(__entry->dev), MINOR(__entry->dev),
2544 #define DEFINE_DEFER_ERROR_EVENT(name) \
2545 DEFINE_EVENT(xfs_defer_error_class, name, \
2546 TP_PROTO(struct xfs_trans *tp, int error), \
2549 DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2550 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2555 __field(void *, intent)
2556 __field(char, committed)
2560 __entry->dev = mp ? mp->m_super->s_dev : 0;
2561 __entry->type = dfp->dfp_type;
2562 __entry->intent = dfp->dfp_intent;
2563 __entry->committed = dfp->dfp_done != NULL;
2564 __entry->nr = dfp->dfp_count;
2566 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
2567 MAJOR(__entry->dev), MINOR(__entry->dev),
2573 #define DEFINE_DEFER_PENDING_EVENT(name) \
2574 DEFINE_EVENT(xfs_defer_pending_class, name, \
2575 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2578 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2579 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2580 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2581 TP_ARGS(mp, agno, type, agbno, len),
2584 __field(xfs_agnumber_t, agno)
2586 __field(xfs_agblock_t, agbno)
2587 __field(xfs_extlen_t, len)
2590 __entry->dev = mp->m_super->s_dev;
2591 __entry->agno = agno;
2592 __entry->type = type;
2593 __entry->agbno = agbno;
2596 TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x fsbcount 0x%x",
2597 MAJOR(__entry->dev), MINOR(__entry->dev),
2603 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2604 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2605 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2607 xfs_agblock_t bno, \
2608 xfs_extlen_t len), \
2609 TP_ARGS(mp, agno, type, bno, len))
2611 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2612 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2614 xfs_agblock_t agbno,
2617 xfs_fileoff_t offset,
2619 xfs_exntst_t state),
2620 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2623 __field(xfs_agnumber_t, agno)
2624 __field(xfs_ino_t, ino)
2625 __field(xfs_agblock_t, agbno)
2626 __field(int, whichfork)
2627 __field(xfs_fileoff_t, l_loff)
2628 __field(xfs_filblks_t, l_len)
2629 __field(xfs_exntst_t, l_state)
2633 __entry->dev = mp->m_super->s_dev;
2634 __entry->agno = agno;
2636 __entry->agbno = agbno;
2637 __entry->whichfork = whichfork;
2638 __entry->l_loff = offset;
2639 __entry->l_len = len;
2640 __entry->l_state = state;
2643 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",
2644 MAJOR(__entry->dev), MINOR(__entry->dev),
2649 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
2654 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2655 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2656 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2658 xfs_agblock_t agbno, \
2661 xfs_fileoff_t offset, \
2662 xfs_filblks_t len, \
2663 xfs_exntst_t state), \
2664 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2666 DEFINE_DEFER_EVENT(xfs_defer_cancel);
2667 DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2668 DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2669 DEFINE_DEFER_EVENT(xfs_defer_finish);
2670 DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2672 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2673 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2675 DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2676 DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
2677 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2678 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2679 DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent);
2681 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2682 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2683 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2684 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2685 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
2687 /* rmap tracepoints */
2688 DECLARE_EVENT_CLASS(xfs_rmap_class,
2689 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2690 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2691 const struct xfs_owner_info *oinfo),
2692 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2695 __field(xfs_agnumber_t, agno)
2696 __field(xfs_agblock_t, agbno)
2697 __field(xfs_extlen_t, len)
2698 __field(uint64_t, owner)
2699 __field(uint64_t, offset)
2700 __field(unsigned long, flags)
2703 __entry->dev = mp->m_super->s_dev;
2704 __entry->agno = agno;
2705 __entry->agbno = agbno;
2707 __entry->owner = oinfo->oi_owner;
2708 __entry->offset = oinfo->oi_offset;
2709 __entry->flags = oinfo->oi_flags;
2711 __entry->flags |= XFS_RMAP_UNWRITTEN;
2713 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%lx",
2714 MAJOR(__entry->dev), MINOR(__entry->dev),
2722 #define DEFINE_RMAP_EVENT(name) \
2723 DEFINE_EVENT(xfs_rmap_class, name, \
2724 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2725 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2726 const struct xfs_owner_info *oinfo), \
2727 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2729 /* simple AG-based error/%ip tracepoint class */
2730 DECLARE_EVENT_CLASS(xfs_ag_error_class,
2731 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2732 unsigned long caller_ip),
2733 TP_ARGS(mp, agno, error, caller_ip),
2736 __field(xfs_agnumber_t, agno)
2738 __field(unsigned long, caller_ip)
2741 __entry->dev = mp->m_super->s_dev;
2742 __entry->agno = agno;
2743 __entry->error = error;
2744 __entry->caller_ip = caller_ip;
2746 TP_printk("dev %d:%d agno 0x%x error %d caller %pS",
2747 MAJOR(__entry->dev), MINOR(__entry->dev),
2750 (char *)__entry->caller_ip)
2753 #define DEFINE_AG_ERROR_EVENT(name) \
2754 DEFINE_EVENT(xfs_ag_error_class, name, \
2755 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2756 unsigned long caller_ip), \
2757 TP_ARGS(mp, agno, error, caller_ip))
2759 DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2760 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2761 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2762 DEFINE_RMAP_EVENT(xfs_rmap_map);
2763 DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2764 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2765 DEFINE_RMAP_EVENT(xfs_rmap_convert);
2766 DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2767 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2768 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
2770 DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2771 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2772 xfs_agblock_t agbno, xfs_extlen_t len,
2773 uint64_t owner, uint64_t offset, unsigned int flags),
2774 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2777 __field(xfs_agnumber_t, agno)
2778 __field(xfs_agblock_t, agbno)
2779 __field(xfs_extlen_t, len)
2780 __field(uint64_t, owner)
2781 __field(uint64_t, offset)
2782 __field(unsigned int, flags)
2785 __entry->dev = mp->m_super->s_dev;
2786 __entry->agno = agno;
2787 __entry->agbno = agbno;
2789 __entry->owner = owner;
2790 __entry->offset = offset;
2791 __entry->flags = flags;
2793 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
2794 MAJOR(__entry->dev), MINOR(__entry->dev),
2802 #define DEFINE_RMAPBT_EVENT(name) \
2803 DEFINE_EVENT(xfs_rmapbt_class, name, \
2804 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2805 xfs_agblock_t agbno, xfs_extlen_t len, \
2806 uint64_t owner, uint64_t offset, unsigned int flags), \
2807 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2809 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2810 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2811 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2813 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2814 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
2815 DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2816 DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2817 DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2818 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2819 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2820 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
2822 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2823 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2824 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2825 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
2826 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2827 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
2828 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
2830 /* deferred bmbt updates */
2831 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2832 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2833 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2835 /* per-AG reservation */
2836 DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2837 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2839 TP_ARGS(pag, resv, len),
2842 __field(xfs_agnumber_t, agno)
2844 __field(xfs_extlen_t, freeblks)
2845 __field(xfs_extlen_t, flcount)
2846 __field(xfs_extlen_t, reserved)
2847 __field(xfs_extlen_t, asked)
2848 __field(xfs_extlen_t, len)
2851 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2853 __entry->dev = pag->pag_mount->m_super->s_dev;
2854 __entry->agno = pag->pag_agno;
2855 __entry->resv = resv;
2856 __entry->freeblks = pag->pagf_freeblks;
2857 __entry->flcount = pag->pagf_flcount;
2858 __entry->reserved = r ? r->ar_reserved : 0;
2859 __entry->asked = r ? r->ar_asked : 0;
2862 TP_printk("dev %d:%d agno 0x%x resv %d freeblks %u flcount %u "
2863 "resv %u ask %u len %u",
2864 MAJOR(__entry->dev), MINOR(__entry->dev),
2873 #define DEFINE_AG_RESV_EVENT(name) \
2874 DEFINE_EVENT(xfs_ag_resv_class, name, \
2875 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2876 xfs_extlen_t len), \
2877 TP_ARGS(pag, type, len))
2879 /* per-AG reservation tracepoints */
2880 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2881 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2882 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2883 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2884 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2885 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2887 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2888 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2890 /* refcount tracepoint classes */
2892 /* reuse the discard trace class for agbno/aglen-based traces */
2893 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2895 /* ag btree lookup tracepoint class */
2896 TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2897 TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2898 TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
2899 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2900 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2901 xfs_agblock_t agbno, xfs_lookup_t dir),
2902 TP_ARGS(mp, agno, agbno, dir),
2905 __field(xfs_agnumber_t, agno)
2906 __field(xfs_agblock_t, agbno)
2907 __field(xfs_lookup_t, dir)
2910 __entry->dev = mp->m_super->s_dev;
2911 __entry->agno = agno;
2912 __entry->agbno = agbno;
2915 TP_printk("dev %d:%d agno 0x%x agbno 0x%x cmp %s(%d)",
2916 MAJOR(__entry->dev), MINOR(__entry->dev),
2919 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2923 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2924 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2925 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2926 xfs_agblock_t agbno, xfs_lookup_t dir), \
2927 TP_ARGS(mp, agno, agbno, dir))
2929 /* single-rcext tracepoint class */
2930 DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2931 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2932 struct xfs_refcount_irec *irec),
2933 TP_ARGS(mp, agno, irec),
2936 __field(xfs_agnumber_t, agno)
2937 __field(xfs_agblock_t, startblock)
2938 __field(xfs_extlen_t, blockcount)
2939 __field(xfs_nlink_t, refcount)
2942 __entry->dev = mp->m_super->s_dev;
2943 __entry->agno = agno;
2944 __entry->startblock = irec->rc_startblock;
2945 __entry->blockcount = irec->rc_blockcount;
2946 __entry->refcount = irec->rc_refcount;
2948 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u",
2949 MAJOR(__entry->dev), MINOR(__entry->dev),
2951 __entry->startblock,
2952 __entry->blockcount,
2956 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2957 DEFINE_EVENT(xfs_refcount_extent_class, name, \
2958 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2959 struct xfs_refcount_irec *irec), \
2960 TP_ARGS(mp, agno, irec))
2962 /* single-rcext and an agbno tracepoint class */
2963 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2964 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2965 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2966 TP_ARGS(mp, agno, irec, agbno),
2969 __field(xfs_agnumber_t, agno)
2970 __field(xfs_agblock_t, startblock)
2971 __field(xfs_extlen_t, blockcount)
2972 __field(xfs_nlink_t, refcount)
2973 __field(xfs_agblock_t, agbno)
2976 __entry->dev = mp->m_super->s_dev;
2977 __entry->agno = agno;
2978 __entry->startblock = irec->rc_startblock;
2979 __entry->blockcount = irec->rc_blockcount;
2980 __entry->refcount = irec->rc_refcount;
2981 __entry->agbno = agbno;
2983 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
2984 MAJOR(__entry->dev), MINOR(__entry->dev),
2986 __entry->startblock,
2987 __entry->blockcount,
2992 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2993 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2994 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2995 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2996 TP_ARGS(mp, agno, irec, agbno))
2998 /* double-rcext tracepoint class */
2999 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
3000 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3001 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
3002 TP_ARGS(mp, agno, i1, i2),
3005 __field(xfs_agnumber_t, agno)
3006 __field(xfs_agblock_t, i1_startblock)
3007 __field(xfs_extlen_t, i1_blockcount)
3008 __field(xfs_nlink_t, i1_refcount)
3009 __field(xfs_agblock_t, i2_startblock)
3010 __field(xfs_extlen_t, i2_blockcount)
3011 __field(xfs_nlink_t, i2_refcount)
3014 __entry->dev = mp->m_super->s_dev;
3015 __entry->agno = agno;
3016 __entry->i1_startblock = i1->rc_startblock;
3017 __entry->i1_blockcount = i1->rc_blockcount;
3018 __entry->i1_refcount = i1->rc_refcount;
3019 __entry->i2_startblock = i2->rc_startblock;
3020 __entry->i2_blockcount = i2->rc_blockcount;
3021 __entry->i2_refcount = i2->rc_refcount;
3023 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- "
3024 "agbno 0x%x fsbcount 0x%x refcount %u",
3025 MAJOR(__entry->dev), MINOR(__entry->dev),
3027 __entry->i1_startblock,
3028 __entry->i1_blockcount,
3029 __entry->i1_refcount,
3030 __entry->i2_startblock,
3031 __entry->i2_blockcount,
3032 __entry->i2_refcount)
3035 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
3036 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
3037 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3038 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
3039 TP_ARGS(mp, agno, i1, i2))
3041 /* double-rcext and an agbno tracepoint class */
3042 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
3043 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3044 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3045 xfs_agblock_t agbno),
3046 TP_ARGS(mp, agno, i1, i2, agbno),
3049 __field(xfs_agnumber_t, agno)
3050 __field(xfs_agblock_t, i1_startblock)
3051 __field(xfs_extlen_t, i1_blockcount)
3052 __field(xfs_nlink_t, i1_refcount)
3053 __field(xfs_agblock_t, i2_startblock)
3054 __field(xfs_extlen_t, i2_blockcount)
3055 __field(xfs_nlink_t, i2_refcount)
3056 __field(xfs_agblock_t, agbno)
3059 __entry->dev = mp->m_super->s_dev;
3060 __entry->agno = agno;
3061 __entry->i1_startblock = i1->rc_startblock;
3062 __entry->i1_blockcount = i1->rc_blockcount;
3063 __entry->i1_refcount = i1->rc_refcount;
3064 __entry->i2_startblock = i2->rc_startblock;
3065 __entry->i2_blockcount = i2->rc_blockcount;
3066 __entry->i2_refcount = i2->rc_refcount;
3067 __entry->agbno = agbno;
3069 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- "
3070 "agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
3071 MAJOR(__entry->dev), MINOR(__entry->dev),
3073 __entry->i1_startblock,
3074 __entry->i1_blockcount,
3075 __entry->i1_refcount,
3076 __entry->i2_startblock,
3077 __entry->i2_blockcount,
3078 __entry->i2_refcount,
3082 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
3083 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
3084 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3085 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3086 xfs_agblock_t agbno), \
3087 TP_ARGS(mp, agno, i1, i2, agbno))
3089 /* triple-rcext tracepoint class */
3090 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
3091 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3092 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3093 struct xfs_refcount_irec *i3),
3094 TP_ARGS(mp, agno, i1, i2, i3),
3097 __field(xfs_agnumber_t, agno)
3098 __field(xfs_agblock_t, i1_startblock)
3099 __field(xfs_extlen_t, i1_blockcount)
3100 __field(xfs_nlink_t, i1_refcount)
3101 __field(xfs_agblock_t, i2_startblock)
3102 __field(xfs_extlen_t, i2_blockcount)
3103 __field(xfs_nlink_t, i2_refcount)
3104 __field(xfs_agblock_t, i3_startblock)
3105 __field(xfs_extlen_t, i3_blockcount)
3106 __field(xfs_nlink_t, i3_refcount)
3109 __entry->dev = mp->m_super->s_dev;
3110 __entry->agno = agno;
3111 __entry->i1_startblock = i1->rc_startblock;
3112 __entry->i1_blockcount = i1->rc_blockcount;
3113 __entry->i1_refcount = i1->rc_refcount;
3114 __entry->i2_startblock = i2->rc_startblock;
3115 __entry->i2_blockcount = i2->rc_blockcount;
3116 __entry->i2_refcount = i2->rc_refcount;
3117 __entry->i3_startblock = i3->rc_startblock;
3118 __entry->i3_blockcount = i3->rc_blockcount;
3119 __entry->i3_refcount = i3->rc_refcount;
3121 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- "
3122 "agbno 0x%x fsbcount 0x%x refcount %u -- "
3123 "agbno 0x%x fsbcount 0x%x refcount %u",
3124 MAJOR(__entry->dev), MINOR(__entry->dev),
3126 __entry->i1_startblock,
3127 __entry->i1_blockcount,
3128 __entry->i1_refcount,
3129 __entry->i2_startblock,
3130 __entry->i2_blockcount,
3131 __entry->i2_refcount,
3132 __entry->i3_startblock,
3133 __entry->i3_blockcount,
3134 __entry->i3_refcount)
3137 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
3138 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
3139 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3140 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3141 struct xfs_refcount_irec *i3), \
3142 TP_ARGS(mp, agno, i1, i2, i3))
3144 /* refcount btree tracepoints */
3145 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
3146 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
3147 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
3148 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
3149 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
3150 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
3151 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
3152 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
3153 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
3154 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
3156 /* refcount adjustment tracepoints */
3157 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
3158 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
3159 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
3160 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
3161 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
3162 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
3163 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
3164 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
3165 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
3166 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
3167 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
3168 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
3169 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
3170 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
3171 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
3172 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
3173 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
3174 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
3175 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
3176 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
3177 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
3179 /* reflink helpers */
3180 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
3181 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
3182 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
3183 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
3184 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
3185 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
3187 TRACE_EVENT(xfs_refcount_finish_one_leftover,
3188 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3189 int type, xfs_agblock_t agbno, xfs_extlen_t len,
3190 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
3191 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
3194 __field(xfs_agnumber_t, agno)
3196 __field(xfs_agblock_t, agbno)
3197 __field(xfs_extlen_t, len)
3198 __field(xfs_agblock_t, new_agbno)
3199 __field(xfs_extlen_t, new_len)
3202 __entry->dev = mp->m_super->s_dev;
3203 __entry->agno = agno;
3204 __entry->type = type;
3205 __entry->agbno = agbno;
3207 __entry->new_agbno = new_agbno;
3208 __entry->new_len = new_len;
3210 TP_printk("dev %d:%d type %d agno 0x%x agbno 0x%x fsbcount 0x%x new_agbno 0x%x new_fsbcount 0x%x",
3211 MAJOR(__entry->dev), MINOR(__entry->dev),
3220 /* simple inode-based error/%ip tracepoint class */
3221 DECLARE_EVENT_CLASS(xfs_inode_error_class,
3222 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3223 TP_ARGS(ip, error, caller_ip),
3226 __field(xfs_ino_t, ino)
3228 __field(unsigned long, caller_ip)
3231 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3232 __entry->ino = ip->i_ino;
3233 __entry->error = error;
3234 __entry->caller_ip = caller_ip;
3236 TP_printk("dev %d:%d ino 0x%llx error %d caller %pS",
3237 MAJOR(__entry->dev), MINOR(__entry->dev),
3240 (char *)__entry->caller_ip)
3243 #define DEFINE_INODE_ERROR_EVENT(name) \
3244 DEFINE_EVENT(xfs_inode_error_class, name, \
3245 TP_PROTO(struct xfs_inode *ip, int error, \
3246 unsigned long caller_ip), \
3247 TP_ARGS(ip, error, caller_ip))
3249 /* reflink tracepoint classes */
3251 /* two-file io tracepoint class */
3252 DECLARE_EVENT_CLASS(xfs_double_io_class,
3253 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3254 struct xfs_inode *dest, xfs_off_t doffset),
3255 TP_ARGS(src, soffset, len, dest, doffset),
3258 __field(xfs_ino_t, src_ino)
3259 __field(loff_t, src_isize)
3260 __field(loff_t, src_disize)
3261 __field(loff_t, src_offset)
3262 __field(long long, len)
3263 __field(xfs_ino_t, dest_ino)
3264 __field(loff_t, dest_isize)
3265 __field(loff_t, dest_disize)
3266 __field(loff_t, dest_offset)
3269 __entry->dev = VFS_I(src)->i_sb->s_dev;
3270 __entry->src_ino = src->i_ino;
3271 __entry->src_isize = VFS_I(src)->i_size;
3272 __entry->src_disize = src->i_disk_size;
3273 __entry->src_offset = soffset;
3275 __entry->dest_ino = dest->i_ino;
3276 __entry->dest_isize = VFS_I(dest)->i_size;
3277 __entry->dest_disize = dest->i_disk_size;
3278 __entry->dest_offset = doffset;
3280 TP_printk("dev %d:%d bytecount 0x%llx "
3281 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx -> "
3282 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx",
3283 MAJOR(__entry->dev), MINOR(__entry->dev),
3287 __entry->src_disize,
3288 __entry->src_offset,
3290 __entry->dest_isize,
3291 __entry->dest_disize,
3292 __entry->dest_offset)
3295 #define DEFINE_DOUBLE_IO_EVENT(name) \
3296 DEFINE_EVENT(xfs_double_io_class, name, \
3297 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3298 struct xfs_inode *dest, xfs_off_t doffset), \
3299 TP_ARGS(src, soffset, len, dest, doffset))
3301 /* inode/irec events */
3302 DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3303 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3307 __field(xfs_ino_t, ino)
3308 __field(xfs_fileoff_t, lblk)
3309 __field(xfs_extlen_t, len)
3310 __field(xfs_fsblock_t, pblk)
3314 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3315 __entry->ino = ip->i_ino;
3316 __entry->lblk = irec->br_startoff;
3317 __entry->len = irec->br_blockcount;
3318 __entry->pblk = irec->br_startblock;
3319 __entry->state = irec->br_state;
3321 TP_printk("dev %d:%d ino 0x%llx fileoff 0x%llx fsbcount 0x%x startblock 0x%llx st %d",
3322 MAJOR(__entry->dev), MINOR(__entry->dev),
3329 #define DEFINE_INODE_IREC_EVENT(name) \
3330 DEFINE_EVENT(xfs_inode_irec_class, name, \
3331 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3334 /* refcount/reflink tracepoint definitions */
3336 /* reflink tracepoints */
3337 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3338 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3339 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3340 TRACE_EVENT(xfs_reflink_remap_blocks,
3341 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3342 xfs_filblks_t len, struct xfs_inode *dest,
3343 xfs_fileoff_t doffset),
3344 TP_ARGS(src, soffset, len, dest, doffset),
3347 __field(xfs_ino_t, src_ino)
3348 __field(xfs_fileoff_t, src_lblk)
3349 __field(xfs_filblks_t, len)
3350 __field(xfs_ino_t, dest_ino)
3351 __field(xfs_fileoff_t, dest_lblk)
3354 __entry->dev = VFS_I(src)->i_sb->s_dev;
3355 __entry->src_ino = src->i_ino;
3356 __entry->src_lblk = soffset;
3358 __entry->dest_ino = dest->i_ino;
3359 __entry->dest_lblk = doffset;
3361 TP_printk("dev %d:%d fsbcount 0x%llx "
3362 "ino 0x%llx fileoff 0x%llx -> ino 0x%llx fileoff 0x%llx",
3363 MAJOR(__entry->dev), MINOR(__entry->dev),
3370 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3371 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3372 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3373 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
3374 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3375 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3376 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
3377 DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
3379 /* dedupe tracepoints */
3380 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3381 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3383 /* ioctl tracepoints */
3384 TRACE_EVENT(xfs_ioctl_clone,
3385 TP_PROTO(struct inode *src, struct inode *dest),
3389 __field(unsigned long, src_ino)
3390 __field(loff_t, src_isize)
3391 __field(unsigned long, dest_ino)
3392 __field(loff_t, dest_isize)
3395 __entry->dev = src->i_sb->s_dev;
3396 __entry->src_ino = src->i_ino;
3397 __entry->src_isize = i_size_read(src);
3398 __entry->dest_ino = dest->i_ino;
3399 __entry->dest_isize = i_size_read(dest);
3401 TP_printk("dev %d:%d ino 0x%lx isize 0x%llx -> ino 0x%lx isize 0x%llx",
3402 MAJOR(__entry->dev), MINOR(__entry->dev),
3406 __entry->dest_isize)
3409 /* unshare tracepoints */
3410 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
3411 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
3414 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
3415 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3416 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
3417 DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
3419 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3420 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3421 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
3423 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3424 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3427 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
3429 /* rmap swapext tracepoints */
3430 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3431 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3432 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3435 DECLARE_EVENT_CLASS(xfs_fsmap_class,
3436 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3437 const struct xfs_rmap_irec *rmap),
3438 TP_ARGS(mp, keydev, agno, rmap),
3441 __field(dev_t, keydev)
3442 __field(xfs_agnumber_t, agno)
3443 __field(xfs_fsblock_t, bno)
3444 __field(xfs_filblks_t, len)
3445 __field(uint64_t, owner)
3446 __field(uint64_t, offset)
3447 __field(unsigned int, flags)
3450 __entry->dev = mp->m_super->s_dev;
3451 __entry->keydev = new_decode_dev(keydev);
3452 __entry->agno = agno;
3453 __entry->bno = rmap->rm_startblock;
3454 __entry->len = rmap->rm_blockcount;
3455 __entry->owner = rmap->rm_owner;
3456 __entry->offset = rmap->rm_offset;
3457 __entry->flags = rmap->rm_flags;
3459 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",
3460 MAJOR(__entry->dev), MINOR(__entry->dev),
3461 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3469 #define DEFINE_FSMAP_EVENT(name) \
3470 DEFINE_EVENT(xfs_fsmap_class, name, \
3471 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3472 const struct xfs_rmap_irec *rmap), \
3473 TP_ARGS(mp, keydev, agno, rmap))
3474 DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3475 DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3476 DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3478 DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3479 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3483 __field(dev_t, keydev)
3484 __field(xfs_daddr_t, block)
3485 __field(xfs_daddr_t, len)
3486 __field(uint64_t, owner)
3487 __field(uint64_t, offset)
3488 __field(uint64_t, flags)
3491 __entry->dev = mp->m_super->s_dev;
3492 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3493 __entry->block = fsmap->fmr_physical;
3494 __entry->len = fsmap->fmr_length;
3495 __entry->owner = fsmap->fmr_owner;
3496 __entry->offset = fsmap->fmr_offset;
3497 __entry->flags = fsmap->fmr_flags;
3499 TP_printk("dev %d:%d keydev %d:%d daddr 0x%llx bbcount 0x%llx owner 0x%llx fileoff_daddr 0x%llx flags 0x%llx",
3500 MAJOR(__entry->dev), MINOR(__entry->dev),
3501 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3508 #define DEFINE_GETFSMAP_EVENT(name) \
3509 DEFINE_EVENT(xfs_getfsmap_class, name, \
3510 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3512 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3513 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3514 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3516 TRACE_EVENT(xfs_trans_resv_calc,
3517 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3518 struct xfs_trans_res *res),
3519 TP_ARGS(mp, type, res),
3523 __field(uint, logres)
3524 __field(int, logcount)
3525 __field(int, logflags)
3528 __entry->dev = mp->m_super->s_dev;
3529 __entry->type = type;
3530 __entry->logres = res->tr_logres;
3531 __entry->logcount = res->tr_logcount;
3532 __entry->logflags = res->tr_logflags;
3534 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3535 MAJOR(__entry->dev), MINOR(__entry->dev),
3542 DECLARE_EVENT_CLASS(xfs_trans_class,
3543 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3544 TP_ARGS(tp, caller_ip),
3547 __field(uint32_t, tid)
3548 __field(uint32_t, flags)
3549 __field(unsigned long, caller_ip)
3552 __entry->dev = tp->t_mountp->m_super->s_dev;
3555 __entry->tid = tp->t_ticket->t_tid;
3556 __entry->flags = tp->t_flags;
3557 __entry->caller_ip = caller_ip;
3559 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3560 MAJOR(__entry->dev), MINOR(__entry->dev),
3563 (char *)__entry->caller_ip)
3566 #define DEFINE_TRANS_EVENT(name) \
3567 DEFINE_EVENT(xfs_trans_class, name, \
3568 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3569 TP_ARGS(tp, caller_ip))
3570 DEFINE_TRANS_EVENT(xfs_trans_alloc);
3571 DEFINE_TRANS_EVENT(xfs_trans_cancel);
3572 DEFINE_TRANS_EVENT(xfs_trans_commit);
3573 DEFINE_TRANS_EVENT(xfs_trans_dup);
3574 DEFINE_TRANS_EVENT(xfs_trans_free);
3575 DEFINE_TRANS_EVENT(xfs_trans_roll);
3576 DEFINE_TRANS_EVENT(xfs_trans_add_item);
3577 DEFINE_TRANS_EVENT(xfs_trans_commit_items);
3578 DEFINE_TRANS_EVENT(xfs_trans_free_items);
3580 TRACE_EVENT(xfs_iunlink_update_bucket,
3581 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3582 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3583 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3586 __field(xfs_agnumber_t, agno)
3587 __field(unsigned int, bucket)
3588 __field(xfs_agino_t, old_ptr)
3589 __field(xfs_agino_t, new_ptr)
3592 __entry->dev = mp->m_super->s_dev;
3593 __entry->agno = agno;
3594 __entry->bucket = bucket;
3595 __entry->old_ptr = old_ptr;
3596 __entry->new_ptr = new_ptr;
3598 TP_printk("dev %d:%d agno 0x%x bucket %u old 0x%x new 0x%x",
3599 MAJOR(__entry->dev), MINOR(__entry->dev),
3606 TRACE_EVENT(xfs_iunlink_update_dinode,
3607 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3608 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3609 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3612 __field(xfs_agnumber_t, agno)
3613 __field(xfs_agino_t, agino)
3614 __field(xfs_agino_t, old_ptr)
3615 __field(xfs_agino_t, new_ptr)
3618 __entry->dev = mp->m_super->s_dev;
3619 __entry->agno = agno;
3620 __entry->agino = agino;
3621 __entry->old_ptr = old_ptr;
3622 __entry->new_ptr = new_ptr;
3624 TP_printk("dev %d:%d agno 0x%x agino 0x%x old 0x%x new 0x%x",
3625 MAJOR(__entry->dev), MINOR(__entry->dev),
3632 DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3633 TP_PROTO(struct xfs_inode *ip),
3637 __field(xfs_agnumber_t, agno)
3638 __field(xfs_agino_t, agino)
3641 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3642 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3643 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3645 TP_printk("dev %d:%d agno 0x%x agino 0x%x",
3646 MAJOR(__entry->dev), MINOR(__entry->dev),
3647 __entry->agno, __entry->agino)
3650 #define DEFINE_AGINODE_EVENT(name) \
3651 DEFINE_EVENT(xfs_ag_inode_class, name, \
3652 TP_PROTO(struct xfs_inode *ip), \
3654 DEFINE_AGINODE_EVENT(xfs_iunlink);
3655 DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
3656 DEFINE_AG_EVENT(xfs_iunlink_map_prev_fallback);
3658 DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3659 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3663 __field(unsigned int, flags)
3666 __entry->dev = mp->m_super->s_dev;
3667 __entry->flags = flags;
3669 TP_printk("dev %d:%d flags 0x%x",
3670 MAJOR(__entry->dev), MINOR(__entry->dev),
3673 #define DEFINE_FS_CORRUPT_EVENT(name) \
3674 DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3675 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3677 DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3678 DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
3679 DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
3680 DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3681 DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
3682 DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
3684 DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3685 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3686 TP_ARGS(mp, agno, flags),
3689 __field(xfs_agnumber_t, agno)
3690 __field(unsigned int, flags)
3693 __entry->dev = mp->m_super->s_dev;
3694 __entry->agno = agno;
3695 __entry->flags = flags;
3697 TP_printk("dev %d:%d agno 0x%x flags 0x%x",
3698 MAJOR(__entry->dev), MINOR(__entry->dev),
3699 __entry->agno, __entry->flags)
3701 #define DEFINE_AG_CORRUPT_EVENT(name) \
3702 DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3703 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3704 unsigned int flags), \
3705 TP_ARGS(mp, agno, flags))
3706 DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3707 DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
3708 DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
3710 DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3711 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3715 __field(xfs_ino_t, ino)
3716 __field(unsigned int, flags)
3719 __entry->dev = ip->i_mount->m_super->s_dev;
3720 __entry->ino = ip->i_ino;
3721 __entry->flags = flags;
3723 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3724 MAJOR(__entry->dev), MINOR(__entry->dev),
3725 __entry->ino, __entry->flags)
3727 #define DEFINE_INODE_CORRUPT_EVENT(name) \
3728 DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3729 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3731 DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3732 DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3734 TRACE_EVENT(xfs_iwalk_ag,
3735 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3736 xfs_agino_t startino),
3737 TP_ARGS(mp, agno, startino),
3740 __field(xfs_agnumber_t, agno)
3741 __field(xfs_agino_t, startino)
3744 __entry->dev = mp->m_super->s_dev;
3745 __entry->agno = agno;
3746 __entry->startino = startino;
3748 TP_printk("dev %d:%d agno 0x%x startino 0x%x",
3749 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3753 TRACE_EVENT(xfs_iwalk_ag_rec,
3754 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3755 struct xfs_inobt_rec_incore *irec),
3756 TP_ARGS(mp, agno, irec),
3759 __field(xfs_agnumber_t, agno)
3760 __field(xfs_agino_t, startino)
3761 __field(uint64_t, freemask)
3764 __entry->dev = mp->m_super->s_dev;
3765 __entry->agno = agno;
3766 __entry->startino = irec->ir_startino;
3767 __entry->freemask = irec->ir_free;
3769 TP_printk("dev %d:%d agno 0x%x startino 0x%x freemask 0x%llx",
3770 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3771 __entry->startino, __entry->freemask)
3774 TRACE_EVENT(xfs_pwork_init,
3775 TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
3776 TP_ARGS(mp, nr_threads, pid),
3779 __field(unsigned int, nr_threads)
3783 __entry->dev = mp->m_super->s_dev;
3784 __entry->nr_threads = nr_threads;
3787 TP_printk("dev %d:%d nr_threads %u pid %u",
3788 MAJOR(__entry->dev), MINOR(__entry->dev),
3789 __entry->nr_threads, __entry->pid)
3792 DECLARE_EVENT_CLASS(xfs_kmem_class,
3793 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
3794 TP_ARGS(size, flags, caller_ip),
3796 __field(ssize_t, size)
3798 __field(unsigned long, caller_ip)
3801 __entry->size = size;
3802 __entry->flags = flags;
3803 __entry->caller_ip = caller_ip;
3805 TP_printk("size %zd flags 0x%x caller %pS",
3808 (char *)__entry->caller_ip)
3811 #define DEFINE_KMEM_EVENT(name) \
3812 DEFINE_EVENT(xfs_kmem_class, name, \
3813 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
3814 TP_ARGS(size, flags, caller_ip))
3815 DEFINE_KMEM_EVENT(kmem_alloc);
3817 TRACE_EVENT(xfs_check_new_dalign,
3818 TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
3819 TP_ARGS(mp, new_dalign, calc_rootino),
3822 __field(int, new_dalign)
3823 __field(xfs_ino_t, sb_rootino)
3824 __field(xfs_ino_t, calc_rootino)
3827 __entry->dev = mp->m_super->s_dev;
3828 __entry->new_dalign = new_dalign;
3829 __entry->sb_rootino = mp->m_sb.sb_rootino;
3830 __entry->calc_rootino = calc_rootino;
3832 TP_printk("dev %d:%d new_dalign %d sb_rootino 0x%llx calc_rootino 0x%llx",
3833 MAJOR(__entry->dev), MINOR(__entry->dev),
3834 __entry->new_dalign, __entry->sb_rootino,
3835 __entry->calc_rootino)
3838 TRACE_EVENT(xfs_btree_commit_afakeroot,
3839 TP_PROTO(struct xfs_btree_cur *cur),
3843 __field(xfs_btnum_t, btnum)
3844 __field(xfs_agnumber_t, agno)
3845 __field(xfs_agblock_t, agbno)
3846 __field(unsigned int, levels)
3847 __field(unsigned int, blocks)
3850 __entry->dev = cur->bc_mp->m_super->s_dev;
3851 __entry->btnum = cur->bc_btnum;
3852 __entry->agno = cur->bc_ag.pag->pag_agno;
3853 __entry->agbno = cur->bc_ag.afake->af_root;
3854 __entry->levels = cur->bc_ag.afake->af_levels;
3855 __entry->blocks = cur->bc_ag.afake->af_blocks;
3857 TP_printk("dev %d:%d btree %s agno 0x%x levels %u blocks %u root %u",
3858 MAJOR(__entry->dev), MINOR(__entry->dev),
3859 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3866 TRACE_EVENT(xfs_btree_commit_ifakeroot,
3867 TP_PROTO(struct xfs_btree_cur *cur),
3871 __field(xfs_btnum_t, btnum)
3872 __field(xfs_agnumber_t, agno)
3873 __field(xfs_agino_t, agino)
3874 __field(unsigned int, levels)
3875 __field(unsigned int, blocks)
3876 __field(int, whichfork)
3879 __entry->dev = cur->bc_mp->m_super->s_dev;
3880 __entry->btnum = cur->bc_btnum;
3881 __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp,
3882 cur->bc_ino.ip->i_ino);
3883 __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp,
3884 cur->bc_ino.ip->i_ino);
3885 __entry->levels = cur->bc_ino.ifake->if_levels;
3886 __entry->blocks = cur->bc_ino.ifake->if_blocks;
3887 __entry->whichfork = cur->bc_ino.whichfork;
3889 TP_printk("dev %d:%d btree %s agno 0x%x agino 0x%x whichfork %s levels %u blocks %u",
3890 MAJOR(__entry->dev), MINOR(__entry->dev),
3891 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3894 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
3899 TRACE_EVENT(xfs_btree_bload_level_geometry,
3900 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3901 uint64_t nr_this_level, unsigned int nr_per_block,
3902 unsigned int desired_npb, uint64_t blocks,
3903 uint64_t blocks_with_extra),
3904 TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks,
3908 __field(xfs_btnum_t, btnum)
3909 __field(unsigned int, level)
3910 __field(unsigned int, nlevels)
3911 __field(uint64_t, nr_this_level)
3912 __field(unsigned int, nr_per_block)
3913 __field(unsigned int, desired_npb)
3914 __field(unsigned long long, blocks)
3915 __field(unsigned long long, blocks_with_extra)
3918 __entry->dev = cur->bc_mp->m_super->s_dev;
3919 __entry->btnum = cur->bc_btnum;
3920 __entry->level = level;
3921 __entry->nlevels = cur->bc_nlevels;
3922 __entry->nr_this_level = nr_this_level;
3923 __entry->nr_per_block = nr_per_block;
3924 __entry->desired_npb = desired_npb;
3925 __entry->blocks = blocks;
3926 __entry->blocks_with_extra = blocks_with_extra;
3928 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",
3929 MAJOR(__entry->dev), MINOR(__entry->dev),
3930 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3933 __entry->nr_this_level,
3934 __entry->nr_per_block,
3935 __entry->desired_npb,
3937 __entry->blocks_with_extra)
3940 TRACE_EVENT(xfs_btree_bload_block,
3941 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3942 uint64_t block_idx, uint64_t nr_blocks,
3943 union xfs_btree_ptr *ptr, unsigned int nr_records),
3944 TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records),
3947 __field(xfs_btnum_t, btnum)
3948 __field(unsigned int, level)
3949 __field(unsigned long long, block_idx)
3950 __field(unsigned long long, nr_blocks)
3951 __field(xfs_agnumber_t, agno)
3952 __field(xfs_agblock_t, agbno)
3953 __field(unsigned int, nr_records)
3956 __entry->dev = cur->bc_mp->m_super->s_dev;
3957 __entry->btnum = cur->bc_btnum;
3958 __entry->level = level;
3959 __entry->block_idx = block_idx;
3960 __entry->nr_blocks = nr_blocks;
3961 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
3962 xfs_fsblock_t fsb = be64_to_cpu(ptr->l);
3964 __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb);
3965 __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb);
3967 __entry->agno = cur->bc_ag.pag->pag_agno;
3968 __entry->agbno = be32_to_cpu(ptr->s);
3970 __entry->nr_records = nr_records;
3972 TP_printk("dev %d:%d btree %s level %u block %llu/%llu agno 0x%x agbno 0x%x recs %u",
3973 MAJOR(__entry->dev), MINOR(__entry->dev),
3974 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3980 __entry->nr_records)
3983 DECLARE_EVENT_CLASS(xfs_timestamp_range_class,
3984 TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max),
3985 TP_ARGS(mp, min, max),
3988 __field(long long, min)
3989 __field(long long, max)
3992 __entry->dev = mp->m_super->s_dev;
3996 TP_printk("dev %d:%d min %lld max %lld",
3997 MAJOR(__entry->dev), MINOR(__entry->dev),
4002 #define DEFINE_TIMESTAMP_RANGE_EVENT(name) \
4003 DEFINE_EVENT(xfs_timestamp_range_class, name, \
4004 TP_PROTO(struct xfs_mount *mp, long long min, long long max), \
4005 TP_ARGS(mp, min, max))
4006 DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range);
4007 DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range);
4009 DECLARE_EVENT_CLASS(xfs_icwalk_class,
4010 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw,
4011 unsigned long caller_ip),
4012 TP_ARGS(mp, icw, caller_ip),
4015 __field(__u32, flags)
4016 __field(uint32_t, uid)
4017 __field(uint32_t, gid)
4018 __field(prid_t, prid)
4019 __field(__u64, min_file_size)
4020 __field(long, scan_limit)
4021 __field(unsigned long, caller_ip)
4024 __entry->dev = mp->m_super->s_dev;
4025 __entry->flags = icw ? icw->icw_flags : 0;
4026 __entry->uid = icw ? from_kuid(mp->m_super->s_user_ns,
4028 __entry->gid = icw ? from_kgid(mp->m_super->s_user_ns,
4030 __entry->prid = icw ? icw->icw_prid : 0;
4031 __entry->min_file_size = icw ? icw->icw_min_file_size : 0;
4032 __entry->scan_limit = icw ? icw->icw_scan_limit : 0;
4033 __entry->caller_ip = caller_ip;
4035 TP_printk("dev %d:%d flags 0x%x uid %u gid %u prid %u minsize %llu scan_limit %ld caller %pS",
4036 MAJOR(__entry->dev), MINOR(__entry->dev),
4041 __entry->min_file_size,
4042 __entry->scan_limit,
4043 (char *)__entry->caller_ip)
4045 #define DEFINE_ICWALK_EVENT(name) \
4046 DEFINE_EVENT(xfs_icwalk_class, name, \
4047 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw, \
4048 unsigned long caller_ip), \
4049 TP_ARGS(mp, icw, caller_ip))
4050 DEFINE_ICWALK_EVENT(xfs_ioc_free_eofblocks);
4051 DEFINE_ICWALK_EVENT(xfs_blockgc_free_space);
4053 TRACE_DEFINE_ENUM(XLOG_STATE_ACTIVE);
4054 TRACE_DEFINE_ENUM(XLOG_STATE_WANT_SYNC);
4055 TRACE_DEFINE_ENUM(XLOG_STATE_SYNCING);
4056 TRACE_DEFINE_ENUM(XLOG_STATE_DONE_SYNC);
4057 TRACE_DEFINE_ENUM(XLOG_STATE_CALLBACK);
4058 TRACE_DEFINE_ENUM(XLOG_STATE_DIRTY);
4060 DECLARE_EVENT_CLASS(xlog_iclog_class,
4061 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip),
4062 TP_ARGS(iclog, caller_ip),
4065 __field(uint32_t, state)
4066 __field(int32_t, refcount)
4067 __field(uint32_t, offset)
4068 __field(uint32_t, flags)
4069 __field(unsigned long long, lsn)
4070 __field(unsigned long, caller_ip)
4073 __entry->dev = iclog->ic_log->l_mp->m_super->s_dev;
4074 __entry->state = iclog->ic_state;
4075 __entry->refcount = atomic_read(&iclog->ic_refcnt);
4076 __entry->offset = iclog->ic_offset;
4077 __entry->flags = iclog->ic_flags;
4078 __entry->lsn = be64_to_cpu(iclog->ic_header.h_lsn);
4079 __entry->caller_ip = caller_ip;
4081 TP_printk("dev %d:%d state %s refcnt %d offset %u lsn 0x%llx flags %s caller %pS",
4082 MAJOR(__entry->dev), MINOR(__entry->dev),
4083 __print_symbolic(__entry->state, XLOG_STATE_STRINGS),
4087 __print_flags(__entry->flags, "|", XLOG_ICL_STRINGS),
4088 (char *)__entry->caller_ip)
4092 #define DEFINE_ICLOG_EVENT(name) \
4093 DEFINE_EVENT(xlog_iclog_class, name, \
4094 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip), \
4095 TP_ARGS(iclog, caller_ip))
4097 DEFINE_ICLOG_EVENT(xlog_iclog_activate);
4098 DEFINE_ICLOG_EVENT(xlog_iclog_clean);
4099 DEFINE_ICLOG_EVENT(xlog_iclog_callback);
4100 DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_start);
4101 DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_done);
4102 DEFINE_ICLOG_EVENT(xlog_iclog_force);
4103 DEFINE_ICLOG_EVENT(xlog_iclog_force_lsn);
4104 DEFINE_ICLOG_EVENT(xlog_iclog_get_space);
4105 DEFINE_ICLOG_EVENT(xlog_iclog_release);
4106 DEFINE_ICLOG_EVENT(xlog_iclog_switch);
4107 DEFINE_ICLOG_EVENT(xlog_iclog_sync);
4108 DEFINE_ICLOG_EVENT(xlog_iclog_syncing);
4109 DEFINE_ICLOG_EVENT(xlog_iclog_sync_done);
4110 DEFINE_ICLOG_EVENT(xlog_iclog_want_sync);
4111 DEFINE_ICLOG_EVENT(xlog_iclog_wait_on);
4112 DEFINE_ICLOG_EVENT(xlog_iclog_write);
4114 DECLARE_EVENT_CLASS(xfs_das_state_class,
4115 TP_PROTO(int das, struct xfs_inode *ip),
4119 __field(xfs_ino_t, ino)
4123 __entry->ino = ip->i_ino;
4125 TP_printk("state change %d ino 0x%llx",
4126 __entry->das, __entry->ino)
4129 #define DEFINE_DAS_STATE_EVENT(name) \
4130 DEFINE_EVENT(xfs_das_state_class, name, \
4131 TP_PROTO(int das, struct xfs_inode *ip), \
4133 DEFINE_DAS_STATE_EVENT(xfs_attr_sf_addname_return);
4134 DEFINE_DAS_STATE_EVENT(xfs_attr_set_iter_return);
4135 DEFINE_DAS_STATE_EVENT(xfs_attr_node_addname_return);
4136 DEFINE_DAS_STATE_EVENT(xfs_attr_remove_iter_return);
4137 DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_remove_return);
4139 TRACE_EVENT(xfs_force_shutdown,
4140 TP_PROTO(struct xfs_mount *mp, int ptag, int flags, const char *fname,
4142 TP_ARGS(mp, ptag, flags, fname, line_num),
4147 __string(fname, fname)
4148 __field(int, line_num)
4151 __entry->dev = mp->m_super->s_dev;
4152 __entry->ptag = ptag;
4153 __entry->flags = flags;
4154 __assign_str(fname, fname);
4155 __entry->line_num = line_num;
4157 TP_printk("dev %d:%d tag %s flags %s file %s line_num %d",
4158 MAJOR(__entry->dev), MINOR(__entry->dev),
4159 __print_flags(__entry->ptag, "|", XFS_PTAG_STRINGS),
4160 __print_flags(__entry->flags, "|", XFS_SHUTDOWN_STRINGS),
4165 #endif /* _TRACE_XFS_H */
4167 #undef TRACE_INCLUDE_PATH
4168 #define TRACE_INCLUDE_PATH .
4169 #define TRACE_INCLUDE_FILE xfs_trace
4170 #include <trace/define_trace.h>