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;
36 struct xlog_recover_item;
37 struct xfs_buf_log_format;
38 struct xfs_inode_log_format;
40 DECLARE_EVENT_CLASS(xfs_attr_list_class,
41 TP_PROTO(struct xfs_attr_list_context *ctx),
45 __field(xfs_ino_t, ino)
49 __field(void *, alist)
57 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
58 __entry->ino = ctx->dp->i_ino;
59 __entry->hashval = ctx->cursor->hashval;
60 __entry->blkno = ctx->cursor->blkno;
61 __entry->offset = ctx->cursor->offset;
62 __entry->alist = ctx->alist;
63 __entry->bufsize = ctx->bufsize;
64 __entry->count = ctx->count;
65 __entry->firstu = ctx->firstu;
66 __entry->flags = ctx->flags;
68 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
69 "alist 0x%p size %u count %u firstu %u flags %d %s",
70 MAJOR(__entry->dev), MINOR(__entry->dev),
81 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
85 #define DEFINE_PERAG_REF_EVENT(name) \
87 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
88 unsigned long caller_ip), \
89 TP_ARGS(mp, agno, refcount, caller_ip), \
92 __field(xfs_agnumber_t, agno) \
93 __field(int, refcount) \
94 __field(unsigned long, caller_ip) \
97 __entry->dev = mp->m_super->s_dev; \
98 __entry->agno = agno; \
99 __entry->refcount = refcount; \
100 __entry->caller_ip = caller_ip; \
102 TP_printk("dev %d:%d agno %u refcount %d caller %pf", \
103 MAJOR(__entry->dev), MINOR(__entry->dev), \
106 (char *)__entry->caller_ip) \
109 DEFINE_PERAG_REF_EVENT(xfs_perag_get)
110 DEFINE_PERAG_REF_EVENT(xfs_perag_put)
112 #define DEFINE_ATTR_LIST_EVENT(name) \
113 DEFINE_EVENT(xfs_attr_list_class, name, \
114 TP_PROTO(struct xfs_attr_list_context *ctx), \
116 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
117 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
118 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
119 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
120 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
121 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
122 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
123 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
125 TRACE_EVENT(xfs_attr_list_node_descend,
126 TP_PROTO(struct xfs_attr_list_context *ctx,
127 struct xfs_da_node_entry *btree),
131 __field(xfs_ino_t, ino)
132 __field(u32, hashval)
135 __field(void *, alist)
136 __field(int, bufsize)
141 __field(u32, bt_hashval)
142 __field(u32, bt_before)
145 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
146 __entry->ino = ctx->dp->i_ino;
147 __entry->hashval = ctx->cursor->hashval;
148 __entry->blkno = ctx->cursor->blkno;
149 __entry->offset = ctx->cursor->offset;
150 __entry->alist = ctx->alist;
151 __entry->bufsize = ctx->bufsize;
152 __entry->count = ctx->count;
153 __entry->firstu = ctx->firstu;
154 __entry->flags = ctx->flags;
155 __entry->bt_hashval = be32_to_cpu(btree->hashval);
156 __entry->bt_before = be32_to_cpu(btree->before);
158 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
159 "alist 0x%p size %u count %u firstu %u flags %d %s "
160 "node hashval %u, node before %u",
161 MAJOR(__entry->dev), MINOR(__entry->dev),
172 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
177 TRACE_EVENT(xfs_iext_insert,
178 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
179 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
180 TP_ARGS(ip, idx, r, state, caller_ip),
183 __field(xfs_ino_t, ino)
184 __field(xfs_extnum_t, idx)
185 __field(xfs_fileoff_t, startoff)
186 __field(xfs_fsblock_t, startblock)
187 __field(xfs_filblks_t, blockcount)
188 __field(xfs_exntst_t, state)
189 __field(int, bmap_state)
190 __field(unsigned long, caller_ip)
193 __entry->dev = VFS_I(ip)->i_sb->s_dev;
194 __entry->ino = ip->i_ino;
196 __entry->startoff = r->br_startoff;
197 __entry->startblock = r->br_startblock;
198 __entry->blockcount = r->br_blockcount;
199 __entry->state = r->br_state;
200 __entry->bmap_state = state;
201 __entry->caller_ip = caller_ip;
203 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
204 "offset %lld block %lld count %lld flag %d caller %pf",
205 MAJOR(__entry->dev), MINOR(__entry->dev),
207 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
210 (__int64_t)__entry->startblock,
213 (char *)__entry->caller_ip)
216 DECLARE_EVENT_CLASS(xfs_bmap_class,
217 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
218 unsigned long caller_ip),
219 TP_ARGS(ip, idx, state, caller_ip),
222 __field(xfs_ino_t, ino)
223 __field(xfs_extnum_t, idx)
224 __field(xfs_fileoff_t, startoff)
225 __field(xfs_fsblock_t, startblock)
226 __field(xfs_filblks_t, blockcount)
227 __field(xfs_exntst_t, state)
228 __field(int, bmap_state)
229 __field(unsigned long, caller_ip)
232 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
233 ip->i_afp : &ip->i_df;
234 struct xfs_bmbt_irec r;
236 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
237 __entry->dev = VFS_I(ip)->i_sb->s_dev;
238 __entry->ino = ip->i_ino;
240 __entry->startoff = r.br_startoff;
241 __entry->startblock = r.br_startblock;
242 __entry->blockcount = r.br_blockcount;
243 __entry->state = r.br_state;
244 __entry->bmap_state = state;
245 __entry->caller_ip = caller_ip;
247 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
248 "offset %lld block %lld count %lld flag %d caller %pf",
249 MAJOR(__entry->dev), MINOR(__entry->dev),
251 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
254 (__int64_t)__entry->startblock,
257 (char *)__entry->caller_ip)
260 #define DEFINE_BMAP_EVENT(name) \
261 DEFINE_EVENT(xfs_bmap_class, name, \
262 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
263 unsigned long caller_ip), \
264 TP_ARGS(ip, idx, state, caller_ip))
265 DEFINE_BMAP_EVENT(xfs_iext_remove);
266 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
267 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
268 DEFINE_BMAP_EVENT(xfs_extlist);
270 DECLARE_EVENT_CLASS(xfs_buf_class,
271 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
272 TP_ARGS(bp, caller_ip),
275 __field(xfs_daddr_t, bno)
276 __field(size_t, buffer_length)
278 __field(int, pincount)
279 __field(unsigned, lockval)
280 __field(unsigned, flags)
281 __field(unsigned long, caller_ip)
284 __entry->dev = bp->b_target->bt_dev;
285 __entry->bno = bp->b_bn;
286 __entry->buffer_length = bp->b_buffer_length;
287 __entry->hold = atomic_read(&bp->b_hold);
288 __entry->pincount = atomic_read(&bp->b_pin_count);
289 __entry->lockval = xfs_buf_lock_value(bp);
290 __entry->flags = bp->b_flags;
291 __entry->caller_ip = caller_ip;
293 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
294 "lock %d flags %s caller %pf",
295 MAJOR(__entry->dev), MINOR(__entry->dev),
296 (unsigned long long)__entry->bno,
297 __entry->buffer_length,
301 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
302 (void *)__entry->caller_ip)
305 #define DEFINE_BUF_EVENT(name) \
306 DEFINE_EVENT(xfs_buf_class, name, \
307 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
308 TP_ARGS(bp, caller_ip))
309 DEFINE_BUF_EVENT(xfs_buf_init);
310 DEFINE_BUF_EVENT(xfs_buf_free);
311 DEFINE_BUF_EVENT(xfs_buf_hold);
312 DEFINE_BUF_EVENT(xfs_buf_rele);
313 DEFINE_BUF_EVENT(xfs_buf_pin);
314 DEFINE_BUF_EVENT(xfs_buf_unpin);
315 DEFINE_BUF_EVENT(xfs_buf_iodone);
316 DEFINE_BUF_EVENT(xfs_buf_iorequest);
317 DEFINE_BUF_EVENT(xfs_buf_bawrite);
318 DEFINE_BUF_EVENT(xfs_buf_bdwrite);
319 DEFINE_BUF_EVENT(xfs_buf_lock);
320 DEFINE_BUF_EVENT(xfs_buf_lock_done);
321 DEFINE_BUF_EVENT(xfs_buf_cond_lock);
322 DEFINE_BUF_EVENT(xfs_buf_unlock);
323 DEFINE_BUF_EVENT(xfs_buf_ordered_retry);
324 DEFINE_BUF_EVENT(xfs_buf_iowait);
325 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
326 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
327 DEFINE_BUF_EVENT(xfs_buf_delwri_dequeue);
328 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
329 DEFINE_BUF_EVENT(xfs_buf_get_noaddr);
330 DEFINE_BUF_EVENT(xfs_bdstrat_shut);
331 DEFINE_BUF_EVENT(xfs_buf_item_relse);
332 DEFINE_BUF_EVENT(xfs_buf_item_iodone);
333 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
334 DEFINE_BUF_EVENT(xfs_buf_error_relse);
335 DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
336 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
338 /* not really buffer traces, but the buf provides useful information */
339 DEFINE_BUF_EVENT(xfs_btree_corrupt);
340 DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
341 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
342 DEFINE_BUF_EVENT(xfs_inode_item_push);
344 /* pass flags explicitly */
345 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
346 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
347 TP_ARGS(bp, flags, caller_ip),
350 __field(xfs_daddr_t, bno)
351 __field(size_t, buffer_length)
353 __field(int, pincount)
354 __field(unsigned, lockval)
355 __field(unsigned, flags)
356 __field(unsigned long, caller_ip)
359 __entry->dev = bp->b_target->bt_dev;
360 __entry->bno = bp->b_bn;
361 __entry->buffer_length = bp->b_buffer_length;
362 __entry->flags = flags;
363 __entry->hold = atomic_read(&bp->b_hold);
364 __entry->pincount = atomic_read(&bp->b_pin_count);
365 __entry->lockval = xfs_buf_lock_value(bp);
366 __entry->caller_ip = caller_ip;
368 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
369 "lock %d flags %s caller %pf",
370 MAJOR(__entry->dev), MINOR(__entry->dev),
371 (unsigned long long)__entry->bno,
372 __entry->buffer_length,
376 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
377 (void *)__entry->caller_ip)
380 #define DEFINE_BUF_FLAGS_EVENT(name) \
381 DEFINE_EVENT(xfs_buf_flags_class, name, \
382 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
383 TP_ARGS(bp, flags, caller_ip))
384 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
385 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
386 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
388 TRACE_EVENT(xfs_buf_ioerror,
389 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
390 TP_ARGS(bp, error, caller_ip),
393 __field(xfs_daddr_t, bno)
394 __field(size_t, buffer_length)
395 __field(unsigned, flags)
397 __field(int, pincount)
398 __field(unsigned, lockval)
400 __field(unsigned long, caller_ip)
403 __entry->dev = bp->b_target->bt_dev;
404 __entry->bno = bp->b_bn;
405 __entry->buffer_length = bp->b_buffer_length;
406 __entry->hold = atomic_read(&bp->b_hold);
407 __entry->pincount = atomic_read(&bp->b_pin_count);
408 __entry->lockval = xfs_buf_lock_value(bp);
409 __entry->error = error;
410 __entry->flags = bp->b_flags;
411 __entry->caller_ip = caller_ip;
413 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
414 "lock %d error %d flags %s caller %pf",
415 MAJOR(__entry->dev), MINOR(__entry->dev),
416 (unsigned long long)__entry->bno,
417 __entry->buffer_length,
422 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
423 (void *)__entry->caller_ip)
426 DECLARE_EVENT_CLASS(xfs_buf_item_class,
427 TP_PROTO(struct xfs_buf_log_item *bip),
431 __field(xfs_daddr_t, buf_bno)
432 __field(size_t, buf_len)
433 __field(int, buf_hold)
434 __field(int, buf_pincount)
435 __field(int, buf_lockval)
436 __field(unsigned, buf_flags)
437 __field(unsigned, bli_recur)
438 __field(int, bli_refcount)
439 __field(unsigned, bli_flags)
440 __field(void *, li_desc)
441 __field(unsigned, li_flags)
444 __entry->dev = bip->bli_buf->b_target->bt_dev;
445 __entry->bli_flags = bip->bli_flags;
446 __entry->bli_recur = bip->bli_recur;
447 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
448 __entry->buf_bno = bip->bli_buf->b_bn;
449 __entry->buf_len = bip->bli_buf->b_buffer_length;
450 __entry->buf_flags = bip->bli_buf->b_flags;
451 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
452 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
453 __entry->buf_lockval = xfs_buf_lock_value(bip->bli_buf);
454 __entry->li_desc = bip->bli_item.li_desc;
455 __entry->li_flags = bip->bli_item.li_flags;
457 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
458 "lock %d flags %s recur %d refcount %d bliflags %s "
459 "lidesc 0x%p liflags %s",
460 MAJOR(__entry->dev), MINOR(__entry->dev),
461 (unsigned long long)__entry->buf_bno,
464 __entry->buf_pincount,
465 __entry->buf_lockval,
466 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
468 __entry->bli_refcount,
469 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
471 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
474 #define DEFINE_BUF_ITEM_EVENT(name) \
475 DEFINE_EVENT(xfs_buf_item_class, name, \
476 TP_PROTO(struct xfs_buf_log_item *bip), \
478 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
479 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
480 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
481 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
482 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
483 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
484 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
485 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_trylock);
486 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
487 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
488 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
489 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
490 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pushbuf);
491 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
492 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
493 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
494 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
495 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
496 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
497 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
498 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
499 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
500 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
501 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
502 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
504 DECLARE_EVENT_CLASS(xfs_lock_class,
505 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
506 unsigned long caller_ip),
507 TP_ARGS(ip, lock_flags, caller_ip),
510 __field(xfs_ino_t, ino)
511 __field(int, lock_flags)
512 __field(unsigned long, caller_ip)
515 __entry->dev = VFS_I(ip)->i_sb->s_dev;
516 __entry->ino = ip->i_ino;
517 __entry->lock_flags = lock_flags;
518 __entry->caller_ip = caller_ip;
520 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
521 MAJOR(__entry->dev), MINOR(__entry->dev),
523 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
524 (void *)__entry->caller_ip)
527 #define DEFINE_LOCK_EVENT(name) \
528 DEFINE_EVENT(xfs_lock_class, name, \
529 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
530 unsigned long caller_ip), \
531 TP_ARGS(ip, lock_flags, caller_ip))
532 DEFINE_LOCK_EVENT(xfs_ilock);
533 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
534 DEFINE_LOCK_EVENT(xfs_ilock_demote);
535 DEFINE_LOCK_EVENT(xfs_iunlock);
537 DECLARE_EVENT_CLASS(xfs_iget_class,
538 TP_PROTO(struct xfs_inode *ip),
542 __field(xfs_ino_t, ino)
545 __entry->dev = VFS_I(ip)->i_sb->s_dev;
546 __entry->ino = ip->i_ino;
548 TP_printk("dev %d:%d ino 0x%llx",
549 MAJOR(__entry->dev), MINOR(__entry->dev),
553 #define DEFINE_IGET_EVENT(name) \
554 DEFINE_EVENT(xfs_iget_class, name, \
555 TP_PROTO(struct xfs_inode *ip), \
557 DEFINE_IGET_EVENT(xfs_iget_skip);
558 DEFINE_IGET_EVENT(xfs_iget_reclaim);
559 DEFINE_IGET_EVENT(xfs_iget_found);
560 DEFINE_IGET_EVENT(xfs_iget_alloc);
562 DECLARE_EVENT_CLASS(xfs_inode_class,
563 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
564 TP_ARGS(ip, caller_ip),
567 __field(xfs_ino_t, ino)
569 __field(int, pincount)
570 __field(unsigned long, caller_ip)
573 __entry->dev = VFS_I(ip)->i_sb->s_dev;
574 __entry->ino = ip->i_ino;
575 __entry->count = atomic_read(&VFS_I(ip)->i_count);
576 __entry->pincount = atomic_read(&ip->i_pincount);
577 __entry->caller_ip = caller_ip;
579 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pf",
580 MAJOR(__entry->dev), MINOR(__entry->dev),
584 (char *)__entry->caller_ip)
587 #define DEFINE_INODE_EVENT(name) \
588 DEFINE_EVENT(xfs_inode_class, name, \
589 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
590 TP_ARGS(ip, caller_ip))
591 DEFINE_INODE_EVENT(xfs_ihold);
592 DEFINE_INODE_EVENT(xfs_irele);
593 DEFINE_INODE_EVENT(xfs_inode_pin);
594 DEFINE_INODE_EVENT(xfs_inode_unpin);
595 DEFINE_INODE_EVENT(xfs_inode_unpin_nowait);
597 /* the old xfs_itrace_entry tracer - to be replaced by s.th. in the VFS */
598 DEFINE_INODE_EVENT(xfs_inode);
599 #define xfs_itrace_entry(ip) \
600 trace_xfs_inode(ip, _THIS_IP_)
602 DECLARE_EVENT_CLASS(xfs_dquot_class,
603 TP_PROTO(struct xfs_dquot *dqp),
608 __field(unsigned, flags)
609 __field(unsigned, nrefs)
610 __field(unsigned long long, res_bcount)
611 __field(unsigned long long, bcount)
612 __field(unsigned long long, icount)
613 __field(unsigned long long, blk_hardlimit)
614 __field(unsigned long long, blk_softlimit)
615 __field(unsigned long long, ino_hardlimit)
616 __field(unsigned long long, ino_softlimit)
619 __entry->dev = dqp->q_mount->m_super->s_dev;
620 __entry->id = be32_to_cpu(dqp->q_core.d_id);
621 __entry->flags = dqp->dq_flags;
622 __entry->nrefs = dqp->q_nrefs;
623 __entry->res_bcount = dqp->q_res_bcount;
624 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
625 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
626 __entry->blk_hardlimit =
627 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
628 __entry->blk_softlimit =
629 be64_to_cpu(dqp->q_core.d_blk_softlimit);
630 __entry->ino_hardlimit =
631 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
632 __entry->ino_softlimit =
633 be64_to_cpu(dqp->q_core.d_ino_softlimit);
635 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
636 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
637 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
638 MAJOR(__entry->dev), MINOR(__entry->dev),
640 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
644 __entry->blk_hardlimit,
645 __entry->blk_softlimit,
647 __entry->ino_hardlimit,
648 __entry->ino_softlimit)
651 #define DEFINE_DQUOT_EVENT(name) \
652 DEFINE_EVENT(xfs_dquot_class, name, \
653 TP_PROTO(struct xfs_dquot *dqp), \
655 DEFINE_DQUOT_EVENT(xfs_dqadjust);
656 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
657 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
658 DEFINE_DQUOT_EVENT(xfs_dqreclaim_unlink);
659 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
660 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
661 DEFINE_DQUOT_EVENT(xfs_dqinit);
662 DEFINE_DQUOT_EVENT(xfs_dqreuse);
663 DEFINE_DQUOT_EVENT(xfs_dqalloc);
664 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
665 DEFINE_DQUOT_EVENT(xfs_dqread);
666 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
667 DEFINE_DQUOT_EVENT(xfs_dqlookup_found);
668 DEFINE_DQUOT_EVENT(xfs_dqlookup_want);
669 DEFINE_DQUOT_EVENT(xfs_dqlookup_freelist);
670 DEFINE_DQUOT_EVENT(xfs_dqlookup_done);
671 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
672 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
673 DEFINE_DQUOT_EVENT(xfs_dqput);
674 DEFINE_DQUOT_EVENT(xfs_dqput_wait);
675 DEFINE_DQUOT_EVENT(xfs_dqput_free);
676 DEFINE_DQUOT_EVENT(xfs_dqrele);
677 DEFINE_DQUOT_EVENT(xfs_dqflush);
678 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
679 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
680 /* not really iget events, but we re-use the format */
681 DEFINE_IGET_EVENT(xfs_dquot_dqalloc);
682 DEFINE_IGET_EVENT(xfs_dquot_dqdetach);
684 DECLARE_EVENT_CLASS(xfs_loggrant_class,
685 TP_PROTO(struct log *log, struct xlog_ticket *tic),
689 __field(unsigned, trans_type)
692 __field(int, curr_res)
693 __field(int, unit_res)
694 __field(unsigned int, flags)
695 __field(void *, reserve_headq)
696 __field(void *, write_headq)
697 __field(int, grant_reserve_cycle)
698 __field(int, grant_reserve_bytes)
699 __field(int, grant_write_cycle)
700 __field(int, grant_write_bytes)
701 __field(int, curr_cycle)
702 __field(int, curr_block)
703 __field(xfs_lsn_t, tail_lsn)
706 __entry->dev = log->l_mp->m_super->s_dev;
707 __entry->trans_type = tic->t_trans_type;
708 __entry->ocnt = tic->t_ocnt;
709 __entry->cnt = tic->t_cnt;
710 __entry->curr_res = tic->t_curr_res;
711 __entry->unit_res = tic->t_unit_res;
712 __entry->flags = tic->t_flags;
713 __entry->reserve_headq = log->l_reserve_headq;
714 __entry->write_headq = log->l_write_headq;
715 __entry->grant_reserve_cycle = log->l_grant_reserve_cycle;
716 __entry->grant_reserve_bytes = log->l_grant_reserve_bytes;
717 __entry->grant_write_cycle = log->l_grant_write_cycle;
718 __entry->grant_write_bytes = log->l_grant_write_bytes;
719 __entry->curr_cycle = log->l_curr_cycle;
720 __entry->curr_block = log->l_curr_block;
721 __entry->tail_lsn = log->l_tail_lsn;
723 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
724 "t_unit_res %u t_flags %s reserve_headq 0x%p "
725 "write_headq 0x%p grant_reserve_cycle %d "
726 "grant_reserve_bytes %d grant_write_cycle %d "
727 "grant_write_bytes %d curr_cycle %d curr_block %d "
728 "tail_cycle %d tail_block %d",
729 MAJOR(__entry->dev), MINOR(__entry->dev),
730 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
735 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
736 __entry->reserve_headq,
737 __entry->write_headq,
738 __entry->grant_reserve_cycle,
739 __entry->grant_reserve_bytes,
740 __entry->grant_write_cycle,
741 __entry->grant_write_bytes,
744 CYCLE_LSN(__entry->tail_lsn),
745 BLOCK_LSN(__entry->tail_lsn)
749 #define DEFINE_LOGGRANT_EVENT(name) \
750 DEFINE_EVENT(xfs_loggrant_class, name, \
751 TP_PROTO(struct log *log, struct xlog_ticket *tic), \
753 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
754 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
755 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
756 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
757 DEFINE_LOGGRANT_EVENT(xfs_log_grant_enter);
758 DEFINE_LOGGRANT_EVENT(xfs_log_grant_exit);
759 DEFINE_LOGGRANT_EVENT(xfs_log_grant_error);
760 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep1);
761 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake1);
762 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep2);
763 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake2);
764 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_enter);
765 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_exit);
766 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_error);
767 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep1);
768 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake1);
769 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep2);
770 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake2);
771 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
772 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
773 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
774 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
775 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
776 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
778 #define DEFINE_RW_EVENT(name) \
780 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
781 TP_ARGS(ip, count, offset, flags), \
783 __field(dev_t, dev) \
784 __field(xfs_ino_t, ino) \
785 __field(xfs_fsize_t, size) \
786 __field(xfs_fsize_t, new_size) \
787 __field(loff_t, offset) \
788 __field(size_t, count) \
789 __field(int, flags) \
792 __entry->dev = VFS_I(ip)->i_sb->s_dev; \
793 __entry->ino = ip->i_ino; \
794 __entry->size = ip->i_d.di_size; \
795 __entry->new_size = ip->i_new_size; \
796 __entry->offset = offset; \
797 __entry->count = count; \
798 __entry->flags = flags; \
800 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
801 "offset 0x%llx count 0x%zx ioflags %s", \
802 MAJOR(__entry->dev), MINOR(__entry->dev), \
808 __print_flags(__entry->flags, "|", XFS_IO_FLAGS)) \
810 DEFINE_RW_EVENT(xfs_file_read);
811 DEFINE_RW_EVENT(xfs_file_buffered_write);
812 DEFINE_RW_EVENT(xfs_file_direct_write);
813 DEFINE_RW_EVENT(xfs_file_splice_read);
814 DEFINE_RW_EVENT(xfs_file_splice_write);
817 #define DEFINE_PAGE_EVENT(name) \
819 TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \
820 TP_ARGS(inode, page, off), \
822 __field(dev_t, dev) \
823 __field(xfs_ino_t, ino) \
824 __field(pgoff_t, pgoff) \
825 __field(loff_t, size) \
826 __field(unsigned long, offset) \
827 __field(int, delalloc) \
828 __field(int, unmapped) \
829 __field(int, unwritten) \
832 int delalloc = -1, unmapped = -1, unwritten = -1; \
834 if (page_has_buffers(page)) \
835 xfs_count_page_state(page, &delalloc, \
836 &unmapped, &unwritten); \
837 __entry->dev = inode->i_sb->s_dev; \
838 __entry->ino = XFS_I(inode)->i_ino; \
839 __entry->pgoff = page_offset(page); \
840 __entry->size = i_size_read(inode); \
841 __entry->offset = off; \
842 __entry->delalloc = delalloc; \
843 __entry->unmapped = unmapped; \
844 __entry->unwritten = unwritten; \
846 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx " \
847 "delalloc %d unmapped %d unwritten %d", \
848 MAJOR(__entry->dev), MINOR(__entry->dev), \
855 __entry->unwritten) \
857 DEFINE_PAGE_EVENT(xfs_writepage);
858 DEFINE_PAGE_EVENT(xfs_releasepage);
859 DEFINE_PAGE_EVENT(xfs_invalidatepage);
861 #define DEFINE_IOMAP_EVENT(name) \
863 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
864 int flags, struct xfs_bmbt_irec *irec), \
865 TP_ARGS(ip, offset, count, flags, irec), \
867 __field(dev_t, dev) \
868 __field(xfs_ino_t, ino) \
869 __field(loff_t, size) \
870 __field(loff_t, new_size) \
871 __field(loff_t, offset) \
872 __field(size_t, count) \
873 __field(int, flags) \
874 __field(xfs_fileoff_t, startoff) \
875 __field(xfs_fsblock_t, startblock) \
876 __field(xfs_filblks_t, blockcount) \
879 __entry->dev = VFS_I(ip)->i_sb->s_dev; \
880 __entry->ino = ip->i_ino; \
881 __entry->size = ip->i_d.di_size; \
882 __entry->new_size = ip->i_new_size; \
883 __entry->offset = offset; \
884 __entry->count = count; \
885 __entry->flags = flags; \
886 __entry->startoff = irec ? irec->br_startoff : 0; \
887 __entry->startblock = irec ? irec->br_startblock : 0; \
888 __entry->blockcount = irec ? irec->br_blockcount : 0; \
890 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
891 "offset 0x%llx count %zd flags %s " \
892 "startoff 0x%llx startblock %lld blockcount 0x%llx", \
893 MAJOR(__entry->dev), MINOR(__entry->dev), \
899 __print_flags(__entry->flags, "|", BMAPI_FLAGS), \
901 (__int64_t)__entry->startblock, \
902 __entry->blockcount) \
904 DEFINE_IOMAP_EVENT(xfs_iomap_enter);
905 DEFINE_IOMAP_EVENT(xfs_iomap_found);
906 DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
908 #define DEFINE_SIMPLE_IO_EVENT(name) \
910 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
911 TP_ARGS(ip, offset, count), \
913 __field(dev_t, dev) \
914 __field(xfs_ino_t, ino) \
915 __field(loff_t, size) \
916 __field(loff_t, new_size) \
917 __field(loff_t, offset) \
918 __field(size_t, count) \
921 __entry->dev = VFS_I(ip)->i_sb->s_dev; \
922 __entry->ino = ip->i_ino; \
923 __entry->size = ip->i_d.di_size; \
924 __entry->new_size = ip->i_new_size; \
925 __entry->offset = offset; \
926 __entry->count = count; \
928 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
929 "offset 0x%llx count %zd", \
930 MAJOR(__entry->dev), MINOR(__entry->dev), \
937 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
938 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
941 TRACE_EVENT(xfs_itruncate_start,
942 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size, int flag,
943 xfs_off_t toss_start, xfs_off_t toss_finish),
944 TP_ARGS(ip, new_size, flag, toss_start, toss_finish),
947 __field(xfs_ino_t, ino)
948 __field(xfs_fsize_t, size)
949 __field(xfs_fsize_t, new_size)
950 __field(xfs_off_t, toss_start)
951 __field(xfs_off_t, toss_finish)
955 __entry->dev = VFS_I(ip)->i_sb->s_dev;
956 __entry->ino = ip->i_ino;
957 __entry->size = ip->i_d.di_size;
958 __entry->new_size = new_size;
959 __entry->toss_start = toss_start;
960 __entry->toss_finish = toss_finish;
961 __entry->flag = flag;
963 TP_printk("dev %d:%d ino 0x%llx %s size 0x%llx new_size 0x%llx "
964 "toss start 0x%llx toss finish 0x%llx",
965 MAJOR(__entry->dev), MINOR(__entry->dev),
967 __print_flags(__entry->flag, "|", XFS_ITRUNC_FLAGS),
971 __entry->toss_finish)
974 DECLARE_EVENT_CLASS(xfs_itrunc_class,
975 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
976 TP_ARGS(ip, new_size),
979 __field(xfs_ino_t, ino)
980 __field(xfs_fsize_t, size)
981 __field(xfs_fsize_t, new_size)
984 __entry->dev = VFS_I(ip)->i_sb->s_dev;
985 __entry->ino = ip->i_ino;
986 __entry->size = ip->i_d.di_size;
987 __entry->new_size = new_size;
989 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
990 MAJOR(__entry->dev), MINOR(__entry->dev),
996 #define DEFINE_ITRUNC_EVENT(name) \
997 DEFINE_EVENT(xfs_itrunc_class, name, \
998 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
999 TP_ARGS(ip, new_size))
1000 DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_start);
1001 DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_end);
1003 TRACE_EVENT(xfs_pagecache_inval,
1004 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1005 TP_ARGS(ip, start, finish),
1008 __field(xfs_ino_t, ino)
1009 __field(xfs_fsize_t, size)
1010 __field(xfs_off_t, start)
1011 __field(xfs_off_t, finish)
1014 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1015 __entry->ino = ip->i_ino;
1016 __entry->size = ip->i_d.di_size;
1017 __entry->start = start;
1018 __entry->finish = finish;
1020 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1021 MAJOR(__entry->dev), MINOR(__entry->dev),
1028 TRACE_EVENT(xfs_bunmap,
1029 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1030 int flags, unsigned long caller_ip),
1031 TP_ARGS(ip, bno, len, flags, caller_ip),
1034 __field(xfs_ino_t, ino)
1035 __field(xfs_fsize_t, size)
1036 __field(xfs_fileoff_t, bno)
1037 __field(xfs_filblks_t, len)
1038 __field(unsigned long, caller_ip)
1042 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1043 __entry->ino = ip->i_ino;
1044 __entry->size = ip->i_d.di_size;
1047 __entry->caller_ip = caller_ip;
1048 __entry->flags = flags;
1050 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1051 "flags %s caller %pf",
1052 MAJOR(__entry->dev), MINOR(__entry->dev),
1057 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1058 (void *)__entry->caller_ip)
1062 #define XFS_BUSY_SYNC \
1066 TRACE_EVENT(xfs_alloc_busy,
1067 TP_PROTO(struct xfs_trans *trans, xfs_agnumber_t agno,
1068 xfs_agblock_t agbno, xfs_extlen_t len, int sync),
1069 TP_ARGS(trans, agno, agbno, len, sync),
1072 __field(struct xfs_trans *, tp)
1074 __field(xfs_agnumber_t, agno)
1075 __field(xfs_agblock_t, agbno)
1076 __field(xfs_extlen_t, len)
1080 __entry->dev = trans->t_mountp->m_super->s_dev;
1081 __entry->tp = trans;
1082 __entry->tid = trans->t_ticket->t_tid;
1083 __entry->agno = agno;
1084 __entry->agbno = agbno;
1086 __entry->sync = sync;
1088 TP_printk("dev %d:%d trans 0x%p tid 0x%x agno %u agbno %u len %u %s",
1089 MAJOR(__entry->dev), MINOR(__entry->dev),
1095 __print_symbolic(__entry->sync, XFS_BUSY_SYNC))
1099 TRACE_EVENT(xfs_alloc_unbusy,
1100 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1101 xfs_agblock_t agbno, xfs_extlen_t len),
1102 TP_ARGS(mp, agno, agbno, len),
1105 __field(xfs_agnumber_t, agno)
1106 __field(xfs_agblock_t, agbno)
1107 __field(xfs_extlen_t, len)
1110 __entry->dev = mp->m_super->s_dev;
1111 __entry->agno = agno;
1112 __entry->agbno = agbno;
1115 TP_printk("dev %d:%d agno %u agbno %u len %u",
1116 MAJOR(__entry->dev), MINOR(__entry->dev),
1122 #define XFS_BUSY_STATES \
1126 TRACE_EVENT(xfs_alloc_busysearch,
1127 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1128 xfs_agblock_t agbno, xfs_extlen_t len, int found),
1129 TP_ARGS(mp, agno, agbno, len, found),
1132 __field(xfs_agnumber_t, agno)
1133 __field(xfs_agblock_t, agbno)
1134 __field(xfs_extlen_t, len)
1138 __entry->dev = mp->m_super->s_dev;
1139 __entry->agno = agno;
1140 __entry->agbno = agbno;
1142 __entry->found = found;
1144 TP_printk("dev %d:%d agno %u agbno %u len %u %s",
1145 MAJOR(__entry->dev), MINOR(__entry->dev),
1149 __print_symbolic(__entry->found, XFS_BUSY_STATES))
1152 TRACE_EVENT(xfs_trans_commit_lsn,
1153 TP_PROTO(struct xfs_trans *trans),
1157 __field(struct xfs_trans *, tp)
1158 __field(xfs_lsn_t, lsn)
1161 __entry->dev = trans->t_mountp->m_super->s_dev;
1162 __entry->tp = trans;
1163 __entry->lsn = trans->t_commit_lsn;
1165 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1166 MAJOR(__entry->dev), MINOR(__entry->dev),
1171 TRACE_EVENT(xfs_agf,
1172 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1173 unsigned long caller_ip),
1174 TP_ARGS(mp, agf, flags, caller_ip),
1177 __field(xfs_agnumber_t, agno)
1179 __field(__u32, length)
1180 __field(__u32, bno_root)
1181 __field(__u32, cnt_root)
1182 __field(__u32, bno_level)
1183 __field(__u32, cnt_level)
1184 __field(__u32, flfirst)
1185 __field(__u32, fllast)
1186 __field(__u32, flcount)
1187 __field(__u32, freeblks)
1188 __field(__u32, longest)
1189 __field(unsigned long, caller_ip)
1192 __entry->dev = mp->m_super->s_dev;
1193 __entry->agno = be32_to_cpu(agf->agf_seqno),
1194 __entry->flags = flags;
1195 __entry->length = be32_to_cpu(agf->agf_length),
1196 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1197 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1198 __entry->bno_level =
1199 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1200 __entry->cnt_level =
1201 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1202 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1203 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1204 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1205 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1206 __entry->longest = be32_to_cpu(agf->agf_longest);
1207 __entry->caller_ip = caller_ip;
1209 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1210 "levels b %u c %u flfirst %u fllast %u flcount %u "
1211 "freeblks %u longest %u caller %pf",
1212 MAJOR(__entry->dev), MINOR(__entry->dev),
1214 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1225 (void *)__entry->caller_ip)
1228 TRACE_EVENT(xfs_free_extent,
1229 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1230 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1231 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1234 __field(xfs_agnumber_t, agno)
1235 __field(xfs_agblock_t, agbno)
1236 __field(xfs_extlen_t, len)
1238 __field(int, haveleft)
1239 __field(int, haveright)
1242 __entry->dev = mp->m_super->s_dev;
1243 __entry->agno = agno;
1244 __entry->agbno = agbno;
1246 __entry->isfl = isfl;
1247 __entry->haveleft = haveleft;
1248 __entry->haveright = haveright;
1250 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1251 MAJOR(__entry->dev), MINOR(__entry->dev),
1257 (__entry->haveright ? "both" : "left") :
1258 (__entry->haveright ? "right" : "none"))
1262 DECLARE_EVENT_CLASS(xfs_alloc_class,
1263 TP_PROTO(struct xfs_alloc_arg *args),
1267 __field(xfs_agnumber_t, agno)
1268 __field(xfs_agblock_t, agbno)
1269 __field(xfs_extlen_t, minlen)
1270 __field(xfs_extlen_t, maxlen)
1271 __field(xfs_extlen_t, mod)
1272 __field(xfs_extlen_t, prod)
1273 __field(xfs_extlen_t, minleft)
1274 __field(xfs_extlen_t, total)
1275 __field(xfs_extlen_t, alignment)
1276 __field(xfs_extlen_t, minalignslop)
1277 __field(xfs_extlen_t, len)
1278 __field(short, type)
1279 __field(short, otype)
1280 __field(char, wasdel)
1281 __field(char, wasfromfl)
1283 __field(char, userdata)
1284 __field(xfs_fsblock_t, firstblock)
1287 __entry->dev = args->mp->m_super->s_dev;
1288 __entry->agno = args->agno;
1289 __entry->agbno = args->agbno;
1290 __entry->minlen = args->minlen;
1291 __entry->maxlen = args->maxlen;
1292 __entry->mod = args->mod;
1293 __entry->prod = args->prod;
1294 __entry->minleft = args->minleft;
1295 __entry->total = args->total;
1296 __entry->alignment = args->alignment;
1297 __entry->minalignslop = args->minalignslop;
1298 __entry->len = args->len;
1299 __entry->type = args->type;
1300 __entry->otype = args->otype;
1301 __entry->wasdel = args->wasdel;
1302 __entry->wasfromfl = args->wasfromfl;
1303 __entry->isfl = args->isfl;
1304 __entry->userdata = args->userdata;
1305 __entry->firstblock = args->firstblock;
1307 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1308 "prod %u minleft %u total %u alignment %u minalignslop %u "
1309 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1310 "userdata %d firstblock 0x%llx",
1311 MAJOR(__entry->dev), MINOR(__entry->dev),
1321 __entry->minalignslop,
1323 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1324 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1329 __entry->firstblock)
1332 #define DEFINE_ALLOC_EVENT(name) \
1333 DEFINE_EVENT(xfs_alloc_class, name, \
1334 TP_PROTO(struct xfs_alloc_arg *args), \
1336 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1337 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1338 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1339 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1340 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1341 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1342 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1343 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1344 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1345 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1346 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1347 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1348 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1349 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1350 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1351 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1352 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1353 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1354 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1355 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1356 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1358 DECLARE_EVENT_CLASS(xfs_dir2_class,
1359 TP_PROTO(struct xfs_da_args *args),
1363 __field(xfs_ino_t, ino)
1364 __dynamic_array(char, name, args->namelen)
1365 __field(int, namelen)
1366 __field(xfs_dahash_t, hashval)
1367 __field(xfs_ino_t, inumber)
1368 __field(int, op_flags)
1371 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1372 __entry->ino = args->dp->i_ino;
1374 memcpy(__get_str(name), args->name, args->namelen);
1375 __entry->namelen = args->namelen;
1376 __entry->hashval = args->hashval;
1377 __entry->inumber = args->inumber;
1378 __entry->op_flags = args->op_flags;
1380 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1381 "inumber 0x%llx op_flags %s",
1382 MAJOR(__entry->dev), MINOR(__entry->dev),
1385 __entry->namelen ? __get_str(name) : NULL,
1389 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1392 #define DEFINE_DIR2_EVENT(name) \
1393 DEFINE_EVENT(xfs_dir2_class, name, \
1394 TP_PROTO(struct xfs_da_args *args), \
1396 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1397 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1398 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1399 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1400 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1401 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1402 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1403 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1404 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1405 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1406 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1407 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1408 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1409 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1410 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1411 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1412 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1413 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1414 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1415 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1416 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1417 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1418 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1419 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1420 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1422 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1423 TP_PROTO(struct xfs_da_args *args, int idx),
1427 __field(xfs_ino_t, ino)
1428 __field(int, op_flags)
1432 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1433 __entry->ino = args->dp->i_ino;
1434 __entry->op_flags = args->op_flags;
1437 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1438 MAJOR(__entry->dev), MINOR(__entry->dev),
1440 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1444 #define DEFINE_DIR2_SPACE_EVENT(name) \
1445 DEFINE_EVENT(xfs_dir2_space_class, name, \
1446 TP_PROTO(struct xfs_da_args *args, int idx), \
1448 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1449 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1450 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1451 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1453 TRACE_EVENT(xfs_dir2_leafn_moveents,
1454 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1455 TP_ARGS(args, src_idx, dst_idx, count),
1458 __field(xfs_ino_t, ino)
1459 __field(int, op_flags)
1460 __field(int, src_idx)
1461 __field(int, dst_idx)
1465 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1466 __entry->ino = args->dp->i_ino;
1467 __entry->op_flags = args->op_flags;
1468 __entry->src_idx = src_idx;
1469 __entry->dst_idx = dst_idx;
1470 __entry->count = count;
1472 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1473 "src_idx %d dst_idx %d count %d",
1474 MAJOR(__entry->dev), MINOR(__entry->dev),
1476 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1482 #define XFS_SWAPEXT_INODES \
1486 #define XFS_INODE_FORMAT_STR \
1492 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1493 TP_PROTO(struct xfs_inode *ip, int which),
1498 __field(xfs_ino_t, ino)
1499 __field(int, format)
1501 __field(int, max_nex)
1502 __field(int, broot_size)
1503 __field(int, fork_off)
1506 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1507 __entry->which = which;
1508 __entry->ino = ip->i_ino;
1509 __entry->format = ip->i_d.di_format;
1510 __entry->nex = ip->i_d.di_nextents;
1511 __entry->max_nex = ip->i_df.if_ext_max;
1512 __entry->broot_size = ip->i_df.if_broot_bytes;
1513 __entry->fork_off = XFS_IFORK_BOFF(ip);
1515 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1516 "Max in-fork extents %d, broot size %d, fork offset %d",
1517 MAJOR(__entry->dev), MINOR(__entry->dev),
1519 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1520 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1523 __entry->broot_size,
1527 #define DEFINE_SWAPEXT_EVENT(name) \
1528 DEFINE_EVENT(xfs_swap_extent_class, name, \
1529 TP_PROTO(struct xfs_inode *ip, int which), \
1532 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1533 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1535 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
1536 TP_PROTO(struct log *log, struct xlog_recover *trans,
1537 struct xlog_recover_item *item, int pass),
1538 TP_ARGS(log, trans, item, pass),
1541 __field(unsigned long, item)
1542 __field(xlog_tid_t, tid)
1549 __entry->dev = log->l_mp->m_super->s_dev;
1550 __entry->item = (unsigned long)item;
1551 __entry->tid = trans->r_log_tid;
1552 __entry->type = ITEM_TYPE(item);
1553 __entry->pass = pass;
1554 __entry->count = item->ri_cnt;
1555 __entry->total = item->ri_total;
1557 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1558 "item region count/total %d/%d",
1559 MAJOR(__entry->dev), MINOR(__entry->dev),
1562 (void *)__entry->item,
1563 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1568 #define DEFINE_LOG_RECOVER_ITEM(name) \
1569 DEFINE_EVENT(xfs_log_recover_item_class, name, \
1570 TP_PROTO(struct log *log, struct xlog_recover *trans, \
1571 struct xlog_recover_item *item, int pass), \
1572 TP_ARGS(log, trans, item, pass))
1574 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1575 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1576 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1577 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1578 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1580 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
1581 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f),
1582 TP_ARGS(log, buf_f),
1585 __field(__int64_t, blkno)
1586 __field(unsigned short, len)
1587 __field(unsigned short, flags)
1588 __field(unsigned short, size)
1589 __field(unsigned int, map_size)
1592 __entry->dev = log->l_mp->m_super->s_dev;
1593 __entry->blkno = buf_f->blf_blkno;
1594 __entry->len = buf_f->blf_len;
1595 __entry->flags = buf_f->blf_flags;
1596 __entry->size = buf_f->blf_size;
1597 __entry->map_size = buf_f->blf_map_size;
1599 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1601 MAJOR(__entry->dev), MINOR(__entry->dev),
1609 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1610 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
1611 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f), \
1612 TP_ARGS(log, buf_f))
1614 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
1615 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
1616 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
1617 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
1618 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
1619 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
1620 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
1621 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
1623 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
1624 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f),
1628 __field(xfs_ino_t, ino)
1629 __field(unsigned short, size)
1630 __field(int, fields)
1631 __field(unsigned short, asize)
1632 __field(unsigned short, dsize)
1633 __field(__int64_t, blkno)
1635 __field(int, boffset)
1638 __entry->dev = log->l_mp->m_super->s_dev;
1639 __entry->ino = in_f->ilf_ino;
1640 __entry->size = in_f->ilf_size;
1641 __entry->fields = in_f->ilf_fields;
1642 __entry->asize = in_f->ilf_asize;
1643 __entry->dsize = in_f->ilf_dsize;
1644 __entry->blkno = in_f->ilf_blkno;
1645 __entry->len = in_f->ilf_len;
1646 __entry->boffset = in_f->ilf_boffset;
1648 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
1649 "dsize %d, blkno 0x%llx, len %d, boffset %d",
1650 MAJOR(__entry->dev), MINOR(__entry->dev),
1660 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
1661 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
1662 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f), \
1665 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
1666 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
1667 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
1669 #endif /* _TRACE_XFS_H */
1671 #undef TRACE_INCLUDE_PATH
1672 #define TRACE_INCLUDE_PATH .
1673 #define TRACE_INCLUDE_FILE xfs_trace
1674 #include <trace/define_trace.h>