2 * Copyright (c) 2009, Christoph Hellwig
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #define TRACE_SYSTEM xfs
21 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
24 #include <linux/tracepoint.h>
28 struct xfs_attr_list_context
;
29 struct xfs_buf_log_item
;
31 struct xfs_da_node_entry
;
37 struct xlog_recover_item
;
38 struct xfs_buf_log_format
;
39 struct xfs_inode_log_format
;
43 DECLARE_EVENT_CLASS(xfs_attr_list_class
,
44 TP_PROTO(struct xfs_attr_list_context
*ctx
),
48 __field(xfs_ino_t
, ino
)
52 __field(void *, alist
)
60 __entry
->dev
= VFS_I(ctx
->dp
)->i_sb
->s_dev
;
61 __entry
->ino
= ctx
->dp
->i_ino
;
62 __entry
->hashval
= ctx
->cursor
->hashval
;
63 __entry
->blkno
= ctx
->cursor
->blkno
;
64 __entry
->offset
= ctx
->cursor
->offset
;
65 __entry
->alist
= ctx
->alist
;
66 __entry
->bufsize
= ctx
->bufsize
;
67 __entry
->count
= ctx
->count
;
68 __entry
->firstu
= ctx
->firstu
;
69 __entry
->flags
= ctx
->flags
;
71 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
72 "alist 0x%p size %u count %u firstu %u flags %d %s",
73 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
84 __print_flags(__entry
->flags
, "|", XFS_ATTR_FLAGS
)
88 #define DEFINE_ATTR_LIST_EVENT(name) \
89 DEFINE_EVENT(xfs_attr_list_class, name, \
90 TP_PROTO(struct xfs_attr_list_context *ctx), \
92 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf
);
93 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all
);
94 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf
);
95 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end
);
96 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full
);
97 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add
);
98 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk
);
99 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound
);
100 DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list
);
101 DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list
);
103 DECLARE_EVENT_CLASS(xfs_perag_class
,
104 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, int refcount
,
105 unsigned long caller_ip
),
106 TP_ARGS(mp
, agno
, refcount
, caller_ip
),
109 __field(xfs_agnumber_t
, agno
)
110 __field(int, refcount
)
111 __field(unsigned long, caller_ip
)
114 __entry
->dev
= mp
->m_super
->s_dev
;
115 __entry
->agno
= agno
;
116 __entry
->refcount
= refcount
;
117 __entry
->caller_ip
= caller_ip
;
119 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
120 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
123 (char *)__entry
->caller_ip
)
126 #define DEFINE_PERAG_REF_EVENT(name) \
127 DEFINE_EVENT(xfs_perag_class, name, \
128 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
129 unsigned long caller_ip), \
130 TP_ARGS(mp, agno, refcount, caller_ip))
131 DEFINE_PERAG_REF_EVENT(xfs_perag_get
);
132 DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag
);
133 DEFINE_PERAG_REF_EVENT(xfs_perag_put
);
134 DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim
);
135 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim
);
136 DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks
);
137 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks
);
139 DECLARE_EVENT_CLASS(xfs_ag_class
,
140 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
),
144 __field(xfs_agnumber_t
, agno
)
147 __entry
->dev
= mp
->m_super
->s_dev
;
148 __entry
->agno
= agno
;
150 TP_printk("dev %d:%d agno %u",
151 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
154 #define DEFINE_AG_EVENT(name) \
155 DEFINE_EVENT(xfs_ag_class, name, \
156 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
159 DEFINE_AG_EVENT(xfs_read_agf
);
160 DEFINE_AG_EVENT(xfs_alloc_read_agf
);
161 DEFINE_AG_EVENT(xfs_read_agi
);
162 DEFINE_AG_EVENT(xfs_ialloc_read_agi
);
164 TRACE_EVENT(xfs_attr_list_node_descend
,
165 TP_PROTO(struct xfs_attr_list_context
*ctx
,
166 struct xfs_da_node_entry
*btree
),
170 __field(xfs_ino_t
, ino
)
171 __field(u32
, hashval
)
174 __field(void *, alist
)
175 __field(int, bufsize
)
180 __field(u32
, bt_hashval
)
181 __field(u32
, bt_before
)
184 __entry
->dev
= VFS_I(ctx
->dp
)->i_sb
->s_dev
;
185 __entry
->ino
= ctx
->dp
->i_ino
;
186 __entry
->hashval
= ctx
->cursor
->hashval
;
187 __entry
->blkno
= ctx
->cursor
->blkno
;
188 __entry
->offset
= ctx
->cursor
->offset
;
189 __entry
->alist
= ctx
->alist
;
190 __entry
->bufsize
= ctx
->bufsize
;
191 __entry
->count
= ctx
->count
;
192 __entry
->firstu
= ctx
->firstu
;
193 __entry
->flags
= ctx
->flags
;
194 __entry
->bt_hashval
= be32_to_cpu(btree
->hashval
);
195 __entry
->bt_before
= be32_to_cpu(btree
->before
);
197 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
198 "alist 0x%p size %u count %u firstu %u flags %d %s "
199 "node hashval %u, node before %u",
200 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
211 __print_flags(__entry
->flags
, "|", XFS_ATTR_FLAGS
),
216 TRACE_EVENT(xfs_iext_insert
,
217 TP_PROTO(struct xfs_inode
*ip
, xfs_extnum_t idx
,
218 struct xfs_bmbt_irec
*r
, int state
, unsigned long caller_ip
),
219 TP_ARGS(ip
, idx
, r
, 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 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
233 __entry
->ino
= ip
->i_ino
;
235 __entry
->startoff
= r
->br_startoff
;
236 __entry
->startblock
= r
->br_startblock
;
237 __entry
->blockcount
= r
->br_blockcount
;
238 __entry
->state
= r
->br_state
;
239 __entry
->bmap_state
= state
;
240 __entry
->caller_ip
= caller_ip
;
242 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
243 "offset %lld block %lld count %lld flag %d caller %ps",
244 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
246 __print_flags(__entry
->bmap_state
, "|", XFS_BMAP_EXT_FLAGS
),
249 (__int64_t
)__entry
->startblock
,
252 (char *)__entry
->caller_ip
)
255 DECLARE_EVENT_CLASS(xfs_bmap_class
,
256 TP_PROTO(struct xfs_inode
*ip
, xfs_extnum_t idx
, int state
,
257 unsigned long caller_ip
),
258 TP_ARGS(ip
, idx
, state
, caller_ip
),
261 __field(xfs_ino_t
, ino
)
262 __field(xfs_extnum_t
, idx
)
263 __field(xfs_fileoff_t
, startoff
)
264 __field(xfs_fsblock_t
, startblock
)
265 __field(xfs_filblks_t
, blockcount
)
266 __field(xfs_exntst_t
, state
)
267 __field(int, bmap_state
)
268 __field(unsigned long, caller_ip
)
271 struct xfs_ifork
*ifp
= (state
& BMAP_ATTRFORK
) ?
272 ip
->i_afp
: &ip
->i_df
;
273 struct xfs_bmbt_irec r
;
275 xfs_bmbt_get_all(xfs_iext_get_ext(ifp
, idx
), &r
);
276 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
277 __entry
->ino
= ip
->i_ino
;
279 __entry
->startoff
= r
.br_startoff
;
280 __entry
->startblock
= r
.br_startblock
;
281 __entry
->blockcount
= r
.br_blockcount
;
282 __entry
->state
= r
.br_state
;
283 __entry
->bmap_state
= state
;
284 __entry
->caller_ip
= caller_ip
;
286 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
287 "offset %lld block %lld count %lld flag %d caller %ps",
288 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
290 __print_flags(__entry
->bmap_state
, "|", XFS_BMAP_EXT_FLAGS
),
293 (__int64_t
)__entry
->startblock
,
296 (char *)__entry
->caller_ip
)
299 #define DEFINE_BMAP_EVENT(name) \
300 DEFINE_EVENT(xfs_bmap_class, name, \
301 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
302 unsigned long caller_ip), \
303 TP_ARGS(ip, idx, state, caller_ip))
304 DEFINE_BMAP_EVENT(xfs_iext_remove
);
305 DEFINE_BMAP_EVENT(xfs_bmap_pre_update
);
306 DEFINE_BMAP_EVENT(xfs_bmap_post_update
);
307 DEFINE_BMAP_EVENT(xfs_extlist
);
309 DECLARE_EVENT_CLASS(xfs_buf_class
,
310 TP_PROTO(struct xfs_buf
*bp
, unsigned long caller_ip
),
311 TP_ARGS(bp
, caller_ip
),
314 __field(xfs_daddr_t
, bno
)
317 __field(int, pincount
)
318 __field(unsigned, lockval
)
319 __field(unsigned, flags
)
320 __field(unsigned long, caller_ip
)
323 __entry
->dev
= bp
->b_target
->bt_dev
;
324 __entry
->bno
= bp
->b_bn
;
325 __entry
->nblks
= bp
->b_length
;
326 __entry
->hold
= atomic_read(&bp
->b_hold
);
327 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
328 __entry
->lockval
= bp
->b_sema
.count
;
329 __entry
->flags
= bp
->b_flags
;
330 __entry
->caller_ip
= caller_ip
;
332 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
333 "lock %d flags %s caller %ps",
334 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
335 (unsigned long long)__entry
->bno
,
340 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
341 (void *)__entry
->caller_ip
)
344 #define DEFINE_BUF_EVENT(name) \
345 DEFINE_EVENT(xfs_buf_class, name, \
346 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
347 TP_ARGS(bp, caller_ip))
348 DEFINE_BUF_EVENT(xfs_buf_init
);
349 DEFINE_BUF_EVENT(xfs_buf_free
);
350 DEFINE_BUF_EVENT(xfs_buf_hold
);
351 DEFINE_BUF_EVENT(xfs_buf_rele
);
352 DEFINE_BUF_EVENT(xfs_buf_iodone
);
353 DEFINE_BUF_EVENT(xfs_buf_submit
);
354 DEFINE_BUF_EVENT(xfs_buf_submit_wait
);
355 DEFINE_BUF_EVENT(xfs_buf_bawrite
);
356 DEFINE_BUF_EVENT(xfs_buf_lock
);
357 DEFINE_BUF_EVENT(xfs_buf_lock_done
);
358 DEFINE_BUF_EVENT(xfs_buf_trylock_fail
);
359 DEFINE_BUF_EVENT(xfs_buf_trylock
);
360 DEFINE_BUF_EVENT(xfs_buf_unlock
);
361 DEFINE_BUF_EVENT(xfs_buf_iowait
);
362 DEFINE_BUF_EVENT(xfs_buf_iowait_done
);
363 DEFINE_BUF_EVENT(xfs_buf_delwri_queue
);
364 DEFINE_BUF_EVENT(xfs_buf_delwri_queued
);
365 DEFINE_BUF_EVENT(xfs_buf_delwri_split
);
366 DEFINE_BUF_EVENT(xfs_buf_get_uncached
);
367 DEFINE_BUF_EVENT(xfs_bdstrat_shut
);
368 DEFINE_BUF_EVENT(xfs_buf_item_relse
);
369 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async
);
370 DEFINE_BUF_EVENT(xfs_buf_error_relse
);
371 DEFINE_BUF_EVENT(xfs_buf_wait_buftarg
);
372 DEFINE_BUF_EVENT(xfs_trans_read_buf_io
);
373 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut
);
375 /* not really buffer traces, but the buf provides useful information */
376 DEFINE_BUF_EVENT(xfs_btree_corrupt
);
377 DEFINE_BUF_EVENT(xfs_da_btree_corrupt
);
378 DEFINE_BUF_EVENT(xfs_reset_dqcounts
);
379 DEFINE_BUF_EVENT(xfs_inode_item_push
);
381 /* pass flags explicitly */
382 DECLARE_EVENT_CLASS(xfs_buf_flags_class
,
383 TP_PROTO(struct xfs_buf
*bp
, unsigned flags
, unsigned long caller_ip
),
384 TP_ARGS(bp
, flags
, caller_ip
),
387 __field(xfs_daddr_t
, bno
)
388 __field(size_t, buffer_length
)
390 __field(int, pincount
)
391 __field(unsigned, lockval
)
392 __field(unsigned, flags
)
393 __field(unsigned long, caller_ip
)
396 __entry
->dev
= bp
->b_target
->bt_dev
;
397 __entry
->bno
= bp
->b_bn
;
398 __entry
->buffer_length
= BBTOB(bp
->b_length
);
399 __entry
->flags
= flags
;
400 __entry
->hold
= atomic_read(&bp
->b_hold
);
401 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
402 __entry
->lockval
= bp
->b_sema
.count
;
403 __entry
->caller_ip
= caller_ip
;
405 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
406 "lock %d flags %s caller %ps",
407 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
408 (unsigned long long)__entry
->bno
,
409 __entry
->buffer_length
,
413 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
414 (void *)__entry
->caller_ip
)
417 #define DEFINE_BUF_FLAGS_EVENT(name) \
418 DEFINE_EVENT(xfs_buf_flags_class, name, \
419 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
420 TP_ARGS(bp, flags, caller_ip))
421 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find
);
422 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get
);
423 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read
);
425 TRACE_EVENT(xfs_buf_ioerror
,
426 TP_PROTO(struct xfs_buf
*bp
, int error
, unsigned long caller_ip
),
427 TP_ARGS(bp
, error
, caller_ip
),
430 __field(xfs_daddr_t
, bno
)
431 __field(size_t, buffer_length
)
432 __field(unsigned, flags
)
434 __field(int, pincount
)
435 __field(unsigned, lockval
)
437 __field(unsigned long, caller_ip
)
440 __entry
->dev
= bp
->b_target
->bt_dev
;
441 __entry
->bno
= bp
->b_bn
;
442 __entry
->buffer_length
= BBTOB(bp
->b_length
);
443 __entry
->hold
= atomic_read(&bp
->b_hold
);
444 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
445 __entry
->lockval
= bp
->b_sema
.count
;
446 __entry
->error
= error
;
447 __entry
->flags
= bp
->b_flags
;
448 __entry
->caller_ip
= caller_ip
;
450 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
451 "lock %d error %d flags %s caller %ps",
452 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
453 (unsigned long long)__entry
->bno
,
454 __entry
->buffer_length
,
459 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
460 (void *)__entry
->caller_ip
)
463 DECLARE_EVENT_CLASS(xfs_buf_item_class
,
464 TP_PROTO(struct xfs_buf_log_item
*bip
),
468 __field(xfs_daddr_t
, buf_bno
)
469 __field(size_t, buf_len
)
470 __field(int, buf_hold
)
471 __field(int, buf_pincount
)
472 __field(int, buf_lockval
)
473 __field(unsigned, buf_flags
)
474 __field(unsigned, bli_recur
)
475 __field(int, bli_refcount
)
476 __field(unsigned, bli_flags
)
477 __field(void *, li_desc
)
478 __field(unsigned, li_flags
)
481 __entry
->dev
= bip
->bli_buf
->b_target
->bt_dev
;
482 __entry
->bli_flags
= bip
->bli_flags
;
483 __entry
->bli_recur
= bip
->bli_recur
;
484 __entry
->bli_refcount
= atomic_read(&bip
->bli_refcount
);
485 __entry
->buf_bno
= bip
->bli_buf
->b_bn
;
486 __entry
->buf_len
= BBTOB(bip
->bli_buf
->b_length
);
487 __entry
->buf_flags
= bip
->bli_buf
->b_flags
;
488 __entry
->buf_hold
= atomic_read(&bip
->bli_buf
->b_hold
);
489 __entry
->buf_pincount
= atomic_read(&bip
->bli_buf
->b_pin_count
);
490 __entry
->buf_lockval
= bip
->bli_buf
->b_sema
.count
;
491 __entry
->li_desc
= bip
->bli_item
.li_desc
;
492 __entry
->li_flags
= bip
->bli_item
.li_flags
;
494 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
495 "lock %d flags %s recur %d refcount %d bliflags %s "
496 "lidesc 0x%p liflags %s",
497 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
498 (unsigned long long)__entry
->buf_bno
,
501 __entry
->buf_pincount
,
502 __entry
->buf_lockval
,
503 __print_flags(__entry
->buf_flags
, "|", XFS_BUF_FLAGS
),
505 __entry
->bli_refcount
,
506 __print_flags(__entry
->bli_flags
, "|", XFS_BLI_FLAGS
),
508 __print_flags(__entry
->li_flags
, "|", XFS_LI_FLAGS
))
511 #define DEFINE_BUF_ITEM_EVENT(name) \
512 DEFINE_EVENT(xfs_buf_item_class, name, \
513 TP_PROTO(struct xfs_buf_log_item *bip), \
515 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size
);
516 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered
);
517 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale
);
518 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format
);
519 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered
);
520 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale
);
521 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered
);
522 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin
);
523 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin
);
524 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale
);
525 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock
);
526 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale
);
527 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed
);
528 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push
);
529 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf
);
530 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur
);
531 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb
);
532 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur
);
533 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf
);
534 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur
);
535 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf
);
536 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse
);
537 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin
);
538 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold
);
539 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release
);
540 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval
);
541 DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered
);
543 DECLARE_EVENT_CLASS(xfs_filestream_class
,
544 TP_PROTO(struct xfs_inode
*ip
, xfs_agnumber_t agno
),
548 __field(xfs_ino_t
, ino
)
549 __field(xfs_agnumber_t
, agno
)
550 __field(int, streams
)
553 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
554 __entry
->ino
= ip
->i_ino
;
555 __entry
->agno
= agno
;
556 __entry
->streams
= xfs_filestream_peek_ag(ip
->i_mount
, agno
);
558 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
559 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
564 #define DEFINE_FILESTREAM_EVENT(name) \
565 DEFINE_EVENT(xfs_filestream_class, name, \
566 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
568 DEFINE_FILESTREAM_EVENT(xfs_filestream_free
);
569 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup
);
570 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan
);
572 TRACE_EVENT(xfs_filestream_pick
,
573 TP_PROTO(struct xfs_inode
*ip
, xfs_agnumber_t agno
,
574 xfs_extlen_t free
, int nscan
),
575 TP_ARGS(ip
, agno
, free
, nscan
),
578 __field(xfs_ino_t
, ino
)
579 __field(xfs_agnumber_t
, agno
)
580 __field(int, streams
)
581 __field(xfs_extlen_t
, free
)
585 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
586 __entry
->ino
= ip
->i_ino
;
587 __entry
->agno
= agno
;
588 __entry
->streams
= xfs_filestream_peek_ag(ip
->i_mount
, agno
);
589 __entry
->free
= free
;
590 __entry
->nscan
= nscan
;
592 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
593 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
601 DECLARE_EVENT_CLASS(xfs_lock_class
,
602 TP_PROTO(struct xfs_inode
*ip
, unsigned lock_flags
,
603 unsigned long caller_ip
),
604 TP_ARGS(ip
, lock_flags
, caller_ip
),
607 __field(xfs_ino_t
, ino
)
608 __field(int, lock_flags
)
609 __field(unsigned long, caller_ip
)
612 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
613 __entry
->ino
= ip
->i_ino
;
614 __entry
->lock_flags
= lock_flags
;
615 __entry
->caller_ip
= caller_ip
;
617 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
618 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
620 __print_flags(__entry
->lock_flags
, "|", XFS_LOCK_FLAGS
),
621 (void *)__entry
->caller_ip
)
624 #define DEFINE_LOCK_EVENT(name) \
625 DEFINE_EVENT(xfs_lock_class, name, \
626 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
627 unsigned long caller_ip), \
628 TP_ARGS(ip, lock_flags, caller_ip))
629 DEFINE_LOCK_EVENT(xfs_ilock
);
630 DEFINE_LOCK_EVENT(xfs_ilock_nowait
);
631 DEFINE_LOCK_EVENT(xfs_ilock_demote
);
632 DEFINE_LOCK_EVENT(xfs_iunlock
);
634 DECLARE_EVENT_CLASS(xfs_inode_class
,
635 TP_PROTO(struct xfs_inode
*ip
),
639 __field(xfs_ino_t
, ino
)
642 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
643 __entry
->ino
= ip
->i_ino
;
645 TP_printk("dev %d:%d ino 0x%llx",
646 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
650 #define DEFINE_INODE_EVENT(name) \
651 DEFINE_EVENT(xfs_inode_class, name, \
652 TP_PROTO(struct xfs_inode *ip), \
654 DEFINE_INODE_EVENT(xfs_iget_skip
);
655 DEFINE_INODE_EVENT(xfs_iget_reclaim
);
656 DEFINE_INODE_EVENT(xfs_iget_reclaim_fail
);
657 DEFINE_INODE_EVENT(xfs_iget_hit
);
658 DEFINE_INODE_EVENT(xfs_iget_miss
);
660 DEFINE_INODE_EVENT(xfs_getattr
);
661 DEFINE_INODE_EVENT(xfs_setattr
);
662 DEFINE_INODE_EVENT(xfs_readlink
);
663 DEFINE_INODE_EVENT(xfs_inactive_symlink
);
664 DEFINE_INODE_EVENT(xfs_alloc_file_space
);
665 DEFINE_INODE_EVENT(xfs_free_file_space
);
666 DEFINE_INODE_EVENT(xfs_zero_file_space
);
667 DEFINE_INODE_EVENT(xfs_collapse_file_space
);
668 DEFINE_INODE_EVENT(xfs_insert_file_space
);
669 DEFINE_INODE_EVENT(xfs_readdir
);
670 #ifdef CONFIG_XFS_POSIX_ACL
671 DEFINE_INODE_EVENT(xfs_get_acl
);
673 DEFINE_INODE_EVENT(xfs_vm_bmap
);
674 DEFINE_INODE_EVENT(xfs_file_ioctl
);
675 DEFINE_INODE_EVENT(xfs_file_compat_ioctl
);
676 DEFINE_INODE_EVENT(xfs_ioctl_setattr
);
677 DEFINE_INODE_EVENT(xfs_dir_fsync
);
678 DEFINE_INODE_EVENT(xfs_file_fsync
);
679 DEFINE_INODE_EVENT(xfs_destroy_inode
);
680 DEFINE_INODE_EVENT(xfs_evict_inode
);
681 DEFINE_INODE_EVENT(xfs_update_time
);
683 DEFINE_INODE_EVENT(xfs_dquot_dqalloc
);
684 DEFINE_INODE_EVENT(xfs_dquot_dqdetach
);
686 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag
);
687 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag
);
688 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid
);
690 DEFINE_INODE_EVENT(xfs_filemap_fault
);
691 DEFINE_INODE_EVENT(xfs_filemap_pmd_fault
);
692 DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite
);
693 DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite
);
695 DECLARE_EVENT_CLASS(xfs_iref_class
,
696 TP_PROTO(struct xfs_inode
*ip
, unsigned long caller_ip
),
697 TP_ARGS(ip
, caller_ip
),
700 __field(xfs_ino_t
, ino
)
702 __field(int, pincount
)
703 __field(unsigned long, caller_ip
)
706 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
707 __entry
->ino
= ip
->i_ino
;
708 __entry
->count
= atomic_read(&VFS_I(ip
)->i_count
);
709 __entry
->pincount
= atomic_read(&ip
->i_pincount
);
710 __entry
->caller_ip
= caller_ip
;
712 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
713 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
717 (char *)__entry
->caller_ip
)
720 TRACE_EVENT(xfs_iomap_prealloc_size
,
721 TP_PROTO(struct xfs_inode
*ip
, xfs_fsblock_t blocks
, int shift
,
722 unsigned int writeio_blocks
),
723 TP_ARGS(ip
, blocks
, shift
, writeio_blocks
),
726 __field(xfs_ino_t
, ino
)
727 __field(xfs_fsblock_t
, blocks
)
729 __field(unsigned int, writeio_blocks
)
732 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
733 __entry
->ino
= ip
->i_ino
;
734 __entry
->blocks
= blocks
;
735 __entry
->shift
= shift
;
736 __entry
->writeio_blocks
= writeio_blocks
;
738 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
739 "m_writeio_blocks %u",
740 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->ino
,
741 __entry
->blocks
, __entry
->shift
, __entry
->writeio_blocks
)
744 TRACE_EVENT(xfs_irec_merge_pre
,
745 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agino_t agino
,
746 uint16_t holemask
, xfs_agino_t nagino
, uint16_t nholemask
),
747 TP_ARGS(mp
, agno
, agino
, holemask
, nagino
, nholemask
),
750 __field(xfs_agnumber_t
, agno
)
751 __field(xfs_agino_t
, agino
)
752 __field(uint16_t, holemask
)
753 __field(xfs_agino_t
, nagino
)
754 __field(uint16_t, nholemask
)
757 __entry
->dev
= mp
->m_super
->s_dev
;
758 __entry
->agno
= agno
;
759 __entry
->agino
= agino
;
760 __entry
->holemask
= holemask
;
761 __entry
->nagino
= nagino
;
762 __entry
->nholemask
= holemask
;
764 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
765 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->agno
,
766 __entry
->agino
, __entry
->holemask
, __entry
->nagino
,
770 TRACE_EVENT(xfs_irec_merge_post
,
771 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agino_t agino
,
773 TP_ARGS(mp
, agno
, agino
, holemask
),
776 __field(xfs_agnumber_t
, agno
)
777 __field(xfs_agino_t
, agino
)
778 __field(uint16_t, holemask
)
781 __entry
->dev
= mp
->m_super
->s_dev
;
782 __entry
->agno
= agno
;
783 __entry
->agino
= agino
;
784 __entry
->holemask
= holemask
;
786 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry
->dev
),
787 MINOR(__entry
->dev
), __entry
->agno
, __entry
->agino
,
791 #define DEFINE_IREF_EVENT(name) \
792 DEFINE_EVENT(xfs_iref_class, name, \
793 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
794 TP_ARGS(ip, caller_ip))
795 DEFINE_IREF_EVENT(xfs_ihold
);
796 DEFINE_IREF_EVENT(xfs_irele
);
797 DEFINE_IREF_EVENT(xfs_inode_pin
);
798 DEFINE_IREF_EVENT(xfs_inode_unpin
);
799 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait
);
801 DECLARE_EVENT_CLASS(xfs_namespace_class
,
802 TP_PROTO(struct xfs_inode
*dp
, struct xfs_name
*name
),
806 __field(xfs_ino_t
, dp_ino
)
807 __field(int, namelen
)
808 __dynamic_array(char, name
, name
->len
)
811 __entry
->dev
= VFS_I(dp
)->i_sb
->s_dev
;
812 __entry
->dp_ino
= dp
->i_ino
;
813 __entry
->namelen
= name
->len
;
814 memcpy(__get_str(name
), name
->name
, name
->len
);
816 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
817 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
823 #define DEFINE_NAMESPACE_EVENT(name) \
824 DEFINE_EVENT(xfs_namespace_class, name, \
825 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
827 DEFINE_NAMESPACE_EVENT(xfs_remove
);
828 DEFINE_NAMESPACE_EVENT(xfs_link
);
829 DEFINE_NAMESPACE_EVENT(xfs_lookup
);
830 DEFINE_NAMESPACE_EVENT(xfs_create
);
831 DEFINE_NAMESPACE_EVENT(xfs_symlink
);
833 TRACE_EVENT(xfs_rename
,
834 TP_PROTO(struct xfs_inode
*src_dp
, struct xfs_inode
*target_dp
,
835 struct xfs_name
*src_name
, struct xfs_name
*target_name
),
836 TP_ARGS(src_dp
, target_dp
, src_name
, target_name
),
839 __field(xfs_ino_t
, src_dp_ino
)
840 __field(xfs_ino_t
, target_dp_ino
)
841 __field(int, src_namelen
)
842 __field(int, target_namelen
)
843 __dynamic_array(char, src_name
, src_name
->len
)
844 __dynamic_array(char, target_name
, target_name
->len
)
847 __entry
->dev
= VFS_I(src_dp
)->i_sb
->s_dev
;
848 __entry
->src_dp_ino
= src_dp
->i_ino
;
849 __entry
->target_dp_ino
= target_dp
->i_ino
;
850 __entry
->src_namelen
= src_name
->len
;
851 __entry
->target_namelen
= target_name
->len
;
852 memcpy(__get_str(src_name
), src_name
->name
, src_name
->len
);
853 memcpy(__get_str(target_name
), target_name
->name
,
856 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
857 " src name %.*s target name %.*s",
858 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
860 __entry
->target_dp_ino
,
861 __entry
->src_namelen
,
863 __entry
->target_namelen
,
864 __get_str(target_name
))
867 DECLARE_EVENT_CLASS(xfs_dquot_class
,
868 TP_PROTO(struct xfs_dquot
*dqp
),
873 __field(unsigned, flags
)
874 __field(unsigned, nrefs
)
875 __field(unsigned long long, res_bcount
)
876 __field(unsigned long long, bcount
)
877 __field(unsigned long long, icount
)
878 __field(unsigned long long, blk_hardlimit
)
879 __field(unsigned long long, blk_softlimit
)
880 __field(unsigned long long, ino_hardlimit
)
881 __field(unsigned long long, ino_softlimit
)
884 __entry
->dev
= dqp
->q_mount
->m_super
->s_dev
;
885 __entry
->id
= be32_to_cpu(dqp
->q_core
.d_id
);
886 __entry
->flags
= dqp
->dq_flags
;
887 __entry
->nrefs
= dqp
->q_nrefs
;
888 __entry
->res_bcount
= dqp
->q_res_bcount
;
889 __entry
->bcount
= be64_to_cpu(dqp
->q_core
.d_bcount
);
890 __entry
->icount
= be64_to_cpu(dqp
->q_core
.d_icount
);
891 __entry
->blk_hardlimit
=
892 be64_to_cpu(dqp
->q_core
.d_blk_hardlimit
);
893 __entry
->blk_softlimit
=
894 be64_to_cpu(dqp
->q_core
.d_blk_softlimit
);
895 __entry
->ino_hardlimit
=
896 be64_to_cpu(dqp
->q_core
.d_ino_hardlimit
);
897 __entry
->ino_softlimit
=
898 be64_to_cpu(dqp
->q_core
.d_ino_softlimit
);
900 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
901 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
902 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
903 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
905 __print_flags(__entry
->flags
, "|", XFS_DQ_FLAGS
),
909 __entry
->blk_hardlimit
,
910 __entry
->blk_softlimit
,
912 __entry
->ino_hardlimit
,
913 __entry
->ino_softlimit
)
916 #define DEFINE_DQUOT_EVENT(name) \
917 DEFINE_EVENT(xfs_dquot_class, name, \
918 TP_PROTO(struct xfs_dquot *dqp), \
920 DEFINE_DQUOT_EVENT(xfs_dqadjust
);
921 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want
);
922 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty
);
923 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy
);
924 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done
);
925 DEFINE_DQUOT_EVENT(xfs_dqattach_found
);
926 DEFINE_DQUOT_EVENT(xfs_dqattach_get
);
927 DEFINE_DQUOT_EVENT(xfs_dqalloc
);
928 DEFINE_DQUOT_EVENT(xfs_dqtobp_read
);
929 DEFINE_DQUOT_EVENT(xfs_dqread
);
930 DEFINE_DQUOT_EVENT(xfs_dqread_fail
);
931 DEFINE_DQUOT_EVENT(xfs_dqget_hit
);
932 DEFINE_DQUOT_EVENT(xfs_dqget_miss
);
933 DEFINE_DQUOT_EVENT(xfs_dqget_freeing
);
934 DEFINE_DQUOT_EVENT(xfs_dqget_dup
);
935 DEFINE_DQUOT_EVENT(xfs_dqput
);
936 DEFINE_DQUOT_EVENT(xfs_dqput_wait
);
937 DEFINE_DQUOT_EVENT(xfs_dqput_free
);
938 DEFINE_DQUOT_EVENT(xfs_dqrele
);
939 DEFINE_DQUOT_EVENT(xfs_dqflush
);
940 DEFINE_DQUOT_EVENT(xfs_dqflush_force
);
941 DEFINE_DQUOT_EVENT(xfs_dqflush_done
);
943 DECLARE_EVENT_CLASS(xfs_loggrant_class
,
944 TP_PROTO(struct xlog
*log
, struct xlog_ticket
*tic
),
950 __field(int, curr_res
)
951 __field(int, unit_res
)
952 __field(unsigned int, flags
)
953 __field(int, reserveq
)
955 __field(int, grant_reserve_cycle
)
956 __field(int, grant_reserve_bytes
)
957 __field(int, grant_write_cycle
)
958 __field(int, grant_write_bytes
)
959 __field(int, curr_cycle
)
960 __field(int, curr_block
)
961 __field(xfs_lsn_t
, tail_lsn
)
964 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
965 __entry
->ocnt
= tic
->t_ocnt
;
966 __entry
->cnt
= tic
->t_cnt
;
967 __entry
->curr_res
= tic
->t_curr_res
;
968 __entry
->unit_res
= tic
->t_unit_res
;
969 __entry
->flags
= tic
->t_flags
;
970 __entry
->reserveq
= list_empty(&log
->l_reserve_head
.waiters
);
971 __entry
->writeq
= list_empty(&log
->l_write_head
.waiters
);
972 xlog_crack_grant_head(&log
->l_reserve_head
.grant
,
973 &__entry
->grant_reserve_cycle
,
974 &__entry
->grant_reserve_bytes
);
975 xlog_crack_grant_head(&log
->l_write_head
.grant
,
976 &__entry
->grant_write_cycle
,
977 &__entry
->grant_write_bytes
);
978 __entry
->curr_cycle
= log
->l_curr_cycle
;
979 __entry
->curr_block
= log
->l_curr_block
;
980 __entry
->tail_lsn
= atomic64_read(&log
->l_tail_lsn
);
982 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
983 "t_unit_res %u t_flags %s reserveq %s "
984 "writeq %s grant_reserve_cycle %d "
985 "grant_reserve_bytes %d grant_write_cycle %d "
986 "grant_write_bytes %d curr_cycle %d curr_block %d "
987 "tail_cycle %d tail_block %d",
988 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
993 __print_flags(__entry
->flags
, "|", XLOG_TIC_FLAGS
),
994 __entry
->reserveq
? "empty" : "active",
995 __entry
->writeq
? "empty" : "active",
996 __entry
->grant_reserve_cycle
,
997 __entry
->grant_reserve_bytes
,
998 __entry
->grant_write_cycle
,
999 __entry
->grant_write_bytes
,
1000 __entry
->curr_cycle
,
1001 __entry
->curr_block
,
1002 CYCLE_LSN(__entry
->tail_lsn
),
1003 BLOCK_LSN(__entry
->tail_lsn
)
1007 #define DEFINE_LOGGRANT_EVENT(name) \
1008 DEFINE_EVENT(xfs_loggrant_class, name, \
1009 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1011 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm
);
1012 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm
);
1013 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write
);
1014 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep
);
1015 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake
);
1016 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up
);
1017 DEFINE_LOGGRANT_EVENT(xfs_log_reserve
);
1018 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit
);
1019 DEFINE_LOGGRANT_EVENT(xfs_log_regrant
);
1020 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit
);
1021 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter
);
1022 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit
);
1023 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub
);
1024 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter
);
1025 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit
);
1026 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub
);
1028 DECLARE_EVENT_CLASS(xfs_log_item_class
,
1029 TP_PROTO(struct xfs_log_item
*lip
),
1033 __field(void *, lip
)
1035 __field(uint
, flags
)
1036 __field(xfs_lsn_t
, lsn
)
1039 __entry
->dev
= lip
->li_mountp
->m_super
->s_dev
;
1041 __entry
->type
= lip
->li_type
;
1042 __entry
->flags
= lip
->li_flags
;
1043 __entry
->lsn
= lip
->li_lsn
;
1045 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1046 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1048 CYCLE_LSN(__entry
->lsn
), BLOCK_LSN(__entry
->lsn
),
1049 __print_symbolic(__entry
->type
, XFS_LI_TYPE_DESC
),
1050 __print_flags(__entry
->flags
, "|", XFS_LI_FLAGS
))
1053 TRACE_EVENT(xfs_log_force
,
1054 TP_PROTO(struct xfs_mount
*mp
, xfs_lsn_t lsn
, unsigned long caller_ip
),
1055 TP_ARGS(mp
, lsn
, caller_ip
),
1058 __field(xfs_lsn_t
, lsn
)
1059 __field(unsigned long, caller_ip
)
1062 __entry
->dev
= mp
->m_super
->s_dev
;
1064 __entry
->caller_ip
= caller_ip
;
1066 TP_printk("dev %d:%d lsn 0x%llx caller %ps",
1067 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1068 __entry
->lsn
, (void *)__entry
->caller_ip
)
1071 #define DEFINE_LOG_ITEM_EVENT(name) \
1072 DEFINE_EVENT(xfs_log_item_class, name, \
1073 TP_PROTO(struct xfs_log_item *lip), \
1075 DEFINE_LOG_ITEM_EVENT(xfs_ail_push
);
1076 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned
);
1077 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked
);
1078 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing
);
1080 DECLARE_EVENT_CLASS(xfs_ail_class
,
1081 TP_PROTO(struct xfs_log_item
*lip
, xfs_lsn_t old_lsn
, xfs_lsn_t new_lsn
),
1082 TP_ARGS(lip
, old_lsn
, new_lsn
),
1085 __field(void *, lip
)
1087 __field(uint
, flags
)
1088 __field(xfs_lsn_t
, old_lsn
)
1089 __field(xfs_lsn_t
, new_lsn
)
1092 __entry
->dev
= lip
->li_mountp
->m_super
->s_dev
;
1094 __entry
->type
= lip
->li_type
;
1095 __entry
->flags
= lip
->li_flags
;
1096 __entry
->old_lsn
= old_lsn
;
1097 __entry
->new_lsn
= new_lsn
;
1099 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1100 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1102 CYCLE_LSN(__entry
->old_lsn
), BLOCK_LSN(__entry
->old_lsn
),
1103 CYCLE_LSN(__entry
->new_lsn
), BLOCK_LSN(__entry
->new_lsn
),
1104 __print_symbolic(__entry
->type
, XFS_LI_TYPE_DESC
),
1105 __print_flags(__entry
->flags
, "|", XFS_LI_FLAGS
))
1108 #define DEFINE_AIL_EVENT(name) \
1109 DEFINE_EVENT(xfs_ail_class, name, \
1110 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1111 TP_ARGS(lip, old_lsn, new_lsn))
1112 DEFINE_AIL_EVENT(xfs_ail_insert
);
1113 DEFINE_AIL_EVENT(xfs_ail_move
);
1114 DEFINE_AIL_EVENT(xfs_ail_delete
);
1116 TRACE_EVENT(xfs_log_assign_tail_lsn
,
1117 TP_PROTO(struct xlog
*log
, xfs_lsn_t new_lsn
),
1118 TP_ARGS(log
, new_lsn
),
1121 __field(xfs_lsn_t
, new_lsn
)
1122 __field(xfs_lsn_t
, old_lsn
)
1123 __field(xfs_lsn_t
, last_sync_lsn
)
1126 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
1127 __entry
->new_lsn
= new_lsn
;
1128 __entry
->old_lsn
= atomic64_read(&log
->l_tail_lsn
);
1129 __entry
->last_sync_lsn
= atomic64_read(&log
->l_last_sync_lsn
);
1131 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1132 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1133 CYCLE_LSN(__entry
->new_lsn
), BLOCK_LSN(__entry
->new_lsn
),
1134 CYCLE_LSN(__entry
->old_lsn
), BLOCK_LSN(__entry
->old_lsn
),
1135 CYCLE_LSN(__entry
->last_sync_lsn
), BLOCK_LSN(__entry
->last_sync_lsn
))
1138 DECLARE_EVENT_CLASS(xfs_file_class
,
1139 TP_PROTO(struct xfs_inode
*ip
, size_t count
, loff_t offset
),
1140 TP_ARGS(ip
, count
, offset
),
1143 __field(xfs_ino_t
, ino
)
1144 __field(xfs_fsize_t
, size
)
1145 __field(loff_t
, offset
)
1146 __field(size_t, count
)
1149 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1150 __entry
->ino
= ip
->i_ino
;
1151 __entry
->size
= ip
->i_d
.di_size
;
1152 __entry
->offset
= offset
;
1153 __entry
->count
= count
;
1155 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
1156 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1163 #define DEFINE_RW_EVENT(name) \
1164 DEFINE_EVENT(xfs_file_class, name, \
1165 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1166 TP_ARGS(ip, count, offset))
1167 DEFINE_RW_EVENT(xfs_file_buffered_read
);
1168 DEFINE_RW_EVENT(xfs_file_direct_read
);
1169 DEFINE_RW_EVENT(xfs_file_dax_read
);
1170 DEFINE_RW_EVENT(xfs_file_buffered_write
);
1171 DEFINE_RW_EVENT(xfs_file_direct_write
);
1172 DEFINE_RW_EVENT(xfs_file_dax_write
);
1173 DEFINE_RW_EVENT(xfs_file_splice_read
);
1175 DECLARE_EVENT_CLASS(xfs_page_class
,
1176 TP_PROTO(struct inode
*inode
, struct page
*page
, unsigned long off
,
1178 TP_ARGS(inode
, page
, off
, len
),
1181 __field(xfs_ino_t
, ino
)
1182 __field(pgoff_t
, pgoff
)
1183 __field(loff_t
, size
)
1184 __field(unsigned long, offset
)
1185 __field(unsigned int, length
)
1186 __field(int, delalloc
)
1187 __field(int, unwritten
)
1190 int delalloc
= -1, unwritten
= -1;
1192 if (page_has_buffers(page
))
1193 xfs_count_page_state(page
, &delalloc
, &unwritten
);
1194 __entry
->dev
= inode
->i_sb
->s_dev
;
1195 __entry
->ino
= XFS_I(inode
)->i_ino
;
1196 __entry
->pgoff
= page_offset(page
);
1197 __entry
->size
= i_size_read(inode
);
1198 __entry
->offset
= off
;
1199 __entry
->length
= len
;
1200 __entry
->delalloc
= delalloc
;
1201 __entry
->unwritten
= unwritten
;
1203 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
1204 "length %x delalloc %d unwritten %d",
1205 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1215 #define DEFINE_PAGE_EVENT(name) \
1216 DEFINE_EVENT(xfs_page_class, name, \
1217 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1218 unsigned int len), \
1219 TP_ARGS(inode, page, off, len))
1220 DEFINE_PAGE_EVENT(xfs_writepage
);
1221 DEFINE_PAGE_EVENT(xfs_releasepage
);
1222 DEFINE_PAGE_EVENT(xfs_invalidatepage
);
1224 DECLARE_EVENT_CLASS(xfs_readpage_class
,
1225 TP_PROTO(struct inode
*inode
, int nr_pages
),
1226 TP_ARGS(inode
, nr_pages
),
1229 __field(xfs_ino_t
, ino
)
1230 __field(int, nr_pages
)
1233 __entry
->dev
= inode
->i_sb
->s_dev
;
1234 __entry
->ino
= inode
->i_ino
;
1235 __entry
->nr_pages
= nr_pages
;
1237 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1238 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1243 #define DEFINE_READPAGE_EVENT(name) \
1244 DEFINE_EVENT(xfs_readpage_class, name, \
1245 TP_PROTO(struct inode *inode, int nr_pages), \
1246 TP_ARGS(inode, nr_pages))
1247 DEFINE_READPAGE_EVENT(xfs_vm_readpage
);
1248 DEFINE_READPAGE_EVENT(xfs_vm_readpages
);
1250 DECLARE_EVENT_CLASS(xfs_imap_class
,
1251 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t offset
, ssize_t count
,
1252 int type
, struct xfs_bmbt_irec
*irec
),
1253 TP_ARGS(ip
, offset
, count
, type
, irec
),
1256 __field(xfs_ino_t
, ino
)
1257 __field(loff_t
, size
)
1258 __field(loff_t
, offset
)
1259 __field(size_t, count
)
1261 __field(xfs_fileoff_t
, startoff
)
1262 __field(xfs_fsblock_t
, startblock
)
1263 __field(xfs_filblks_t
, blockcount
)
1266 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1267 __entry
->ino
= ip
->i_ino
;
1268 __entry
->size
= ip
->i_d
.di_size
;
1269 __entry
->offset
= offset
;
1270 __entry
->count
= count
;
1271 __entry
->type
= type
;
1272 __entry
->startoff
= irec
? irec
->br_startoff
: 0;
1273 __entry
->startblock
= irec
? irec
->br_startblock
: 0;
1274 __entry
->blockcount
= irec
? irec
->br_blockcount
: 0;
1276 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1277 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
1278 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1283 __print_symbolic(__entry
->type
, XFS_IO_TYPES
),
1285 (__int64_t
)__entry
->startblock
,
1286 __entry
->blockcount
)
1289 #define DEFINE_IOMAP_EVENT(name) \
1290 DEFINE_EVENT(xfs_imap_class, name, \
1291 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1292 int type, struct xfs_bmbt_irec *irec), \
1293 TP_ARGS(ip, offset, count, type, irec))
1294 DEFINE_IOMAP_EVENT(xfs_map_blocks_found
);
1295 DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc
);
1296 DEFINE_IOMAP_EVENT(xfs_get_blocks_found
);
1297 DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc
);
1298 DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct
);
1299 DEFINE_IOMAP_EVENT(xfs_iomap_alloc
);
1300 DEFINE_IOMAP_EVENT(xfs_iomap_found
);
1302 DECLARE_EVENT_CLASS(xfs_simple_io_class
,
1303 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t offset
, ssize_t count
),
1304 TP_ARGS(ip
, offset
, count
),
1307 __field(xfs_ino_t
, ino
)
1308 __field(loff_t
, isize
)
1309 __field(loff_t
, disize
)
1310 __field(loff_t
, offset
)
1311 __field(size_t, count
)
1314 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1315 __entry
->ino
= ip
->i_ino
;
1316 __entry
->isize
= VFS_I(ip
)->i_size
;
1317 __entry
->disize
= ip
->i_d
.di_size
;
1318 __entry
->offset
= offset
;
1319 __entry
->count
= count
;
1321 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1322 "offset 0x%llx count %zd",
1323 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1331 #define DEFINE_SIMPLE_IO_EVENT(name) \
1332 DEFINE_EVENT(xfs_simple_io_class, name, \
1333 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1334 TP_ARGS(ip, offset, count))
1335 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc
);
1336 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert
);
1337 DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound
);
1338 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize
);
1339 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof
);
1340 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write
);
1341 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten
);
1342 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append
);
1344 DECLARE_EVENT_CLASS(xfs_itrunc_class
,
1345 TP_PROTO(struct xfs_inode
*ip
, xfs_fsize_t new_size
),
1346 TP_ARGS(ip
, new_size
),
1349 __field(xfs_ino_t
, ino
)
1350 __field(xfs_fsize_t
, size
)
1351 __field(xfs_fsize_t
, new_size
)
1354 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1355 __entry
->ino
= ip
->i_ino
;
1356 __entry
->size
= ip
->i_d
.di_size
;
1357 __entry
->new_size
= new_size
;
1359 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1360 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1366 #define DEFINE_ITRUNC_EVENT(name) \
1367 DEFINE_EVENT(xfs_itrunc_class, name, \
1368 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1369 TP_ARGS(ip, new_size))
1370 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start
);
1371 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end
);
1373 TRACE_EVENT(xfs_pagecache_inval
,
1374 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t start
, xfs_off_t finish
),
1375 TP_ARGS(ip
, start
, finish
),
1378 __field(xfs_ino_t
, ino
)
1379 __field(xfs_fsize_t
, size
)
1380 __field(xfs_off_t
, start
)
1381 __field(xfs_off_t
, finish
)
1384 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1385 __entry
->ino
= ip
->i_ino
;
1386 __entry
->size
= ip
->i_d
.di_size
;
1387 __entry
->start
= start
;
1388 __entry
->finish
= finish
;
1390 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1391 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1398 TRACE_EVENT(xfs_bunmap
,
1399 TP_PROTO(struct xfs_inode
*ip
, xfs_fileoff_t bno
, xfs_filblks_t len
,
1400 int flags
, unsigned long caller_ip
),
1401 TP_ARGS(ip
, bno
, len
, flags
, caller_ip
),
1404 __field(xfs_ino_t
, ino
)
1405 __field(xfs_fsize_t
, size
)
1406 __field(xfs_fileoff_t
, bno
)
1407 __field(xfs_filblks_t
, len
)
1408 __field(unsigned long, caller_ip
)
1412 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1413 __entry
->ino
= ip
->i_ino
;
1414 __entry
->size
= ip
->i_d
.di_size
;
1417 __entry
->caller_ip
= caller_ip
;
1418 __entry
->flags
= flags
;
1420 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1421 "flags %s caller %ps",
1422 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1427 __print_flags(__entry
->flags
, "|", XFS_BMAPI_FLAGS
),
1428 (void *)__entry
->caller_ip
)
1432 DECLARE_EVENT_CLASS(xfs_extent_busy_class
,
1433 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
1434 xfs_agblock_t agbno
, xfs_extlen_t len
),
1435 TP_ARGS(mp
, agno
, agbno
, len
),
1438 __field(xfs_agnumber_t
, agno
)
1439 __field(xfs_agblock_t
, agbno
)
1440 __field(xfs_extlen_t
, len
)
1443 __entry
->dev
= mp
->m_super
->s_dev
;
1444 __entry
->agno
= agno
;
1445 __entry
->agbno
= agbno
;
1448 TP_printk("dev %d:%d agno %u agbno %u len %u",
1449 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1454 #define DEFINE_BUSY_EVENT(name) \
1455 DEFINE_EVENT(xfs_extent_busy_class, name, \
1456 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1457 xfs_agblock_t agbno, xfs_extlen_t len), \
1458 TP_ARGS(mp, agno, agbno, len))
1459 DEFINE_BUSY_EVENT(xfs_extent_busy
);
1460 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem
);
1461 DEFINE_BUSY_EVENT(xfs_extent_busy_force
);
1462 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse
);
1463 DEFINE_BUSY_EVENT(xfs_extent_busy_clear
);
1465 TRACE_EVENT(xfs_extent_busy_trim
,
1466 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
1467 xfs_agblock_t agbno
, xfs_extlen_t len
,
1468 xfs_agblock_t tbno
, xfs_extlen_t tlen
),
1469 TP_ARGS(mp
, agno
, agbno
, len
, tbno
, tlen
),
1472 __field(xfs_agnumber_t
, agno
)
1473 __field(xfs_agblock_t
, agbno
)
1474 __field(xfs_extlen_t
, len
)
1475 __field(xfs_agblock_t
, tbno
)
1476 __field(xfs_extlen_t
, tlen
)
1479 __entry
->dev
= mp
->m_super
->s_dev
;
1480 __entry
->agno
= agno
;
1481 __entry
->agbno
= agbno
;
1483 __entry
->tbno
= tbno
;
1484 __entry
->tlen
= tlen
;
1486 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1487 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1495 TRACE_EVENT(xfs_trans_commit_lsn
,
1496 TP_PROTO(struct xfs_trans
*trans
),
1500 __field(struct xfs_trans
*, tp
)
1501 __field(xfs_lsn_t
, lsn
)
1504 __entry
->dev
= trans
->t_mountp
->m_super
->s_dev
;
1505 __entry
->tp
= trans
;
1506 __entry
->lsn
= trans
->t_commit_lsn
;
1508 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1509 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1514 TRACE_EVENT(xfs_agf
,
1515 TP_PROTO(struct xfs_mount
*mp
, struct xfs_agf
*agf
, int flags
,
1516 unsigned long caller_ip
),
1517 TP_ARGS(mp
, agf
, flags
, caller_ip
),
1520 __field(xfs_agnumber_t
, agno
)
1522 __field(__u32
, length
)
1523 __field(__u32
, bno_root
)
1524 __field(__u32
, cnt_root
)
1525 __field(__u32
, bno_level
)
1526 __field(__u32
, cnt_level
)
1527 __field(__u32
, flfirst
)
1528 __field(__u32
, fllast
)
1529 __field(__u32
, flcount
)
1530 __field(__u32
, freeblks
)
1531 __field(__u32
, longest
)
1532 __field(unsigned long, caller_ip
)
1535 __entry
->dev
= mp
->m_super
->s_dev
;
1536 __entry
->agno
= be32_to_cpu(agf
->agf_seqno
),
1537 __entry
->flags
= flags
;
1538 __entry
->length
= be32_to_cpu(agf
->agf_length
),
1539 __entry
->bno_root
= be32_to_cpu(agf
->agf_roots
[XFS_BTNUM_BNO
]),
1540 __entry
->cnt_root
= be32_to_cpu(agf
->agf_roots
[XFS_BTNUM_CNT
]),
1541 __entry
->bno_level
=
1542 be32_to_cpu(agf
->agf_levels
[XFS_BTNUM_BNO
]),
1543 __entry
->cnt_level
=
1544 be32_to_cpu(agf
->agf_levels
[XFS_BTNUM_CNT
]),
1545 __entry
->flfirst
= be32_to_cpu(agf
->agf_flfirst
),
1546 __entry
->fllast
= be32_to_cpu(agf
->agf_fllast
),
1547 __entry
->flcount
= be32_to_cpu(agf
->agf_flcount
),
1548 __entry
->freeblks
= be32_to_cpu(agf
->agf_freeblks
),
1549 __entry
->longest
= be32_to_cpu(agf
->agf_longest
);
1550 __entry
->caller_ip
= caller_ip
;
1552 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1553 "levels b %u c %u flfirst %u fllast %u flcount %u "
1554 "freeblks %u longest %u caller %ps",
1555 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1557 __print_flags(__entry
->flags
, "|", XFS_AGF_FLAGS
),
1568 (void *)__entry
->caller_ip
)
1571 TRACE_EVENT(xfs_free_extent
,
1572 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agblock_t agbno
,
1573 xfs_extlen_t len
, bool isfl
, int haveleft
, int haveright
),
1574 TP_ARGS(mp
, agno
, agbno
, len
, isfl
, haveleft
, haveright
),
1577 __field(xfs_agnumber_t
, agno
)
1578 __field(xfs_agblock_t
, agbno
)
1579 __field(xfs_extlen_t
, len
)
1581 __field(int, haveleft
)
1582 __field(int, haveright
)
1585 __entry
->dev
= mp
->m_super
->s_dev
;
1586 __entry
->agno
= agno
;
1587 __entry
->agbno
= agbno
;
1589 __entry
->isfl
= isfl
;
1590 __entry
->haveleft
= haveleft
;
1591 __entry
->haveright
= haveright
;
1593 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1594 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1600 (__entry
->haveright
? "both" : "left") :
1601 (__entry
->haveright
? "right" : "none"))
1605 DECLARE_EVENT_CLASS(xfs_alloc_class
,
1606 TP_PROTO(struct xfs_alloc_arg
*args
),
1610 __field(xfs_agnumber_t
, agno
)
1611 __field(xfs_agblock_t
, agbno
)
1612 __field(xfs_extlen_t
, minlen
)
1613 __field(xfs_extlen_t
, maxlen
)
1614 __field(xfs_extlen_t
, mod
)
1615 __field(xfs_extlen_t
, prod
)
1616 __field(xfs_extlen_t
, minleft
)
1617 __field(xfs_extlen_t
, total
)
1618 __field(xfs_extlen_t
, alignment
)
1619 __field(xfs_extlen_t
, minalignslop
)
1620 __field(xfs_extlen_t
, len
)
1621 __field(short, type
)
1622 __field(short, otype
)
1623 __field(char, wasdel
)
1624 __field(char, wasfromfl
)
1626 __field(char, userdata
)
1627 __field(xfs_fsblock_t
, firstblock
)
1630 __entry
->dev
= args
->mp
->m_super
->s_dev
;
1631 __entry
->agno
= args
->agno
;
1632 __entry
->agbno
= args
->agbno
;
1633 __entry
->minlen
= args
->minlen
;
1634 __entry
->maxlen
= args
->maxlen
;
1635 __entry
->mod
= args
->mod
;
1636 __entry
->prod
= args
->prod
;
1637 __entry
->minleft
= args
->minleft
;
1638 __entry
->total
= args
->total
;
1639 __entry
->alignment
= args
->alignment
;
1640 __entry
->minalignslop
= args
->minalignslop
;
1641 __entry
->len
= args
->len
;
1642 __entry
->type
= args
->type
;
1643 __entry
->otype
= args
->otype
;
1644 __entry
->wasdel
= args
->wasdel
;
1645 __entry
->wasfromfl
= args
->wasfromfl
;
1646 __entry
->isfl
= args
->isfl
;
1647 __entry
->userdata
= args
->userdata
;
1648 __entry
->firstblock
= args
->firstblock
;
1650 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1651 "prod %u minleft %u total %u alignment %u minalignslop %u "
1652 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1653 "userdata %d firstblock 0x%llx",
1654 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1664 __entry
->minalignslop
,
1666 __print_symbolic(__entry
->type
, XFS_ALLOC_TYPES
),
1667 __print_symbolic(__entry
->otype
, XFS_ALLOC_TYPES
),
1672 (unsigned long long)__entry
->firstblock
)
1675 #define DEFINE_ALLOC_EVENT(name) \
1676 DEFINE_EVENT(xfs_alloc_class, name, \
1677 TP_PROTO(struct xfs_alloc_arg *args), \
1679 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done
);
1680 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound
);
1681 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error
);
1682 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft
);
1683 DEFINE_ALLOC_EVENT(xfs_alloc_near_first
);
1684 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater
);
1685 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser
);
1686 DEFINE_ALLOC_EVENT(xfs_alloc_near_error
);
1687 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry
);
1688 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy
);
1689 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither
);
1690 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry
);
1691 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft
);
1692 DEFINE_ALLOC_EVENT(xfs_alloc_size_done
);
1693 DEFINE_ALLOC_EVENT(xfs_alloc_size_error
);
1694 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy
);
1695 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist
);
1696 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough
);
1697 DEFINE_ALLOC_EVENT(xfs_alloc_small_done
);
1698 DEFINE_ALLOC_EVENT(xfs_alloc_small_error
);
1699 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs
);
1700 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix
);
1701 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp
);
1702 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed
);
1703 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed
);
1705 DECLARE_EVENT_CLASS(xfs_da_class
,
1706 TP_PROTO(struct xfs_da_args
*args
),
1710 __field(xfs_ino_t
, ino
)
1711 __dynamic_array(char, name
, args
->namelen
)
1712 __field(int, namelen
)
1713 __field(xfs_dahash_t
, hashval
)
1714 __field(xfs_ino_t
, inumber
)
1715 __field(int, op_flags
)
1718 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1719 __entry
->ino
= args
->dp
->i_ino
;
1721 memcpy(__get_str(name
), args
->name
, args
->namelen
);
1722 __entry
->namelen
= args
->namelen
;
1723 __entry
->hashval
= args
->hashval
;
1724 __entry
->inumber
= args
->inumber
;
1725 __entry
->op_flags
= args
->op_flags
;
1727 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1728 "inumber 0x%llx op_flags %s",
1729 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1732 __entry
->namelen
? __get_str(name
) : NULL
,
1736 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
))
1739 #define DEFINE_DIR2_EVENT(name) \
1740 DEFINE_EVENT(xfs_da_class, name, \
1741 TP_PROTO(struct xfs_da_args *args), \
1743 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname
);
1744 DEFINE_DIR2_EVENT(xfs_dir2_sf_create
);
1745 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup
);
1746 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace
);
1747 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename
);
1748 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4
);
1749 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8
);
1750 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block
);
1751 DEFINE_DIR2_EVENT(xfs_dir2_block_addname
);
1752 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup
);
1753 DEFINE_DIR2_EVENT(xfs_dir2_block_replace
);
1754 DEFINE_DIR2_EVENT(xfs_dir2_block_removename
);
1755 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf
);
1756 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf
);
1757 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname
);
1758 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup
);
1759 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace
);
1760 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename
);
1761 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block
);
1762 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node
);
1763 DEFINE_DIR2_EVENT(xfs_dir2_node_addname
);
1764 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup
);
1765 DEFINE_DIR2_EVENT(xfs_dir2_node_replace
);
1766 DEFINE_DIR2_EVENT(xfs_dir2_node_removename
);
1767 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf
);
1769 DECLARE_EVENT_CLASS(xfs_attr_class
,
1770 TP_PROTO(struct xfs_da_args
*args
),
1774 __field(xfs_ino_t
, ino
)
1775 __dynamic_array(char, name
, args
->namelen
)
1776 __field(int, namelen
)
1777 __field(int, valuelen
)
1778 __field(xfs_dahash_t
, hashval
)
1779 __field(int, op_flags
)
1782 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1783 __entry
->ino
= args
->dp
->i_ino
;
1785 memcpy(__get_str(name
), args
->name
, args
->namelen
);
1786 __entry
->namelen
= args
->namelen
;
1787 __entry
->valuelen
= args
->valuelen
;
1788 __entry
->hashval
= args
->hashval
;
1789 __entry
->op_flags
= args
->op_flags
;
1791 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1792 "hashval 0x%x op_flags %s",
1793 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1796 __entry
->namelen
? __get_str(name
) : NULL
,
1800 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
))
1803 #define DEFINE_ATTR_EVENT(name) \
1804 DEFINE_EVENT(xfs_attr_class, name, \
1805 TP_PROTO(struct xfs_da_args *args), \
1807 DEFINE_ATTR_EVENT(xfs_attr_sf_add
);
1808 DEFINE_ATTR_EVENT(xfs_attr_sf_addname
);
1809 DEFINE_ATTR_EVENT(xfs_attr_sf_create
);
1810 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup
);
1811 DEFINE_ATTR_EVENT(xfs_attr_sf_remove
);
1812 DEFINE_ATTR_EVENT(xfs_attr_sf_removename
);
1813 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf
);
1815 DEFINE_ATTR_EVENT(xfs_attr_leaf_add
);
1816 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old
);
1817 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new
);
1818 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work
);
1819 DEFINE_ATTR_EVENT(xfs_attr_leaf_addname
);
1820 DEFINE_ATTR_EVENT(xfs_attr_leaf_create
);
1821 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact
);
1822 DEFINE_ATTR_EVENT(xfs_attr_leaf_get
);
1823 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup
);
1824 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace
);
1825 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove
);
1826 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename
);
1827 DEFINE_ATTR_EVENT(xfs_attr_leaf_split
);
1828 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before
);
1829 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after
);
1830 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag
);
1831 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag
);
1832 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags
);
1833 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf
);
1834 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node
);
1835 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance
);
1836 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance
);
1837 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall
);
1839 DEFINE_ATTR_EVENT(xfs_attr_node_addname
);
1840 DEFINE_ATTR_EVENT(xfs_attr_node_get
);
1841 DEFINE_ATTR_EVENT(xfs_attr_node_lookup
);
1842 DEFINE_ATTR_EVENT(xfs_attr_node_replace
);
1843 DEFINE_ATTR_EVENT(xfs_attr_node_removename
);
1845 DEFINE_ATTR_EVENT(xfs_attr_fillstate
);
1846 DEFINE_ATTR_EVENT(xfs_attr_refillstate
);
1848 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get
);
1849 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set
);
1850 DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove
);
1852 #define DEFINE_DA_EVENT(name) \
1853 DEFINE_EVENT(xfs_da_class, name, \
1854 TP_PROTO(struct xfs_da_args *args), \
1856 DEFINE_DA_EVENT(xfs_da_split
);
1857 DEFINE_DA_EVENT(xfs_da_join
);
1858 DEFINE_DA_EVENT(xfs_da_link_before
);
1859 DEFINE_DA_EVENT(xfs_da_link_after
);
1860 DEFINE_DA_EVENT(xfs_da_unlink_back
);
1861 DEFINE_DA_EVENT(xfs_da_unlink_forward
);
1862 DEFINE_DA_EVENT(xfs_da_root_split
);
1863 DEFINE_DA_EVENT(xfs_da_root_join
);
1864 DEFINE_DA_EVENT(xfs_da_node_add
);
1865 DEFINE_DA_EVENT(xfs_da_node_create
);
1866 DEFINE_DA_EVENT(xfs_da_node_split
);
1867 DEFINE_DA_EVENT(xfs_da_node_remove
);
1868 DEFINE_DA_EVENT(xfs_da_node_rebalance
);
1869 DEFINE_DA_EVENT(xfs_da_node_unbalance
);
1870 DEFINE_DA_EVENT(xfs_da_node_toosmall
);
1871 DEFINE_DA_EVENT(xfs_da_swap_lastblock
);
1872 DEFINE_DA_EVENT(xfs_da_grow_inode
);
1873 DEFINE_DA_EVENT(xfs_da_shrink_inode
);
1874 DEFINE_DA_EVENT(xfs_da_fixhashpath
);
1875 DEFINE_DA_EVENT(xfs_da_path_shift
);
1877 DECLARE_EVENT_CLASS(xfs_dir2_space_class
,
1878 TP_PROTO(struct xfs_da_args
*args
, int idx
),
1882 __field(xfs_ino_t
, ino
)
1883 __field(int, op_flags
)
1887 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1888 __entry
->ino
= args
->dp
->i_ino
;
1889 __entry
->op_flags
= args
->op_flags
;
1892 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1893 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1895 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
),
1899 #define DEFINE_DIR2_SPACE_EVENT(name) \
1900 DEFINE_EVENT(xfs_dir2_space_class, name, \
1901 TP_PROTO(struct xfs_da_args *args, int idx), \
1903 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add
);
1904 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove
);
1905 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode
);
1906 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode
);
1908 TRACE_EVENT(xfs_dir2_leafn_moveents
,
1909 TP_PROTO(struct xfs_da_args
*args
, int src_idx
, int dst_idx
, int count
),
1910 TP_ARGS(args
, src_idx
, dst_idx
, count
),
1913 __field(xfs_ino_t
, ino
)
1914 __field(int, op_flags
)
1915 __field(int, src_idx
)
1916 __field(int, dst_idx
)
1920 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1921 __entry
->ino
= args
->dp
->i_ino
;
1922 __entry
->op_flags
= args
->op_flags
;
1923 __entry
->src_idx
= src_idx
;
1924 __entry
->dst_idx
= dst_idx
;
1925 __entry
->count
= count
;
1927 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1928 "src_idx %d dst_idx %d count %d",
1929 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1931 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
),
1937 #define XFS_SWAPEXT_INODES \
1941 #define XFS_INODE_FORMAT_STR \
1947 DECLARE_EVENT_CLASS(xfs_swap_extent_class
,
1948 TP_PROTO(struct xfs_inode
*ip
, int which
),
1953 __field(xfs_ino_t
, ino
)
1954 __field(int, format
)
1956 __field(int, broot_size
)
1957 __field(int, fork_off
)
1960 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1961 __entry
->which
= which
;
1962 __entry
->ino
= ip
->i_ino
;
1963 __entry
->format
= ip
->i_d
.di_format
;
1964 __entry
->nex
= ip
->i_d
.di_nextents
;
1965 __entry
->broot_size
= ip
->i_df
.if_broot_bytes
;
1966 __entry
->fork_off
= XFS_IFORK_BOFF(ip
);
1968 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1969 "broot size %d, fork offset %d",
1970 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1972 __print_symbolic(__entry
->which
, XFS_SWAPEXT_INODES
),
1973 __print_symbolic(__entry
->format
, XFS_INODE_FORMAT_STR
),
1975 __entry
->broot_size
,
1979 #define DEFINE_SWAPEXT_EVENT(name) \
1980 DEFINE_EVENT(xfs_swap_extent_class, name, \
1981 TP_PROTO(struct xfs_inode *ip, int which), \
1984 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before
);
1985 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after
);
1987 DECLARE_EVENT_CLASS(xfs_log_recover_item_class
,
1988 TP_PROTO(struct xlog
*log
, struct xlog_recover
*trans
,
1989 struct xlog_recover_item
*item
, int pass
),
1990 TP_ARGS(log
, trans
, item
, pass
),
1993 __field(unsigned long, item
)
1994 __field(xlog_tid_t
, tid
)
2001 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2002 __entry
->item
= (unsigned long)item
;
2003 __entry
->tid
= trans
->r_log_tid
;
2004 __entry
->type
= ITEM_TYPE(item
);
2005 __entry
->pass
= pass
;
2006 __entry
->count
= item
->ri_cnt
;
2007 __entry
->total
= item
->ri_total
;
2009 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
2010 "item region count/total %d/%d",
2011 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2014 (void *)__entry
->item
,
2015 __print_symbolic(__entry
->type
, XFS_LI_TYPE_DESC
),
2020 #define DEFINE_LOG_RECOVER_ITEM(name) \
2021 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2022 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2023 struct xlog_recover_item *item, int pass), \
2024 TP_ARGS(log, trans, item, pass))
2026 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add
);
2027 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont
);
2028 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head
);
2029 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail
);
2030 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover
);
2032 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class
,
2033 TP_PROTO(struct xlog
*log
, struct xfs_buf_log_format
*buf_f
),
2034 TP_ARGS(log
, buf_f
),
2037 __field(__int64_t
, blkno
)
2038 __field(unsigned short, len
)
2039 __field(unsigned short, flags
)
2040 __field(unsigned short, size
)
2041 __field(unsigned int, map_size
)
2044 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2045 __entry
->blkno
= buf_f
->blf_blkno
;
2046 __entry
->len
= buf_f
->blf_len
;
2047 __entry
->flags
= buf_f
->blf_flags
;
2048 __entry
->size
= buf_f
->blf_size
;
2049 __entry
->map_size
= buf_f
->blf_map_size
;
2051 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2053 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2061 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2062 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2063 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2064 TP_ARGS(log, buf_f))
2066 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel
);
2067 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel
);
2068 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add
);
2069 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc
);
2070 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover
);
2071 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf
);
2072 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf
);
2073 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf
);
2075 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class
,
2076 TP_PROTO(struct xlog
*log
, struct xfs_inode_log_format
*in_f
),
2080 __field(xfs_ino_t
, ino
)
2081 __field(unsigned short, size
)
2082 __field(int, fields
)
2083 __field(unsigned short, asize
)
2084 __field(unsigned short, dsize
)
2085 __field(__int64_t
, blkno
)
2087 __field(int, boffset
)
2090 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2091 __entry
->ino
= in_f
->ilf_ino
;
2092 __entry
->size
= in_f
->ilf_size
;
2093 __entry
->fields
= in_f
->ilf_fields
;
2094 __entry
->asize
= in_f
->ilf_asize
;
2095 __entry
->dsize
= in_f
->ilf_dsize
;
2096 __entry
->blkno
= in_f
->ilf_blkno
;
2097 __entry
->len
= in_f
->ilf_len
;
2098 __entry
->boffset
= in_f
->ilf_boffset
;
2100 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2101 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2102 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2112 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2113 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2114 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2117 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover
);
2118 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel
);
2119 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip
);
2121 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class
,
2122 TP_PROTO(struct xlog
*log
, struct xfs_icreate_log
*in_f
),
2126 __field(xfs_agnumber_t
, agno
)
2127 __field(xfs_agblock_t
, agbno
)
2128 __field(unsigned int, count
)
2129 __field(unsigned int, isize
)
2130 __field(xfs_agblock_t
, length
)
2131 __field(unsigned int, gen
)
2134 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2135 __entry
->agno
= be32_to_cpu(in_f
->icl_ag
);
2136 __entry
->agbno
= be32_to_cpu(in_f
->icl_agbno
);
2137 __entry
->count
= be32_to_cpu(in_f
->icl_count
);
2138 __entry
->isize
= be32_to_cpu(in_f
->icl_isize
);
2139 __entry
->length
= be32_to_cpu(in_f
->icl_length
);
2140 __entry
->gen
= be32_to_cpu(in_f
->icl_gen
);
2142 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2143 "gen %u", MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2144 __entry
->agno
, __entry
->agbno
, __entry
->count
, __entry
->isize
,
2145 __entry
->length
, __entry
->gen
)
2147 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2148 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2149 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2152 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel
);
2153 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover
);
2155 DECLARE_EVENT_CLASS(xfs_discard_class
,
2156 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2157 xfs_agblock_t agbno
, xfs_extlen_t len
),
2158 TP_ARGS(mp
, agno
, agbno
, len
),
2161 __field(xfs_agnumber_t
, agno
)
2162 __field(xfs_agblock_t
, agbno
)
2163 __field(xfs_extlen_t
, len
)
2166 __entry
->dev
= mp
->m_super
->s_dev
;
2167 __entry
->agno
= agno
;
2168 __entry
->agbno
= agbno
;
2171 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2172 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2178 #define DEFINE_DISCARD_EVENT(name) \
2179 DEFINE_EVENT(xfs_discard_class, name, \
2180 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2181 xfs_agblock_t agbno, xfs_extlen_t len), \
2182 TP_ARGS(mp, agno, agbno, len))
2183 DEFINE_DISCARD_EVENT(xfs_discard_extent
);
2184 DEFINE_DISCARD_EVENT(xfs_discard_toosmall
);
2185 DEFINE_DISCARD_EVENT(xfs_discard_exclude
);
2186 DEFINE_DISCARD_EVENT(xfs_discard_busy
);
2188 /* btree cursor events */
2189 DECLARE_EVENT_CLASS(xfs_btree_cur_class
,
2190 TP_PROTO(struct xfs_btree_cur
*cur
, int level
, struct xfs_buf
*bp
),
2191 TP_ARGS(cur
, level
, bp
),
2194 __field(xfs_btnum_t
, btnum
)
2196 __field(int, nlevels
)
2198 __field(xfs_daddr_t
, daddr
)
2201 __entry
->dev
= cur
->bc_mp
->m_super
->s_dev
;
2202 __entry
->btnum
= cur
->bc_btnum
;
2203 __entry
->level
= level
;
2204 __entry
->nlevels
= cur
->bc_nlevels
;
2205 __entry
->ptr
= cur
->bc_ptrs
[level
];
2206 __entry
->daddr
= bp
? bp
->b_bn
: -1;
2208 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2209 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2214 (unsigned long long)__entry
->daddr
)
2217 #define DEFINE_BTREE_CUR_EVENT(name) \
2218 DEFINE_EVENT(xfs_btree_cur_class, name, \
2219 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2220 TP_ARGS(cur, level, bp))
2221 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys
);
2222 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range
);
2225 struct xfs_defer_pending
;
2226 struct xfs_defer_intake
;
2227 struct xfs_defer_ops
;
2229 DECLARE_EVENT_CLASS(xfs_defer_class
,
2230 TP_PROTO(struct xfs_mount
*mp
, struct xfs_defer_ops
*dop
),
2234 __field(void *, dop
)
2235 __field(bool, committed
)
2239 __entry
->dev
= mp
? mp
->m_super
->s_dev
: 0;
2241 __entry
->committed
= dop
->dop_committed
;
2242 __entry
->low
= dop
->dop_low
;
2244 TP_printk("dev %d:%d ops %p committed %d low %d\n",
2245 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2250 #define DEFINE_DEFER_EVENT(name) \
2251 DEFINE_EVENT(xfs_defer_class, name, \
2252 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2255 DECLARE_EVENT_CLASS(xfs_defer_error_class
,
2256 TP_PROTO(struct xfs_mount
*mp
, struct xfs_defer_ops
*dop
, int error
),
2257 TP_ARGS(mp
, dop
, error
),
2260 __field(void *, dop
)
2261 __field(bool, committed
)
2266 __entry
->dev
= mp
? mp
->m_super
->s_dev
: 0;
2268 __entry
->committed
= dop
->dop_committed
;
2269 __entry
->low
= dop
->dop_low
;
2270 __entry
->error
= error
;
2272 TP_printk("dev %d:%d ops %p committed %d low %d err %d\n",
2273 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2279 #define DEFINE_DEFER_ERROR_EVENT(name) \
2280 DEFINE_EVENT(xfs_defer_error_class, name, \
2281 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2282 TP_ARGS(mp, dop, error))
2284 DECLARE_EVENT_CLASS(xfs_defer_pending_class
,
2285 TP_PROTO(struct xfs_mount
*mp
, struct xfs_defer_pending
*dfp
),
2290 __field(void *, intent
)
2291 __field(bool, committed
)
2295 __entry
->dev
= mp
? mp
->m_super
->s_dev
: 0;
2296 __entry
->type
= dfp
->dfp_type
->type
;
2297 __entry
->intent
= dfp
->dfp_intent
;
2298 __entry
->committed
= dfp
->dfp_done
!= NULL
;
2299 __entry
->nr
= dfp
->dfp_count
;
2301 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d\n",
2302 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2308 #define DEFINE_DEFER_PENDING_EVENT(name) \
2309 DEFINE_EVENT(xfs_defer_pending_class, name, \
2310 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2313 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class
,
2314 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2315 int type
, xfs_agblock_t agbno
, xfs_extlen_t len
),
2316 TP_ARGS(mp
, agno
, type
, agbno
, len
),
2319 __field(xfs_agnumber_t
, agno
)
2321 __field(xfs_agblock_t
, agbno
)
2322 __field(xfs_extlen_t
, len
)
2325 __entry
->dev
= mp
->m_super
->s_dev
;
2326 __entry
->agno
= agno
;
2327 __entry
->type
= type
;
2328 __entry
->agbno
= agbno
;
2331 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2332 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2338 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2339 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2340 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2342 xfs_agblock_t bno, \
2343 xfs_extlen_t len), \
2344 TP_ARGS(mp, agno, type, bno, len))
2346 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class
,
2347 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2349 xfs_agblock_t agbno
,
2352 xfs_fileoff_t offset
,
2354 xfs_exntst_t state
),
2355 TP_ARGS(mp
, agno
, op
, agbno
, ino
, whichfork
, offset
, len
, state
),
2358 __field(xfs_agnumber_t
, agno
)
2359 __field(xfs_ino_t
, ino
)
2360 __field(xfs_agblock_t
, agbno
)
2361 __field(int, whichfork
)
2362 __field(xfs_fileoff_t
, l_loff
)
2363 __field(xfs_filblks_t
, l_len
)
2364 __field(xfs_exntst_t
, l_state
)
2368 __entry
->dev
= mp
->m_super
->s_dev
;
2369 __entry
->agno
= agno
;
2371 __entry
->agbno
= agbno
;
2372 __entry
->whichfork
= whichfork
;
2373 __entry
->l_loff
= offset
;
2374 __entry
->l_len
= len
;
2375 __entry
->l_state
= state
;
2378 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2379 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2384 __entry
->whichfork
== XFS_ATTR_FORK
? "attr" : "data",
2389 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2390 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2391 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2393 xfs_agblock_t agbno, \
2396 xfs_fileoff_t offset, \
2397 xfs_filblks_t len, \
2398 xfs_exntst_t state), \
2399 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2401 DEFINE_DEFER_EVENT(xfs_defer_init
);
2402 DEFINE_DEFER_EVENT(xfs_defer_cancel
);
2403 DEFINE_DEFER_EVENT(xfs_defer_trans_roll
);
2404 DEFINE_DEFER_EVENT(xfs_defer_trans_abort
);
2405 DEFINE_DEFER_EVENT(xfs_defer_finish
);
2406 DEFINE_DEFER_EVENT(xfs_defer_finish_done
);
2408 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error
);
2409 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error
);
2410 DEFINE_DEFER_ERROR_EVENT(xfs_defer_op_finish_error
);
2412 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work
);
2413 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel
);
2414 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_commit
);
2415 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel
);
2416 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish
);
2417 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort
);
2419 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2420 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer
);
2421 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred
);
2423 /* rmap tracepoints */
2424 DECLARE_EVENT_CLASS(xfs_rmap_class
,
2425 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2426 xfs_agblock_t agbno
, xfs_extlen_t len
, bool unwritten
,
2427 struct xfs_owner_info
*oinfo
),
2428 TP_ARGS(mp
, agno
, agbno
, len
, unwritten
, oinfo
),
2431 __field(xfs_agnumber_t
, agno
)
2432 __field(xfs_agblock_t
, agbno
)
2433 __field(xfs_extlen_t
, len
)
2434 __field(uint64_t, owner
)
2435 __field(uint64_t, offset
)
2436 __field(unsigned long, flags
)
2439 __entry
->dev
= mp
->m_super
->s_dev
;
2440 __entry
->agno
= agno
;
2441 __entry
->agbno
= agbno
;
2443 __entry
->owner
= oinfo
->oi_owner
;
2444 __entry
->offset
= oinfo
->oi_offset
;
2445 __entry
->flags
= oinfo
->oi_flags
;
2447 __entry
->flags
|= XFS_RMAP_UNWRITTEN
;
2449 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2450 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2458 #define DEFINE_RMAP_EVENT(name) \
2459 DEFINE_EVENT(xfs_rmap_class, name, \
2460 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2461 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2462 struct xfs_owner_info *oinfo), \
2463 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2465 /* simple AG-based error/%ip tracepoint class */
2466 DECLARE_EVENT_CLASS(xfs_ag_error_class
,
2467 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, int error
,
2468 unsigned long caller_ip
),
2469 TP_ARGS(mp
, agno
, error
, caller_ip
),
2472 __field(xfs_agnumber_t
, agno
)
2474 __field(unsigned long, caller_ip
)
2477 __entry
->dev
= mp
->m_super
->s_dev
;
2478 __entry
->agno
= agno
;
2479 __entry
->error
= error
;
2480 __entry
->caller_ip
= caller_ip
;
2482 TP_printk("dev %d:%d agno %u error %d caller %ps",
2483 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2486 (char *)__entry
->caller_ip
)
2489 #define DEFINE_AG_ERROR_EVENT(name) \
2490 DEFINE_EVENT(xfs_ag_error_class, name, \
2491 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2492 unsigned long caller_ip), \
2493 TP_ARGS(mp, agno, error, caller_ip))
2495 DEFINE_RMAP_EVENT(xfs_rmap_unmap
);
2496 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done
);
2497 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error
);
2498 DEFINE_RMAP_EVENT(xfs_rmap_map
);
2499 DEFINE_RMAP_EVENT(xfs_rmap_map_done
);
2500 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error
);
2501 DEFINE_RMAP_EVENT(xfs_rmap_convert
);
2502 DEFINE_RMAP_EVENT(xfs_rmap_convert_done
);
2503 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error
);
2504 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state
);
2506 DECLARE_EVENT_CLASS(xfs_rmapbt_class
,
2507 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2508 xfs_agblock_t agbno
, xfs_extlen_t len
,
2509 uint64_t owner
, uint64_t offset
, unsigned int flags
),
2510 TP_ARGS(mp
, agno
, agbno
, len
, owner
, offset
, flags
),
2513 __field(xfs_agnumber_t
, agno
)
2514 __field(xfs_agblock_t
, agbno
)
2515 __field(xfs_extlen_t
, len
)
2516 __field(uint64_t, owner
)
2517 __field(uint64_t, offset
)
2518 __field(unsigned int, flags
)
2521 __entry
->dev
= mp
->m_super
->s_dev
;
2522 __entry
->agno
= agno
;
2523 __entry
->agbno
= agbno
;
2525 __entry
->owner
= owner
;
2526 __entry
->offset
= offset
;
2527 __entry
->flags
= flags
;
2529 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2530 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2538 #define DEFINE_RMAPBT_EVENT(name) \
2539 DEFINE_EVENT(xfs_rmapbt_class, name, \
2540 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2541 xfs_agblock_t agbno, xfs_extlen_t len, \
2542 uint64_t owner, uint64_t offset, unsigned int flags), \
2543 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2545 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2546 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer
);
2547 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred
);
2549 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block
);
2550 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block
);
2551 DEFINE_RMAPBT_EVENT(xfs_rmap_update
);
2552 DEFINE_RMAPBT_EVENT(xfs_rmap_insert
);
2553 DEFINE_RMAPBT_EVENT(xfs_rmap_delete
);
2554 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error
);
2555 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error
);
2556 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error
);
2557 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result
);
2558 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result
);
2559 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result
);
2561 #endif /* _TRACE_XFS_H */
2563 #undef TRACE_INCLUDE_PATH
2564 #define TRACE_INCLUDE_PATH .
2565 #define TRACE_INCLUDE_FILE xfs_trace
2566 #include <trace/define_trace.h>