2 * Copyright (c) 2009, Christoph Hellwig
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #define TRACE_SYSTEM xfs
21 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
24 #include <linux/tracepoint.h>
28 struct xfs_attr_list_context;
29 struct xfs_buf_log_item;
31 struct xfs_da_node_entry;
37 struct xlog_recover_item;
38 struct xfs_buf_log_format;
39 struct xfs_inode_log_format;
42 struct xfs_refcount_irec;
46 DECLARE_EVENT_CLASS(xfs_attr_list_class,
47 TP_PROTO(struct xfs_attr_list_context *ctx),
51 __field(xfs_ino_t, ino)
55 __field(void *, alist)
63 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
64 __entry->ino = ctx->dp->i_ino;
65 __entry->hashval = ctx->cursor->hashval;
66 __entry->blkno = ctx->cursor->blkno;
67 __entry->offset = ctx->cursor->offset;
68 __entry->alist = ctx->alist;
69 __entry->bufsize = ctx->bufsize;
70 __entry->count = ctx->count;
71 __entry->firstu = ctx->firstu;
72 __entry->flags = ctx->flags;
74 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
75 "alist 0x%p size %u count %u firstu %u flags %d %s",
76 MAJOR(__entry->dev), MINOR(__entry->dev),
87 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
91 #define DEFINE_ATTR_LIST_EVENT(name) \
92 DEFINE_EVENT(xfs_attr_list_class, name, \
93 TP_PROTO(struct xfs_attr_list_context *ctx), \
95 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
96 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
97 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
98 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
99 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
100 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
101 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
102 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
103 DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
104 DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
106 DECLARE_EVENT_CLASS(xfs_perag_class,
107 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
108 unsigned long caller_ip),
109 TP_ARGS(mp, agno, refcount, caller_ip),
112 __field(xfs_agnumber_t, agno)
113 __field(int, refcount)
114 __field(unsigned long, caller_ip)
117 __entry->dev = mp->m_super->s_dev;
118 __entry->agno = agno;
119 __entry->refcount = refcount;
120 __entry->caller_ip = caller_ip;
122 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
123 MAJOR(__entry->dev), MINOR(__entry->dev),
126 (char *)__entry->caller_ip)
129 #define DEFINE_PERAG_REF_EVENT(name) \
130 DEFINE_EVENT(xfs_perag_class, name, \
131 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
132 unsigned long caller_ip), \
133 TP_ARGS(mp, agno, refcount, caller_ip))
134 DEFINE_PERAG_REF_EVENT(xfs_perag_get);
135 DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
136 DEFINE_PERAG_REF_EVENT(xfs_perag_put);
137 DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
138 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
139 DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
140 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
141 DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks);
142 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks);
144 DECLARE_EVENT_CLASS(xfs_ag_class,
145 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
149 __field(xfs_agnumber_t, agno)
152 __entry->dev = mp->m_super->s_dev;
153 __entry->agno = agno;
155 TP_printk("dev %d:%d agno %u",
156 MAJOR(__entry->dev), MINOR(__entry->dev),
159 #define DEFINE_AG_EVENT(name) \
160 DEFINE_EVENT(xfs_ag_class, name, \
161 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
164 DEFINE_AG_EVENT(xfs_read_agf);
165 DEFINE_AG_EVENT(xfs_alloc_read_agf);
166 DEFINE_AG_EVENT(xfs_read_agi);
167 DEFINE_AG_EVENT(xfs_ialloc_read_agi);
169 TRACE_EVENT(xfs_attr_list_node_descend,
170 TP_PROTO(struct xfs_attr_list_context *ctx,
171 struct xfs_da_node_entry *btree),
175 __field(xfs_ino_t, ino)
176 __field(u32, hashval)
179 __field(void *, alist)
180 __field(int, bufsize)
185 __field(u32, bt_hashval)
186 __field(u32, bt_before)
189 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
190 __entry->ino = ctx->dp->i_ino;
191 __entry->hashval = ctx->cursor->hashval;
192 __entry->blkno = ctx->cursor->blkno;
193 __entry->offset = ctx->cursor->offset;
194 __entry->alist = ctx->alist;
195 __entry->bufsize = ctx->bufsize;
196 __entry->count = ctx->count;
197 __entry->firstu = ctx->firstu;
198 __entry->flags = ctx->flags;
199 __entry->bt_hashval = be32_to_cpu(btree->hashval);
200 __entry->bt_before = be32_to_cpu(btree->before);
202 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
203 "alist 0x%p size %u count %u firstu %u flags %d %s "
204 "node hashval %u, node before %u",
205 MAJOR(__entry->dev), MINOR(__entry->dev),
216 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
221 TRACE_EVENT(xfs_iext_insert,
222 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
223 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
224 TP_ARGS(ip, idx, r, state, caller_ip),
227 __field(xfs_ino_t, ino)
228 __field(xfs_extnum_t, idx)
229 __field(xfs_fileoff_t, startoff)
230 __field(xfs_fsblock_t, startblock)
231 __field(xfs_filblks_t, blockcount)
232 __field(xfs_exntst_t, state)
233 __field(int, bmap_state)
234 __field(unsigned long, caller_ip)
237 __entry->dev = VFS_I(ip)->i_sb->s_dev;
238 __entry->ino = ip->i_ino;
240 __entry->startoff = r->br_startoff;
241 __entry->startblock = r->br_startblock;
242 __entry->blockcount = r->br_blockcount;
243 __entry->state = r->br_state;
244 __entry->bmap_state = state;
245 __entry->caller_ip = caller_ip;
247 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
248 "offset %lld block %lld count %lld flag %d caller %ps",
249 MAJOR(__entry->dev), MINOR(__entry->dev),
251 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
254 (__int64_t)__entry->startblock,
257 (char *)__entry->caller_ip)
260 DECLARE_EVENT_CLASS(xfs_bmap_class,
261 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
262 unsigned long caller_ip),
263 TP_ARGS(ip, idx, state, caller_ip),
266 __field(xfs_ino_t, ino)
267 __field(xfs_extnum_t, idx)
268 __field(xfs_fileoff_t, startoff)
269 __field(xfs_fsblock_t, startblock)
270 __field(xfs_filblks_t, blockcount)
271 __field(xfs_exntst_t, state)
272 __field(int, bmap_state)
273 __field(unsigned long, caller_ip)
276 struct xfs_ifork *ifp;
277 struct xfs_bmbt_irec r;
279 ifp = xfs_iext_state_to_fork(ip, state);
280 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
281 __entry->dev = VFS_I(ip)->i_sb->s_dev;
282 __entry->ino = ip->i_ino;
284 __entry->startoff = r.br_startoff;
285 __entry->startblock = r.br_startblock;
286 __entry->blockcount = r.br_blockcount;
287 __entry->state = r.br_state;
288 __entry->bmap_state = state;
289 __entry->caller_ip = caller_ip;
291 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
292 "offset %lld block %lld count %lld flag %d caller %ps",
293 MAJOR(__entry->dev), MINOR(__entry->dev),
295 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
298 (__int64_t)__entry->startblock,
301 (char *)__entry->caller_ip)
304 #define DEFINE_BMAP_EVENT(name) \
305 DEFINE_EVENT(xfs_bmap_class, name, \
306 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
307 unsigned long caller_ip), \
308 TP_ARGS(ip, idx, state, caller_ip))
309 DEFINE_BMAP_EVENT(xfs_iext_remove);
310 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
311 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
312 DEFINE_BMAP_EVENT(xfs_extlist);
314 DECLARE_EVENT_CLASS(xfs_buf_class,
315 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
316 TP_ARGS(bp, caller_ip),
319 __field(xfs_daddr_t, bno)
322 __field(int, pincount)
323 __field(unsigned, lockval)
324 __field(unsigned, flags)
325 __field(unsigned long, caller_ip)
328 __entry->dev = bp->b_target->bt_dev;
329 __entry->bno = bp->b_bn;
330 __entry->nblks = bp->b_length;
331 __entry->hold = atomic_read(&bp->b_hold);
332 __entry->pincount = atomic_read(&bp->b_pin_count);
333 __entry->lockval = bp->b_sema.count;
334 __entry->flags = bp->b_flags;
335 __entry->caller_ip = caller_ip;
337 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
338 "lock %d flags %s caller %ps",
339 MAJOR(__entry->dev), MINOR(__entry->dev),
340 (unsigned long long)__entry->bno,
345 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
346 (void *)__entry->caller_ip)
349 #define DEFINE_BUF_EVENT(name) \
350 DEFINE_EVENT(xfs_buf_class, name, \
351 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
352 TP_ARGS(bp, caller_ip))
353 DEFINE_BUF_EVENT(xfs_buf_init);
354 DEFINE_BUF_EVENT(xfs_buf_free);
355 DEFINE_BUF_EVENT(xfs_buf_hold);
356 DEFINE_BUF_EVENT(xfs_buf_rele);
357 DEFINE_BUF_EVENT(xfs_buf_iodone);
358 DEFINE_BUF_EVENT(xfs_buf_submit);
359 DEFINE_BUF_EVENT(xfs_buf_submit_wait);
360 DEFINE_BUF_EVENT(xfs_buf_lock);
361 DEFINE_BUF_EVENT(xfs_buf_lock_done);
362 DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
363 DEFINE_BUF_EVENT(xfs_buf_trylock);
364 DEFINE_BUF_EVENT(xfs_buf_unlock);
365 DEFINE_BUF_EVENT(xfs_buf_iowait);
366 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
367 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
368 DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
369 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
370 DEFINE_BUF_EVENT(xfs_buf_get_uncached);
371 DEFINE_BUF_EVENT(xfs_buf_item_relse);
372 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
373 DEFINE_BUF_EVENT(xfs_buf_error_relse);
374 DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
375 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
377 /* not really buffer traces, but the buf provides useful information */
378 DEFINE_BUF_EVENT(xfs_btree_corrupt);
379 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
381 /* pass flags explicitly */
382 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
383 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
384 TP_ARGS(bp, flags, caller_ip),
387 __field(xfs_daddr_t, bno)
388 __field(size_t, buffer_length)
390 __field(int, pincount)
391 __field(unsigned, lockval)
392 __field(unsigned, flags)
393 __field(unsigned long, caller_ip)
396 __entry->dev = bp->b_target->bt_dev;
397 __entry->bno = bp->b_bn;
398 __entry->buffer_length = BBTOB(bp->b_length);
399 __entry->flags = flags;
400 __entry->hold = atomic_read(&bp->b_hold);
401 __entry->pincount = atomic_read(&bp->b_pin_count);
402 __entry->lockval = bp->b_sema.count;
403 __entry->caller_ip = caller_ip;
405 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
406 "lock %d flags %s caller %ps",
407 MAJOR(__entry->dev), MINOR(__entry->dev),
408 (unsigned long long)__entry->bno,
409 __entry->buffer_length,
413 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
414 (void *)__entry->caller_ip)
417 #define DEFINE_BUF_FLAGS_EVENT(name) \
418 DEFINE_EVENT(xfs_buf_flags_class, name, \
419 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
420 TP_ARGS(bp, flags, caller_ip))
421 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
422 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
423 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
425 TRACE_EVENT(xfs_buf_ioerror,
426 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
427 TP_ARGS(bp, error, caller_ip),
430 __field(xfs_daddr_t, bno)
431 __field(size_t, buffer_length)
432 __field(unsigned, flags)
434 __field(int, pincount)
435 __field(unsigned, lockval)
437 __field(unsigned long, caller_ip)
440 __entry->dev = bp->b_target->bt_dev;
441 __entry->bno = bp->b_bn;
442 __entry->buffer_length = BBTOB(bp->b_length);
443 __entry->hold = atomic_read(&bp->b_hold);
444 __entry->pincount = atomic_read(&bp->b_pin_count);
445 __entry->lockval = bp->b_sema.count;
446 __entry->error = error;
447 __entry->flags = bp->b_flags;
448 __entry->caller_ip = caller_ip;
450 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
451 "lock %d error %d flags %s caller %ps",
452 MAJOR(__entry->dev), MINOR(__entry->dev),
453 (unsigned long long)__entry->bno,
454 __entry->buffer_length,
459 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
460 (void *)__entry->caller_ip)
463 DECLARE_EVENT_CLASS(xfs_buf_item_class,
464 TP_PROTO(struct xfs_buf_log_item *bip),
468 __field(xfs_daddr_t, buf_bno)
469 __field(size_t, buf_len)
470 __field(int, buf_hold)
471 __field(int, buf_pincount)
472 __field(int, buf_lockval)
473 __field(unsigned, buf_flags)
474 __field(unsigned, bli_recur)
475 __field(int, bli_refcount)
476 __field(unsigned, bli_flags)
477 __field(void *, li_desc)
478 __field(unsigned, li_flags)
481 __entry->dev = bip->bli_buf->b_target->bt_dev;
482 __entry->bli_flags = bip->bli_flags;
483 __entry->bli_recur = bip->bli_recur;
484 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
485 __entry->buf_bno = bip->bli_buf->b_bn;
486 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
487 __entry->buf_flags = bip->bli_buf->b_flags;
488 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
489 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
490 __entry->buf_lockval = bip->bli_buf->b_sema.count;
491 __entry->li_desc = bip->bli_item.li_desc;
492 __entry->li_flags = bip->bli_item.li_flags;
494 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
495 "lock %d flags %s recur %d refcount %d bliflags %s "
496 "lidesc 0x%p liflags %s",
497 MAJOR(__entry->dev), MINOR(__entry->dev),
498 (unsigned long long)__entry->buf_bno,
501 __entry->buf_pincount,
502 __entry->buf_lockval,
503 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
505 __entry->bli_refcount,
506 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
508 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
511 #define DEFINE_BUF_ITEM_EVENT(name) \
512 DEFINE_EVENT(xfs_buf_item_class, name, \
513 TP_PROTO(struct xfs_buf_log_item *bip), \
515 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
516 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
517 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
518 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
519 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
520 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
521 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
522 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
523 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
524 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
525 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
526 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
527 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
528 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
529 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
530 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
531 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
532 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
533 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
534 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
535 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
536 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
537 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
538 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
539 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
540 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
542 DECLARE_EVENT_CLASS(xfs_filestream_class,
543 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
547 __field(xfs_ino_t, ino)
548 __field(xfs_agnumber_t, agno)
549 __field(int, streams)
552 __entry->dev = VFS_I(ip)->i_sb->s_dev;
553 __entry->ino = ip->i_ino;
554 __entry->agno = agno;
555 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
557 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
558 MAJOR(__entry->dev), MINOR(__entry->dev),
563 #define DEFINE_FILESTREAM_EVENT(name) \
564 DEFINE_EVENT(xfs_filestream_class, name, \
565 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
567 DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
568 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
569 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
571 TRACE_EVENT(xfs_filestream_pick,
572 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
573 xfs_extlen_t free, int nscan),
574 TP_ARGS(ip, agno, free, nscan),
577 __field(xfs_ino_t, ino)
578 __field(xfs_agnumber_t, agno)
579 __field(int, streams)
580 __field(xfs_extlen_t, free)
584 __entry->dev = VFS_I(ip)->i_sb->s_dev;
585 __entry->ino = ip->i_ino;
586 __entry->agno = agno;
587 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
588 __entry->free = free;
589 __entry->nscan = nscan;
591 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
592 MAJOR(__entry->dev), MINOR(__entry->dev),
600 DECLARE_EVENT_CLASS(xfs_lock_class,
601 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
602 unsigned long caller_ip),
603 TP_ARGS(ip, lock_flags, caller_ip),
606 __field(xfs_ino_t, ino)
607 __field(int, lock_flags)
608 __field(unsigned long, caller_ip)
611 __entry->dev = VFS_I(ip)->i_sb->s_dev;
612 __entry->ino = ip->i_ino;
613 __entry->lock_flags = lock_flags;
614 __entry->caller_ip = caller_ip;
616 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
617 MAJOR(__entry->dev), MINOR(__entry->dev),
619 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
620 (void *)__entry->caller_ip)
623 #define DEFINE_LOCK_EVENT(name) \
624 DEFINE_EVENT(xfs_lock_class, name, \
625 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
626 unsigned long caller_ip), \
627 TP_ARGS(ip, lock_flags, caller_ip))
628 DEFINE_LOCK_EVENT(xfs_ilock);
629 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
630 DEFINE_LOCK_EVENT(xfs_ilock_demote);
631 DEFINE_LOCK_EVENT(xfs_iunlock);
633 DECLARE_EVENT_CLASS(xfs_inode_class,
634 TP_PROTO(struct xfs_inode *ip),
638 __field(xfs_ino_t, ino)
641 __entry->dev = VFS_I(ip)->i_sb->s_dev;
642 __entry->ino = ip->i_ino;
644 TP_printk("dev %d:%d ino 0x%llx",
645 MAJOR(__entry->dev), MINOR(__entry->dev),
649 #define DEFINE_INODE_EVENT(name) \
650 DEFINE_EVENT(xfs_inode_class, name, \
651 TP_PROTO(struct xfs_inode *ip), \
653 DEFINE_INODE_EVENT(xfs_iget_skip);
654 DEFINE_INODE_EVENT(xfs_iget_reclaim);
655 DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
656 DEFINE_INODE_EVENT(xfs_iget_hit);
657 DEFINE_INODE_EVENT(xfs_iget_miss);
659 DEFINE_INODE_EVENT(xfs_getattr);
660 DEFINE_INODE_EVENT(xfs_setattr);
661 DEFINE_INODE_EVENT(xfs_readlink);
662 DEFINE_INODE_EVENT(xfs_inactive_symlink);
663 DEFINE_INODE_EVENT(xfs_alloc_file_space);
664 DEFINE_INODE_EVENT(xfs_free_file_space);
665 DEFINE_INODE_EVENT(xfs_zero_file_space);
666 DEFINE_INODE_EVENT(xfs_collapse_file_space);
667 DEFINE_INODE_EVENT(xfs_insert_file_space);
668 DEFINE_INODE_EVENT(xfs_readdir);
669 #ifdef CONFIG_XFS_POSIX_ACL
670 DEFINE_INODE_EVENT(xfs_get_acl);
672 DEFINE_INODE_EVENT(xfs_vm_bmap);
673 DEFINE_INODE_EVENT(xfs_file_ioctl);
674 DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
675 DEFINE_INODE_EVENT(xfs_ioctl_setattr);
676 DEFINE_INODE_EVENT(xfs_dir_fsync);
677 DEFINE_INODE_EVENT(xfs_file_fsync);
678 DEFINE_INODE_EVENT(xfs_destroy_inode);
679 DEFINE_INODE_EVENT(xfs_update_time);
681 DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
682 DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
684 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
685 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
686 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
687 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
688 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
689 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
691 DEFINE_INODE_EVENT(xfs_filemap_fault);
692 DEFINE_INODE_EVENT(xfs_filemap_huge_fault);
693 DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
694 DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
696 DECLARE_EVENT_CLASS(xfs_iref_class,
697 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
698 TP_ARGS(ip, caller_ip),
701 __field(xfs_ino_t, ino)
703 __field(int, pincount)
704 __field(unsigned long, caller_ip)
707 __entry->dev = VFS_I(ip)->i_sb->s_dev;
708 __entry->ino = ip->i_ino;
709 __entry->count = atomic_read(&VFS_I(ip)->i_count);
710 __entry->pincount = atomic_read(&ip->i_pincount);
711 __entry->caller_ip = caller_ip;
713 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
714 MAJOR(__entry->dev), MINOR(__entry->dev),
718 (char *)__entry->caller_ip)
721 TRACE_EVENT(xfs_iomap_prealloc_size,
722 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
723 unsigned int writeio_blocks),
724 TP_ARGS(ip, blocks, shift, writeio_blocks),
727 __field(xfs_ino_t, ino)
728 __field(xfs_fsblock_t, blocks)
730 __field(unsigned int, writeio_blocks)
733 __entry->dev = VFS_I(ip)->i_sb->s_dev;
734 __entry->ino = ip->i_ino;
735 __entry->blocks = blocks;
736 __entry->shift = shift;
737 __entry->writeio_blocks = writeio_blocks;
739 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
740 "m_writeio_blocks %u",
741 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
742 __entry->blocks, __entry->shift, __entry->writeio_blocks)
745 TRACE_EVENT(xfs_irec_merge_pre,
746 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
747 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
748 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
751 __field(xfs_agnumber_t, agno)
752 __field(xfs_agino_t, agino)
753 __field(uint16_t, holemask)
754 __field(xfs_agino_t, nagino)
755 __field(uint16_t, nholemask)
758 __entry->dev = mp->m_super->s_dev;
759 __entry->agno = agno;
760 __entry->agino = agino;
761 __entry->holemask = holemask;
762 __entry->nagino = nagino;
763 __entry->nholemask = holemask;
765 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
766 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
767 __entry->agino, __entry->holemask, __entry->nagino,
771 TRACE_EVENT(xfs_irec_merge_post,
772 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
774 TP_ARGS(mp, agno, agino, holemask),
777 __field(xfs_agnumber_t, agno)
778 __field(xfs_agino_t, agino)
779 __field(uint16_t, holemask)
782 __entry->dev = mp->m_super->s_dev;
783 __entry->agno = agno;
784 __entry->agino = agino;
785 __entry->holemask = holemask;
787 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
788 MINOR(__entry->dev), __entry->agno, __entry->agino,
792 #define DEFINE_IREF_EVENT(name) \
793 DEFINE_EVENT(xfs_iref_class, name, \
794 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
795 TP_ARGS(ip, caller_ip))
796 DEFINE_IREF_EVENT(xfs_irele);
797 DEFINE_IREF_EVENT(xfs_inode_pin);
798 DEFINE_IREF_EVENT(xfs_inode_unpin);
799 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
801 DECLARE_EVENT_CLASS(xfs_namespace_class,
802 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
806 __field(xfs_ino_t, dp_ino)
807 __field(int, namelen)
808 __dynamic_array(char, name, name->len)
811 __entry->dev = VFS_I(dp)->i_sb->s_dev;
812 __entry->dp_ino = dp->i_ino;
813 __entry->namelen = name->len;
814 memcpy(__get_str(name), name->name, name->len);
816 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
817 MAJOR(__entry->dev), MINOR(__entry->dev),
823 #define DEFINE_NAMESPACE_EVENT(name) \
824 DEFINE_EVENT(xfs_namespace_class, name, \
825 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
827 DEFINE_NAMESPACE_EVENT(xfs_remove);
828 DEFINE_NAMESPACE_EVENT(xfs_link);
829 DEFINE_NAMESPACE_EVENT(xfs_lookup);
830 DEFINE_NAMESPACE_EVENT(xfs_create);
831 DEFINE_NAMESPACE_EVENT(xfs_symlink);
833 TRACE_EVENT(xfs_rename,
834 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
835 struct xfs_name *src_name, struct xfs_name *target_name),
836 TP_ARGS(src_dp, target_dp, src_name, target_name),
839 __field(xfs_ino_t, src_dp_ino)
840 __field(xfs_ino_t, target_dp_ino)
841 __field(int, src_namelen)
842 __field(int, target_namelen)
843 __dynamic_array(char, src_name, src_name->len)
844 __dynamic_array(char, target_name, target_name->len)
847 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
848 __entry->src_dp_ino = src_dp->i_ino;
849 __entry->target_dp_ino = target_dp->i_ino;
850 __entry->src_namelen = src_name->len;
851 __entry->target_namelen = target_name->len;
852 memcpy(__get_str(src_name), src_name->name, src_name->len);
853 memcpy(__get_str(target_name), target_name->name,
856 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
857 " src name %.*s target name %.*s",
858 MAJOR(__entry->dev), MINOR(__entry->dev),
860 __entry->target_dp_ino,
861 __entry->src_namelen,
863 __entry->target_namelen,
864 __get_str(target_name))
867 DECLARE_EVENT_CLASS(xfs_dquot_class,
868 TP_PROTO(struct xfs_dquot *dqp),
873 __field(unsigned, flags)
874 __field(unsigned, nrefs)
875 __field(unsigned long long, res_bcount)
876 __field(unsigned long long, bcount)
877 __field(unsigned long long, icount)
878 __field(unsigned long long, blk_hardlimit)
879 __field(unsigned long long, blk_softlimit)
880 __field(unsigned long long, ino_hardlimit)
881 __field(unsigned long long, ino_softlimit)
884 __entry->dev = dqp->q_mount->m_super->s_dev;
885 __entry->id = be32_to_cpu(dqp->q_core.d_id);
886 __entry->flags = dqp->dq_flags;
887 __entry->nrefs = dqp->q_nrefs;
888 __entry->res_bcount = dqp->q_res_bcount;
889 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
890 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
891 __entry->blk_hardlimit =
892 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
893 __entry->blk_softlimit =
894 be64_to_cpu(dqp->q_core.d_blk_softlimit);
895 __entry->ino_hardlimit =
896 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
897 __entry->ino_softlimit =
898 be64_to_cpu(dqp->q_core.d_ino_softlimit);
900 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
901 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
902 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
903 MAJOR(__entry->dev), MINOR(__entry->dev),
905 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
909 __entry->blk_hardlimit,
910 __entry->blk_softlimit,
912 __entry->ino_hardlimit,
913 __entry->ino_softlimit)
916 #define DEFINE_DQUOT_EVENT(name) \
917 DEFINE_EVENT(xfs_dquot_class, name, \
918 TP_PROTO(struct xfs_dquot *dqp), \
920 DEFINE_DQUOT_EVENT(xfs_dqadjust);
921 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
922 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
923 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
924 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
925 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
926 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
927 DEFINE_DQUOT_EVENT(xfs_dqalloc);
928 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
929 DEFINE_DQUOT_EVENT(xfs_dqread);
930 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
931 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
932 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
933 DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
934 DEFINE_DQUOT_EVENT(xfs_dqget_dup);
935 DEFINE_DQUOT_EVENT(xfs_dqput);
936 DEFINE_DQUOT_EVENT(xfs_dqput_free);
937 DEFINE_DQUOT_EVENT(xfs_dqrele);
938 DEFINE_DQUOT_EVENT(xfs_dqflush);
939 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
940 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
942 DECLARE_EVENT_CLASS(xfs_loggrant_class,
943 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
949 __field(int, curr_res)
950 __field(int, unit_res)
951 __field(unsigned int, flags)
952 __field(int, reserveq)
954 __field(int, grant_reserve_cycle)
955 __field(int, grant_reserve_bytes)
956 __field(int, grant_write_cycle)
957 __field(int, grant_write_bytes)
958 __field(int, curr_cycle)
959 __field(int, curr_block)
960 __field(xfs_lsn_t, tail_lsn)
963 __entry->dev = log->l_mp->m_super->s_dev;
964 __entry->ocnt = tic->t_ocnt;
965 __entry->cnt = tic->t_cnt;
966 __entry->curr_res = tic->t_curr_res;
967 __entry->unit_res = tic->t_unit_res;
968 __entry->flags = tic->t_flags;
969 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
970 __entry->writeq = list_empty(&log->l_write_head.waiters);
971 xlog_crack_grant_head(&log->l_reserve_head.grant,
972 &__entry->grant_reserve_cycle,
973 &__entry->grant_reserve_bytes);
974 xlog_crack_grant_head(&log->l_write_head.grant,
975 &__entry->grant_write_cycle,
976 &__entry->grant_write_bytes);
977 __entry->curr_cycle = log->l_curr_cycle;
978 __entry->curr_block = log->l_curr_block;
979 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
981 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
982 "t_unit_res %u t_flags %s reserveq %s "
983 "writeq %s grant_reserve_cycle %d "
984 "grant_reserve_bytes %d grant_write_cycle %d "
985 "grant_write_bytes %d curr_cycle %d curr_block %d "
986 "tail_cycle %d tail_block %d",
987 MAJOR(__entry->dev), MINOR(__entry->dev),
992 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
993 __entry->reserveq ? "empty" : "active",
994 __entry->writeq ? "empty" : "active",
995 __entry->grant_reserve_cycle,
996 __entry->grant_reserve_bytes,
997 __entry->grant_write_cycle,
998 __entry->grant_write_bytes,
1000 __entry->curr_block,
1001 CYCLE_LSN(__entry->tail_lsn),
1002 BLOCK_LSN(__entry->tail_lsn)
1006 #define DEFINE_LOGGRANT_EVENT(name) \
1007 DEFINE_EVENT(xfs_loggrant_class, name, \
1008 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1010 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1011 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
1012 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1013 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1014 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1015 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1016 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1017 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1018 DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1019 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1020 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1021 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1022 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1023 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1024 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1025 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1027 DECLARE_EVENT_CLASS(xfs_log_item_class,
1028 TP_PROTO(struct xfs_log_item *lip),
1032 __field(void *, lip)
1034 __field(uint, flags)
1035 __field(xfs_lsn_t, lsn)
1038 __entry->dev = lip->li_mountp->m_super->s_dev;
1040 __entry->type = lip->li_type;
1041 __entry->flags = lip->li_flags;
1042 __entry->lsn = lip->li_lsn;
1044 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1045 MAJOR(__entry->dev), MINOR(__entry->dev),
1047 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1048 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1049 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1052 TRACE_EVENT(xfs_log_force,
1053 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1054 TP_ARGS(mp, lsn, caller_ip),
1057 __field(xfs_lsn_t, lsn)
1058 __field(unsigned long, caller_ip)
1061 __entry->dev = mp->m_super->s_dev;
1063 __entry->caller_ip = caller_ip;
1065 TP_printk("dev %d:%d lsn 0x%llx caller %ps",
1066 MAJOR(__entry->dev), MINOR(__entry->dev),
1067 __entry->lsn, (void *)__entry->caller_ip)
1070 #define DEFINE_LOG_ITEM_EVENT(name) \
1071 DEFINE_EVENT(xfs_log_item_class, name, \
1072 TP_PROTO(struct xfs_log_item *lip), \
1074 DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1075 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1076 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1077 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1079 DECLARE_EVENT_CLASS(xfs_ail_class,
1080 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1081 TP_ARGS(lip, old_lsn, new_lsn),
1084 __field(void *, lip)
1086 __field(uint, flags)
1087 __field(xfs_lsn_t, old_lsn)
1088 __field(xfs_lsn_t, new_lsn)
1091 __entry->dev = lip->li_mountp->m_super->s_dev;
1093 __entry->type = lip->li_type;
1094 __entry->flags = lip->li_flags;
1095 __entry->old_lsn = old_lsn;
1096 __entry->new_lsn = new_lsn;
1098 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1099 MAJOR(__entry->dev), MINOR(__entry->dev),
1101 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1102 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1103 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1104 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1107 #define DEFINE_AIL_EVENT(name) \
1108 DEFINE_EVENT(xfs_ail_class, name, \
1109 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1110 TP_ARGS(lip, old_lsn, new_lsn))
1111 DEFINE_AIL_EVENT(xfs_ail_insert);
1112 DEFINE_AIL_EVENT(xfs_ail_move);
1113 DEFINE_AIL_EVENT(xfs_ail_delete);
1115 TRACE_EVENT(xfs_log_assign_tail_lsn,
1116 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1117 TP_ARGS(log, new_lsn),
1120 __field(xfs_lsn_t, new_lsn)
1121 __field(xfs_lsn_t, old_lsn)
1122 __field(xfs_lsn_t, last_sync_lsn)
1125 __entry->dev = log->l_mp->m_super->s_dev;
1126 __entry->new_lsn = new_lsn;
1127 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1128 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1130 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1131 MAJOR(__entry->dev), MINOR(__entry->dev),
1132 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1133 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1134 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1137 DECLARE_EVENT_CLASS(xfs_file_class,
1138 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1139 TP_ARGS(ip, count, offset),
1142 __field(xfs_ino_t, ino)
1143 __field(xfs_fsize_t, size)
1144 __field(loff_t, offset)
1145 __field(size_t, count)
1148 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1149 __entry->ino = ip->i_ino;
1150 __entry->size = ip->i_d.di_size;
1151 __entry->offset = offset;
1152 __entry->count = count;
1154 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
1155 MAJOR(__entry->dev), MINOR(__entry->dev),
1162 #define DEFINE_RW_EVENT(name) \
1163 DEFINE_EVENT(xfs_file_class, name, \
1164 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1165 TP_ARGS(ip, count, offset))
1166 DEFINE_RW_EVENT(xfs_file_buffered_read);
1167 DEFINE_RW_EVENT(xfs_file_direct_read);
1168 DEFINE_RW_EVENT(xfs_file_dax_read);
1169 DEFINE_RW_EVENT(xfs_file_buffered_write);
1170 DEFINE_RW_EVENT(xfs_file_direct_write);
1171 DEFINE_RW_EVENT(xfs_file_dax_write);
1173 DECLARE_EVENT_CLASS(xfs_page_class,
1174 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1176 TP_ARGS(inode, page, off, len),
1179 __field(xfs_ino_t, ino)
1180 __field(pgoff_t, pgoff)
1181 __field(loff_t, size)
1182 __field(unsigned long, offset)
1183 __field(unsigned int, length)
1184 __field(int, delalloc)
1185 __field(int, unwritten)
1188 int delalloc = -1, unwritten = -1;
1190 if (page_has_buffers(page))
1191 xfs_count_page_state(page, &delalloc, &unwritten);
1192 __entry->dev = inode->i_sb->s_dev;
1193 __entry->ino = XFS_I(inode)->i_ino;
1194 __entry->pgoff = page_offset(page);
1195 __entry->size = i_size_read(inode);
1196 __entry->offset = off;
1197 __entry->length = len;
1198 __entry->delalloc = delalloc;
1199 __entry->unwritten = unwritten;
1201 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
1202 "length %x delalloc %d unwritten %d",
1203 MAJOR(__entry->dev), MINOR(__entry->dev),
1213 #define DEFINE_PAGE_EVENT(name) \
1214 DEFINE_EVENT(xfs_page_class, name, \
1215 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1216 unsigned int len), \
1217 TP_ARGS(inode, page, off, len))
1218 DEFINE_PAGE_EVENT(xfs_writepage);
1219 DEFINE_PAGE_EVENT(xfs_releasepage);
1220 DEFINE_PAGE_EVENT(xfs_invalidatepage);
1222 DECLARE_EVENT_CLASS(xfs_readpage_class,
1223 TP_PROTO(struct inode *inode, int nr_pages),
1224 TP_ARGS(inode, nr_pages),
1227 __field(xfs_ino_t, ino)
1228 __field(int, nr_pages)
1231 __entry->dev = inode->i_sb->s_dev;
1232 __entry->ino = inode->i_ino;
1233 __entry->nr_pages = nr_pages;
1235 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1236 MAJOR(__entry->dev), MINOR(__entry->dev),
1241 #define DEFINE_READPAGE_EVENT(name) \
1242 DEFINE_EVENT(xfs_readpage_class, name, \
1243 TP_PROTO(struct inode *inode, int nr_pages), \
1244 TP_ARGS(inode, nr_pages))
1245 DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1246 DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1248 DECLARE_EVENT_CLASS(xfs_imap_class,
1249 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1250 int type, struct xfs_bmbt_irec *irec),
1251 TP_ARGS(ip, offset, count, type, irec),
1254 __field(xfs_ino_t, ino)
1255 __field(loff_t, size)
1256 __field(loff_t, offset)
1257 __field(size_t, count)
1259 __field(xfs_fileoff_t, startoff)
1260 __field(xfs_fsblock_t, startblock)
1261 __field(xfs_filblks_t, blockcount)
1264 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1265 __entry->ino = ip->i_ino;
1266 __entry->size = ip->i_d.di_size;
1267 __entry->offset = offset;
1268 __entry->count = count;
1269 __entry->type = type;
1270 __entry->startoff = irec ? irec->br_startoff : 0;
1271 __entry->startblock = irec ? irec->br_startblock : 0;
1272 __entry->blockcount = irec ? irec->br_blockcount : 0;
1274 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1275 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
1276 MAJOR(__entry->dev), MINOR(__entry->dev),
1281 __print_symbolic(__entry->type, XFS_IO_TYPES),
1283 (__int64_t)__entry->startblock,
1284 __entry->blockcount)
1287 #define DEFINE_IOMAP_EVENT(name) \
1288 DEFINE_EVENT(xfs_imap_class, name, \
1289 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1290 int type, struct xfs_bmbt_irec *irec), \
1291 TP_ARGS(ip, offset, count, type, irec))
1292 DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1293 DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1294 DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1295 DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
1296 DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
1297 DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
1298 DEFINE_IOMAP_EVENT(xfs_iomap_found);
1300 DECLARE_EVENT_CLASS(xfs_simple_io_class,
1301 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1302 TP_ARGS(ip, offset, count),
1305 __field(xfs_ino_t, ino)
1306 __field(loff_t, isize)
1307 __field(loff_t, disize)
1308 __field(loff_t, offset)
1309 __field(size_t, count)
1312 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1313 __entry->ino = ip->i_ino;
1314 __entry->isize = VFS_I(ip)->i_size;
1315 __entry->disize = ip->i_d.di_size;
1316 __entry->offset = offset;
1317 __entry->count = count;
1319 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1320 "offset 0x%llx count %zd",
1321 MAJOR(__entry->dev), MINOR(__entry->dev),
1329 #define DEFINE_SIMPLE_IO_EVENT(name) \
1330 DEFINE_EVENT(xfs_simple_io_class, name, \
1331 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1332 TP_ARGS(ip, offset, count))
1333 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1334 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1335 DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
1336 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1337 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1338 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1339 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1340 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1342 DECLARE_EVENT_CLASS(xfs_itrunc_class,
1343 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1344 TP_ARGS(ip, new_size),
1347 __field(xfs_ino_t, ino)
1348 __field(xfs_fsize_t, size)
1349 __field(xfs_fsize_t, new_size)
1352 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1353 __entry->ino = ip->i_ino;
1354 __entry->size = ip->i_d.di_size;
1355 __entry->new_size = new_size;
1357 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1358 MAJOR(__entry->dev), MINOR(__entry->dev),
1364 #define DEFINE_ITRUNC_EVENT(name) \
1365 DEFINE_EVENT(xfs_itrunc_class, name, \
1366 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1367 TP_ARGS(ip, new_size))
1368 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1369 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1371 TRACE_EVENT(xfs_pagecache_inval,
1372 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1373 TP_ARGS(ip, start, finish),
1376 __field(xfs_ino_t, ino)
1377 __field(xfs_fsize_t, size)
1378 __field(xfs_off_t, start)
1379 __field(xfs_off_t, finish)
1382 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1383 __entry->ino = ip->i_ino;
1384 __entry->size = ip->i_d.di_size;
1385 __entry->start = start;
1386 __entry->finish = finish;
1388 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1389 MAJOR(__entry->dev), MINOR(__entry->dev),
1396 TRACE_EVENT(xfs_bunmap,
1397 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1398 int flags, unsigned long caller_ip),
1399 TP_ARGS(ip, bno, len, flags, caller_ip),
1402 __field(xfs_ino_t, ino)
1403 __field(xfs_fsize_t, size)
1404 __field(xfs_fileoff_t, bno)
1405 __field(xfs_filblks_t, len)
1406 __field(unsigned long, caller_ip)
1410 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1411 __entry->ino = ip->i_ino;
1412 __entry->size = ip->i_d.di_size;
1415 __entry->caller_ip = caller_ip;
1416 __entry->flags = flags;
1418 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1419 "flags %s caller %ps",
1420 MAJOR(__entry->dev), MINOR(__entry->dev),
1425 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1426 (void *)__entry->caller_ip)
1430 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1431 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1432 xfs_agblock_t agbno, xfs_extlen_t len),
1433 TP_ARGS(mp, agno, agbno, len),
1436 __field(xfs_agnumber_t, agno)
1437 __field(xfs_agblock_t, agbno)
1438 __field(xfs_extlen_t, len)
1441 __entry->dev = mp->m_super->s_dev;
1442 __entry->agno = agno;
1443 __entry->agbno = agbno;
1446 TP_printk("dev %d:%d agno %u agbno %u len %u",
1447 MAJOR(__entry->dev), MINOR(__entry->dev),
1452 #define DEFINE_BUSY_EVENT(name) \
1453 DEFINE_EVENT(xfs_extent_busy_class, name, \
1454 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1455 xfs_agblock_t agbno, xfs_extlen_t len), \
1456 TP_ARGS(mp, agno, agbno, len))
1457 DEFINE_BUSY_EVENT(xfs_extent_busy);
1458 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1459 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1460 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1461 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1463 TRACE_EVENT(xfs_extent_busy_trim,
1464 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1465 xfs_agblock_t agbno, xfs_extlen_t len,
1466 xfs_agblock_t tbno, xfs_extlen_t tlen),
1467 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1470 __field(xfs_agnumber_t, agno)
1471 __field(xfs_agblock_t, agbno)
1472 __field(xfs_extlen_t, len)
1473 __field(xfs_agblock_t, tbno)
1474 __field(xfs_extlen_t, tlen)
1477 __entry->dev = mp->m_super->s_dev;
1478 __entry->agno = agno;
1479 __entry->agbno = agbno;
1481 __entry->tbno = tbno;
1482 __entry->tlen = tlen;
1484 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1485 MAJOR(__entry->dev), MINOR(__entry->dev),
1493 TRACE_EVENT(xfs_trans_commit_lsn,
1494 TP_PROTO(struct xfs_trans *trans),
1498 __field(struct xfs_trans *, tp)
1499 __field(xfs_lsn_t, lsn)
1502 __entry->dev = trans->t_mountp->m_super->s_dev;
1503 __entry->tp = trans;
1504 __entry->lsn = trans->t_commit_lsn;
1506 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1507 MAJOR(__entry->dev), MINOR(__entry->dev),
1512 TRACE_EVENT(xfs_agf,
1513 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1514 unsigned long caller_ip),
1515 TP_ARGS(mp, agf, flags, caller_ip),
1518 __field(xfs_agnumber_t, agno)
1520 __field(__u32, length)
1521 __field(__u32, bno_root)
1522 __field(__u32, cnt_root)
1523 __field(__u32, bno_level)
1524 __field(__u32, cnt_level)
1525 __field(__u32, flfirst)
1526 __field(__u32, fllast)
1527 __field(__u32, flcount)
1528 __field(__u32, freeblks)
1529 __field(__u32, longest)
1530 __field(unsigned long, caller_ip)
1533 __entry->dev = mp->m_super->s_dev;
1534 __entry->agno = be32_to_cpu(agf->agf_seqno),
1535 __entry->flags = flags;
1536 __entry->length = be32_to_cpu(agf->agf_length),
1537 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1538 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1539 __entry->bno_level =
1540 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1541 __entry->cnt_level =
1542 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1543 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1544 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1545 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1546 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1547 __entry->longest = be32_to_cpu(agf->agf_longest);
1548 __entry->caller_ip = caller_ip;
1550 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1551 "levels b %u c %u flfirst %u fllast %u flcount %u "
1552 "freeblks %u longest %u caller %ps",
1553 MAJOR(__entry->dev), MINOR(__entry->dev),
1555 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1566 (void *)__entry->caller_ip)
1569 TRACE_EVENT(xfs_free_extent,
1570 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1571 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1573 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
1576 __field(xfs_agnumber_t, agno)
1577 __field(xfs_agblock_t, agbno)
1578 __field(xfs_extlen_t, len)
1580 __field(int, haveleft)
1581 __field(int, haveright)
1584 __entry->dev = mp->m_super->s_dev;
1585 __entry->agno = agno;
1586 __entry->agbno = agbno;
1588 __entry->resv = resv;
1589 __entry->haveleft = haveleft;
1590 __entry->haveright = haveright;
1592 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
1593 MAJOR(__entry->dev), MINOR(__entry->dev),
1599 (__entry->haveright ? "both" : "left") :
1600 (__entry->haveright ? "right" : "none"))
1604 DECLARE_EVENT_CLASS(xfs_alloc_class,
1605 TP_PROTO(struct xfs_alloc_arg *args),
1609 __field(xfs_agnumber_t, agno)
1610 __field(xfs_agblock_t, agbno)
1611 __field(xfs_extlen_t, minlen)
1612 __field(xfs_extlen_t, maxlen)
1613 __field(xfs_extlen_t, mod)
1614 __field(xfs_extlen_t, prod)
1615 __field(xfs_extlen_t, minleft)
1616 __field(xfs_extlen_t, total)
1617 __field(xfs_extlen_t, alignment)
1618 __field(xfs_extlen_t, minalignslop)
1619 __field(xfs_extlen_t, len)
1620 __field(short, type)
1621 __field(short, otype)
1622 __field(char, wasdel)
1623 __field(char, wasfromfl)
1625 __field(int, datatype)
1626 __field(xfs_fsblock_t, firstblock)
1629 __entry->dev = args->mp->m_super->s_dev;
1630 __entry->agno = args->agno;
1631 __entry->agbno = args->agbno;
1632 __entry->minlen = args->minlen;
1633 __entry->maxlen = args->maxlen;
1634 __entry->mod = args->mod;
1635 __entry->prod = args->prod;
1636 __entry->minleft = args->minleft;
1637 __entry->total = args->total;
1638 __entry->alignment = args->alignment;
1639 __entry->minalignslop = args->minalignslop;
1640 __entry->len = args->len;
1641 __entry->type = args->type;
1642 __entry->otype = args->otype;
1643 __entry->wasdel = args->wasdel;
1644 __entry->wasfromfl = args->wasfromfl;
1645 __entry->resv = args->resv;
1646 __entry->datatype = args->datatype;
1647 __entry->firstblock = args->firstblock;
1649 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1650 "prod %u minleft %u total %u alignment %u minalignslop %u "
1651 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1652 "datatype 0x%x firstblock 0x%llx",
1653 MAJOR(__entry->dev), MINOR(__entry->dev),
1663 __entry->minalignslop,
1665 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1666 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1671 (unsigned long long)__entry->firstblock)
1674 #define DEFINE_ALLOC_EVENT(name) \
1675 DEFINE_EVENT(xfs_alloc_class, name, \
1676 TP_PROTO(struct xfs_alloc_arg *args), \
1678 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1679 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1680 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1681 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1682 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1683 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1684 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1685 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1686 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1687 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1688 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1689 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1690 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1691 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1692 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1693 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1694 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1695 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1696 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1697 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1698 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1699 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1700 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1701 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1702 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1704 DECLARE_EVENT_CLASS(xfs_da_class,
1705 TP_PROTO(struct xfs_da_args *args),
1709 __field(xfs_ino_t, ino)
1710 __dynamic_array(char, name, args->namelen)
1711 __field(int, namelen)
1712 __field(xfs_dahash_t, hashval)
1713 __field(xfs_ino_t, inumber)
1714 __field(int, op_flags)
1717 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1718 __entry->ino = args->dp->i_ino;
1720 memcpy(__get_str(name), args->name, args->namelen);
1721 __entry->namelen = args->namelen;
1722 __entry->hashval = args->hashval;
1723 __entry->inumber = args->inumber;
1724 __entry->op_flags = args->op_flags;
1726 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1727 "inumber 0x%llx op_flags %s",
1728 MAJOR(__entry->dev), MINOR(__entry->dev),
1731 __entry->namelen ? __get_str(name) : NULL,
1735 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1738 #define DEFINE_DIR2_EVENT(name) \
1739 DEFINE_EVENT(xfs_da_class, name, \
1740 TP_PROTO(struct xfs_da_args *args), \
1742 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1743 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1744 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1745 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1746 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1747 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1748 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1749 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1750 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1751 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1752 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1753 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1754 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1755 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1756 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1757 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1758 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1759 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1760 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1761 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1762 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1763 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1764 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1765 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1766 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1768 DECLARE_EVENT_CLASS(xfs_attr_class,
1769 TP_PROTO(struct xfs_da_args *args),
1773 __field(xfs_ino_t, ino)
1774 __dynamic_array(char, name, args->namelen)
1775 __field(int, namelen)
1776 __field(int, valuelen)
1777 __field(xfs_dahash_t, hashval)
1778 __field(int, op_flags)
1781 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1782 __entry->ino = args->dp->i_ino;
1784 memcpy(__get_str(name), args->name, args->namelen);
1785 __entry->namelen = args->namelen;
1786 __entry->valuelen = args->valuelen;
1787 __entry->hashval = args->hashval;
1788 __entry->op_flags = args->op_flags;
1790 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1791 "hashval 0x%x op_flags %s",
1792 MAJOR(__entry->dev), MINOR(__entry->dev),
1795 __entry->namelen ? __get_str(name) : NULL,
1799 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1802 #define DEFINE_ATTR_EVENT(name) \
1803 DEFINE_EVENT(xfs_attr_class, name, \
1804 TP_PROTO(struct xfs_da_args *args), \
1806 DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1807 DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1808 DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1809 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1810 DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1811 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1813 DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1814 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1815 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
1816 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
1817 DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1818 DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
1819 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1820 DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
1821 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1822 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
1823 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
1824 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1825 DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1826 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1827 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1828 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1829 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1830 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1831 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1832 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1833 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1834 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
1835 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
1837 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
1838 DEFINE_ATTR_EVENT(xfs_attr_node_get);
1839 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1840 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1842 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1843 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1845 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1846 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1847 DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1849 #define DEFINE_DA_EVENT(name) \
1850 DEFINE_EVENT(xfs_da_class, name, \
1851 TP_PROTO(struct xfs_da_args *args), \
1853 DEFINE_DA_EVENT(xfs_da_split);
1854 DEFINE_DA_EVENT(xfs_da_join);
1855 DEFINE_DA_EVENT(xfs_da_link_before);
1856 DEFINE_DA_EVENT(xfs_da_link_after);
1857 DEFINE_DA_EVENT(xfs_da_unlink_back);
1858 DEFINE_DA_EVENT(xfs_da_unlink_forward);
1859 DEFINE_DA_EVENT(xfs_da_root_split);
1860 DEFINE_DA_EVENT(xfs_da_root_join);
1861 DEFINE_DA_EVENT(xfs_da_node_add);
1862 DEFINE_DA_EVENT(xfs_da_node_create);
1863 DEFINE_DA_EVENT(xfs_da_node_split);
1864 DEFINE_DA_EVENT(xfs_da_node_remove);
1865 DEFINE_DA_EVENT(xfs_da_node_rebalance);
1866 DEFINE_DA_EVENT(xfs_da_node_unbalance);
1867 DEFINE_DA_EVENT(xfs_da_node_toosmall);
1868 DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1869 DEFINE_DA_EVENT(xfs_da_grow_inode);
1870 DEFINE_DA_EVENT(xfs_da_shrink_inode);
1871 DEFINE_DA_EVENT(xfs_da_fixhashpath);
1872 DEFINE_DA_EVENT(xfs_da_path_shift);
1874 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1875 TP_PROTO(struct xfs_da_args *args, int idx),
1879 __field(xfs_ino_t, ino)
1880 __field(int, op_flags)
1884 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1885 __entry->ino = args->dp->i_ino;
1886 __entry->op_flags = args->op_flags;
1889 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1890 MAJOR(__entry->dev), MINOR(__entry->dev),
1892 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1896 #define DEFINE_DIR2_SPACE_EVENT(name) \
1897 DEFINE_EVENT(xfs_dir2_space_class, name, \
1898 TP_PROTO(struct xfs_da_args *args, int idx), \
1900 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1901 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1902 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1903 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1905 TRACE_EVENT(xfs_dir2_leafn_moveents,
1906 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1907 TP_ARGS(args, src_idx, dst_idx, count),
1910 __field(xfs_ino_t, ino)
1911 __field(int, op_flags)
1912 __field(int, src_idx)
1913 __field(int, dst_idx)
1917 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1918 __entry->ino = args->dp->i_ino;
1919 __entry->op_flags = args->op_flags;
1920 __entry->src_idx = src_idx;
1921 __entry->dst_idx = dst_idx;
1922 __entry->count = count;
1924 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1925 "src_idx %d dst_idx %d count %d",
1926 MAJOR(__entry->dev), MINOR(__entry->dev),
1928 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1934 #define XFS_SWAPEXT_INODES \
1938 #define XFS_INODE_FORMAT_STR \
1944 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1945 TP_PROTO(struct xfs_inode *ip, int which),
1950 __field(xfs_ino_t, ino)
1951 __field(int, format)
1953 __field(int, broot_size)
1954 __field(int, fork_off)
1957 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1958 __entry->which = which;
1959 __entry->ino = ip->i_ino;
1960 __entry->format = ip->i_d.di_format;
1961 __entry->nex = ip->i_d.di_nextents;
1962 __entry->broot_size = ip->i_df.if_broot_bytes;
1963 __entry->fork_off = XFS_IFORK_BOFF(ip);
1965 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1966 "broot size %d, fork offset %d",
1967 MAJOR(__entry->dev), MINOR(__entry->dev),
1969 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1970 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1972 __entry->broot_size,
1976 #define DEFINE_SWAPEXT_EVENT(name) \
1977 DEFINE_EVENT(xfs_swap_extent_class, name, \
1978 TP_PROTO(struct xfs_inode *ip, int which), \
1981 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1982 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1984 TRACE_EVENT(xfs_log_recover_record,
1985 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
1986 TP_ARGS(log, rhead, pass),
1989 __field(xfs_lsn_t, lsn)
1991 __field(int, num_logops)
1995 __entry->dev = log->l_mp->m_super->s_dev;
1996 __entry->lsn = be64_to_cpu(rhead->h_lsn);
1997 __entry->len = be32_to_cpu(rhead->h_len);
1998 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
1999 __entry->pass = pass;
2001 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2002 MAJOR(__entry->dev), MINOR(__entry->dev),
2003 __entry->lsn, __entry->len, __entry->num_logops,
2007 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2008 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2009 struct xlog_recover_item *item, int pass),
2010 TP_ARGS(log, trans, item, pass),
2013 __field(unsigned long, item)
2014 __field(xlog_tid_t, tid)
2015 __field(xfs_lsn_t, lsn)
2022 __entry->dev = log->l_mp->m_super->s_dev;
2023 __entry->item = (unsigned long)item;
2024 __entry->tid = trans->r_log_tid;
2025 __entry->lsn = trans->r_lsn;
2026 __entry->type = ITEM_TYPE(item);
2027 __entry->pass = pass;
2028 __entry->count = item->ri_cnt;
2029 __entry->total = item->ri_total;
2031 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, "
2032 "item type %s item region count/total %d/%d",
2033 MAJOR(__entry->dev), MINOR(__entry->dev),
2037 (void *)__entry->item,
2038 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2043 #define DEFINE_LOG_RECOVER_ITEM(name) \
2044 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2045 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2046 struct xlog_recover_item *item, int pass), \
2047 TP_ARGS(log, trans, item, pass))
2049 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2050 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2051 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2052 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2053 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2055 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2056 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2057 TP_ARGS(log, buf_f),
2060 __field(__int64_t, blkno)
2061 __field(unsigned short, len)
2062 __field(unsigned short, flags)
2063 __field(unsigned short, size)
2064 __field(unsigned int, map_size)
2067 __entry->dev = log->l_mp->m_super->s_dev;
2068 __entry->blkno = buf_f->blf_blkno;
2069 __entry->len = buf_f->blf_len;
2070 __entry->flags = buf_f->blf_flags;
2071 __entry->size = buf_f->blf_size;
2072 __entry->map_size = buf_f->blf_map_size;
2074 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2076 MAJOR(__entry->dev), MINOR(__entry->dev),
2084 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2085 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2086 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2087 TP_ARGS(log, buf_f))
2089 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2090 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2091 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2092 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2093 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2094 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2095 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2096 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2097 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2099 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2100 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2104 __field(xfs_ino_t, ino)
2105 __field(unsigned short, size)
2106 __field(int, fields)
2107 __field(unsigned short, asize)
2108 __field(unsigned short, dsize)
2109 __field(__int64_t, blkno)
2111 __field(int, boffset)
2114 __entry->dev = log->l_mp->m_super->s_dev;
2115 __entry->ino = in_f->ilf_ino;
2116 __entry->size = in_f->ilf_size;
2117 __entry->fields = in_f->ilf_fields;
2118 __entry->asize = in_f->ilf_asize;
2119 __entry->dsize = in_f->ilf_dsize;
2120 __entry->blkno = in_f->ilf_blkno;
2121 __entry->len = in_f->ilf_len;
2122 __entry->boffset = in_f->ilf_boffset;
2124 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2125 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2126 MAJOR(__entry->dev), MINOR(__entry->dev),
2136 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2137 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2138 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2141 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2142 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2143 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2145 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2146 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2150 __field(xfs_agnumber_t, agno)
2151 __field(xfs_agblock_t, agbno)
2152 __field(unsigned int, count)
2153 __field(unsigned int, isize)
2154 __field(xfs_agblock_t, length)
2155 __field(unsigned int, gen)
2158 __entry->dev = log->l_mp->m_super->s_dev;
2159 __entry->agno = be32_to_cpu(in_f->icl_ag);
2160 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2161 __entry->count = be32_to_cpu(in_f->icl_count);
2162 __entry->isize = be32_to_cpu(in_f->icl_isize);
2163 __entry->length = be32_to_cpu(in_f->icl_length);
2164 __entry->gen = be32_to_cpu(in_f->icl_gen);
2166 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2167 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2168 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2169 __entry->length, __entry->gen)
2171 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2172 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2173 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2176 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2177 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2179 DECLARE_EVENT_CLASS(xfs_discard_class,
2180 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2181 xfs_agblock_t agbno, xfs_extlen_t len),
2182 TP_ARGS(mp, agno, agbno, len),
2185 __field(xfs_agnumber_t, agno)
2186 __field(xfs_agblock_t, agbno)
2187 __field(xfs_extlen_t, len)
2190 __entry->dev = mp->m_super->s_dev;
2191 __entry->agno = agno;
2192 __entry->agbno = agbno;
2195 TP_printk("dev %d:%d agno %u agbno %u len %u",
2196 MAJOR(__entry->dev), MINOR(__entry->dev),
2202 #define DEFINE_DISCARD_EVENT(name) \
2203 DEFINE_EVENT(xfs_discard_class, name, \
2204 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2205 xfs_agblock_t agbno, xfs_extlen_t len), \
2206 TP_ARGS(mp, agno, agbno, len))
2207 DEFINE_DISCARD_EVENT(xfs_discard_extent);
2208 DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2209 DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2210 DEFINE_DISCARD_EVENT(xfs_discard_busy);
2212 /* btree cursor events */
2213 DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2214 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2215 TP_ARGS(cur, level, bp),
2218 __field(xfs_btnum_t, btnum)
2220 __field(int, nlevels)
2222 __field(xfs_daddr_t, daddr)
2225 __entry->dev = cur->bc_mp->m_super->s_dev;
2226 __entry->btnum = cur->bc_btnum;
2227 __entry->level = level;
2228 __entry->nlevels = cur->bc_nlevels;
2229 __entry->ptr = cur->bc_ptrs[level];
2230 __entry->daddr = bp ? bp->b_bn : -1;
2232 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2233 MAJOR(__entry->dev), MINOR(__entry->dev),
2238 (unsigned long long)__entry->daddr)
2241 #define DEFINE_BTREE_CUR_EVENT(name) \
2242 DEFINE_EVENT(xfs_btree_cur_class, name, \
2243 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2244 TP_ARGS(cur, level, bp))
2245 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2246 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2249 struct xfs_defer_pending;
2250 struct xfs_defer_ops;
2252 DECLARE_EVENT_CLASS(xfs_defer_class,
2253 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop),
2257 __field(void *, dop)
2258 __field(char, committed)
2262 __entry->dev = mp ? mp->m_super->s_dev : 0;
2264 __entry->committed = dop->dop_committed;
2265 __entry->low = dop->dop_low;
2267 TP_printk("dev %d:%d ops %p committed %d low %d",
2268 MAJOR(__entry->dev), MINOR(__entry->dev),
2273 #define DEFINE_DEFER_EVENT(name) \
2274 DEFINE_EVENT(xfs_defer_class, name, \
2275 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2278 DECLARE_EVENT_CLASS(xfs_defer_error_class,
2279 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
2280 TP_ARGS(mp, dop, error),
2283 __field(void *, dop)
2284 __field(char, committed)
2289 __entry->dev = mp ? mp->m_super->s_dev : 0;
2291 __entry->committed = dop->dop_committed;
2292 __entry->low = dop->dop_low;
2293 __entry->error = error;
2295 TP_printk("dev %d:%d ops %p committed %d low %d err %d",
2296 MAJOR(__entry->dev), MINOR(__entry->dev),
2302 #define DEFINE_DEFER_ERROR_EVENT(name) \
2303 DEFINE_EVENT(xfs_defer_error_class, name, \
2304 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2305 TP_ARGS(mp, dop, error))
2307 DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2308 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2313 __field(void *, intent)
2314 __field(char, committed)
2318 __entry->dev = mp ? mp->m_super->s_dev : 0;
2319 __entry->type = dfp->dfp_type->type;
2320 __entry->intent = dfp->dfp_intent;
2321 __entry->committed = dfp->dfp_done != NULL;
2322 __entry->nr = dfp->dfp_count;
2324 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
2325 MAJOR(__entry->dev), MINOR(__entry->dev),
2331 #define DEFINE_DEFER_PENDING_EVENT(name) \
2332 DEFINE_EVENT(xfs_defer_pending_class, name, \
2333 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2336 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2337 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2338 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2339 TP_ARGS(mp, agno, type, agbno, len),
2342 __field(xfs_agnumber_t, agno)
2344 __field(xfs_agblock_t, agbno)
2345 __field(xfs_extlen_t, len)
2348 __entry->dev = mp->m_super->s_dev;
2349 __entry->agno = agno;
2350 __entry->type = type;
2351 __entry->agbno = agbno;
2354 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2355 MAJOR(__entry->dev), MINOR(__entry->dev),
2361 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2362 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2363 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2365 xfs_agblock_t bno, \
2366 xfs_extlen_t len), \
2367 TP_ARGS(mp, agno, type, bno, len))
2369 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2370 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2372 xfs_agblock_t agbno,
2375 xfs_fileoff_t offset,
2377 xfs_exntst_t state),
2378 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2381 __field(xfs_agnumber_t, agno)
2382 __field(xfs_ino_t, ino)
2383 __field(xfs_agblock_t, agbno)
2384 __field(int, whichfork)
2385 __field(xfs_fileoff_t, l_loff)
2386 __field(xfs_filblks_t, l_len)
2387 __field(xfs_exntst_t, l_state)
2391 __entry->dev = mp->m_super->s_dev;
2392 __entry->agno = agno;
2394 __entry->agbno = agbno;
2395 __entry->whichfork = whichfork;
2396 __entry->l_loff = offset;
2397 __entry->l_len = len;
2398 __entry->l_state = state;
2401 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2402 MAJOR(__entry->dev), MINOR(__entry->dev),
2407 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2412 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2413 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2414 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2416 xfs_agblock_t agbno, \
2419 xfs_fileoff_t offset, \
2420 xfs_filblks_t len, \
2421 xfs_exntst_t state), \
2422 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2424 DEFINE_DEFER_EVENT(xfs_defer_init);
2425 DEFINE_DEFER_EVENT(xfs_defer_cancel);
2426 DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2427 DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2428 DEFINE_DEFER_EVENT(xfs_defer_finish);
2429 DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2431 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2432 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2434 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
2435 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
2436 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
2437 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2438 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2440 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2441 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2442 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2444 /* rmap tracepoints */
2445 DECLARE_EVENT_CLASS(xfs_rmap_class,
2446 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2447 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2448 struct xfs_owner_info *oinfo),
2449 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2452 __field(xfs_agnumber_t, agno)
2453 __field(xfs_agblock_t, agbno)
2454 __field(xfs_extlen_t, len)
2455 __field(uint64_t, owner)
2456 __field(uint64_t, offset)
2457 __field(unsigned long, flags)
2460 __entry->dev = mp->m_super->s_dev;
2461 __entry->agno = agno;
2462 __entry->agbno = agbno;
2464 __entry->owner = oinfo->oi_owner;
2465 __entry->offset = oinfo->oi_offset;
2466 __entry->flags = oinfo->oi_flags;
2468 __entry->flags |= XFS_RMAP_UNWRITTEN;
2470 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2471 MAJOR(__entry->dev), MINOR(__entry->dev),
2479 #define DEFINE_RMAP_EVENT(name) \
2480 DEFINE_EVENT(xfs_rmap_class, name, \
2481 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2482 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2483 struct xfs_owner_info *oinfo), \
2484 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2486 /* simple AG-based error/%ip tracepoint class */
2487 DECLARE_EVENT_CLASS(xfs_ag_error_class,
2488 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2489 unsigned long caller_ip),
2490 TP_ARGS(mp, agno, error, caller_ip),
2493 __field(xfs_agnumber_t, agno)
2495 __field(unsigned long, caller_ip)
2498 __entry->dev = mp->m_super->s_dev;
2499 __entry->agno = agno;
2500 __entry->error = error;
2501 __entry->caller_ip = caller_ip;
2503 TP_printk("dev %d:%d agno %u error %d caller %ps",
2504 MAJOR(__entry->dev), MINOR(__entry->dev),
2507 (char *)__entry->caller_ip)
2510 #define DEFINE_AG_ERROR_EVENT(name) \
2511 DEFINE_EVENT(xfs_ag_error_class, name, \
2512 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2513 unsigned long caller_ip), \
2514 TP_ARGS(mp, agno, error, caller_ip))
2516 DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2517 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2518 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2519 DEFINE_RMAP_EVENT(xfs_rmap_map);
2520 DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2521 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2522 DEFINE_RMAP_EVENT(xfs_rmap_convert);
2523 DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2524 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2525 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
2527 DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2528 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2529 xfs_agblock_t agbno, xfs_extlen_t len,
2530 uint64_t owner, uint64_t offset, unsigned int flags),
2531 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2534 __field(xfs_agnumber_t, agno)
2535 __field(xfs_agblock_t, agbno)
2536 __field(xfs_extlen_t, len)
2537 __field(uint64_t, owner)
2538 __field(uint64_t, offset)
2539 __field(unsigned int, flags)
2542 __entry->dev = mp->m_super->s_dev;
2543 __entry->agno = agno;
2544 __entry->agbno = agbno;
2546 __entry->owner = owner;
2547 __entry->offset = offset;
2548 __entry->flags = flags;
2550 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2551 MAJOR(__entry->dev), MINOR(__entry->dev),
2559 #define DEFINE_RMAPBT_EVENT(name) \
2560 DEFINE_EVENT(xfs_rmapbt_class, name, \
2561 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2562 xfs_agblock_t agbno, xfs_extlen_t len, \
2563 uint64_t owner, uint64_t offset, unsigned int flags), \
2564 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2566 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2567 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2568 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2570 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2571 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
2572 DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2573 DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2574 DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2575 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2576 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2577 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
2579 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2580 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2581 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2582 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
2583 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2584 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
2585 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
2587 /* deferred bmbt updates */
2588 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2589 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2590 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2592 /* per-AG reservation */
2593 DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2594 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2596 TP_ARGS(pag, resv, len),
2599 __field(xfs_agnumber_t, agno)
2601 __field(xfs_extlen_t, freeblks)
2602 __field(xfs_extlen_t, flcount)
2603 __field(xfs_extlen_t, reserved)
2604 __field(xfs_extlen_t, asked)
2605 __field(xfs_extlen_t, len)
2608 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2610 __entry->dev = pag->pag_mount->m_super->s_dev;
2611 __entry->agno = pag->pag_agno;
2612 __entry->resv = resv;
2613 __entry->freeblks = pag->pagf_freeblks;
2614 __entry->flcount = pag->pagf_flcount;
2615 __entry->reserved = r ? r->ar_reserved : 0;
2616 __entry->asked = r ? r->ar_asked : 0;
2619 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u "
2620 "resv %u ask %u len %u",
2621 MAJOR(__entry->dev), MINOR(__entry->dev),
2630 #define DEFINE_AG_RESV_EVENT(name) \
2631 DEFINE_EVENT(xfs_ag_resv_class, name, \
2632 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2633 xfs_extlen_t len), \
2634 TP_ARGS(pag, type, len))
2636 /* per-AG reservation tracepoints */
2637 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2638 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2639 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2640 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2641 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2642 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2644 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2645 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2647 /* refcount tracepoint classes */
2649 /* reuse the discard trace class for agbno/aglen-based traces */
2650 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2652 /* ag btree lookup tracepoint class */
2653 #define XFS_AG_BTREE_CMP_FORMAT_STR \
2654 { XFS_LOOKUP_EQ, "eq" }, \
2655 { XFS_LOOKUP_LE, "le" }, \
2656 { XFS_LOOKUP_GE, "ge" }
2657 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2658 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2659 xfs_agblock_t agbno, xfs_lookup_t dir),
2660 TP_ARGS(mp, agno, agbno, dir),
2663 __field(xfs_agnumber_t, agno)
2664 __field(xfs_agblock_t, agbno)
2665 __field(xfs_lookup_t, dir)
2668 __entry->dev = mp->m_super->s_dev;
2669 __entry->agno = agno;
2670 __entry->agbno = agbno;
2673 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)",
2674 MAJOR(__entry->dev), MINOR(__entry->dev),
2677 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2681 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2682 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2683 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2684 xfs_agblock_t agbno, xfs_lookup_t dir), \
2685 TP_ARGS(mp, agno, agbno, dir))
2687 /* single-rcext tracepoint class */
2688 DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2689 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2690 struct xfs_refcount_irec *irec),
2691 TP_ARGS(mp, agno, irec),
2694 __field(xfs_agnumber_t, agno)
2695 __field(xfs_agblock_t, startblock)
2696 __field(xfs_extlen_t, blockcount)
2697 __field(xfs_nlink_t, refcount)
2700 __entry->dev = mp->m_super->s_dev;
2701 __entry->agno = agno;
2702 __entry->startblock = irec->rc_startblock;
2703 __entry->blockcount = irec->rc_blockcount;
2704 __entry->refcount = irec->rc_refcount;
2706 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u",
2707 MAJOR(__entry->dev), MINOR(__entry->dev),
2709 __entry->startblock,
2710 __entry->blockcount,
2714 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2715 DEFINE_EVENT(xfs_refcount_extent_class, name, \
2716 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2717 struct xfs_refcount_irec *irec), \
2718 TP_ARGS(mp, agno, irec))
2720 /* single-rcext and an agbno tracepoint class */
2721 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2722 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2723 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2724 TP_ARGS(mp, agno, irec, agbno),
2727 __field(xfs_agnumber_t, agno)
2728 __field(xfs_agblock_t, startblock)
2729 __field(xfs_extlen_t, blockcount)
2730 __field(xfs_nlink_t, refcount)
2731 __field(xfs_agblock_t, agbno)
2734 __entry->dev = mp->m_super->s_dev;
2735 __entry->agno = agno;
2736 __entry->startblock = irec->rc_startblock;
2737 __entry->blockcount = irec->rc_blockcount;
2738 __entry->refcount = irec->rc_refcount;
2739 __entry->agbno = agbno;
2741 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u",
2742 MAJOR(__entry->dev), MINOR(__entry->dev),
2744 __entry->startblock,
2745 __entry->blockcount,
2750 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2751 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2752 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2753 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2754 TP_ARGS(mp, agno, irec, agbno))
2756 /* double-rcext tracepoint class */
2757 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2758 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2759 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2760 TP_ARGS(mp, agno, i1, i2),
2763 __field(xfs_agnumber_t, agno)
2764 __field(xfs_agblock_t, i1_startblock)
2765 __field(xfs_extlen_t, i1_blockcount)
2766 __field(xfs_nlink_t, i1_refcount)
2767 __field(xfs_agblock_t, i2_startblock)
2768 __field(xfs_extlen_t, i2_blockcount)
2769 __field(xfs_nlink_t, i2_refcount)
2772 __entry->dev = mp->m_super->s_dev;
2773 __entry->agno = agno;
2774 __entry->i1_startblock = i1->rc_startblock;
2775 __entry->i1_blockcount = i1->rc_blockcount;
2776 __entry->i1_refcount = i1->rc_refcount;
2777 __entry->i2_startblock = i2->rc_startblock;
2778 __entry->i2_blockcount = i2->rc_blockcount;
2779 __entry->i2_refcount = i2->rc_refcount;
2781 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2782 "agbno %u len %u refcount %u",
2783 MAJOR(__entry->dev), MINOR(__entry->dev),
2785 __entry->i1_startblock,
2786 __entry->i1_blockcount,
2787 __entry->i1_refcount,
2788 __entry->i2_startblock,
2789 __entry->i2_blockcount,
2790 __entry->i2_refcount)
2793 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2794 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2795 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2796 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2797 TP_ARGS(mp, agno, i1, i2))
2799 /* double-rcext and an agbno tracepoint class */
2800 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
2801 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2802 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2803 xfs_agblock_t agbno),
2804 TP_ARGS(mp, agno, i1, i2, agbno),
2807 __field(xfs_agnumber_t, agno)
2808 __field(xfs_agblock_t, i1_startblock)
2809 __field(xfs_extlen_t, i1_blockcount)
2810 __field(xfs_nlink_t, i1_refcount)
2811 __field(xfs_agblock_t, i2_startblock)
2812 __field(xfs_extlen_t, i2_blockcount)
2813 __field(xfs_nlink_t, i2_refcount)
2814 __field(xfs_agblock_t, agbno)
2817 __entry->dev = mp->m_super->s_dev;
2818 __entry->agno = agno;
2819 __entry->i1_startblock = i1->rc_startblock;
2820 __entry->i1_blockcount = i1->rc_blockcount;
2821 __entry->i1_refcount = i1->rc_refcount;
2822 __entry->i2_startblock = i2->rc_startblock;
2823 __entry->i2_blockcount = i2->rc_blockcount;
2824 __entry->i2_refcount = i2->rc_refcount;
2825 __entry->agbno = agbno;
2827 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2828 "agbno %u len %u refcount %u @ agbno %u",
2829 MAJOR(__entry->dev), MINOR(__entry->dev),
2831 __entry->i1_startblock,
2832 __entry->i1_blockcount,
2833 __entry->i1_refcount,
2834 __entry->i2_startblock,
2835 __entry->i2_blockcount,
2836 __entry->i2_refcount,
2840 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2841 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2842 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2843 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2844 xfs_agblock_t agbno), \
2845 TP_ARGS(mp, agno, i1, i2, agbno))
2847 /* triple-rcext tracepoint class */
2848 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
2849 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2850 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2851 struct xfs_refcount_irec *i3),
2852 TP_ARGS(mp, agno, i1, i2, i3),
2855 __field(xfs_agnumber_t, agno)
2856 __field(xfs_agblock_t, i1_startblock)
2857 __field(xfs_extlen_t, i1_blockcount)
2858 __field(xfs_nlink_t, i1_refcount)
2859 __field(xfs_agblock_t, i2_startblock)
2860 __field(xfs_extlen_t, i2_blockcount)
2861 __field(xfs_nlink_t, i2_refcount)
2862 __field(xfs_agblock_t, i3_startblock)
2863 __field(xfs_extlen_t, i3_blockcount)
2864 __field(xfs_nlink_t, i3_refcount)
2867 __entry->dev = mp->m_super->s_dev;
2868 __entry->agno = agno;
2869 __entry->i1_startblock = i1->rc_startblock;
2870 __entry->i1_blockcount = i1->rc_blockcount;
2871 __entry->i1_refcount = i1->rc_refcount;
2872 __entry->i2_startblock = i2->rc_startblock;
2873 __entry->i2_blockcount = i2->rc_blockcount;
2874 __entry->i2_refcount = i2->rc_refcount;
2875 __entry->i3_startblock = i3->rc_startblock;
2876 __entry->i3_blockcount = i3->rc_blockcount;
2877 __entry->i3_refcount = i3->rc_refcount;
2879 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2880 "agbno %u len %u refcount %u -- "
2881 "agbno %u len %u refcount %u",
2882 MAJOR(__entry->dev), MINOR(__entry->dev),
2884 __entry->i1_startblock,
2885 __entry->i1_blockcount,
2886 __entry->i1_refcount,
2887 __entry->i2_startblock,
2888 __entry->i2_blockcount,
2889 __entry->i2_refcount,
2890 __entry->i3_startblock,
2891 __entry->i3_blockcount,
2892 __entry->i3_refcount)
2895 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2896 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
2897 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2898 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2899 struct xfs_refcount_irec *i3), \
2900 TP_ARGS(mp, agno, i1, i2, i3))
2902 /* refcount btree tracepoints */
2903 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
2904 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
2905 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
2906 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
2907 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
2908 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
2909 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
2910 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
2911 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
2912 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
2914 /* refcount adjustment tracepoints */
2915 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
2916 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
2917 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
2918 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
2919 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
2920 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
2921 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
2922 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
2923 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
2924 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
2925 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
2926 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
2927 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
2928 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
2929 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
2930 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
2931 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
2932 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
2933 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
2934 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
2935 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
2937 /* reflink helpers */
2938 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
2939 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
2940 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
2941 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2942 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
2943 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
2945 TRACE_EVENT(xfs_refcount_finish_one_leftover,
2946 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2947 int type, xfs_agblock_t agbno, xfs_extlen_t len,
2948 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
2949 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
2952 __field(xfs_agnumber_t, agno)
2954 __field(xfs_agblock_t, agbno)
2955 __field(xfs_extlen_t, len)
2956 __field(xfs_agblock_t, new_agbno)
2957 __field(xfs_extlen_t, new_len)
2960 __entry->dev = mp->m_super->s_dev;
2961 __entry->agno = agno;
2962 __entry->type = type;
2963 __entry->agbno = agbno;
2965 __entry->new_agbno = new_agbno;
2966 __entry->new_len = new_len;
2968 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
2969 MAJOR(__entry->dev), MINOR(__entry->dev),
2978 /* simple inode-based error/%ip tracepoint class */
2979 DECLARE_EVENT_CLASS(xfs_inode_error_class,
2980 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
2981 TP_ARGS(ip, error, caller_ip),
2984 __field(xfs_ino_t, ino)
2986 __field(unsigned long, caller_ip)
2989 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2990 __entry->ino = ip->i_ino;
2991 __entry->error = error;
2992 __entry->caller_ip = caller_ip;
2994 TP_printk("dev %d:%d ino %llx error %d caller %ps",
2995 MAJOR(__entry->dev), MINOR(__entry->dev),
2998 (char *)__entry->caller_ip)
3001 #define DEFINE_INODE_ERROR_EVENT(name) \
3002 DEFINE_EVENT(xfs_inode_error_class, name, \
3003 TP_PROTO(struct xfs_inode *ip, int error, \
3004 unsigned long caller_ip), \
3005 TP_ARGS(ip, error, caller_ip))
3007 /* reflink tracepoint classes */
3009 /* two-file io tracepoint class */
3010 DECLARE_EVENT_CLASS(xfs_double_io_class,
3011 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3012 struct xfs_inode *dest, xfs_off_t doffset),
3013 TP_ARGS(src, soffset, len, dest, doffset),
3016 __field(xfs_ino_t, src_ino)
3017 __field(loff_t, src_isize)
3018 __field(loff_t, src_disize)
3019 __field(loff_t, src_offset)
3020 __field(size_t, len)
3021 __field(xfs_ino_t, dest_ino)
3022 __field(loff_t, dest_isize)
3023 __field(loff_t, dest_disize)
3024 __field(loff_t, dest_offset)
3027 __entry->dev = VFS_I(src)->i_sb->s_dev;
3028 __entry->src_ino = src->i_ino;
3029 __entry->src_isize = VFS_I(src)->i_size;
3030 __entry->src_disize = src->i_d.di_size;
3031 __entry->src_offset = soffset;
3033 __entry->dest_ino = dest->i_ino;
3034 __entry->dest_isize = VFS_I(dest)->i_size;
3035 __entry->dest_disize = dest->i_d.di_size;
3036 __entry->dest_offset = doffset;
3038 TP_printk("dev %d:%d count %zd "
3039 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
3040 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
3041 MAJOR(__entry->dev), MINOR(__entry->dev),
3045 __entry->src_disize,
3046 __entry->src_offset,
3048 __entry->dest_isize,
3049 __entry->dest_disize,
3050 __entry->dest_offset)
3053 #define DEFINE_DOUBLE_IO_EVENT(name) \
3054 DEFINE_EVENT(xfs_double_io_class, name, \
3055 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3056 struct xfs_inode *dest, xfs_off_t doffset), \
3057 TP_ARGS(src, soffset, len, dest, doffset))
3059 /* inode/irec events */
3060 DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3061 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3065 __field(xfs_ino_t, ino)
3066 __field(xfs_fileoff_t, lblk)
3067 __field(xfs_extlen_t, len)
3068 __field(xfs_fsblock_t, pblk)
3072 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3073 __entry->ino = ip->i_ino;
3074 __entry->lblk = irec->br_startoff;
3075 __entry->len = irec->br_blockcount;
3076 __entry->pblk = irec->br_startblock;
3077 __entry->state = irec->br_state;
3079 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d",
3080 MAJOR(__entry->dev), MINOR(__entry->dev),
3087 #define DEFINE_INODE_IREC_EVENT(name) \
3088 DEFINE_EVENT(xfs_inode_irec_class, name, \
3089 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3092 /* refcount/reflink tracepoint definitions */
3094 /* reflink tracepoints */
3095 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3096 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3097 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3098 DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap);
3099 TRACE_EVENT(xfs_reflink_remap_blocks_loop,
3100 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3101 xfs_filblks_t len, struct xfs_inode *dest,
3102 xfs_fileoff_t doffset),
3103 TP_ARGS(src, soffset, len, dest, doffset),
3106 __field(xfs_ino_t, src_ino)
3107 __field(xfs_fileoff_t, src_lblk)
3108 __field(xfs_filblks_t, len)
3109 __field(xfs_ino_t, dest_ino)
3110 __field(xfs_fileoff_t, dest_lblk)
3113 __entry->dev = VFS_I(src)->i_sb->s_dev;
3114 __entry->src_ino = src->i_ino;
3115 __entry->src_lblk = soffset;
3117 __entry->dest_ino = dest->i_ino;
3118 __entry->dest_lblk = doffset;
3120 TP_printk("dev %d:%d len 0x%llx "
3121 "ino 0x%llx offset 0x%llx blocks -> "
3122 "ino 0x%llx offset 0x%llx blocks",
3123 MAJOR(__entry->dev), MINOR(__entry->dev),
3130 TRACE_EVENT(xfs_reflink_punch_range,
3131 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3133 TP_ARGS(ip, lblk, len),
3136 __field(xfs_ino_t, ino)
3137 __field(xfs_fileoff_t, lblk)
3138 __field(xfs_extlen_t, len)
3141 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3142 __entry->ino = ip->i_ino;
3143 __entry->lblk = lblk;
3146 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x",
3147 MAJOR(__entry->dev), MINOR(__entry->dev),
3152 TRACE_EVENT(xfs_reflink_remap,
3153 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3154 xfs_extlen_t len, xfs_fsblock_t new_pblk),
3155 TP_ARGS(ip, lblk, len, new_pblk),
3158 __field(xfs_ino_t, ino)
3159 __field(xfs_fileoff_t, lblk)
3160 __field(xfs_extlen_t, len)
3161 __field(xfs_fsblock_t, new_pblk)
3164 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3165 __entry->ino = ip->i_ino;
3166 __entry->lblk = lblk;
3168 __entry->new_pblk = new_pblk;
3170 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu",
3171 MAJOR(__entry->dev), MINOR(__entry->dev),
3177 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3178 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3179 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3180 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
3181 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3182 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3184 /* dedupe tracepoints */
3185 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3186 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3188 /* ioctl tracepoints */
3189 TRACE_EVENT(xfs_ioctl_clone,
3190 TP_PROTO(struct inode *src, struct inode *dest),
3194 __field(unsigned long, src_ino)
3195 __field(loff_t, src_isize)
3196 __field(unsigned long, dest_ino)
3197 __field(loff_t, dest_isize)
3200 __entry->dev = src->i_sb->s_dev;
3201 __entry->src_ino = src->i_ino;
3202 __entry->src_isize = i_size_read(src);
3203 __entry->dest_ino = dest->i_ino;
3204 __entry->dest_isize = i_size_read(dest);
3206 TP_printk("dev %d:%d "
3207 "ino 0x%lx isize 0x%llx -> "
3208 "ino 0x%lx isize 0x%llx",
3209 MAJOR(__entry->dev), MINOR(__entry->dev),
3213 __entry->dest_isize)
3216 /* unshare tracepoints */
3217 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
3218 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
3221 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
3222 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc);
3223 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3224 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
3225 DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
3227 DEFINE_RW_EVENT(xfs_reflink_reserve_cow);
3229 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write);
3230 DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping);
3231 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec);
3233 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3234 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3235 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
3237 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3238 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3241 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
3243 /* rmap swapext tracepoints */
3244 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3245 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3246 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3249 DECLARE_EVENT_CLASS(xfs_fsmap_class,
3250 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3251 struct xfs_rmap_irec *rmap),
3252 TP_ARGS(mp, keydev, agno, rmap),
3255 __field(dev_t, keydev)
3256 __field(xfs_agnumber_t, agno)
3257 __field(xfs_fsblock_t, bno)
3258 __field(xfs_filblks_t, len)
3259 __field(__uint64_t, owner)
3260 __field(__uint64_t, offset)
3261 __field(unsigned int, flags)
3264 __entry->dev = mp->m_super->s_dev;
3265 __entry->keydev = new_decode_dev(keydev);
3266 __entry->agno = agno;
3267 __entry->bno = rmap->rm_startblock;
3268 __entry->len = rmap->rm_blockcount;
3269 __entry->owner = rmap->rm_owner;
3270 __entry->offset = rmap->rm_offset;
3271 __entry->flags = rmap->rm_flags;
3273 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld offset %llu flags 0x%x",
3274 MAJOR(__entry->dev), MINOR(__entry->dev),
3275 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3283 #define DEFINE_FSMAP_EVENT(name) \
3284 DEFINE_EVENT(xfs_fsmap_class, name, \
3285 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3286 struct xfs_rmap_irec *rmap), \
3287 TP_ARGS(mp, keydev, agno, rmap))
3288 DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3289 DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3290 DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3292 DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3293 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3297 __field(dev_t, keydev)
3298 __field(xfs_daddr_t, block)
3299 __field(xfs_daddr_t, len)
3300 __field(__uint64_t, owner)
3301 __field(__uint64_t, offset)
3302 __field(__uint64_t, flags)
3305 __entry->dev = mp->m_super->s_dev;
3306 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3307 __entry->block = fsmap->fmr_physical;
3308 __entry->len = fsmap->fmr_length;
3309 __entry->owner = fsmap->fmr_owner;
3310 __entry->offset = fsmap->fmr_offset;
3311 __entry->flags = fsmap->fmr_flags;
3313 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld offset %llu flags 0x%llx",
3314 MAJOR(__entry->dev), MINOR(__entry->dev),
3315 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3322 #define DEFINE_GETFSMAP_EVENT(name) \
3323 DEFINE_EVENT(xfs_getfsmap_class, name, \
3324 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3326 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3327 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3328 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3330 #endif /* _TRACE_XFS_H */
3332 #undef TRACE_INCLUDE_PATH
3333 #define TRACE_INCLUDE_PATH .
3334 #define TRACE_INCLUDE_FILE xfs_trace
3335 #include <trace/define_trace.h>