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 DECLARE_EVENT_CLASS(xfs_attr_list_class,
37 TP_PROTO(struct xfs_attr_list_context *ctx),
41 __field(xfs_ino_t, ino)
45 __field(void *, alist)
53 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
54 __entry->ino = ctx->dp->i_ino;
55 __entry->hashval = ctx->cursor->hashval;
56 __entry->blkno = ctx->cursor->blkno;
57 __entry->offset = ctx->cursor->offset;
58 __entry->alist = ctx->alist;
59 __entry->bufsize = ctx->bufsize;
60 __entry->count = ctx->count;
61 __entry->firstu = ctx->firstu;
62 __entry->flags = ctx->flags;
64 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
65 "alist 0x%p size %u count %u firstu %u flags %d %s",
66 MAJOR(__entry->dev), MINOR(__entry->dev),
77 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
81 #define DEFINE_PERAG_REF_EVENT(name) \
83 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
84 unsigned long caller_ip), \
85 TP_ARGS(mp, agno, refcount, caller_ip), \
88 __field(xfs_agnumber_t, agno) \
89 __field(int, refcount) \
90 __field(unsigned long, caller_ip) \
93 __entry->dev = mp->m_super->s_dev; \
94 __entry->agno = agno; \
95 __entry->refcount = refcount; \
96 __entry->caller_ip = caller_ip; \
98 TP_printk("dev %d:%d agno %u refcount %d caller %pf", \
99 MAJOR(__entry->dev), MINOR(__entry->dev), \
102 (char *)__entry->caller_ip) \
105 DEFINE_PERAG_REF_EVENT(xfs_perag_get)
106 DEFINE_PERAG_REF_EVENT(xfs_perag_put)
108 #define DEFINE_ATTR_LIST_EVENT(name) \
109 DEFINE_EVENT(xfs_attr_list_class, name, \
110 TP_PROTO(struct xfs_attr_list_context *ctx), \
112 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
113 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
114 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
115 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
116 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
117 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
118 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
119 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
121 TRACE_EVENT(xfs_attr_list_node_descend,
122 TP_PROTO(struct xfs_attr_list_context *ctx,
123 struct xfs_da_node_entry *btree),
127 __field(xfs_ino_t, ino)
128 __field(u32, hashval)
131 __field(void *, alist)
132 __field(int, bufsize)
137 __field(u32, bt_hashval)
138 __field(u32, bt_before)
141 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
142 __entry->ino = ctx->dp->i_ino;
143 __entry->hashval = ctx->cursor->hashval;
144 __entry->blkno = ctx->cursor->blkno;
145 __entry->offset = ctx->cursor->offset;
146 __entry->alist = ctx->alist;
147 __entry->bufsize = ctx->bufsize;
148 __entry->count = ctx->count;
149 __entry->firstu = ctx->firstu;
150 __entry->flags = ctx->flags;
151 __entry->bt_hashval = be32_to_cpu(btree->hashval);
152 __entry->bt_before = be32_to_cpu(btree->before);
154 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
155 "alist 0x%p size %u count %u firstu %u flags %d %s "
156 "node hashval %u, node before %u",
157 MAJOR(__entry->dev), MINOR(__entry->dev),
168 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
173 TRACE_EVENT(xfs_iext_insert,
174 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
175 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
176 TP_ARGS(ip, idx, r, state, caller_ip),
179 __field(xfs_ino_t, ino)
180 __field(xfs_extnum_t, idx)
181 __field(xfs_fileoff_t, startoff)
182 __field(xfs_fsblock_t, startblock)
183 __field(xfs_filblks_t, blockcount)
184 __field(xfs_exntst_t, state)
185 __field(int, bmap_state)
186 __field(unsigned long, caller_ip)
189 __entry->dev = VFS_I(ip)->i_sb->s_dev;
190 __entry->ino = ip->i_ino;
192 __entry->startoff = r->br_startoff;
193 __entry->startblock = r->br_startblock;
194 __entry->blockcount = r->br_blockcount;
195 __entry->state = r->br_state;
196 __entry->bmap_state = state;
197 __entry->caller_ip = caller_ip;
199 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
200 "offset %lld block %lld count %lld flag %d caller %pf",
201 MAJOR(__entry->dev), MINOR(__entry->dev),
203 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
206 (__int64_t)__entry->startblock,
209 (char *)__entry->caller_ip)
212 DECLARE_EVENT_CLASS(xfs_bmap_class,
213 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
214 unsigned long caller_ip),
215 TP_ARGS(ip, idx, state, caller_ip),
218 __field(xfs_ino_t, ino)
219 __field(xfs_extnum_t, idx)
220 __field(xfs_fileoff_t, startoff)
221 __field(xfs_fsblock_t, startblock)
222 __field(xfs_filblks_t, blockcount)
223 __field(xfs_exntst_t, state)
224 __field(int, bmap_state)
225 __field(unsigned long, caller_ip)
228 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
229 ip->i_afp : &ip->i_df;
230 struct xfs_bmbt_irec r;
232 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
233 __entry->dev = VFS_I(ip)->i_sb->s_dev;
234 __entry->ino = ip->i_ino;
236 __entry->startoff = r.br_startoff;
237 __entry->startblock = r.br_startblock;
238 __entry->blockcount = r.br_blockcount;
239 __entry->state = r.br_state;
240 __entry->bmap_state = state;
241 __entry->caller_ip = caller_ip;
243 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
244 "offset %lld block %lld count %lld flag %d caller %pf",
245 MAJOR(__entry->dev), MINOR(__entry->dev),
247 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
250 (__int64_t)__entry->startblock,
253 (char *)__entry->caller_ip)
256 #define DEFINE_BMAP_EVENT(name) \
257 DEFINE_EVENT(xfs_bmap_class, name, \
258 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
259 unsigned long caller_ip), \
260 TP_ARGS(ip, idx, state, caller_ip))
261 DEFINE_BMAP_EVENT(xfs_iext_remove);
262 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
263 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
264 DEFINE_BMAP_EVENT(xfs_extlist);
266 DECLARE_EVENT_CLASS(xfs_buf_class,
267 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
268 TP_ARGS(bp, caller_ip),
271 __field(xfs_daddr_t, bno)
272 __field(size_t, buffer_length)
274 __field(int, pincount)
275 __field(unsigned, lockval)
276 __field(unsigned, flags)
277 __field(unsigned long, caller_ip)
280 __entry->dev = bp->b_target->bt_dev;
281 __entry->bno = bp->b_bn;
282 __entry->buffer_length = bp->b_buffer_length;
283 __entry->hold = atomic_read(&bp->b_hold);
284 __entry->pincount = atomic_read(&bp->b_pin_count);
285 __entry->lockval = xfs_buf_lock_value(bp);
286 __entry->flags = bp->b_flags;
287 __entry->caller_ip = caller_ip;
289 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
290 "lock %d flags %s caller %pf",
291 MAJOR(__entry->dev), MINOR(__entry->dev),
292 (unsigned long long)__entry->bno,
293 __entry->buffer_length,
297 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
298 (void *)__entry->caller_ip)
301 #define DEFINE_BUF_EVENT(name) \
302 DEFINE_EVENT(xfs_buf_class, name, \
303 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
304 TP_ARGS(bp, caller_ip))
305 DEFINE_BUF_EVENT(xfs_buf_init);
306 DEFINE_BUF_EVENT(xfs_buf_free);
307 DEFINE_BUF_EVENT(xfs_buf_hold);
308 DEFINE_BUF_EVENT(xfs_buf_rele);
309 DEFINE_BUF_EVENT(xfs_buf_pin);
310 DEFINE_BUF_EVENT(xfs_buf_unpin);
311 DEFINE_BUF_EVENT(xfs_buf_iodone);
312 DEFINE_BUF_EVENT(xfs_buf_iorequest);
313 DEFINE_BUF_EVENT(xfs_buf_bawrite);
314 DEFINE_BUF_EVENT(xfs_buf_bdwrite);
315 DEFINE_BUF_EVENT(xfs_buf_lock);
316 DEFINE_BUF_EVENT(xfs_buf_lock_done);
317 DEFINE_BUF_EVENT(xfs_buf_cond_lock);
318 DEFINE_BUF_EVENT(xfs_buf_unlock);
319 DEFINE_BUF_EVENT(xfs_buf_ordered_retry);
320 DEFINE_BUF_EVENT(xfs_buf_iowait);
321 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
322 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
323 DEFINE_BUF_EVENT(xfs_buf_delwri_dequeue);
324 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
325 DEFINE_BUF_EVENT(xfs_buf_get_noaddr);
326 DEFINE_BUF_EVENT(xfs_bdstrat_shut);
327 DEFINE_BUF_EVENT(xfs_buf_item_relse);
328 DEFINE_BUF_EVENT(xfs_buf_item_iodone);
329 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
330 DEFINE_BUF_EVENT(xfs_buf_error_relse);
331 DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
332 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
334 /* not really buffer traces, but the buf provides useful information */
335 DEFINE_BUF_EVENT(xfs_btree_corrupt);
336 DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
337 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
338 DEFINE_BUF_EVENT(xfs_inode_item_push);
340 /* pass flags explicitly */
341 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
342 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
343 TP_ARGS(bp, flags, caller_ip),
346 __field(xfs_daddr_t, bno)
347 __field(size_t, buffer_length)
349 __field(int, pincount)
350 __field(unsigned, lockval)
351 __field(unsigned, flags)
352 __field(unsigned long, caller_ip)
355 __entry->dev = bp->b_target->bt_dev;
356 __entry->bno = bp->b_bn;
357 __entry->buffer_length = bp->b_buffer_length;
358 __entry->flags = flags;
359 __entry->hold = atomic_read(&bp->b_hold);
360 __entry->pincount = atomic_read(&bp->b_pin_count);
361 __entry->lockval = xfs_buf_lock_value(bp);
362 __entry->caller_ip = caller_ip;
364 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
365 "lock %d flags %s caller %pf",
366 MAJOR(__entry->dev), MINOR(__entry->dev),
367 (unsigned long long)__entry->bno,
368 __entry->buffer_length,
372 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
373 (void *)__entry->caller_ip)
376 #define DEFINE_BUF_FLAGS_EVENT(name) \
377 DEFINE_EVENT(xfs_buf_flags_class, name, \
378 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
379 TP_ARGS(bp, flags, caller_ip))
380 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
381 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
382 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
384 TRACE_EVENT(xfs_buf_ioerror,
385 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
386 TP_ARGS(bp, error, caller_ip),
389 __field(xfs_daddr_t, bno)
390 __field(size_t, buffer_length)
391 __field(unsigned, flags)
393 __field(int, pincount)
394 __field(unsigned, lockval)
396 __field(unsigned long, caller_ip)
399 __entry->dev = bp->b_target->bt_dev;
400 __entry->bno = bp->b_bn;
401 __entry->buffer_length = bp->b_buffer_length;
402 __entry->hold = atomic_read(&bp->b_hold);
403 __entry->pincount = atomic_read(&bp->b_pin_count);
404 __entry->lockval = xfs_buf_lock_value(bp);
405 __entry->error = error;
406 __entry->flags = bp->b_flags;
407 __entry->caller_ip = caller_ip;
409 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
410 "lock %d error %d flags %s caller %pf",
411 MAJOR(__entry->dev), MINOR(__entry->dev),
412 (unsigned long long)__entry->bno,
413 __entry->buffer_length,
418 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
419 (void *)__entry->caller_ip)
422 DECLARE_EVENT_CLASS(xfs_buf_item_class,
423 TP_PROTO(struct xfs_buf_log_item *bip),
427 __field(xfs_daddr_t, buf_bno)
428 __field(size_t, buf_len)
429 __field(int, buf_hold)
430 __field(int, buf_pincount)
431 __field(int, buf_lockval)
432 __field(unsigned, buf_flags)
433 __field(unsigned, bli_recur)
434 __field(int, bli_refcount)
435 __field(unsigned, bli_flags)
436 __field(void *, li_desc)
437 __field(unsigned, li_flags)
440 __entry->dev = bip->bli_buf->b_target->bt_dev;
441 __entry->bli_flags = bip->bli_flags;
442 __entry->bli_recur = bip->bli_recur;
443 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
444 __entry->buf_bno = bip->bli_buf->b_bn;
445 __entry->buf_len = bip->bli_buf->b_buffer_length;
446 __entry->buf_flags = bip->bli_buf->b_flags;
447 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
448 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
449 __entry->buf_lockval = xfs_buf_lock_value(bip->bli_buf);
450 __entry->li_desc = bip->bli_item.li_desc;
451 __entry->li_flags = bip->bli_item.li_flags;
453 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
454 "lock %d flags %s recur %d refcount %d bliflags %s "
455 "lidesc 0x%p liflags %s",
456 MAJOR(__entry->dev), MINOR(__entry->dev),
457 (unsigned long long)__entry->buf_bno,
460 __entry->buf_pincount,
461 __entry->buf_lockval,
462 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
464 __entry->bli_refcount,
465 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
467 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
470 #define DEFINE_BUF_ITEM_EVENT(name) \
471 DEFINE_EVENT(xfs_buf_item_class, name, \
472 TP_PROTO(struct xfs_buf_log_item *bip), \
474 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
475 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
476 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
477 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
478 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
479 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
480 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
481 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_trylock);
482 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
483 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
484 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
485 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
486 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pushbuf);
487 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
488 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
489 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
490 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
491 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
492 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
493 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
494 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
495 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
496 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
497 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
498 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
500 DECLARE_EVENT_CLASS(xfs_lock_class,
501 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
502 unsigned long caller_ip),
503 TP_ARGS(ip, lock_flags, caller_ip),
506 __field(xfs_ino_t, ino)
507 __field(int, lock_flags)
508 __field(unsigned long, caller_ip)
511 __entry->dev = VFS_I(ip)->i_sb->s_dev;
512 __entry->ino = ip->i_ino;
513 __entry->lock_flags = lock_flags;
514 __entry->caller_ip = caller_ip;
516 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
517 MAJOR(__entry->dev), MINOR(__entry->dev),
519 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
520 (void *)__entry->caller_ip)
523 #define DEFINE_LOCK_EVENT(name) \
524 DEFINE_EVENT(xfs_lock_class, name, \
525 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
526 unsigned long caller_ip), \
527 TP_ARGS(ip, lock_flags, caller_ip))
528 DEFINE_LOCK_EVENT(xfs_ilock);
529 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
530 DEFINE_LOCK_EVENT(xfs_ilock_demote);
531 DEFINE_LOCK_EVENT(xfs_iunlock);
533 DECLARE_EVENT_CLASS(xfs_iget_class,
534 TP_PROTO(struct xfs_inode *ip),
538 __field(xfs_ino_t, ino)
541 __entry->dev = VFS_I(ip)->i_sb->s_dev;
542 __entry->ino = ip->i_ino;
544 TP_printk("dev %d:%d ino 0x%llx",
545 MAJOR(__entry->dev), MINOR(__entry->dev),
549 #define DEFINE_IGET_EVENT(name) \
550 DEFINE_EVENT(xfs_iget_class, name, \
551 TP_PROTO(struct xfs_inode *ip), \
553 DEFINE_IGET_EVENT(xfs_iget_skip);
554 DEFINE_IGET_EVENT(xfs_iget_reclaim);
555 DEFINE_IGET_EVENT(xfs_iget_found);
556 DEFINE_IGET_EVENT(xfs_iget_alloc);
558 DECLARE_EVENT_CLASS(xfs_inode_class,
559 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
560 TP_ARGS(ip, caller_ip),
563 __field(xfs_ino_t, ino)
565 __field(unsigned long, caller_ip)
568 __entry->dev = VFS_I(ip)->i_sb->s_dev;
569 __entry->ino = ip->i_ino;
570 __entry->count = atomic_read(&VFS_I(ip)->i_count);
571 __entry->caller_ip = caller_ip;
573 TP_printk("dev %d:%d ino 0x%llx count %d caller %pf",
574 MAJOR(__entry->dev), MINOR(__entry->dev),
577 (char *)__entry->caller_ip)
580 #define DEFINE_INODE_EVENT(name) \
581 DEFINE_EVENT(xfs_inode_class, name, \
582 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
583 TP_ARGS(ip, caller_ip))
584 DEFINE_INODE_EVENT(xfs_ihold);
585 DEFINE_INODE_EVENT(xfs_irele);
586 /* the old xfs_itrace_entry tracer - to be replaced by s.th. in the VFS */
587 DEFINE_INODE_EVENT(xfs_inode);
588 #define xfs_itrace_entry(ip) \
589 trace_xfs_inode(ip, _THIS_IP_)
591 DECLARE_EVENT_CLASS(xfs_dquot_class,
592 TP_PROTO(struct xfs_dquot *dqp),
597 __field(unsigned, flags)
598 __field(unsigned, nrefs)
599 __field(unsigned long long, res_bcount)
600 __field(unsigned long long, bcount)
601 __field(unsigned long long, icount)
602 __field(unsigned long long, blk_hardlimit)
603 __field(unsigned long long, blk_softlimit)
604 __field(unsigned long long, ino_hardlimit)
605 __field(unsigned long long, ino_softlimit)
608 __entry->dev = dqp->q_mount->m_super->s_dev;
609 __entry->id = be32_to_cpu(dqp->q_core.d_id);
610 __entry->flags = dqp->dq_flags;
611 __entry->nrefs = dqp->q_nrefs;
612 __entry->res_bcount = dqp->q_res_bcount;
613 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
614 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
615 __entry->blk_hardlimit =
616 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
617 __entry->blk_softlimit =
618 be64_to_cpu(dqp->q_core.d_blk_softlimit);
619 __entry->ino_hardlimit =
620 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
621 __entry->ino_softlimit =
622 be64_to_cpu(dqp->q_core.d_ino_softlimit);
624 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
625 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
626 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
627 MAJOR(__entry->dev), MINOR(__entry->dev),
629 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
633 __entry->blk_hardlimit,
634 __entry->blk_softlimit,
636 __entry->ino_hardlimit,
637 __entry->ino_softlimit)
640 #define DEFINE_DQUOT_EVENT(name) \
641 DEFINE_EVENT(xfs_dquot_class, name, \
642 TP_PROTO(struct xfs_dquot *dqp), \
644 DEFINE_DQUOT_EVENT(xfs_dqadjust);
645 DEFINE_DQUOT_EVENT(xfs_dqshake_dirty);
646 DEFINE_DQUOT_EVENT(xfs_dqshake_unlink);
647 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
648 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
649 DEFINE_DQUOT_EVENT(xfs_dqreclaim_unlink);
650 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
651 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
652 DEFINE_DQUOT_EVENT(xfs_dqinit);
653 DEFINE_DQUOT_EVENT(xfs_dqreuse);
654 DEFINE_DQUOT_EVENT(xfs_dqalloc);
655 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
656 DEFINE_DQUOT_EVENT(xfs_dqread);
657 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
658 DEFINE_DQUOT_EVENT(xfs_dqlookup_found);
659 DEFINE_DQUOT_EVENT(xfs_dqlookup_want);
660 DEFINE_DQUOT_EVENT(xfs_dqlookup_freelist);
661 DEFINE_DQUOT_EVENT(xfs_dqlookup_move);
662 DEFINE_DQUOT_EVENT(xfs_dqlookup_done);
663 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
664 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
665 DEFINE_DQUOT_EVENT(xfs_dqput);
666 DEFINE_DQUOT_EVENT(xfs_dqput_wait);
667 DEFINE_DQUOT_EVENT(xfs_dqput_free);
668 DEFINE_DQUOT_EVENT(xfs_dqrele);
669 DEFINE_DQUOT_EVENT(xfs_dqflush);
670 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
671 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
672 /* not really iget events, but we re-use the format */
673 DEFINE_IGET_EVENT(xfs_dquot_dqalloc);
674 DEFINE_IGET_EVENT(xfs_dquot_dqdetach);
676 DECLARE_EVENT_CLASS(xfs_loggrant_class,
677 TP_PROTO(struct log *log, struct xlog_ticket *tic),
681 __field(unsigned, trans_type)
684 __field(int, curr_res)
685 __field(int, unit_res)
686 __field(unsigned int, flags)
687 __field(void *, reserve_headq)
688 __field(void *, write_headq)
689 __field(int, grant_reserve_cycle)
690 __field(int, grant_reserve_bytes)
691 __field(int, grant_write_cycle)
692 __field(int, grant_write_bytes)
693 __field(int, curr_cycle)
694 __field(int, curr_block)
695 __field(xfs_lsn_t, tail_lsn)
698 __entry->dev = log->l_mp->m_super->s_dev;
699 __entry->trans_type = tic->t_trans_type;
700 __entry->ocnt = tic->t_ocnt;
701 __entry->cnt = tic->t_cnt;
702 __entry->curr_res = tic->t_curr_res;
703 __entry->unit_res = tic->t_unit_res;
704 __entry->flags = tic->t_flags;
705 __entry->reserve_headq = log->l_reserve_headq;
706 __entry->write_headq = log->l_write_headq;
707 __entry->grant_reserve_cycle = log->l_grant_reserve_cycle;
708 __entry->grant_reserve_bytes = log->l_grant_reserve_bytes;
709 __entry->grant_write_cycle = log->l_grant_write_cycle;
710 __entry->grant_write_bytes = log->l_grant_write_bytes;
711 __entry->curr_cycle = log->l_curr_cycle;
712 __entry->curr_block = log->l_curr_block;
713 __entry->tail_lsn = log->l_tail_lsn;
715 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
716 "t_unit_res %u t_flags %s reserve_headq 0x%p "
717 "write_headq 0x%p grant_reserve_cycle %d "
718 "grant_reserve_bytes %d grant_write_cycle %d "
719 "grant_write_bytes %d curr_cycle %d curr_block %d "
720 "tail_cycle %d tail_block %d",
721 MAJOR(__entry->dev), MINOR(__entry->dev),
722 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
727 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
728 __entry->reserve_headq,
729 __entry->write_headq,
730 __entry->grant_reserve_cycle,
731 __entry->grant_reserve_bytes,
732 __entry->grant_write_cycle,
733 __entry->grant_write_bytes,
736 CYCLE_LSN(__entry->tail_lsn),
737 BLOCK_LSN(__entry->tail_lsn)
741 #define DEFINE_LOGGRANT_EVENT(name) \
742 DEFINE_EVENT(xfs_loggrant_class, name, \
743 TP_PROTO(struct log *log, struct xlog_ticket *tic), \
745 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
746 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
747 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
748 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
749 DEFINE_LOGGRANT_EVENT(xfs_log_grant_enter);
750 DEFINE_LOGGRANT_EVENT(xfs_log_grant_exit);
751 DEFINE_LOGGRANT_EVENT(xfs_log_grant_error);
752 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep1);
753 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake1);
754 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep2);
755 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake2);
756 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_enter);
757 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_exit);
758 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_error);
759 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep1);
760 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake1);
761 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep2);
762 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake2);
763 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
764 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
765 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
766 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
767 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
768 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
770 #define DEFINE_RW_EVENT(name) \
772 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
773 TP_ARGS(ip, count, offset, flags), \
775 __field(dev_t, dev) \
776 __field(xfs_ino_t, ino) \
777 __field(xfs_fsize_t, size) \
778 __field(xfs_fsize_t, new_size) \
779 __field(loff_t, offset) \
780 __field(size_t, count) \
781 __field(int, flags) \
784 __entry->dev = VFS_I(ip)->i_sb->s_dev; \
785 __entry->ino = ip->i_ino; \
786 __entry->size = ip->i_d.di_size; \
787 __entry->new_size = ip->i_new_size; \
788 __entry->offset = offset; \
789 __entry->count = count; \
790 __entry->flags = flags; \
792 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
793 "offset 0x%llx count 0x%zx ioflags %s", \
794 MAJOR(__entry->dev), MINOR(__entry->dev), \
800 __print_flags(__entry->flags, "|", XFS_IO_FLAGS)) \
802 DEFINE_RW_EVENT(xfs_file_read);
803 DEFINE_RW_EVENT(xfs_file_buffered_write);
804 DEFINE_RW_EVENT(xfs_file_direct_write);
805 DEFINE_RW_EVENT(xfs_file_splice_read);
806 DEFINE_RW_EVENT(xfs_file_splice_write);
809 #define DEFINE_PAGE_EVENT(name) \
811 TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \
812 TP_ARGS(inode, page, off), \
814 __field(dev_t, dev) \
815 __field(xfs_ino_t, ino) \
816 __field(pgoff_t, pgoff) \
817 __field(loff_t, size) \
818 __field(unsigned long, offset) \
819 __field(int, delalloc) \
820 __field(int, unmapped) \
821 __field(int, unwritten) \
824 int delalloc = -1, unmapped = -1, unwritten = -1; \
826 if (page_has_buffers(page)) \
827 xfs_count_page_state(page, &delalloc, \
828 &unmapped, &unwritten); \
829 __entry->dev = inode->i_sb->s_dev; \
830 __entry->ino = XFS_I(inode)->i_ino; \
831 __entry->pgoff = page_offset(page); \
832 __entry->size = i_size_read(inode); \
833 __entry->offset = off; \
834 __entry->delalloc = delalloc; \
835 __entry->unmapped = unmapped; \
836 __entry->unwritten = unwritten; \
838 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx " \
839 "delalloc %d unmapped %d unwritten %d", \
840 MAJOR(__entry->dev), MINOR(__entry->dev), \
847 __entry->unwritten) \
849 DEFINE_PAGE_EVENT(xfs_writepage);
850 DEFINE_PAGE_EVENT(xfs_releasepage);
851 DEFINE_PAGE_EVENT(xfs_invalidatepage);
853 #define DEFINE_IOMAP_EVENT(name) \
855 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
856 int flags, struct xfs_bmbt_irec *irec), \
857 TP_ARGS(ip, offset, count, flags, irec), \
859 __field(dev_t, dev) \
860 __field(xfs_ino_t, ino) \
861 __field(loff_t, size) \
862 __field(loff_t, new_size) \
863 __field(loff_t, offset) \
864 __field(size_t, count) \
865 __field(int, flags) \
866 __field(xfs_fileoff_t, startoff) \
867 __field(xfs_fsblock_t, startblock) \
868 __field(xfs_filblks_t, blockcount) \
871 __entry->dev = VFS_I(ip)->i_sb->s_dev; \
872 __entry->ino = ip->i_ino; \
873 __entry->size = ip->i_d.di_size; \
874 __entry->new_size = ip->i_new_size; \
875 __entry->offset = offset; \
876 __entry->count = count; \
877 __entry->flags = flags; \
878 __entry->startoff = irec ? irec->br_startoff : 0; \
879 __entry->startblock = irec ? irec->br_startblock : 0; \
880 __entry->blockcount = irec ? irec->br_blockcount : 0; \
882 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
883 "offset 0x%llx count %zd flags %s " \
884 "startoff 0x%llx startblock %lld blockcount 0x%llx", \
885 MAJOR(__entry->dev), MINOR(__entry->dev), \
891 __print_flags(__entry->flags, "|", BMAPI_FLAGS), \
893 (__int64_t)__entry->startblock, \
894 __entry->blockcount) \
896 DEFINE_IOMAP_EVENT(xfs_iomap_enter);
897 DEFINE_IOMAP_EVENT(xfs_iomap_found);
898 DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
900 #define DEFINE_SIMPLE_IO_EVENT(name) \
902 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
903 TP_ARGS(ip, offset, count), \
905 __field(dev_t, dev) \
906 __field(xfs_ino_t, ino) \
907 __field(loff_t, size) \
908 __field(loff_t, new_size) \
909 __field(loff_t, offset) \
910 __field(size_t, count) \
913 __entry->dev = VFS_I(ip)->i_sb->s_dev; \
914 __entry->ino = ip->i_ino; \
915 __entry->size = ip->i_d.di_size; \
916 __entry->new_size = ip->i_new_size; \
917 __entry->offset = offset; \
918 __entry->count = count; \
920 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
921 "offset 0x%llx count %zd", \
922 MAJOR(__entry->dev), MINOR(__entry->dev), \
929 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
930 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
933 TRACE_EVENT(xfs_itruncate_start,
934 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size, int flag,
935 xfs_off_t toss_start, xfs_off_t toss_finish),
936 TP_ARGS(ip, new_size, flag, toss_start, toss_finish),
939 __field(xfs_ino_t, ino)
940 __field(xfs_fsize_t, size)
941 __field(xfs_fsize_t, new_size)
942 __field(xfs_off_t, toss_start)
943 __field(xfs_off_t, toss_finish)
947 __entry->dev = VFS_I(ip)->i_sb->s_dev;
948 __entry->ino = ip->i_ino;
949 __entry->size = ip->i_d.di_size;
950 __entry->new_size = new_size;
951 __entry->toss_start = toss_start;
952 __entry->toss_finish = toss_finish;
953 __entry->flag = flag;
955 TP_printk("dev %d:%d ino 0x%llx %s size 0x%llx new_size 0x%llx "
956 "toss start 0x%llx toss finish 0x%llx",
957 MAJOR(__entry->dev), MINOR(__entry->dev),
959 __print_flags(__entry->flag, "|", XFS_ITRUNC_FLAGS),
963 __entry->toss_finish)
966 DECLARE_EVENT_CLASS(xfs_itrunc_class,
967 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
968 TP_ARGS(ip, new_size),
971 __field(xfs_ino_t, ino)
972 __field(xfs_fsize_t, size)
973 __field(xfs_fsize_t, new_size)
976 __entry->dev = VFS_I(ip)->i_sb->s_dev;
977 __entry->ino = ip->i_ino;
978 __entry->size = ip->i_d.di_size;
979 __entry->new_size = new_size;
981 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
982 MAJOR(__entry->dev), MINOR(__entry->dev),
988 #define DEFINE_ITRUNC_EVENT(name) \
989 DEFINE_EVENT(xfs_itrunc_class, name, \
990 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
991 TP_ARGS(ip, new_size))
992 DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_start);
993 DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_end);
995 TRACE_EVENT(xfs_pagecache_inval,
996 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
997 TP_ARGS(ip, start, finish),
1000 __field(xfs_ino_t, ino)
1001 __field(xfs_fsize_t, size)
1002 __field(xfs_off_t, start)
1003 __field(xfs_off_t, finish)
1006 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1007 __entry->ino = ip->i_ino;
1008 __entry->size = ip->i_d.di_size;
1009 __entry->start = start;
1010 __entry->finish = finish;
1012 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1013 MAJOR(__entry->dev), MINOR(__entry->dev),
1020 TRACE_EVENT(xfs_bunmap,
1021 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1022 int flags, unsigned long caller_ip),
1023 TP_ARGS(ip, bno, len, flags, caller_ip),
1026 __field(xfs_ino_t, ino)
1027 __field(xfs_fsize_t, size)
1028 __field(xfs_fileoff_t, bno)
1029 __field(xfs_filblks_t, len)
1030 __field(unsigned long, caller_ip)
1034 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1035 __entry->ino = ip->i_ino;
1036 __entry->size = ip->i_d.di_size;
1039 __entry->caller_ip = caller_ip;
1040 __entry->flags = flags;
1042 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1043 "flags %s caller %pf",
1044 MAJOR(__entry->dev), MINOR(__entry->dev),
1049 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1050 (void *)__entry->caller_ip)
1054 TRACE_EVENT(xfs_alloc_busy,
1055 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1056 xfs_extlen_t len, int slot),
1057 TP_ARGS(mp, agno, agbno, len, slot),
1060 __field(xfs_agnumber_t, agno)
1061 __field(xfs_agblock_t, agbno)
1062 __field(xfs_extlen_t, len)
1066 __entry->dev = mp->m_super->s_dev;
1067 __entry->agno = agno;
1068 __entry->agbno = agbno;
1070 __entry->slot = slot;
1072 TP_printk("dev %d:%d agno %u agbno %u len %u slot %d",
1073 MAJOR(__entry->dev), MINOR(__entry->dev),
1081 #define XFS_BUSY_STATES \
1085 TRACE_EVENT(xfs_alloc_unbusy,
1086 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1087 int slot, int found),
1088 TP_ARGS(mp, agno, slot, found),
1091 __field(xfs_agnumber_t, agno)
1096 __entry->dev = mp->m_super->s_dev;
1097 __entry->agno = agno;
1098 __entry->slot = slot;
1099 __entry->found = found;
1101 TP_printk("dev %d:%d agno %u slot %d %s",
1102 MAJOR(__entry->dev), MINOR(__entry->dev),
1105 __print_symbolic(__entry->found, XFS_BUSY_STATES))
1108 TRACE_EVENT(xfs_alloc_busysearch,
1109 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1110 xfs_extlen_t len, xfs_lsn_t lsn),
1111 TP_ARGS(mp, agno, agbno, len, lsn),
1114 __field(xfs_agnumber_t, agno)
1115 __field(xfs_agblock_t, agbno)
1116 __field(xfs_extlen_t, len)
1117 __field(xfs_lsn_t, lsn)
1120 __entry->dev = mp->m_super->s_dev;
1121 __entry->agno = agno;
1122 __entry->agbno = agbno;
1126 TP_printk("dev %d:%d agno %u agbno %u len %u force lsn 0x%llx",
1127 MAJOR(__entry->dev), MINOR(__entry->dev),
1134 TRACE_EVENT(xfs_agf,
1135 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1136 unsigned long caller_ip),
1137 TP_ARGS(mp, agf, flags, caller_ip),
1140 __field(xfs_agnumber_t, agno)
1142 __field(__u32, length)
1143 __field(__u32, bno_root)
1144 __field(__u32, cnt_root)
1145 __field(__u32, bno_level)
1146 __field(__u32, cnt_level)
1147 __field(__u32, flfirst)
1148 __field(__u32, fllast)
1149 __field(__u32, flcount)
1150 __field(__u32, freeblks)
1151 __field(__u32, longest)
1152 __field(unsigned long, caller_ip)
1155 __entry->dev = mp->m_super->s_dev;
1156 __entry->agno = be32_to_cpu(agf->agf_seqno),
1157 __entry->flags = flags;
1158 __entry->length = be32_to_cpu(agf->agf_length),
1159 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1160 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1161 __entry->bno_level =
1162 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1163 __entry->cnt_level =
1164 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1165 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1166 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1167 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1168 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1169 __entry->longest = be32_to_cpu(agf->agf_longest);
1170 __entry->caller_ip = caller_ip;
1172 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1173 "levels b %u c %u flfirst %u fllast %u flcount %u "
1174 "freeblks %u longest %u caller %pf",
1175 MAJOR(__entry->dev), MINOR(__entry->dev),
1177 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1188 (void *)__entry->caller_ip)
1191 TRACE_EVENT(xfs_free_extent,
1192 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1193 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1194 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1197 __field(xfs_agnumber_t, agno)
1198 __field(xfs_agblock_t, agbno)
1199 __field(xfs_extlen_t, len)
1201 __field(int, haveleft)
1202 __field(int, haveright)
1205 __entry->dev = mp->m_super->s_dev;
1206 __entry->agno = agno;
1207 __entry->agbno = agbno;
1209 __entry->isfl = isfl;
1210 __entry->haveleft = haveleft;
1211 __entry->haveright = haveright;
1213 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1214 MAJOR(__entry->dev), MINOR(__entry->dev),
1220 (__entry->haveright ? "both" : "left") :
1221 (__entry->haveright ? "right" : "none"))
1225 DECLARE_EVENT_CLASS(xfs_alloc_class,
1226 TP_PROTO(struct xfs_alloc_arg *args),
1230 __field(xfs_agnumber_t, agno)
1231 __field(xfs_agblock_t, agbno)
1232 __field(xfs_extlen_t, minlen)
1233 __field(xfs_extlen_t, maxlen)
1234 __field(xfs_extlen_t, mod)
1235 __field(xfs_extlen_t, prod)
1236 __field(xfs_extlen_t, minleft)
1237 __field(xfs_extlen_t, total)
1238 __field(xfs_extlen_t, alignment)
1239 __field(xfs_extlen_t, minalignslop)
1240 __field(xfs_extlen_t, len)
1241 __field(short, type)
1242 __field(short, otype)
1243 __field(char, wasdel)
1244 __field(char, wasfromfl)
1246 __field(char, userdata)
1247 __field(xfs_fsblock_t, firstblock)
1250 __entry->dev = args->mp->m_super->s_dev;
1251 __entry->agno = args->agno;
1252 __entry->agbno = args->agbno;
1253 __entry->minlen = args->minlen;
1254 __entry->maxlen = args->maxlen;
1255 __entry->mod = args->mod;
1256 __entry->prod = args->prod;
1257 __entry->minleft = args->minleft;
1258 __entry->total = args->total;
1259 __entry->alignment = args->alignment;
1260 __entry->minalignslop = args->minalignslop;
1261 __entry->len = args->len;
1262 __entry->type = args->type;
1263 __entry->otype = args->otype;
1264 __entry->wasdel = args->wasdel;
1265 __entry->wasfromfl = args->wasfromfl;
1266 __entry->isfl = args->isfl;
1267 __entry->userdata = args->userdata;
1268 __entry->firstblock = args->firstblock;
1270 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1271 "prod %u minleft %u total %u alignment %u minalignslop %u "
1272 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1273 "userdata %d firstblock 0x%llx",
1274 MAJOR(__entry->dev), MINOR(__entry->dev),
1284 __entry->minalignslop,
1286 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1287 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1292 __entry->firstblock)
1295 #define DEFINE_ALLOC_EVENT(name) \
1296 DEFINE_EVENT(xfs_alloc_class, name, \
1297 TP_PROTO(struct xfs_alloc_arg *args), \
1299 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1300 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1301 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1302 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1303 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1304 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1305 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1306 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1307 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1308 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1309 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1310 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1311 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1312 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1313 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1314 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1315 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1316 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1317 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1318 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1319 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1321 DECLARE_EVENT_CLASS(xfs_dir2_class,
1322 TP_PROTO(struct xfs_da_args *args),
1326 __field(xfs_ino_t, ino)
1327 __dynamic_array(char, name, args->namelen)
1328 __field(int, namelen)
1329 __field(xfs_dahash_t, hashval)
1330 __field(xfs_ino_t, inumber)
1331 __field(int, op_flags)
1334 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1335 __entry->ino = args->dp->i_ino;
1337 memcpy(__get_str(name), args->name, args->namelen);
1338 __entry->namelen = args->namelen;
1339 __entry->hashval = args->hashval;
1340 __entry->inumber = args->inumber;
1341 __entry->op_flags = args->op_flags;
1343 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1344 "inumber 0x%llx op_flags %s",
1345 MAJOR(__entry->dev), MINOR(__entry->dev),
1348 __entry->namelen ? __get_str(name) : NULL,
1352 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1355 #define DEFINE_DIR2_EVENT(name) \
1356 DEFINE_EVENT(xfs_dir2_class, name, \
1357 TP_PROTO(struct xfs_da_args *args), \
1359 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1360 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1361 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1362 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1363 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1364 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1365 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1366 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1367 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1368 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1369 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1370 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1371 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1372 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1373 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1374 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1375 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1376 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1377 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1378 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1379 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1380 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1381 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1382 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1383 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1385 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1386 TP_PROTO(struct xfs_da_args *args, int idx),
1390 __field(xfs_ino_t, ino)
1391 __field(int, op_flags)
1395 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1396 __entry->ino = args->dp->i_ino;
1397 __entry->op_flags = args->op_flags;
1400 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1401 MAJOR(__entry->dev), MINOR(__entry->dev),
1403 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1407 #define DEFINE_DIR2_SPACE_EVENT(name) \
1408 DEFINE_EVENT(xfs_dir2_space_class, name, \
1409 TP_PROTO(struct xfs_da_args *args, int idx), \
1411 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1412 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1413 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1414 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1416 TRACE_EVENT(xfs_dir2_leafn_moveents,
1417 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1418 TP_ARGS(args, src_idx, dst_idx, count),
1421 __field(xfs_ino_t, ino)
1422 __field(int, op_flags)
1423 __field(int, src_idx)
1424 __field(int, dst_idx)
1428 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1429 __entry->ino = args->dp->i_ino;
1430 __entry->op_flags = args->op_flags;
1431 __entry->src_idx = src_idx;
1432 __entry->dst_idx = dst_idx;
1433 __entry->count = count;
1435 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1436 "src_idx %d dst_idx %d count %d",
1437 MAJOR(__entry->dev), MINOR(__entry->dev),
1439 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1445 #define XFS_SWAPEXT_INODES \
1449 #define XFS_INODE_FORMAT_STR \
1455 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1456 TP_PROTO(struct xfs_inode *ip, int which),
1461 __field(xfs_ino_t, ino)
1462 __field(int, format)
1464 __field(int, max_nex)
1465 __field(int, broot_size)
1466 __field(int, fork_off)
1469 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1470 __entry->which = which;
1471 __entry->ino = ip->i_ino;
1472 __entry->format = ip->i_d.di_format;
1473 __entry->nex = ip->i_d.di_nextents;
1474 __entry->max_nex = ip->i_df.if_ext_max;
1475 __entry->broot_size = ip->i_df.if_broot_bytes;
1476 __entry->fork_off = XFS_IFORK_BOFF(ip);
1478 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1479 "Max in-fork extents %d, broot size %d, fork offset %d",
1480 MAJOR(__entry->dev), MINOR(__entry->dev),
1482 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1483 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1486 __entry->broot_size,
1490 #define DEFINE_SWAPEXT_EVENT(name) \
1491 DEFINE_EVENT(xfs_swap_extent_class, name, \
1492 TP_PROTO(struct xfs_inode *ip, int which), \
1495 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1496 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1498 #endif /* _TRACE_XFS_H */
1500 #undef TRACE_INCLUDE_PATH
1501 #define TRACE_INCLUDE_PATH .
1502 #define TRACE_INCLUDE_FILE xfs_trace
1503 #include <trace/define_trace.h>