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 TRACE_EVENT(xfs_alloc_busy,
1063 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1064 xfs_extlen_t len, int slot),
1065 TP_ARGS(mp, agno, agbno, len, slot),
1068 __field(xfs_agnumber_t, agno)
1069 __field(xfs_agblock_t, agbno)
1070 __field(xfs_extlen_t, len)
1074 __entry->dev = mp->m_super->s_dev;
1075 __entry->agno = agno;
1076 __entry->agbno = agbno;
1078 __entry->slot = slot;
1080 TP_printk("dev %d:%d agno %u agbno %u len %u slot %d",
1081 MAJOR(__entry->dev), MINOR(__entry->dev),
1089 #define XFS_BUSY_STATES \
1093 TRACE_EVENT(xfs_alloc_unbusy,
1094 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1095 int slot, int found),
1096 TP_ARGS(mp, agno, slot, found),
1099 __field(xfs_agnumber_t, agno)
1104 __entry->dev = mp->m_super->s_dev;
1105 __entry->agno = agno;
1106 __entry->slot = slot;
1107 __entry->found = found;
1109 TP_printk("dev %d:%d agno %u slot %d %s",
1110 MAJOR(__entry->dev), MINOR(__entry->dev),
1113 __print_symbolic(__entry->found, XFS_BUSY_STATES))
1116 TRACE_EVENT(xfs_alloc_busysearch,
1117 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1118 xfs_extlen_t len, xfs_lsn_t lsn),
1119 TP_ARGS(mp, agno, agbno, len, lsn),
1122 __field(xfs_agnumber_t, agno)
1123 __field(xfs_agblock_t, agbno)
1124 __field(xfs_extlen_t, len)
1125 __field(xfs_lsn_t, lsn)
1128 __entry->dev = mp->m_super->s_dev;
1129 __entry->agno = agno;
1130 __entry->agbno = agbno;
1134 TP_printk("dev %d:%d agno %u agbno %u len %u force lsn 0x%llx",
1135 MAJOR(__entry->dev), MINOR(__entry->dev),
1142 TRACE_EVENT(xfs_agf,
1143 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1144 unsigned long caller_ip),
1145 TP_ARGS(mp, agf, flags, caller_ip),
1148 __field(xfs_agnumber_t, agno)
1150 __field(__u32, length)
1151 __field(__u32, bno_root)
1152 __field(__u32, cnt_root)
1153 __field(__u32, bno_level)
1154 __field(__u32, cnt_level)
1155 __field(__u32, flfirst)
1156 __field(__u32, fllast)
1157 __field(__u32, flcount)
1158 __field(__u32, freeblks)
1159 __field(__u32, longest)
1160 __field(unsigned long, caller_ip)
1163 __entry->dev = mp->m_super->s_dev;
1164 __entry->agno = be32_to_cpu(agf->agf_seqno),
1165 __entry->flags = flags;
1166 __entry->length = be32_to_cpu(agf->agf_length),
1167 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1168 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1169 __entry->bno_level =
1170 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1171 __entry->cnt_level =
1172 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1173 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1174 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1175 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1176 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1177 __entry->longest = be32_to_cpu(agf->agf_longest);
1178 __entry->caller_ip = caller_ip;
1180 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1181 "levels b %u c %u flfirst %u fllast %u flcount %u "
1182 "freeblks %u longest %u caller %pf",
1183 MAJOR(__entry->dev), MINOR(__entry->dev),
1185 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1196 (void *)__entry->caller_ip)
1199 TRACE_EVENT(xfs_free_extent,
1200 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1201 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1202 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1205 __field(xfs_agnumber_t, agno)
1206 __field(xfs_agblock_t, agbno)
1207 __field(xfs_extlen_t, len)
1209 __field(int, haveleft)
1210 __field(int, haveright)
1213 __entry->dev = mp->m_super->s_dev;
1214 __entry->agno = agno;
1215 __entry->agbno = agbno;
1217 __entry->isfl = isfl;
1218 __entry->haveleft = haveleft;
1219 __entry->haveright = haveright;
1221 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1222 MAJOR(__entry->dev), MINOR(__entry->dev),
1228 (__entry->haveright ? "both" : "left") :
1229 (__entry->haveright ? "right" : "none"))
1233 DECLARE_EVENT_CLASS(xfs_alloc_class,
1234 TP_PROTO(struct xfs_alloc_arg *args),
1238 __field(xfs_agnumber_t, agno)
1239 __field(xfs_agblock_t, agbno)
1240 __field(xfs_extlen_t, minlen)
1241 __field(xfs_extlen_t, maxlen)
1242 __field(xfs_extlen_t, mod)
1243 __field(xfs_extlen_t, prod)
1244 __field(xfs_extlen_t, minleft)
1245 __field(xfs_extlen_t, total)
1246 __field(xfs_extlen_t, alignment)
1247 __field(xfs_extlen_t, minalignslop)
1248 __field(xfs_extlen_t, len)
1249 __field(short, type)
1250 __field(short, otype)
1251 __field(char, wasdel)
1252 __field(char, wasfromfl)
1254 __field(char, userdata)
1255 __field(xfs_fsblock_t, firstblock)
1258 __entry->dev = args->mp->m_super->s_dev;
1259 __entry->agno = args->agno;
1260 __entry->agbno = args->agbno;
1261 __entry->minlen = args->minlen;
1262 __entry->maxlen = args->maxlen;
1263 __entry->mod = args->mod;
1264 __entry->prod = args->prod;
1265 __entry->minleft = args->minleft;
1266 __entry->total = args->total;
1267 __entry->alignment = args->alignment;
1268 __entry->minalignslop = args->minalignslop;
1269 __entry->len = args->len;
1270 __entry->type = args->type;
1271 __entry->otype = args->otype;
1272 __entry->wasdel = args->wasdel;
1273 __entry->wasfromfl = args->wasfromfl;
1274 __entry->isfl = args->isfl;
1275 __entry->userdata = args->userdata;
1276 __entry->firstblock = args->firstblock;
1278 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1279 "prod %u minleft %u total %u alignment %u minalignslop %u "
1280 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1281 "userdata %d firstblock 0x%llx",
1282 MAJOR(__entry->dev), MINOR(__entry->dev),
1292 __entry->minalignslop,
1294 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1295 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1300 __entry->firstblock)
1303 #define DEFINE_ALLOC_EVENT(name) \
1304 DEFINE_EVENT(xfs_alloc_class, name, \
1305 TP_PROTO(struct xfs_alloc_arg *args), \
1307 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1308 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1309 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1310 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1311 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1312 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1313 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1314 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1315 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1316 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1317 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1318 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1319 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1320 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1321 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1322 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1323 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1324 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1325 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1326 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1327 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1329 DECLARE_EVENT_CLASS(xfs_dir2_class,
1330 TP_PROTO(struct xfs_da_args *args),
1334 __field(xfs_ino_t, ino)
1335 __dynamic_array(char, name, args->namelen)
1336 __field(int, namelen)
1337 __field(xfs_dahash_t, hashval)
1338 __field(xfs_ino_t, inumber)
1339 __field(int, op_flags)
1342 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1343 __entry->ino = args->dp->i_ino;
1345 memcpy(__get_str(name), args->name, args->namelen);
1346 __entry->namelen = args->namelen;
1347 __entry->hashval = args->hashval;
1348 __entry->inumber = args->inumber;
1349 __entry->op_flags = args->op_flags;
1351 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1352 "inumber 0x%llx op_flags %s",
1353 MAJOR(__entry->dev), MINOR(__entry->dev),
1356 __entry->namelen ? __get_str(name) : NULL,
1360 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1363 #define DEFINE_DIR2_EVENT(name) \
1364 DEFINE_EVENT(xfs_dir2_class, name, \
1365 TP_PROTO(struct xfs_da_args *args), \
1367 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1368 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1369 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1370 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1371 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1372 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1373 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1374 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1375 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1376 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1377 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1378 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1379 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1380 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1381 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1382 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1383 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1384 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1385 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1386 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1387 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1388 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1389 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1390 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1391 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1393 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1394 TP_PROTO(struct xfs_da_args *args, int idx),
1398 __field(xfs_ino_t, ino)
1399 __field(int, op_flags)
1403 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1404 __entry->ino = args->dp->i_ino;
1405 __entry->op_flags = args->op_flags;
1408 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1409 MAJOR(__entry->dev), MINOR(__entry->dev),
1411 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1415 #define DEFINE_DIR2_SPACE_EVENT(name) \
1416 DEFINE_EVENT(xfs_dir2_space_class, name, \
1417 TP_PROTO(struct xfs_da_args *args, int idx), \
1419 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1420 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1421 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1422 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1424 TRACE_EVENT(xfs_dir2_leafn_moveents,
1425 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1426 TP_ARGS(args, src_idx, dst_idx, count),
1429 __field(xfs_ino_t, ino)
1430 __field(int, op_flags)
1431 __field(int, src_idx)
1432 __field(int, dst_idx)
1436 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1437 __entry->ino = args->dp->i_ino;
1438 __entry->op_flags = args->op_flags;
1439 __entry->src_idx = src_idx;
1440 __entry->dst_idx = dst_idx;
1441 __entry->count = count;
1443 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1444 "src_idx %d dst_idx %d count %d",
1445 MAJOR(__entry->dev), MINOR(__entry->dev),
1447 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1453 #define XFS_SWAPEXT_INODES \
1457 #define XFS_INODE_FORMAT_STR \
1463 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1464 TP_PROTO(struct xfs_inode *ip, int which),
1469 __field(xfs_ino_t, ino)
1470 __field(int, format)
1472 __field(int, max_nex)
1473 __field(int, broot_size)
1474 __field(int, fork_off)
1477 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1478 __entry->which = which;
1479 __entry->ino = ip->i_ino;
1480 __entry->format = ip->i_d.di_format;
1481 __entry->nex = ip->i_d.di_nextents;
1482 __entry->max_nex = ip->i_df.if_ext_max;
1483 __entry->broot_size = ip->i_df.if_broot_bytes;
1484 __entry->fork_off = XFS_IFORK_BOFF(ip);
1486 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1487 "Max in-fork extents %d, broot size %d, fork offset %d",
1488 MAJOR(__entry->dev), MINOR(__entry->dev),
1490 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1491 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1494 __entry->broot_size,
1498 #define DEFINE_SWAPEXT_EVENT(name) \
1499 DEFINE_EVENT(xfs_swap_extent_class, name, \
1500 TP_PROTO(struct xfs_inode *ip, int which), \
1503 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1504 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1506 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
1507 TP_PROTO(struct log *log, struct xlog_recover *trans,
1508 struct xlog_recover_item *item, int pass),
1509 TP_ARGS(log, trans, item, pass),
1512 __field(unsigned long, item)
1513 __field(xlog_tid_t, tid)
1520 __entry->dev = log->l_mp->m_super->s_dev;
1521 __entry->item = (unsigned long)item;
1522 __entry->tid = trans->r_log_tid;
1523 __entry->type = ITEM_TYPE(item);
1524 __entry->pass = pass;
1525 __entry->count = item->ri_cnt;
1526 __entry->total = item->ri_total;
1528 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1529 "item region count/total %d/%d",
1530 MAJOR(__entry->dev), MINOR(__entry->dev),
1533 (void *)__entry->item,
1534 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1539 #define DEFINE_LOG_RECOVER_ITEM(name) \
1540 DEFINE_EVENT(xfs_log_recover_item_class, name, \
1541 TP_PROTO(struct log *log, struct xlog_recover *trans, \
1542 struct xlog_recover_item *item, int pass), \
1543 TP_ARGS(log, trans, item, pass))
1545 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1546 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1547 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1548 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1549 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1551 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
1552 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f),
1553 TP_ARGS(log, buf_f),
1556 __field(__int64_t, blkno)
1557 __field(unsigned short, len)
1558 __field(unsigned short, flags)
1559 __field(unsigned short, size)
1560 __field(unsigned int, map_size)
1563 __entry->dev = log->l_mp->m_super->s_dev;
1564 __entry->blkno = buf_f->blf_blkno;
1565 __entry->len = buf_f->blf_len;
1566 __entry->flags = buf_f->blf_flags;
1567 __entry->size = buf_f->blf_size;
1568 __entry->map_size = buf_f->blf_map_size;
1570 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1572 MAJOR(__entry->dev), MINOR(__entry->dev),
1580 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1581 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
1582 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f), \
1583 TP_ARGS(log, buf_f))
1585 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
1586 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
1587 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
1588 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
1589 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
1590 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
1591 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
1592 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
1594 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
1595 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f),
1599 __field(xfs_ino_t, ino)
1600 __field(unsigned short, size)
1601 __field(int, fields)
1602 __field(unsigned short, asize)
1603 __field(unsigned short, dsize)
1604 __field(__int64_t, blkno)
1606 __field(int, boffset)
1609 __entry->dev = log->l_mp->m_super->s_dev;
1610 __entry->ino = in_f->ilf_ino;
1611 __entry->size = in_f->ilf_size;
1612 __entry->fields = in_f->ilf_fields;
1613 __entry->asize = in_f->ilf_asize;
1614 __entry->dsize = in_f->ilf_dsize;
1615 __entry->blkno = in_f->ilf_blkno;
1616 __entry->len = in_f->ilf_len;
1617 __entry->boffset = in_f->ilf_boffset;
1619 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
1620 "dsize %d, blkno 0x%llx, len %d, boffset %d",
1621 MAJOR(__entry->dev), MINOR(__entry->dev),
1631 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
1632 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
1633 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f), \
1636 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
1637 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
1638 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
1640 #endif /* _TRACE_XFS_H */
1642 #undef TRACE_INCLUDE_PATH
1643 #define TRACE_INCLUDE_PATH .
1644 #define TRACE_INCLUDE_FILE xfs_trace
1645 #include <trace/define_trace.h>