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 %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 %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 DECLARE_EVENT_CLASS(xfs_bmap_class,
222 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
223 unsigned long caller_ip),
224 TP_ARGS(ip, cur, state, caller_ip),
227 __field(xfs_ino_t, ino)
228 __field(void *, leaf);
230 __field(xfs_fileoff_t, startoff)
231 __field(xfs_fsblock_t, startblock)
232 __field(xfs_filblks_t, blockcount)
233 __field(xfs_exntst_t, state)
234 __field(int, bmap_state)
235 __field(unsigned long, caller_ip)
238 struct xfs_ifork *ifp;
239 struct xfs_bmbt_irec r;
241 ifp = xfs_iext_state_to_fork(ip, state);
242 xfs_iext_get_extent(ifp, cur, &r);
243 __entry->dev = VFS_I(ip)->i_sb->s_dev;
244 __entry->ino = ip->i_ino;
245 __entry->leaf = cur->leaf;
246 __entry->pos = cur->pos;
247 __entry->startoff = r.br_startoff;
248 __entry->startblock = r.br_startblock;
249 __entry->blockcount = r.br_blockcount;
250 __entry->state = r.br_state;
251 __entry->bmap_state = state;
252 __entry->caller_ip = caller_ip;
254 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
255 "offset %lld block %lld count %lld flag %d caller %pS",
256 MAJOR(__entry->dev), MINOR(__entry->dev),
258 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
262 (int64_t)__entry->startblock,
265 (char *)__entry->caller_ip)
268 #define DEFINE_BMAP_EVENT(name) \
269 DEFINE_EVENT(xfs_bmap_class, name, \
270 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
271 unsigned long caller_ip), \
272 TP_ARGS(ip, cur, state, caller_ip))
273 DEFINE_BMAP_EVENT(xfs_iext_insert);
274 DEFINE_BMAP_EVENT(xfs_iext_remove);
275 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
276 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
277 DEFINE_BMAP_EVENT(xfs_read_extent);
278 DEFINE_BMAP_EVENT(xfs_write_extent);
280 DECLARE_EVENT_CLASS(xfs_buf_class,
281 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
282 TP_ARGS(bp, caller_ip),
285 __field(xfs_daddr_t, bno)
288 __field(int, pincount)
289 __field(unsigned, lockval)
290 __field(unsigned, flags)
291 __field(unsigned long, caller_ip)
294 __entry->dev = bp->b_target->bt_dev;
295 __entry->bno = bp->b_bn;
296 __entry->nblks = bp->b_length;
297 __entry->hold = atomic_read(&bp->b_hold);
298 __entry->pincount = atomic_read(&bp->b_pin_count);
299 __entry->lockval = bp->b_sema.count;
300 __entry->flags = bp->b_flags;
301 __entry->caller_ip = caller_ip;
303 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
304 "lock %d flags %s caller %pS",
305 MAJOR(__entry->dev), MINOR(__entry->dev),
306 (unsigned long long)__entry->bno,
311 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
312 (void *)__entry->caller_ip)
315 #define DEFINE_BUF_EVENT(name) \
316 DEFINE_EVENT(xfs_buf_class, name, \
317 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
318 TP_ARGS(bp, caller_ip))
319 DEFINE_BUF_EVENT(xfs_buf_init);
320 DEFINE_BUF_EVENT(xfs_buf_free);
321 DEFINE_BUF_EVENT(xfs_buf_hold);
322 DEFINE_BUF_EVENT(xfs_buf_rele);
323 DEFINE_BUF_EVENT(xfs_buf_iodone);
324 DEFINE_BUF_EVENT(xfs_buf_submit);
325 DEFINE_BUF_EVENT(xfs_buf_submit_wait);
326 DEFINE_BUF_EVENT(xfs_buf_lock);
327 DEFINE_BUF_EVENT(xfs_buf_lock_done);
328 DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
329 DEFINE_BUF_EVENT(xfs_buf_trylock);
330 DEFINE_BUF_EVENT(xfs_buf_unlock);
331 DEFINE_BUF_EVENT(xfs_buf_iowait);
332 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
333 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
334 DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
335 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
336 DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
337 DEFINE_BUF_EVENT(xfs_buf_get_uncached);
338 DEFINE_BUF_EVENT(xfs_buf_item_relse);
339 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
340 DEFINE_BUF_EVENT(xfs_buf_error_relse);
341 DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
342 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
344 /* not really buffer traces, but the buf provides useful information */
345 DEFINE_BUF_EVENT(xfs_btree_corrupt);
346 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
348 /* pass flags explicitly */
349 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
350 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
351 TP_ARGS(bp, flags, caller_ip),
354 __field(xfs_daddr_t, bno)
355 __field(size_t, buffer_length)
357 __field(int, pincount)
358 __field(unsigned, lockval)
359 __field(unsigned, flags)
360 __field(unsigned long, caller_ip)
363 __entry->dev = bp->b_target->bt_dev;
364 __entry->bno = bp->b_bn;
365 __entry->buffer_length = BBTOB(bp->b_length);
366 __entry->flags = flags;
367 __entry->hold = atomic_read(&bp->b_hold);
368 __entry->pincount = atomic_read(&bp->b_pin_count);
369 __entry->lockval = bp->b_sema.count;
370 __entry->caller_ip = caller_ip;
372 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
373 "lock %d flags %s caller %pS",
374 MAJOR(__entry->dev), MINOR(__entry->dev),
375 (unsigned long long)__entry->bno,
376 __entry->buffer_length,
380 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
381 (void *)__entry->caller_ip)
384 #define DEFINE_BUF_FLAGS_EVENT(name) \
385 DEFINE_EVENT(xfs_buf_flags_class, name, \
386 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
387 TP_ARGS(bp, flags, caller_ip))
388 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
389 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
390 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
392 TRACE_EVENT(xfs_buf_ioerror,
393 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
394 TP_ARGS(bp, error, caller_ip),
397 __field(xfs_daddr_t, bno)
398 __field(size_t, buffer_length)
399 __field(unsigned, flags)
401 __field(int, pincount)
402 __field(unsigned, lockval)
404 __field(xfs_failaddr_t, caller_ip)
407 __entry->dev = bp->b_target->bt_dev;
408 __entry->bno = bp->b_bn;
409 __entry->buffer_length = BBTOB(bp->b_length);
410 __entry->hold = atomic_read(&bp->b_hold);
411 __entry->pincount = atomic_read(&bp->b_pin_count);
412 __entry->lockval = bp->b_sema.count;
413 __entry->error = error;
414 __entry->flags = bp->b_flags;
415 __entry->caller_ip = caller_ip;
417 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
418 "lock %d error %d flags %s caller %pS",
419 MAJOR(__entry->dev), MINOR(__entry->dev),
420 (unsigned long long)__entry->bno,
421 __entry->buffer_length,
426 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
427 (void *)__entry->caller_ip)
430 DECLARE_EVENT_CLASS(xfs_buf_item_class,
431 TP_PROTO(struct xfs_buf_log_item *bip),
435 __field(xfs_daddr_t, buf_bno)
436 __field(size_t, buf_len)
437 __field(int, buf_hold)
438 __field(int, buf_pincount)
439 __field(int, buf_lockval)
440 __field(unsigned, buf_flags)
441 __field(unsigned, bli_recur)
442 __field(int, bli_refcount)
443 __field(unsigned, bli_flags)
444 __field(unsigned long, li_flags)
447 __entry->dev = bip->bli_buf->b_target->bt_dev;
448 __entry->bli_flags = bip->bli_flags;
449 __entry->bli_recur = bip->bli_recur;
450 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
451 __entry->buf_bno = bip->bli_buf->b_bn;
452 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
453 __entry->buf_flags = bip->bli_buf->b_flags;
454 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
455 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
456 __entry->buf_lockval = bip->bli_buf->b_sema.count;
457 __entry->li_flags = bip->bli_item.li_flags;
459 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
460 "lock %d flags %s recur %d refcount %d bliflags %s "
462 MAJOR(__entry->dev), MINOR(__entry->dev),
463 (unsigned long long)__entry->buf_bno,
466 __entry->buf_pincount,
467 __entry->buf_lockval,
468 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
470 __entry->bli_refcount,
471 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
472 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
475 #define DEFINE_BUF_ITEM_EVENT(name) \
476 DEFINE_EVENT(xfs_buf_item_class, name, \
477 TP_PROTO(struct xfs_buf_log_item *bip), \
479 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
480 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
481 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
482 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
483 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
484 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
485 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
486 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
487 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
488 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
489 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
490 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
491 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
492 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
493 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
494 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
495 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
496 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
497 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
498 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
499 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
500 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
501 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
502 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
503 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
505 DECLARE_EVENT_CLASS(xfs_filestream_class,
506 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno),
507 TP_ARGS(mp, ino, agno),
510 __field(xfs_ino_t, ino)
511 __field(xfs_agnumber_t, agno)
512 __field(int, streams)
515 __entry->dev = mp->m_super->s_dev;
517 __entry->agno = agno;
518 __entry->streams = xfs_filestream_peek_ag(mp, agno);
520 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
521 MAJOR(__entry->dev), MINOR(__entry->dev),
526 #define DEFINE_FILESTREAM_EVENT(name) \
527 DEFINE_EVENT(xfs_filestream_class, name, \
528 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \
529 TP_ARGS(mp, ino, agno))
530 DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
531 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
532 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
534 TRACE_EVENT(xfs_filestream_pick,
535 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
536 xfs_extlen_t free, int nscan),
537 TP_ARGS(ip, agno, free, nscan),
540 __field(xfs_ino_t, ino)
541 __field(xfs_agnumber_t, agno)
542 __field(int, streams)
543 __field(xfs_extlen_t, free)
547 __entry->dev = VFS_I(ip)->i_sb->s_dev;
548 __entry->ino = ip->i_ino;
549 __entry->agno = agno;
550 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
551 __entry->free = free;
552 __entry->nscan = nscan;
554 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
555 MAJOR(__entry->dev), MINOR(__entry->dev),
563 DECLARE_EVENT_CLASS(xfs_lock_class,
564 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
565 unsigned long caller_ip),
566 TP_ARGS(ip, lock_flags, caller_ip),
569 __field(xfs_ino_t, ino)
570 __field(int, lock_flags)
571 __field(unsigned long, caller_ip)
574 __entry->dev = VFS_I(ip)->i_sb->s_dev;
575 __entry->ino = ip->i_ino;
576 __entry->lock_flags = lock_flags;
577 __entry->caller_ip = caller_ip;
579 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
580 MAJOR(__entry->dev), MINOR(__entry->dev),
582 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
583 (void *)__entry->caller_ip)
586 #define DEFINE_LOCK_EVENT(name) \
587 DEFINE_EVENT(xfs_lock_class, name, \
588 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
589 unsigned long caller_ip), \
590 TP_ARGS(ip, lock_flags, caller_ip))
591 DEFINE_LOCK_EVENT(xfs_ilock);
592 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
593 DEFINE_LOCK_EVENT(xfs_ilock_demote);
594 DEFINE_LOCK_EVENT(xfs_iunlock);
596 DECLARE_EVENT_CLASS(xfs_inode_class,
597 TP_PROTO(struct xfs_inode *ip),
601 __field(xfs_ino_t, ino)
604 __entry->dev = VFS_I(ip)->i_sb->s_dev;
605 __entry->ino = ip->i_ino;
607 TP_printk("dev %d:%d ino 0x%llx",
608 MAJOR(__entry->dev), MINOR(__entry->dev),
612 #define DEFINE_INODE_EVENT(name) \
613 DEFINE_EVENT(xfs_inode_class, name, \
614 TP_PROTO(struct xfs_inode *ip), \
616 DEFINE_INODE_EVENT(xfs_iget_skip);
617 DEFINE_INODE_EVENT(xfs_iget_reclaim);
618 DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
619 DEFINE_INODE_EVENT(xfs_iget_hit);
620 DEFINE_INODE_EVENT(xfs_iget_miss);
622 DEFINE_INODE_EVENT(xfs_getattr);
623 DEFINE_INODE_EVENT(xfs_setattr);
624 DEFINE_INODE_EVENT(xfs_readlink);
625 DEFINE_INODE_EVENT(xfs_inactive_symlink);
626 DEFINE_INODE_EVENT(xfs_alloc_file_space);
627 DEFINE_INODE_EVENT(xfs_free_file_space);
628 DEFINE_INODE_EVENT(xfs_zero_file_space);
629 DEFINE_INODE_EVENT(xfs_collapse_file_space);
630 DEFINE_INODE_EVENT(xfs_insert_file_space);
631 DEFINE_INODE_EVENT(xfs_readdir);
632 #ifdef CONFIG_XFS_POSIX_ACL
633 DEFINE_INODE_EVENT(xfs_get_acl);
635 DEFINE_INODE_EVENT(xfs_vm_bmap);
636 DEFINE_INODE_EVENT(xfs_file_ioctl);
637 DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
638 DEFINE_INODE_EVENT(xfs_ioctl_setattr);
639 DEFINE_INODE_EVENT(xfs_dir_fsync);
640 DEFINE_INODE_EVENT(xfs_file_fsync);
641 DEFINE_INODE_EVENT(xfs_destroy_inode);
642 DEFINE_INODE_EVENT(xfs_update_time);
644 DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
645 DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
647 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
648 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
649 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
650 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
651 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
652 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
654 TRACE_EVENT(xfs_filemap_fault,
655 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
657 TP_ARGS(ip, pe_size, write_fault),
660 __field(xfs_ino_t, ino)
661 __field(enum page_entry_size, pe_size)
662 __field(bool, write_fault)
665 __entry->dev = VFS_I(ip)->i_sb->s_dev;
666 __entry->ino = ip->i_ino;
667 __entry->pe_size = pe_size;
668 __entry->write_fault = write_fault;
670 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
671 MAJOR(__entry->dev), MINOR(__entry->dev),
673 __print_symbolic(__entry->pe_size,
674 { PE_SIZE_PTE, "PTE" },
675 { PE_SIZE_PMD, "PMD" },
676 { PE_SIZE_PUD, "PUD" }),
677 __entry->write_fault)
680 DECLARE_EVENT_CLASS(xfs_iref_class,
681 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
682 TP_ARGS(ip, caller_ip),
685 __field(xfs_ino_t, ino)
687 __field(int, pincount)
688 __field(unsigned long, caller_ip)
691 __entry->dev = VFS_I(ip)->i_sb->s_dev;
692 __entry->ino = ip->i_ino;
693 __entry->count = atomic_read(&VFS_I(ip)->i_count);
694 __entry->pincount = atomic_read(&ip->i_pincount);
695 __entry->caller_ip = caller_ip;
697 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
698 MAJOR(__entry->dev), MINOR(__entry->dev),
702 (char *)__entry->caller_ip)
705 TRACE_EVENT(xfs_iomap_prealloc_size,
706 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
707 unsigned int writeio_blocks),
708 TP_ARGS(ip, blocks, shift, writeio_blocks),
711 __field(xfs_ino_t, ino)
712 __field(xfs_fsblock_t, blocks)
714 __field(unsigned int, writeio_blocks)
717 __entry->dev = VFS_I(ip)->i_sb->s_dev;
718 __entry->ino = ip->i_ino;
719 __entry->blocks = blocks;
720 __entry->shift = shift;
721 __entry->writeio_blocks = writeio_blocks;
723 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
724 "m_writeio_blocks %u",
725 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
726 __entry->blocks, __entry->shift, __entry->writeio_blocks)
729 TRACE_EVENT(xfs_irec_merge_pre,
730 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
731 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
732 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
735 __field(xfs_agnumber_t, agno)
736 __field(xfs_agino_t, agino)
737 __field(uint16_t, holemask)
738 __field(xfs_agino_t, nagino)
739 __field(uint16_t, nholemask)
742 __entry->dev = mp->m_super->s_dev;
743 __entry->agno = agno;
744 __entry->agino = agino;
745 __entry->holemask = holemask;
746 __entry->nagino = nagino;
747 __entry->nholemask = holemask;
749 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
750 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
751 __entry->agino, __entry->holemask, __entry->nagino,
755 TRACE_EVENT(xfs_irec_merge_post,
756 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
758 TP_ARGS(mp, agno, agino, holemask),
761 __field(xfs_agnumber_t, agno)
762 __field(xfs_agino_t, agino)
763 __field(uint16_t, holemask)
766 __entry->dev = mp->m_super->s_dev;
767 __entry->agno = agno;
768 __entry->agino = agino;
769 __entry->holemask = holemask;
771 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
772 MINOR(__entry->dev), __entry->agno, __entry->agino,
776 #define DEFINE_IREF_EVENT(name) \
777 DEFINE_EVENT(xfs_iref_class, name, \
778 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
779 TP_ARGS(ip, caller_ip))
780 DEFINE_IREF_EVENT(xfs_irele);
781 DEFINE_IREF_EVENT(xfs_inode_pin);
782 DEFINE_IREF_EVENT(xfs_inode_unpin);
783 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
785 DECLARE_EVENT_CLASS(xfs_namespace_class,
786 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
790 __field(xfs_ino_t, dp_ino)
791 __field(int, namelen)
792 __dynamic_array(char, name, name->len)
795 __entry->dev = VFS_I(dp)->i_sb->s_dev;
796 __entry->dp_ino = dp->i_ino;
797 __entry->namelen = name->len;
798 memcpy(__get_str(name), name->name, name->len);
800 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
801 MAJOR(__entry->dev), MINOR(__entry->dev),
807 #define DEFINE_NAMESPACE_EVENT(name) \
808 DEFINE_EVENT(xfs_namespace_class, name, \
809 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
811 DEFINE_NAMESPACE_EVENT(xfs_remove);
812 DEFINE_NAMESPACE_EVENT(xfs_link);
813 DEFINE_NAMESPACE_EVENT(xfs_lookup);
814 DEFINE_NAMESPACE_EVENT(xfs_create);
815 DEFINE_NAMESPACE_EVENT(xfs_symlink);
817 TRACE_EVENT(xfs_rename,
818 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
819 struct xfs_name *src_name, struct xfs_name *target_name),
820 TP_ARGS(src_dp, target_dp, src_name, target_name),
823 __field(xfs_ino_t, src_dp_ino)
824 __field(xfs_ino_t, target_dp_ino)
825 __field(int, src_namelen)
826 __field(int, target_namelen)
827 __dynamic_array(char, src_name, src_name->len)
828 __dynamic_array(char, target_name, target_name->len)
831 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
832 __entry->src_dp_ino = src_dp->i_ino;
833 __entry->target_dp_ino = target_dp->i_ino;
834 __entry->src_namelen = src_name->len;
835 __entry->target_namelen = target_name->len;
836 memcpy(__get_str(src_name), src_name->name, src_name->len);
837 memcpy(__get_str(target_name), target_name->name,
840 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
841 " src name %.*s target name %.*s",
842 MAJOR(__entry->dev), MINOR(__entry->dev),
844 __entry->target_dp_ino,
845 __entry->src_namelen,
847 __entry->target_namelen,
848 __get_str(target_name))
851 DECLARE_EVENT_CLASS(xfs_dquot_class,
852 TP_PROTO(struct xfs_dquot *dqp),
857 __field(unsigned, flags)
858 __field(unsigned, nrefs)
859 __field(unsigned long long, res_bcount)
860 __field(unsigned long long, bcount)
861 __field(unsigned long long, icount)
862 __field(unsigned long long, blk_hardlimit)
863 __field(unsigned long long, blk_softlimit)
864 __field(unsigned long long, ino_hardlimit)
865 __field(unsigned long long, ino_softlimit)
868 __entry->dev = dqp->q_mount->m_super->s_dev;
869 __entry->id = be32_to_cpu(dqp->q_core.d_id);
870 __entry->flags = dqp->dq_flags;
871 __entry->nrefs = dqp->q_nrefs;
872 __entry->res_bcount = dqp->q_res_bcount;
873 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
874 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
875 __entry->blk_hardlimit =
876 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
877 __entry->blk_softlimit =
878 be64_to_cpu(dqp->q_core.d_blk_softlimit);
879 __entry->ino_hardlimit =
880 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
881 __entry->ino_softlimit =
882 be64_to_cpu(dqp->q_core.d_ino_softlimit);
884 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
885 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
886 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
887 MAJOR(__entry->dev), MINOR(__entry->dev),
889 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
893 __entry->blk_hardlimit,
894 __entry->blk_softlimit,
896 __entry->ino_hardlimit,
897 __entry->ino_softlimit)
900 #define DEFINE_DQUOT_EVENT(name) \
901 DEFINE_EVENT(xfs_dquot_class, name, \
902 TP_PROTO(struct xfs_dquot *dqp), \
904 DEFINE_DQUOT_EVENT(xfs_dqadjust);
905 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
906 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
907 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
908 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
909 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
910 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
911 DEFINE_DQUOT_EVENT(xfs_dqalloc);
912 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
913 DEFINE_DQUOT_EVENT(xfs_dqread);
914 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
915 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
916 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
917 DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
918 DEFINE_DQUOT_EVENT(xfs_dqget_dup);
919 DEFINE_DQUOT_EVENT(xfs_dqput);
920 DEFINE_DQUOT_EVENT(xfs_dqput_free);
921 DEFINE_DQUOT_EVENT(xfs_dqrele);
922 DEFINE_DQUOT_EVENT(xfs_dqflush);
923 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
924 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
926 DECLARE_EVENT_CLASS(xfs_loggrant_class,
927 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
933 __field(int, curr_res)
934 __field(int, unit_res)
935 __field(unsigned int, flags)
936 __field(int, reserveq)
938 __field(int, grant_reserve_cycle)
939 __field(int, grant_reserve_bytes)
940 __field(int, grant_write_cycle)
941 __field(int, grant_write_bytes)
942 __field(int, curr_cycle)
943 __field(int, curr_block)
944 __field(xfs_lsn_t, tail_lsn)
947 __entry->dev = log->l_mp->m_super->s_dev;
948 __entry->ocnt = tic->t_ocnt;
949 __entry->cnt = tic->t_cnt;
950 __entry->curr_res = tic->t_curr_res;
951 __entry->unit_res = tic->t_unit_res;
952 __entry->flags = tic->t_flags;
953 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
954 __entry->writeq = list_empty(&log->l_write_head.waiters);
955 xlog_crack_grant_head(&log->l_reserve_head.grant,
956 &__entry->grant_reserve_cycle,
957 &__entry->grant_reserve_bytes);
958 xlog_crack_grant_head(&log->l_write_head.grant,
959 &__entry->grant_write_cycle,
960 &__entry->grant_write_bytes);
961 __entry->curr_cycle = log->l_curr_cycle;
962 __entry->curr_block = log->l_curr_block;
963 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
965 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
966 "t_unit_res %u t_flags %s reserveq %s "
967 "writeq %s grant_reserve_cycle %d "
968 "grant_reserve_bytes %d grant_write_cycle %d "
969 "grant_write_bytes %d curr_cycle %d curr_block %d "
970 "tail_cycle %d tail_block %d",
971 MAJOR(__entry->dev), MINOR(__entry->dev),
976 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
977 __entry->reserveq ? "empty" : "active",
978 __entry->writeq ? "empty" : "active",
979 __entry->grant_reserve_cycle,
980 __entry->grant_reserve_bytes,
981 __entry->grant_write_cycle,
982 __entry->grant_write_bytes,
985 CYCLE_LSN(__entry->tail_lsn),
986 BLOCK_LSN(__entry->tail_lsn)
990 #define DEFINE_LOGGRANT_EVENT(name) \
991 DEFINE_EVENT(xfs_loggrant_class, name, \
992 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
994 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
995 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
996 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
997 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
998 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
999 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1000 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1001 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1002 DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1003 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1004 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1005 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1006 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1007 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1008 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1009 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1011 DECLARE_EVENT_CLASS(xfs_log_item_class,
1012 TP_PROTO(struct xfs_log_item *lip),
1016 __field(void *, lip)
1018 __field(unsigned long, flags)
1019 __field(xfs_lsn_t, lsn)
1022 __entry->dev = lip->li_mountp->m_super->s_dev;
1024 __entry->type = lip->li_type;
1025 __entry->flags = lip->li_flags;
1026 __entry->lsn = lip->li_lsn;
1028 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
1029 MAJOR(__entry->dev), MINOR(__entry->dev),
1031 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1032 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1033 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1036 TRACE_EVENT(xfs_log_force,
1037 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1038 TP_ARGS(mp, lsn, caller_ip),
1041 __field(xfs_lsn_t, lsn)
1042 __field(unsigned long, caller_ip)
1045 __entry->dev = mp->m_super->s_dev;
1047 __entry->caller_ip = caller_ip;
1049 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
1050 MAJOR(__entry->dev), MINOR(__entry->dev),
1051 __entry->lsn, (void *)__entry->caller_ip)
1054 #define DEFINE_LOG_ITEM_EVENT(name) \
1055 DEFINE_EVENT(xfs_log_item_class, name, \
1056 TP_PROTO(struct xfs_log_item *lip), \
1058 DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1059 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1060 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1061 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1063 DECLARE_EVENT_CLASS(xfs_ail_class,
1064 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1065 TP_ARGS(lip, old_lsn, new_lsn),
1068 __field(void *, lip)
1070 __field(unsigned long, flags)
1071 __field(xfs_lsn_t, old_lsn)
1072 __field(xfs_lsn_t, new_lsn)
1075 __entry->dev = lip->li_mountp->m_super->s_dev;
1077 __entry->type = lip->li_type;
1078 __entry->flags = lip->li_flags;
1079 __entry->old_lsn = old_lsn;
1080 __entry->new_lsn = new_lsn;
1082 TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s",
1083 MAJOR(__entry->dev), MINOR(__entry->dev),
1085 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1086 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1087 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1088 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1091 #define DEFINE_AIL_EVENT(name) \
1092 DEFINE_EVENT(xfs_ail_class, name, \
1093 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1094 TP_ARGS(lip, old_lsn, new_lsn))
1095 DEFINE_AIL_EVENT(xfs_ail_insert);
1096 DEFINE_AIL_EVENT(xfs_ail_move);
1097 DEFINE_AIL_EVENT(xfs_ail_delete);
1099 TRACE_EVENT(xfs_log_assign_tail_lsn,
1100 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1101 TP_ARGS(log, new_lsn),
1104 __field(xfs_lsn_t, new_lsn)
1105 __field(xfs_lsn_t, old_lsn)
1106 __field(xfs_lsn_t, last_sync_lsn)
1109 __entry->dev = log->l_mp->m_super->s_dev;
1110 __entry->new_lsn = new_lsn;
1111 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1112 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1114 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1115 MAJOR(__entry->dev), MINOR(__entry->dev),
1116 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1117 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1118 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1121 DECLARE_EVENT_CLASS(xfs_file_class,
1122 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1123 TP_ARGS(ip, count, offset),
1126 __field(xfs_ino_t, ino)
1127 __field(xfs_fsize_t, size)
1128 __field(loff_t, offset)
1129 __field(size_t, count)
1132 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1133 __entry->ino = ip->i_ino;
1134 __entry->size = ip->i_d.di_size;
1135 __entry->offset = offset;
1136 __entry->count = count;
1138 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
1139 MAJOR(__entry->dev), MINOR(__entry->dev),
1146 #define DEFINE_RW_EVENT(name) \
1147 DEFINE_EVENT(xfs_file_class, name, \
1148 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1149 TP_ARGS(ip, count, offset))
1150 DEFINE_RW_EVENT(xfs_file_buffered_read);
1151 DEFINE_RW_EVENT(xfs_file_direct_read);
1152 DEFINE_RW_EVENT(xfs_file_dax_read);
1153 DEFINE_RW_EVENT(xfs_file_buffered_write);
1154 DEFINE_RW_EVENT(xfs_file_direct_write);
1155 DEFINE_RW_EVENT(xfs_file_dax_write);
1157 DECLARE_EVENT_CLASS(xfs_page_class,
1158 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1160 TP_ARGS(inode, page, off, len),
1163 __field(xfs_ino_t, ino)
1164 __field(pgoff_t, pgoff)
1165 __field(loff_t, size)
1166 __field(unsigned long, offset)
1167 __field(unsigned int, length)
1168 __field(int, delalloc)
1169 __field(int, unwritten)
1172 int delalloc = -1, unwritten = -1;
1174 if (page_has_buffers(page))
1175 xfs_count_page_state(page, &delalloc, &unwritten);
1176 __entry->dev = inode->i_sb->s_dev;
1177 __entry->ino = XFS_I(inode)->i_ino;
1178 __entry->pgoff = page_offset(page);
1179 __entry->size = i_size_read(inode);
1180 __entry->offset = off;
1181 __entry->length = len;
1182 __entry->delalloc = delalloc;
1183 __entry->unwritten = unwritten;
1185 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
1186 "length %x delalloc %d unwritten %d",
1187 MAJOR(__entry->dev), MINOR(__entry->dev),
1197 #define DEFINE_PAGE_EVENT(name) \
1198 DEFINE_EVENT(xfs_page_class, name, \
1199 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1200 unsigned int len), \
1201 TP_ARGS(inode, page, off, len))
1202 DEFINE_PAGE_EVENT(xfs_writepage);
1203 DEFINE_PAGE_EVENT(xfs_releasepage);
1204 DEFINE_PAGE_EVENT(xfs_invalidatepage);
1206 DECLARE_EVENT_CLASS(xfs_readpage_class,
1207 TP_PROTO(struct inode *inode, int nr_pages),
1208 TP_ARGS(inode, nr_pages),
1211 __field(xfs_ino_t, ino)
1212 __field(int, nr_pages)
1215 __entry->dev = inode->i_sb->s_dev;
1216 __entry->ino = inode->i_ino;
1217 __entry->nr_pages = nr_pages;
1219 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1220 MAJOR(__entry->dev), MINOR(__entry->dev),
1225 #define DEFINE_READPAGE_EVENT(name) \
1226 DEFINE_EVENT(xfs_readpage_class, name, \
1227 TP_PROTO(struct inode *inode, int nr_pages), \
1228 TP_ARGS(inode, nr_pages))
1229 DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1230 DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1232 DECLARE_EVENT_CLASS(xfs_imap_class,
1233 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1234 int type, struct xfs_bmbt_irec *irec),
1235 TP_ARGS(ip, offset, count, type, irec),
1238 __field(xfs_ino_t, ino)
1239 __field(loff_t, size)
1240 __field(loff_t, offset)
1241 __field(size_t, count)
1243 __field(xfs_fileoff_t, startoff)
1244 __field(xfs_fsblock_t, startblock)
1245 __field(xfs_filblks_t, blockcount)
1248 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1249 __entry->ino = ip->i_ino;
1250 __entry->size = ip->i_d.di_size;
1251 __entry->offset = offset;
1252 __entry->count = count;
1253 __entry->type = type;
1254 __entry->startoff = irec ? irec->br_startoff : 0;
1255 __entry->startblock = irec ? irec->br_startblock : 0;
1256 __entry->blockcount = irec ? irec->br_blockcount : 0;
1258 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1259 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
1260 MAJOR(__entry->dev), MINOR(__entry->dev),
1265 __print_symbolic(__entry->type, XFS_IO_TYPES),
1267 (int64_t)__entry->startblock,
1268 __entry->blockcount)
1271 #define DEFINE_IOMAP_EVENT(name) \
1272 DEFINE_EVENT(xfs_imap_class, name, \
1273 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1274 int type, struct xfs_bmbt_irec *irec), \
1275 TP_ARGS(ip, offset, count, type, irec))
1276 DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1277 DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1278 DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1279 DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
1280 DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
1281 DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
1282 DEFINE_IOMAP_EVENT(xfs_iomap_found);
1284 DECLARE_EVENT_CLASS(xfs_simple_io_class,
1285 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1286 TP_ARGS(ip, offset, count),
1289 __field(xfs_ino_t, ino)
1290 __field(loff_t, isize)
1291 __field(loff_t, disize)
1292 __field(loff_t, offset)
1293 __field(size_t, count)
1296 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1297 __entry->ino = ip->i_ino;
1298 __entry->isize = VFS_I(ip)->i_size;
1299 __entry->disize = ip->i_d.di_size;
1300 __entry->offset = offset;
1301 __entry->count = count;
1303 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1304 "offset 0x%llx count %zd",
1305 MAJOR(__entry->dev), MINOR(__entry->dev),
1313 #define DEFINE_SIMPLE_IO_EVENT(name) \
1314 DEFINE_EVENT(xfs_simple_io_class, name, \
1315 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1316 TP_ARGS(ip, offset, count))
1317 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1318 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1319 DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
1320 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1321 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1322 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1323 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1324 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1326 DECLARE_EVENT_CLASS(xfs_itrunc_class,
1327 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1328 TP_ARGS(ip, new_size),
1331 __field(xfs_ino_t, ino)
1332 __field(xfs_fsize_t, size)
1333 __field(xfs_fsize_t, new_size)
1336 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1337 __entry->ino = ip->i_ino;
1338 __entry->size = ip->i_d.di_size;
1339 __entry->new_size = new_size;
1341 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1342 MAJOR(__entry->dev), MINOR(__entry->dev),
1348 #define DEFINE_ITRUNC_EVENT(name) \
1349 DEFINE_EVENT(xfs_itrunc_class, name, \
1350 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1351 TP_ARGS(ip, new_size))
1352 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1353 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1355 TRACE_EVENT(xfs_pagecache_inval,
1356 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1357 TP_ARGS(ip, start, finish),
1360 __field(xfs_ino_t, ino)
1361 __field(xfs_fsize_t, size)
1362 __field(xfs_off_t, start)
1363 __field(xfs_off_t, finish)
1366 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1367 __entry->ino = ip->i_ino;
1368 __entry->size = ip->i_d.di_size;
1369 __entry->start = start;
1370 __entry->finish = finish;
1372 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1373 MAJOR(__entry->dev), MINOR(__entry->dev),
1380 TRACE_EVENT(xfs_bunmap,
1381 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1382 int flags, unsigned long caller_ip),
1383 TP_ARGS(ip, bno, len, flags, caller_ip),
1386 __field(xfs_ino_t, ino)
1387 __field(xfs_fsize_t, size)
1388 __field(xfs_fileoff_t, bno)
1389 __field(xfs_filblks_t, len)
1390 __field(unsigned long, caller_ip)
1394 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1395 __entry->ino = ip->i_ino;
1396 __entry->size = ip->i_d.di_size;
1399 __entry->caller_ip = caller_ip;
1400 __entry->flags = flags;
1402 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1403 "flags %s caller %pS",
1404 MAJOR(__entry->dev), MINOR(__entry->dev),
1409 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1410 (void *)__entry->caller_ip)
1414 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1415 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1416 xfs_agblock_t agbno, xfs_extlen_t len),
1417 TP_ARGS(mp, agno, agbno, len),
1420 __field(xfs_agnumber_t, agno)
1421 __field(xfs_agblock_t, agbno)
1422 __field(xfs_extlen_t, len)
1425 __entry->dev = mp->m_super->s_dev;
1426 __entry->agno = agno;
1427 __entry->agbno = agbno;
1430 TP_printk("dev %d:%d agno %u agbno %u len %u",
1431 MAJOR(__entry->dev), MINOR(__entry->dev),
1436 #define DEFINE_BUSY_EVENT(name) \
1437 DEFINE_EVENT(xfs_extent_busy_class, name, \
1438 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1439 xfs_agblock_t agbno, xfs_extlen_t len), \
1440 TP_ARGS(mp, agno, agbno, len))
1441 DEFINE_BUSY_EVENT(xfs_extent_busy);
1442 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1443 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1444 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1445 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1447 TRACE_EVENT(xfs_extent_busy_trim,
1448 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1449 xfs_agblock_t agbno, xfs_extlen_t len,
1450 xfs_agblock_t tbno, xfs_extlen_t tlen),
1451 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1454 __field(xfs_agnumber_t, agno)
1455 __field(xfs_agblock_t, agbno)
1456 __field(xfs_extlen_t, len)
1457 __field(xfs_agblock_t, tbno)
1458 __field(xfs_extlen_t, tlen)
1461 __entry->dev = mp->m_super->s_dev;
1462 __entry->agno = agno;
1463 __entry->agbno = agbno;
1465 __entry->tbno = tbno;
1466 __entry->tlen = tlen;
1468 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1469 MAJOR(__entry->dev), MINOR(__entry->dev),
1477 DECLARE_EVENT_CLASS(xfs_agf_class,
1478 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1479 unsigned long caller_ip),
1480 TP_ARGS(mp, agf, flags, caller_ip),
1483 __field(xfs_agnumber_t, agno)
1485 __field(__u32, length)
1486 __field(__u32, bno_root)
1487 __field(__u32, cnt_root)
1488 __field(__u32, bno_level)
1489 __field(__u32, cnt_level)
1490 __field(__u32, flfirst)
1491 __field(__u32, fllast)
1492 __field(__u32, flcount)
1493 __field(__u32, freeblks)
1494 __field(__u32, longest)
1495 __field(unsigned long, caller_ip)
1498 __entry->dev = mp->m_super->s_dev;
1499 __entry->agno = be32_to_cpu(agf->agf_seqno),
1500 __entry->flags = flags;
1501 __entry->length = be32_to_cpu(agf->agf_length),
1502 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1503 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1504 __entry->bno_level =
1505 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1506 __entry->cnt_level =
1507 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1508 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1509 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1510 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1511 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1512 __entry->longest = be32_to_cpu(agf->agf_longest);
1513 __entry->caller_ip = caller_ip;
1515 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1516 "levels b %u c %u flfirst %u fllast %u flcount %u "
1517 "freeblks %u longest %u caller %pS",
1518 MAJOR(__entry->dev), MINOR(__entry->dev),
1520 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1531 (void *)__entry->caller_ip)
1533 #define DEFINE_AGF_EVENT(name) \
1534 DEFINE_EVENT(xfs_agf_class, name, \
1535 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1536 unsigned long caller_ip), \
1537 TP_ARGS(mp, agf, flags, caller_ip))
1538 DEFINE_AGF_EVENT(xfs_agf);
1539 DEFINE_AGF_EVENT(xfs_agfl_reset);
1541 TRACE_EVENT(xfs_free_extent,
1542 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1543 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1545 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
1548 __field(xfs_agnumber_t, agno)
1549 __field(xfs_agblock_t, agbno)
1550 __field(xfs_extlen_t, len)
1552 __field(int, haveleft)
1553 __field(int, haveright)
1556 __entry->dev = mp->m_super->s_dev;
1557 __entry->agno = agno;
1558 __entry->agbno = agbno;
1560 __entry->resv = resv;
1561 __entry->haveleft = haveleft;
1562 __entry->haveright = haveright;
1564 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
1565 MAJOR(__entry->dev), MINOR(__entry->dev),
1571 (__entry->haveright ? "both" : "left") :
1572 (__entry->haveright ? "right" : "none"))
1576 DECLARE_EVENT_CLASS(xfs_alloc_class,
1577 TP_PROTO(struct xfs_alloc_arg *args),
1581 __field(xfs_agnumber_t, agno)
1582 __field(xfs_agblock_t, agbno)
1583 __field(xfs_extlen_t, minlen)
1584 __field(xfs_extlen_t, maxlen)
1585 __field(xfs_extlen_t, mod)
1586 __field(xfs_extlen_t, prod)
1587 __field(xfs_extlen_t, minleft)
1588 __field(xfs_extlen_t, total)
1589 __field(xfs_extlen_t, alignment)
1590 __field(xfs_extlen_t, minalignslop)
1591 __field(xfs_extlen_t, len)
1592 __field(short, type)
1593 __field(short, otype)
1594 __field(char, wasdel)
1595 __field(char, wasfromfl)
1597 __field(int, datatype)
1598 __field(xfs_fsblock_t, firstblock)
1601 __entry->dev = args->mp->m_super->s_dev;
1602 __entry->agno = args->agno;
1603 __entry->agbno = args->agbno;
1604 __entry->minlen = args->minlen;
1605 __entry->maxlen = args->maxlen;
1606 __entry->mod = args->mod;
1607 __entry->prod = args->prod;
1608 __entry->minleft = args->minleft;
1609 __entry->total = args->total;
1610 __entry->alignment = args->alignment;
1611 __entry->minalignslop = args->minalignslop;
1612 __entry->len = args->len;
1613 __entry->type = args->type;
1614 __entry->otype = args->otype;
1615 __entry->wasdel = args->wasdel;
1616 __entry->wasfromfl = args->wasfromfl;
1617 __entry->resv = args->resv;
1618 __entry->datatype = args->datatype;
1619 __entry->firstblock = args->firstblock;
1621 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1622 "prod %u minleft %u total %u alignment %u minalignslop %u "
1623 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1624 "datatype 0x%x firstblock 0x%llx",
1625 MAJOR(__entry->dev), MINOR(__entry->dev),
1635 __entry->minalignslop,
1637 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1638 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1643 (unsigned long long)__entry->firstblock)
1646 #define DEFINE_ALLOC_EVENT(name) \
1647 DEFINE_EVENT(xfs_alloc_class, name, \
1648 TP_PROTO(struct xfs_alloc_arg *args), \
1650 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1651 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1652 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1653 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1654 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1655 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1656 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1657 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1658 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1659 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1660 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1661 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1662 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1663 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1664 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1665 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1666 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1667 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1668 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1669 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1670 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1671 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1672 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1673 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1674 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1676 DECLARE_EVENT_CLASS(xfs_da_class,
1677 TP_PROTO(struct xfs_da_args *args),
1681 __field(xfs_ino_t, ino)
1682 __dynamic_array(char, name, args->namelen)
1683 __field(int, namelen)
1684 __field(xfs_dahash_t, hashval)
1685 __field(xfs_ino_t, inumber)
1686 __field(int, op_flags)
1689 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1690 __entry->ino = args->dp->i_ino;
1692 memcpy(__get_str(name), args->name, args->namelen);
1693 __entry->namelen = args->namelen;
1694 __entry->hashval = args->hashval;
1695 __entry->inumber = args->inumber;
1696 __entry->op_flags = args->op_flags;
1698 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1699 "inumber 0x%llx op_flags %s",
1700 MAJOR(__entry->dev), MINOR(__entry->dev),
1703 __entry->namelen ? __get_str(name) : NULL,
1707 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1710 #define DEFINE_DIR2_EVENT(name) \
1711 DEFINE_EVENT(xfs_da_class, name, \
1712 TP_PROTO(struct xfs_da_args *args), \
1714 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1715 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1716 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1717 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1718 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1719 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1720 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1721 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1722 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1723 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1724 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1725 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1726 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1727 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1728 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1729 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1730 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1731 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1732 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1733 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1734 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1735 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1736 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1737 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1738 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1740 DECLARE_EVENT_CLASS(xfs_attr_class,
1741 TP_PROTO(struct xfs_da_args *args),
1745 __field(xfs_ino_t, ino)
1746 __dynamic_array(char, name, args->namelen)
1747 __field(int, namelen)
1748 __field(int, valuelen)
1749 __field(xfs_dahash_t, hashval)
1751 __field(int, op_flags)
1754 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1755 __entry->ino = args->dp->i_ino;
1757 memcpy(__get_str(name), args->name, args->namelen);
1758 __entry->namelen = args->namelen;
1759 __entry->valuelen = args->valuelen;
1760 __entry->hashval = args->hashval;
1761 __entry->flags = args->flags;
1762 __entry->op_flags = args->op_flags;
1764 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1765 "hashval 0x%x flags %s op_flags %s",
1766 MAJOR(__entry->dev), MINOR(__entry->dev),
1769 __entry->namelen ? __get_str(name) : NULL,
1773 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
1774 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1777 #define DEFINE_ATTR_EVENT(name) \
1778 DEFINE_EVENT(xfs_attr_class, name, \
1779 TP_PROTO(struct xfs_da_args *args), \
1781 DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1782 DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1783 DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1784 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1785 DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1786 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1788 DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1789 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1790 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
1791 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
1792 DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1793 DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
1794 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1795 DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
1796 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1797 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
1798 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
1799 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1800 DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1801 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1802 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1803 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1804 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1805 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1806 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1807 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1808 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1809 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
1810 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
1812 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
1813 DEFINE_ATTR_EVENT(xfs_attr_node_get);
1814 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1815 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1817 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1818 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1820 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1821 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1822 DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1824 #define DEFINE_DA_EVENT(name) \
1825 DEFINE_EVENT(xfs_da_class, name, \
1826 TP_PROTO(struct xfs_da_args *args), \
1828 DEFINE_DA_EVENT(xfs_da_split);
1829 DEFINE_DA_EVENT(xfs_da_join);
1830 DEFINE_DA_EVENT(xfs_da_link_before);
1831 DEFINE_DA_EVENT(xfs_da_link_after);
1832 DEFINE_DA_EVENT(xfs_da_unlink_back);
1833 DEFINE_DA_EVENT(xfs_da_unlink_forward);
1834 DEFINE_DA_EVENT(xfs_da_root_split);
1835 DEFINE_DA_EVENT(xfs_da_root_join);
1836 DEFINE_DA_EVENT(xfs_da_node_add);
1837 DEFINE_DA_EVENT(xfs_da_node_create);
1838 DEFINE_DA_EVENT(xfs_da_node_split);
1839 DEFINE_DA_EVENT(xfs_da_node_remove);
1840 DEFINE_DA_EVENT(xfs_da_node_rebalance);
1841 DEFINE_DA_EVENT(xfs_da_node_unbalance);
1842 DEFINE_DA_EVENT(xfs_da_node_toosmall);
1843 DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1844 DEFINE_DA_EVENT(xfs_da_grow_inode);
1845 DEFINE_DA_EVENT(xfs_da_shrink_inode);
1846 DEFINE_DA_EVENT(xfs_da_fixhashpath);
1847 DEFINE_DA_EVENT(xfs_da_path_shift);
1849 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1850 TP_PROTO(struct xfs_da_args *args, int idx),
1854 __field(xfs_ino_t, ino)
1855 __field(int, op_flags)
1859 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1860 __entry->ino = args->dp->i_ino;
1861 __entry->op_flags = args->op_flags;
1864 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1865 MAJOR(__entry->dev), MINOR(__entry->dev),
1867 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1871 #define DEFINE_DIR2_SPACE_EVENT(name) \
1872 DEFINE_EVENT(xfs_dir2_space_class, name, \
1873 TP_PROTO(struct xfs_da_args *args, int idx), \
1875 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1876 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1877 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1878 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1880 TRACE_EVENT(xfs_dir2_leafn_moveents,
1881 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1882 TP_ARGS(args, src_idx, dst_idx, count),
1885 __field(xfs_ino_t, ino)
1886 __field(int, op_flags)
1887 __field(int, src_idx)
1888 __field(int, dst_idx)
1892 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1893 __entry->ino = args->dp->i_ino;
1894 __entry->op_flags = args->op_flags;
1895 __entry->src_idx = src_idx;
1896 __entry->dst_idx = dst_idx;
1897 __entry->count = count;
1899 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1900 "src_idx %d dst_idx %d count %d",
1901 MAJOR(__entry->dev), MINOR(__entry->dev),
1903 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1909 #define XFS_SWAPEXT_INODES \
1913 #define XFS_INODE_FORMAT_STR \
1919 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1920 TP_PROTO(struct xfs_inode *ip, int which),
1925 __field(xfs_ino_t, ino)
1926 __field(int, format)
1928 __field(int, broot_size)
1929 __field(int, fork_off)
1932 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1933 __entry->which = which;
1934 __entry->ino = ip->i_ino;
1935 __entry->format = ip->i_d.di_format;
1936 __entry->nex = ip->i_d.di_nextents;
1937 __entry->broot_size = ip->i_df.if_broot_bytes;
1938 __entry->fork_off = XFS_IFORK_BOFF(ip);
1940 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1941 "broot size %d, fork offset %d",
1942 MAJOR(__entry->dev), MINOR(__entry->dev),
1944 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1945 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1947 __entry->broot_size,
1951 #define DEFINE_SWAPEXT_EVENT(name) \
1952 DEFINE_EVENT(xfs_swap_extent_class, name, \
1953 TP_PROTO(struct xfs_inode *ip, int which), \
1956 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1957 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1959 TRACE_EVENT(xfs_log_recover,
1960 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
1961 TP_ARGS(log, headblk, tailblk),
1964 __field(xfs_daddr_t, headblk)
1965 __field(xfs_daddr_t, tailblk)
1968 __entry->dev = log->l_mp->m_super->s_dev;
1969 __entry->headblk = headblk;
1970 __entry->tailblk = tailblk;
1972 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
1973 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
1977 TRACE_EVENT(xfs_log_recover_record,
1978 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
1979 TP_ARGS(log, rhead, pass),
1982 __field(xfs_lsn_t, lsn)
1984 __field(int, num_logops)
1988 __entry->dev = log->l_mp->m_super->s_dev;
1989 __entry->lsn = be64_to_cpu(rhead->h_lsn);
1990 __entry->len = be32_to_cpu(rhead->h_len);
1991 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
1992 __entry->pass = pass;
1994 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
1995 MAJOR(__entry->dev), MINOR(__entry->dev),
1996 __entry->lsn, __entry->len, __entry->num_logops,
2000 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2001 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2002 struct xlog_recover_item *item, int pass),
2003 TP_ARGS(log, trans, item, pass),
2006 __field(unsigned long, item)
2007 __field(xlog_tid_t, tid)
2008 __field(xfs_lsn_t, lsn)
2015 __entry->dev = log->l_mp->m_super->s_dev;
2016 __entry->item = (unsigned long)item;
2017 __entry->tid = trans->r_log_tid;
2018 __entry->lsn = trans->r_lsn;
2019 __entry->type = ITEM_TYPE(item);
2020 __entry->pass = pass;
2021 __entry->count = item->ri_cnt;
2022 __entry->total = item->ri_total;
2024 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
2025 "item type %s item region count/total %d/%d",
2026 MAJOR(__entry->dev), MINOR(__entry->dev),
2030 (void *)__entry->item,
2031 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2036 #define DEFINE_LOG_RECOVER_ITEM(name) \
2037 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2038 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2039 struct xlog_recover_item *item, int pass), \
2040 TP_ARGS(log, trans, item, pass))
2042 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2043 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2044 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2045 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2046 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2048 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2049 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2050 TP_ARGS(log, buf_f),
2053 __field(int64_t, blkno)
2054 __field(unsigned short, len)
2055 __field(unsigned short, flags)
2056 __field(unsigned short, size)
2057 __field(unsigned int, map_size)
2060 __entry->dev = log->l_mp->m_super->s_dev;
2061 __entry->blkno = buf_f->blf_blkno;
2062 __entry->len = buf_f->blf_len;
2063 __entry->flags = buf_f->blf_flags;
2064 __entry->size = buf_f->blf_size;
2065 __entry->map_size = buf_f->blf_map_size;
2067 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2069 MAJOR(__entry->dev), MINOR(__entry->dev),
2077 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2078 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2079 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2080 TP_ARGS(log, buf_f))
2082 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2083 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2084 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2085 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2086 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2087 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2088 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2089 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2090 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2092 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2093 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2097 __field(xfs_ino_t, ino)
2098 __field(unsigned short, size)
2099 __field(int, fields)
2100 __field(unsigned short, asize)
2101 __field(unsigned short, dsize)
2102 __field(int64_t, blkno)
2104 __field(int, boffset)
2107 __entry->dev = log->l_mp->m_super->s_dev;
2108 __entry->ino = in_f->ilf_ino;
2109 __entry->size = in_f->ilf_size;
2110 __entry->fields = in_f->ilf_fields;
2111 __entry->asize = in_f->ilf_asize;
2112 __entry->dsize = in_f->ilf_dsize;
2113 __entry->blkno = in_f->ilf_blkno;
2114 __entry->len = in_f->ilf_len;
2115 __entry->boffset = in_f->ilf_boffset;
2117 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2118 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2119 MAJOR(__entry->dev), MINOR(__entry->dev),
2129 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2130 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2131 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2134 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2135 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2136 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2138 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2139 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2143 __field(xfs_agnumber_t, agno)
2144 __field(xfs_agblock_t, agbno)
2145 __field(unsigned int, count)
2146 __field(unsigned int, isize)
2147 __field(xfs_agblock_t, length)
2148 __field(unsigned int, gen)
2151 __entry->dev = log->l_mp->m_super->s_dev;
2152 __entry->agno = be32_to_cpu(in_f->icl_ag);
2153 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2154 __entry->count = be32_to_cpu(in_f->icl_count);
2155 __entry->isize = be32_to_cpu(in_f->icl_isize);
2156 __entry->length = be32_to_cpu(in_f->icl_length);
2157 __entry->gen = be32_to_cpu(in_f->icl_gen);
2159 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2160 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2161 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2162 __entry->length, __entry->gen)
2164 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2165 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2166 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2169 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2170 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2172 DECLARE_EVENT_CLASS(xfs_discard_class,
2173 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2174 xfs_agblock_t agbno, xfs_extlen_t len),
2175 TP_ARGS(mp, agno, agbno, len),
2178 __field(xfs_agnumber_t, agno)
2179 __field(xfs_agblock_t, agbno)
2180 __field(xfs_extlen_t, len)
2183 __entry->dev = mp->m_super->s_dev;
2184 __entry->agno = agno;
2185 __entry->agbno = agbno;
2188 TP_printk("dev %d:%d agno %u agbno %u len %u",
2189 MAJOR(__entry->dev), MINOR(__entry->dev),
2195 #define DEFINE_DISCARD_EVENT(name) \
2196 DEFINE_EVENT(xfs_discard_class, name, \
2197 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2198 xfs_agblock_t agbno, xfs_extlen_t len), \
2199 TP_ARGS(mp, agno, agbno, len))
2200 DEFINE_DISCARD_EVENT(xfs_discard_extent);
2201 DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2202 DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2203 DEFINE_DISCARD_EVENT(xfs_discard_busy);
2205 /* btree cursor events */
2206 DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2207 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2208 TP_ARGS(cur, level, bp),
2211 __field(xfs_btnum_t, btnum)
2213 __field(int, nlevels)
2215 __field(xfs_daddr_t, daddr)
2218 __entry->dev = cur->bc_mp->m_super->s_dev;
2219 __entry->btnum = cur->bc_btnum;
2220 __entry->level = level;
2221 __entry->nlevels = cur->bc_nlevels;
2222 __entry->ptr = cur->bc_ptrs[level];
2223 __entry->daddr = bp ? bp->b_bn : -1;
2225 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2226 MAJOR(__entry->dev), MINOR(__entry->dev),
2231 (unsigned long long)__entry->daddr)
2234 #define DEFINE_BTREE_CUR_EVENT(name) \
2235 DEFINE_EVENT(xfs_btree_cur_class, name, \
2236 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2237 TP_ARGS(cur, level, bp))
2238 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2239 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2242 struct xfs_defer_pending;
2243 struct xfs_defer_ops;
2245 DECLARE_EVENT_CLASS(xfs_defer_class,
2246 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop,
2247 unsigned long caller_ip),
2248 TP_ARGS(mp, dop, caller_ip),
2251 __field(void *, dop)
2252 __field(char, committed)
2254 __field(unsigned long, caller_ip)
2257 __entry->dev = mp ? mp->m_super->s_dev : 0;
2259 __entry->committed = dop->dop_committed;
2260 __entry->low = dop->dop_low;
2261 __entry->caller_ip = caller_ip;
2263 TP_printk("dev %d:%d ops %p committed %d low %d, caller %pS",
2264 MAJOR(__entry->dev), MINOR(__entry->dev),
2268 (char *)__entry->caller_ip)
2270 #define DEFINE_DEFER_EVENT(name) \
2271 DEFINE_EVENT(xfs_defer_class, name, \
2272 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, \
2273 unsigned long caller_ip), \
2274 TP_ARGS(mp, dop, caller_ip))
2276 DECLARE_EVENT_CLASS(xfs_defer_error_class,
2277 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
2278 TP_ARGS(mp, dop, error),
2281 __field(void *, dop)
2282 __field(char, committed)
2287 __entry->dev = mp ? mp->m_super->s_dev : 0;
2289 __entry->committed = dop->dop_committed;
2290 __entry->low = dop->dop_low;
2291 __entry->error = error;
2293 TP_printk("dev %d:%d ops %p committed %d low %d err %d",
2294 MAJOR(__entry->dev), MINOR(__entry->dev),
2300 #define DEFINE_DEFER_ERROR_EVENT(name) \
2301 DEFINE_EVENT(xfs_defer_error_class, name, \
2302 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2303 TP_ARGS(mp, dop, error))
2305 DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2306 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2311 __field(void *, intent)
2312 __field(char, committed)
2316 __entry->dev = mp ? mp->m_super->s_dev : 0;
2317 __entry->type = dfp->dfp_type->type;
2318 __entry->intent = dfp->dfp_intent;
2319 __entry->committed = dfp->dfp_done != NULL;
2320 __entry->nr = dfp->dfp_count;
2322 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
2323 MAJOR(__entry->dev), MINOR(__entry->dev),
2329 #define DEFINE_DEFER_PENDING_EVENT(name) \
2330 DEFINE_EVENT(xfs_defer_pending_class, name, \
2331 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2334 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2335 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2336 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2337 TP_ARGS(mp, agno, type, agbno, len),
2340 __field(xfs_agnumber_t, agno)
2342 __field(xfs_agblock_t, agbno)
2343 __field(xfs_extlen_t, len)
2346 __entry->dev = mp->m_super->s_dev;
2347 __entry->agno = agno;
2348 __entry->type = type;
2349 __entry->agbno = agbno;
2352 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2353 MAJOR(__entry->dev), MINOR(__entry->dev),
2359 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2360 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2361 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2363 xfs_agblock_t bno, \
2364 xfs_extlen_t len), \
2365 TP_ARGS(mp, agno, type, bno, len))
2367 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2368 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2370 xfs_agblock_t agbno,
2373 xfs_fileoff_t offset,
2375 xfs_exntst_t state),
2376 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2379 __field(xfs_agnumber_t, agno)
2380 __field(xfs_ino_t, ino)
2381 __field(xfs_agblock_t, agbno)
2382 __field(int, whichfork)
2383 __field(xfs_fileoff_t, l_loff)
2384 __field(xfs_filblks_t, l_len)
2385 __field(xfs_exntst_t, l_state)
2389 __entry->dev = mp->m_super->s_dev;
2390 __entry->agno = agno;
2392 __entry->agbno = agbno;
2393 __entry->whichfork = whichfork;
2394 __entry->l_loff = offset;
2395 __entry->l_len = len;
2396 __entry->l_state = state;
2399 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2400 MAJOR(__entry->dev), MINOR(__entry->dev),
2405 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2410 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2411 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2412 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2414 xfs_agblock_t agbno, \
2417 xfs_fileoff_t offset, \
2418 xfs_filblks_t len, \
2419 xfs_exntst_t state), \
2420 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2422 DEFINE_DEFER_EVENT(xfs_defer_init);
2423 DEFINE_DEFER_EVENT(xfs_defer_cancel);
2424 DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2425 DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2426 DEFINE_DEFER_EVENT(xfs_defer_finish);
2427 DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2429 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2430 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2432 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
2433 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
2434 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
2435 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2436 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2438 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2439 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2440 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2441 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2442 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_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 TRACE_EVENT(xfs_trans_resv_calc,
3331 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3332 struct xfs_trans_res *res),
3333 TP_ARGS(mp, type, res),
3337 __field(uint, logres)
3338 __field(int, logcount)
3339 __field(int, logflags)
3342 __entry->dev = mp->m_super->s_dev;
3343 __entry->type = type;
3344 __entry->logres = res->tr_logres;
3345 __entry->logcount = res->tr_logcount;
3346 __entry->logflags = res->tr_logflags;
3348 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3349 MAJOR(__entry->dev), MINOR(__entry->dev),
3356 DECLARE_EVENT_CLASS(xfs_trans_class,
3357 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3358 TP_ARGS(tp, caller_ip),
3361 __field(uint32_t, tid)
3362 __field(uint32_t, flags)
3363 __field(unsigned long, caller_ip)
3366 __entry->dev = tp->t_mountp->m_super->s_dev;
3369 __entry->tid = tp->t_ticket->t_tid;
3370 __entry->flags = tp->t_flags;
3371 __entry->caller_ip = caller_ip;
3373 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3374 MAJOR(__entry->dev), MINOR(__entry->dev),
3377 (char *)__entry->caller_ip)
3380 #define DEFINE_TRANS_EVENT(name) \
3381 DEFINE_EVENT(xfs_trans_class, name, \
3382 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3383 TP_ARGS(tp, caller_ip))
3384 DEFINE_TRANS_EVENT(xfs_trans_alloc);
3385 DEFINE_TRANS_EVENT(xfs_trans_cancel);
3386 DEFINE_TRANS_EVENT(xfs_trans_commit);
3387 DEFINE_TRANS_EVENT(xfs_trans_dup);
3388 DEFINE_TRANS_EVENT(xfs_trans_free);
3389 DEFINE_TRANS_EVENT(xfs_trans_roll);
3390 DEFINE_TRANS_EVENT(xfs_trans_add_item);
3391 DEFINE_TRANS_EVENT(xfs_trans_free_items);
3393 #endif /* _TRACE_XFS_H */
3395 #undef TRACE_INCLUDE_PATH
3396 #define TRACE_INCLUDE_PATH .
3397 #define TRACE_INCLUDE_FILE xfs_trace
3398 #include <trace/define_trace.h>