2 * Copyright (c) 2009, Christoph Hellwig
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #define TRACE_SYSTEM xfs
21 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
24 #include <linux/tracepoint.h>
28 struct xfs_attr_list_context
;
29 struct xfs_buf_log_item
;
31 struct xfs_da_node_entry
;
37 struct xlog_recover_item
;
38 struct xfs_buf_log_format
;
39 struct xfs_inode_log_format
;
42 struct xfs_refcount_irec
;
46 DECLARE_EVENT_CLASS(xfs_attr_list_class
,
47 TP_PROTO(struct xfs_attr_list_context
*ctx
),
51 __field(xfs_ino_t
, ino
)
55 __field(void *, alist
)
63 __entry
->dev
= VFS_I(ctx
->dp
)->i_sb
->s_dev
;
64 __entry
->ino
= ctx
->dp
->i_ino
;
65 __entry
->hashval
= ctx
->cursor
->hashval
;
66 __entry
->blkno
= ctx
->cursor
->blkno
;
67 __entry
->offset
= ctx
->cursor
->offset
;
68 __entry
->alist
= ctx
->alist
;
69 __entry
->bufsize
= ctx
->bufsize
;
70 __entry
->count
= ctx
->count
;
71 __entry
->firstu
= ctx
->firstu
;
72 __entry
->flags
= ctx
->flags
;
74 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
75 "alist 0x%p size %u count %u firstu %u flags %d %s",
76 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
87 __print_flags(__entry
->flags
, "|", XFS_ATTR_FLAGS
)
91 #define DEFINE_ATTR_LIST_EVENT(name) \
92 DEFINE_EVENT(xfs_attr_list_class, name, \
93 TP_PROTO(struct xfs_attr_list_context *ctx), \
95 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf
);
96 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all
);
97 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf
);
98 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end
);
99 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full
);
100 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add
);
101 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk
);
102 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound
);
103 DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list
);
104 DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list
);
106 DECLARE_EVENT_CLASS(xfs_perag_class
,
107 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, int refcount
,
108 unsigned long caller_ip
),
109 TP_ARGS(mp
, agno
, refcount
, caller_ip
),
112 __field(xfs_agnumber_t
, agno
)
113 __field(int, refcount
)
114 __field(unsigned long, caller_ip
)
117 __entry
->dev
= mp
->m_super
->s_dev
;
118 __entry
->agno
= agno
;
119 __entry
->refcount
= refcount
;
120 __entry
->caller_ip
= caller_ip
;
122 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
123 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
126 (char *)__entry
->caller_ip
)
129 #define DEFINE_PERAG_REF_EVENT(name) \
130 DEFINE_EVENT(xfs_perag_class, name, \
131 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
132 unsigned long caller_ip), \
133 TP_ARGS(mp, agno, refcount, caller_ip))
134 DEFINE_PERAG_REF_EVENT(xfs_perag_get
);
135 DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag
);
136 DEFINE_PERAG_REF_EVENT(xfs_perag_put
);
137 DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim
);
138 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim
);
139 DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks
);
140 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks
);
141 DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks
);
142 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks
);
144 DECLARE_EVENT_CLASS(xfs_ag_class
,
145 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
),
149 __field(xfs_agnumber_t
, agno
)
152 __entry
->dev
= mp
->m_super
->s_dev
;
153 __entry
->agno
= agno
;
155 TP_printk("dev %d:%d agno %u",
156 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
159 #define DEFINE_AG_EVENT(name) \
160 DEFINE_EVENT(xfs_ag_class, name, \
161 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
164 DEFINE_AG_EVENT(xfs_read_agf
);
165 DEFINE_AG_EVENT(xfs_alloc_read_agf
);
166 DEFINE_AG_EVENT(xfs_read_agi
);
167 DEFINE_AG_EVENT(xfs_ialloc_read_agi
);
169 TRACE_EVENT(xfs_attr_list_node_descend
,
170 TP_PROTO(struct xfs_attr_list_context
*ctx
,
171 struct xfs_da_node_entry
*btree
),
175 __field(xfs_ino_t
, ino
)
176 __field(u32
, hashval
)
179 __field(void *, alist
)
180 __field(int, bufsize
)
185 __field(u32
, bt_hashval
)
186 __field(u32
, bt_before
)
189 __entry
->dev
= VFS_I(ctx
->dp
)->i_sb
->s_dev
;
190 __entry
->ino
= ctx
->dp
->i_ino
;
191 __entry
->hashval
= ctx
->cursor
->hashval
;
192 __entry
->blkno
= ctx
->cursor
->blkno
;
193 __entry
->offset
= ctx
->cursor
->offset
;
194 __entry
->alist
= ctx
->alist
;
195 __entry
->bufsize
= ctx
->bufsize
;
196 __entry
->count
= ctx
->count
;
197 __entry
->firstu
= ctx
->firstu
;
198 __entry
->flags
= ctx
->flags
;
199 __entry
->bt_hashval
= be32_to_cpu(btree
->hashval
);
200 __entry
->bt_before
= be32_to_cpu(btree
->before
);
202 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
203 "alist 0x%p size %u count %u firstu %u flags %d %s "
204 "node hashval %u, node before %u",
205 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
216 __print_flags(__entry
->flags
, "|", XFS_ATTR_FLAGS
),
221 TRACE_EVENT(xfs_iext_insert
,
222 TP_PROTO(struct xfs_inode
*ip
, xfs_extnum_t idx
,
223 struct xfs_bmbt_irec
*r
, int state
, unsigned long caller_ip
),
224 TP_ARGS(ip
, idx
, r
, state
, caller_ip
),
227 __field(xfs_ino_t
, ino
)
228 __field(xfs_extnum_t
, idx
)
229 __field(xfs_fileoff_t
, startoff
)
230 __field(xfs_fsblock_t
, startblock
)
231 __field(xfs_filblks_t
, blockcount
)
232 __field(xfs_exntst_t
, state
)
233 __field(int, bmap_state
)
234 __field(unsigned long, caller_ip
)
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 %ps",
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 DECLARE_EVENT_CLASS(xfs_bmap_class
,
261 TP_PROTO(struct xfs_inode
*ip
, xfs_extnum_t idx
, int state
,
262 unsigned long caller_ip
),
263 TP_ARGS(ip
, idx
, state
, caller_ip
),
266 __field(xfs_ino_t
, ino
)
267 __field(xfs_extnum_t
, idx
)
268 __field(xfs_fileoff_t
, startoff
)
269 __field(xfs_fsblock_t
, startblock
)
270 __field(xfs_filblks_t
, blockcount
)
271 __field(xfs_exntst_t
, state
)
272 __field(int, bmap_state
)
273 __field(unsigned long, caller_ip
)
276 struct xfs_ifork
*ifp
;
277 struct xfs_bmbt_irec r
;
279 ifp
= xfs_iext_state_to_fork(ip
, state
);
280 xfs_bmbt_get_all(xfs_iext_get_ext(ifp
, idx
), &r
);
281 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
282 __entry
->ino
= ip
->i_ino
;
284 __entry
->startoff
= r
.br_startoff
;
285 __entry
->startblock
= r
.br_startblock
;
286 __entry
->blockcount
= r
.br_blockcount
;
287 __entry
->state
= r
.br_state
;
288 __entry
->bmap_state
= state
;
289 __entry
->caller_ip
= caller_ip
;
291 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
292 "offset %lld block %lld count %lld flag %d caller %ps",
293 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
295 __print_flags(__entry
->bmap_state
, "|", XFS_BMAP_EXT_FLAGS
),
298 (int64_t)__entry
->startblock
,
301 (char *)__entry
->caller_ip
)
304 #define DEFINE_BMAP_EVENT(name) \
305 DEFINE_EVENT(xfs_bmap_class, name, \
306 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
307 unsigned long caller_ip), \
308 TP_ARGS(ip, idx, state, caller_ip))
309 DEFINE_BMAP_EVENT(xfs_iext_remove
);
310 DEFINE_BMAP_EVENT(xfs_bmap_pre_update
);
311 DEFINE_BMAP_EVENT(xfs_bmap_post_update
);
312 DEFINE_BMAP_EVENT(xfs_extlist
);
314 DECLARE_EVENT_CLASS(xfs_buf_class
,
315 TP_PROTO(struct xfs_buf
*bp
, unsigned long caller_ip
),
316 TP_ARGS(bp
, caller_ip
),
319 __field(xfs_daddr_t
, bno
)
322 __field(int, pincount
)
323 __field(unsigned, lockval
)
324 __field(unsigned, flags
)
325 __field(unsigned long, caller_ip
)
328 __entry
->dev
= bp
->b_target
->bt_dev
;
329 __entry
->bno
= bp
->b_bn
;
330 __entry
->nblks
= bp
->b_length
;
331 __entry
->hold
= atomic_read(&bp
->b_hold
);
332 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
333 __entry
->lockval
= bp
->b_sema
.count
;
334 __entry
->flags
= bp
->b_flags
;
335 __entry
->caller_ip
= caller_ip
;
337 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
338 "lock %d flags %s caller %ps",
339 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
340 (unsigned long long)__entry
->bno
,
345 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
346 (void *)__entry
->caller_ip
)
349 #define DEFINE_BUF_EVENT(name) \
350 DEFINE_EVENT(xfs_buf_class, name, \
351 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
352 TP_ARGS(bp, caller_ip))
353 DEFINE_BUF_EVENT(xfs_buf_init
);
354 DEFINE_BUF_EVENT(xfs_buf_free
);
355 DEFINE_BUF_EVENT(xfs_buf_hold
);
356 DEFINE_BUF_EVENT(xfs_buf_rele
);
357 DEFINE_BUF_EVENT(xfs_buf_iodone
);
358 DEFINE_BUF_EVENT(xfs_buf_submit
);
359 DEFINE_BUF_EVENT(xfs_buf_submit_wait
);
360 DEFINE_BUF_EVENT(xfs_buf_lock
);
361 DEFINE_BUF_EVENT(xfs_buf_lock_done
);
362 DEFINE_BUF_EVENT(xfs_buf_trylock_fail
);
363 DEFINE_BUF_EVENT(xfs_buf_trylock
);
364 DEFINE_BUF_EVENT(xfs_buf_unlock
);
365 DEFINE_BUF_EVENT(xfs_buf_iowait
);
366 DEFINE_BUF_EVENT(xfs_buf_iowait_done
);
367 DEFINE_BUF_EVENT(xfs_buf_delwri_queue
);
368 DEFINE_BUF_EVENT(xfs_buf_delwri_queued
);
369 DEFINE_BUF_EVENT(xfs_buf_delwri_split
);
370 DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf
);
371 DEFINE_BUF_EVENT(xfs_buf_get_uncached
);
372 DEFINE_BUF_EVENT(xfs_buf_item_relse
);
373 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async
);
374 DEFINE_BUF_EVENT(xfs_buf_error_relse
);
375 DEFINE_BUF_EVENT(xfs_buf_wait_buftarg
);
376 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut
);
378 /* not really buffer traces, but the buf provides useful information */
379 DEFINE_BUF_EVENT(xfs_btree_corrupt
);
380 DEFINE_BUF_EVENT(xfs_reset_dqcounts
);
382 /* pass flags explicitly */
383 DECLARE_EVENT_CLASS(xfs_buf_flags_class
,
384 TP_PROTO(struct xfs_buf
*bp
, unsigned flags
, unsigned long caller_ip
),
385 TP_ARGS(bp
, flags
, caller_ip
),
388 __field(xfs_daddr_t
, bno
)
389 __field(size_t, buffer_length
)
391 __field(int, pincount
)
392 __field(unsigned, lockval
)
393 __field(unsigned, flags
)
394 __field(unsigned long, caller_ip
)
397 __entry
->dev
= bp
->b_target
->bt_dev
;
398 __entry
->bno
= bp
->b_bn
;
399 __entry
->buffer_length
= BBTOB(bp
->b_length
);
400 __entry
->flags
= flags
;
401 __entry
->hold
= atomic_read(&bp
->b_hold
);
402 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
403 __entry
->lockval
= bp
->b_sema
.count
;
404 __entry
->caller_ip
= caller_ip
;
406 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
407 "lock %d flags %s caller %ps",
408 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
409 (unsigned long long)__entry
->bno
,
410 __entry
->buffer_length
,
414 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
415 (void *)__entry
->caller_ip
)
418 #define DEFINE_BUF_FLAGS_EVENT(name) \
419 DEFINE_EVENT(xfs_buf_flags_class, name, \
420 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
421 TP_ARGS(bp, flags, caller_ip))
422 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find
);
423 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get
);
424 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read
);
426 TRACE_EVENT(xfs_buf_ioerror
,
427 TP_PROTO(struct xfs_buf
*bp
, int error
, unsigned long caller_ip
),
428 TP_ARGS(bp
, error
, caller_ip
),
431 __field(xfs_daddr_t
, bno
)
432 __field(size_t, buffer_length
)
433 __field(unsigned, flags
)
435 __field(int, pincount
)
436 __field(unsigned, lockval
)
438 __field(unsigned long, caller_ip
)
441 __entry
->dev
= bp
->b_target
->bt_dev
;
442 __entry
->bno
= bp
->b_bn
;
443 __entry
->buffer_length
= BBTOB(bp
->b_length
);
444 __entry
->hold
= atomic_read(&bp
->b_hold
);
445 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
446 __entry
->lockval
= bp
->b_sema
.count
;
447 __entry
->error
= error
;
448 __entry
->flags
= bp
->b_flags
;
449 __entry
->caller_ip
= caller_ip
;
451 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
452 "lock %d error %d flags %s caller %ps",
453 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
454 (unsigned long long)__entry
->bno
,
455 __entry
->buffer_length
,
460 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
461 (void *)__entry
->caller_ip
)
464 DECLARE_EVENT_CLASS(xfs_buf_item_class
,
465 TP_PROTO(struct xfs_buf_log_item
*bip
),
469 __field(xfs_daddr_t
, buf_bno
)
470 __field(size_t, buf_len
)
471 __field(int, buf_hold
)
472 __field(int, buf_pincount
)
473 __field(int, buf_lockval
)
474 __field(unsigned, buf_flags
)
475 __field(unsigned, bli_recur
)
476 __field(int, bli_refcount
)
477 __field(unsigned, bli_flags
)
478 __field(void *, li_desc
)
479 __field(unsigned, li_flags
)
482 __entry
->dev
= bip
->bli_buf
->b_target
->bt_dev
;
483 __entry
->bli_flags
= bip
->bli_flags
;
484 __entry
->bli_recur
= bip
->bli_recur
;
485 __entry
->bli_refcount
= atomic_read(&bip
->bli_refcount
);
486 __entry
->buf_bno
= bip
->bli_buf
->b_bn
;
487 __entry
->buf_len
= BBTOB(bip
->bli_buf
->b_length
);
488 __entry
->buf_flags
= bip
->bli_buf
->b_flags
;
489 __entry
->buf_hold
= atomic_read(&bip
->bli_buf
->b_hold
);
490 __entry
->buf_pincount
= atomic_read(&bip
->bli_buf
->b_pin_count
);
491 __entry
->buf_lockval
= bip
->bli_buf
->b_sema
.count
;
492 __entry
->li_desc
= bip
->bli_item
.li_desc
;
493 __entry
->li_flags
= bip
->bli_item
.li_flags
;
495 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
496 "lock %d flags %s recur %d refcount %d bliflags %s "
497 "lidesc 0x%p liflags %s",
498 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
499 (unsigned long long)__entry
->buf_bno
,
502 __entry
->buf_pincount
,
503 __entry
->buf_lockval
,
504 __print_flags(__entry
->buf_flags
, "|", XFS_BUF_FLAGS
),
506 __entry
->bli_refcount
,
507 __print_flags(__entry
->bli_flags
, "|", XFS_BLI_FLAGS
),
509 __print_flags(__entry
->li_flags
, "|", XFS_LI_FLAGS
))
512 #define DEFINE_BUF_ITEM_EVENT(name) \
513 DEFINE_EVENT(xfs_buf_item_class, name, \
514 TP_PROTO(struct xfs_buf_log_item *bip), \
516 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size
);
517 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered
);
518 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale
);
519 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format
);
520 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered
);
521 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale
);
522 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered
);
523 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin
);
524 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin
);
525 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale
);
526 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock
);
527 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale
);
528 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed
);
529 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push
);
530 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf
);
531 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur
);
532 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb
);
533 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur
);
534 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf
);
535 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur
);
536 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf
);
537 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse
);
538 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin
);
539 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold
);
540 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release
);
541 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval
);
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_update_time
);
682 DEFINE_INODE_EVENT(xfs_dquot_dqalloc
);
683 DEFINE_INODE_EVENT(xfs_dquot_dqdetach
);
685 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag
);
686 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag
);
687 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid
);
688 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag
);
689 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag
);
690 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid
);
692 DEFINE_INODE_EVENT(xfs_filemap_fault
);
693 DEFINE_INODE_EVENT(xfs_filemap_huge_fault
);
694 DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite
);
695 DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite
);
697 DECLARE_EVENT_CLASS(xfs_iref_class
,
698 TP_PROTO(struct xfs_inode
*ip
, unsigned long caller_ip
),
699 TP_ARGS(ip
, caller_ip
),
702 __field(xfs_ino_t
, ino
)
704 __field(int, pincount
)
705 __field(unsigned long, caller_ip
)
708 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
709 __entry
->ino
= ip
->i_ino
;
710 __entry
->count
= atomic_read(&VFS_I(ip
)->i_count
);
711 __entry
->pincount
= atomic_read(&ip
->i_pincount
);
712 __entry
->caller_ip
= caller_ip
;
714 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
715 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
719 (char *)__entry
->caller_ip
)
722 TRACE_EVENT(xfs_iomap_prealloc_size
,
723 TP_PROTO(struct xfs_inode
*ip
, xfs_fsblock_t blocks
, int shift
,
724 unsigned int writeio_blocks
),
725 TP_ARGS(ip
, blocks
, shift
, writeio_blocks
),
728 __field(xfs_ino_t
, ino
)
729 __field(xfs_fsblock_t
, blocks
)
731 __field(unsigned int, writeio_blocks
)
734 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
735 __entry
->ino
= ip
->i_ino
;
736 __entry
->blocks
= blocks
;
737 __entry
->shift
= shift
;
738 __entry
->writeio_blocks
= writeio_blocks
;
740 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
741 "m_writeio_blocks %u",
742 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->ino
,
743 __entry
->blocks
, __entry
->shift
, __entry
->writeio_blocks
)
746 TRACE_EVENT(xfs_irec_merge_pre
,
747 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agino_t agino
,
748 uint16_t holemask
, xfs_agino_t nagino
, uint16_t nholemask
),
749 TP_ARGS(mp
, agno
, agino
, holemask
, nagino
, nholemask
),
752 __field(xfs_agnumber_t
, agno
)
753 __field(xfs_agino_t
, agino
)
754 __field(uint16_t, holemask
)
755 __field(xfs_agino_t
, nagino
)
756 __field(uint16_t, nholemask
)
759 __entry
->dev
= mp
->m_super
->s_dev
;
760 __entry
->agno
= agno
;
761 __entry
->agino
= agino
;
762 __entry
->holemask
= holemask
;
763 __entry
->nagino
= nagino
;
764 __entry
->nholemask
= holemask
;
766 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
767 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->agno
,
768 __entry
->agino
, __entry
->holemask
, __entry
->nagino
,
772 TRACE_EVENT(xfs_irec_merge_post
,
773 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agino_t agino
,
775 TP_ARGS(mp
, agno
, agino
, holemask
),
778 __field(xfs_agnumber_t
, agno
)
779 __field(xfs_agino_t
, agino
)
780 __field(uint16_t, holemask
)
783 __entry
->dev
= mp
->m_super
->s_dev
;
784 __entry
->agno
= agno
;
785 __entry
->agino
= agino
;
786 __entry
->holemask
= holemask
;
788 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry
->dev
),
789 MINOR(__entry
->dev
), __entry
->agno
, __entry
->agino
,
793 #define DEFINE_IREF_EVENT(name) \
794 DEFINE_EVENT(xfs_iref_class, name, \
795 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
796 TP_ARGS(ip, caller_ip))
797 DEFINE_IREF_EVENT(xfs_irele
);
798 DEFINE_IREF_EVENT(xfs_inode_pin
);
799 DEFINE_IREF_EVENT(xfs_inode_unpin
);
800 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait
);
802 DECLARE_EVENT_CLASS(xfs_namespace_class
,
803 TP_PROTO(struct xfs_inode
*dp
, struct xfs_name
*name
),
807 __field(xfs_ino_t
, dp_ino
)
808 __field(int, namelen
)
809 __dynamic_array(char, name
, name
->len
)
812 __entry
->dev
= VFS_I(dp
)->i_sb
->s_dev
;
813 __entry
->dp_ino
= dp
->i_ino
;
814 __entry
->namelen
= name
->len
;
815 memcpy(__get_str(name
), name
->name
, name
->len
);
817 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
818 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
824 #define DEFINE_NAMESPACE_EVENT(name) \
825 DEFINE_EVENT(xfs_namespace_class, name, \
826 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
828 DEFINE_NAMESPACE_EVENT(xfs_remove
);
829 DEFINE_NAMESPACE_EVENT(xfs_link
);
830 DEFINE_NAMESPACE_EVENT(xfs_lookup
);
831 DEFINE_NAMESPACE_EVENT(xfs_create
);
832 DEFINE_NAMESPACE_EVENT(xfs_symlink
);
834 TRACE_EVENT(xfs_rename
,
835 TP_PROTO(struct xfs_inode
*src_dp
, struct xfs_inode
*target_dp
,
836 struct xfs_name
*src_name
, struct xfs_name
*target_name
),
837 TP_ARGS(src_dp
, target_dp
, src_name
, target_name
),
840 __field(xfs_ino_t
, src_dp_ino
)
841 __field(xfs_ino_t
, target_dp_ino
)
842 __field(int, src_namelen
)
843 __field(int, target_namelen
)
844 __dynamic_array(char, src_name
, src_name
->len
)
845 __dynamic_array(char, target_name
, target_name
->len
)
848 __entry
->dev
= VFS_I(src_dp
)->i_sb
->s_dev
;
849 __entry
->src_dp_ino
= src_dp
->i_ino
;
850 __entry
->target_dp_ino
= target_dp
->i_ino
;
851 __entry
->src_namelen
= src_name
->len
;
852 __entry
->target_namelen
= target_name
->len
;
853 memcpy(__get_str(src_name
), src_name
->name
, src_name
->len
);
854 memcpy(__get_str(target_name
), target_name
->name
,
857 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
858 " src name %.*s target name %.*s",
859 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
861 __entry
->target_dp_ino
,
862 __entry
->src_namelen
,
864 __entry
->target_namelen
,
865 __get_str(target_name
))
868 DECLARE_EVENT_CLASS(xfs_dquot_class
,
869 TP_PROTO(struct xfs_dquot
*dqp
),
874 __field(unsigned, flags
)
875 __field(unsigned, nrefs
)
876 __field(unsigned long long, res_bcount
)
877 __field(unsigned long long, bcount
)
878 __field(unsigned long long, icount
)
879 __field(unsigned long long, blk_hardlimit
)
880 __field(unsigned long long, blk_softlimit
)
881 __field(unsigned long long, ino_hardlimit
)
882 __field(unsigned long long, ino_softlimit
)
885 __entry
->dev
= dqp
->q_mount
->m_super
->s_dev
;
886 __entry
->id
= be32_to_cpu(dqp
->q_core
.d_id
);
887 __entry
->flags
= dqp
->dq_flags
;
888 __entry
->nrefs
= dqp
->q_nrefs
;
889 __entry
->res_bcount
= dqp
->q_res_bcount
;
890 __entry
->bcount
= be64_to_cpu(dqp
->q_core
.d_bcount
);
891 __entry
->icount
= be64_to_cpu(dqp
->q_core
.d_icount
);
892 __entry
->blk_hardlimit
=
893 be64_to_cpu(dqp
->q_core
.d_blk_hardlimit
);
894 __entry
->blk_softlimit
=
895 be64_to_cpu(dqp
->q_core
.d_blk_softlimit
);
896 __entry
->ino_hardlimit
=
897 be64_to_cpu(dqp
->q_core
.d_ino_hardlimit
);
898 __entry
->ino_softlimit
=
899 be64_to_cpu(dqp
->q_core
.d_ino_softlimit
);
901 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
902 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
903 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
904 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
906 __print_flags(__entry
->flags
, "|", XFS_DQ_FLAGS
),
910 __entry
->blk_hardlimit
,
911 __entry
->blk_softlimit
,
913 __entry
->ino_hardlimit
,
914 __entry
->ino_softlimit
)
917 #define DEFINE_DQUOT_EVENT(name) \
918 DEFINE_EVENT(xfs_dquot_class, name, \
919 TP_PROTO(struct xfs_dquot *dqp), \
921 DEFINE_DQUOT_EVENT(xfs_dqadjust
);
922 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want
);
923 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty
);
924 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy
);
925 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done
);
926 DEFINE_DQUOT_EVENT(xfs_dqattach_found
);
927 DEFINE_DQUOT_EVENT(xfs_dqattach_get
);
928 DEFINE_DQUOT_EVENT(xfs_dqalloc
);
929 DEFINE_DQUOT_EVENT(xfs_dqtobp_read
);
930 DEFINE_DQUOT_EVENT(xfs_dqread
);
931 DEFINE_DQUOT_EVENT(xfs_dqread_fail
);
932 DEFINE_DQUOT_EVENT(xfs_dqget_hit
);
933 DEFINE_DQUOT_EVENT(xfs_dqget_miss
);
934 DEFINE_DQUOT_EVENT(xfs_dqget_freeing
);
935 DEFINE_DQUOT_EVENT(xfs_dqget_dup
);
936 DEFINE_DQUOT_EVENT(xfs_dqput
);
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
);
1174 DECLARE_EVENT_CLASS(xfs_page_class
,
1175 TP_PROTO(struct inode
*inode
, struct page
*page
, unsigned long off
,
1177 TP_ARGS(inode
, page
, off
, len
),
1180 __field(xfs_ino_t
, ino
)
1181 __field(pgoff_t
, pgoff
)
1182 __field(loff_t
, size
)
1183 __field(unsigned long, offset
)
1184 __field(unsigned int, length
)
1185 __field(int, delalloc
)
1186 __field(int, unwritten
)
1189 int delalloc
= -1, unwritten
= -1;
1191 if (page_has_buffers(page
))
1192 xfs_count_page_state(page
, &delalloc
, &unwritten
);
1193 __entry
->dev
= inode
->i_sb
->s_dev
;
1194 __entry
->ino
= XFS_I(inode
)->i_ino
;
1195 __entry
->pgoff
= page_offset(page
);
1196 __entry
->size
= i_size_read(inode
);
1197 __entry
->offset
= off
;
1198 __entry
->length
= len
;
1199 __entry
->delalloc
= delalloc
;
1200 __entry
->unwritten
= unwritten
;
1202 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
1203 "length %x delalloc %d unwritten %d",
1204 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1214 #define DEFINE_PAGE_EVENT(name) \
1215 DEFINE_EVENT(xfs_page_class, name, \
1216 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1217 unsigned int len), \
1218 TP_ARGS(inode, page, off, len))
1219 DEFINE_PAGE_EVENT(xfs_writepage
);
1220 DEFINE_PAGE_EVENT(xfs_releasepage
);
1221 DEFINE_PAGE_EVENT(xfs_invalidatepage
);
1223 DECLARE_EVENT_CLASS(xfs_readpage_class
,
1224 TP_PROTO(struct inode
*inode
, int nr_pages
),
1225 TP_ARGS(inode
, nr_pages
),
1228 __field(xfs_ino_t
, ino
)
1229 __field(int, nr_pages
)
1232 __entry
->dev
= inode
->i_sb
->s_dev
;
1233 __entry
->ino
= inode
->i_ino
;
1234 __entry
->nr_pages
= nr_pages
;
1236 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1237 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1242 #define DEFINE_READPAGE_EVENT(name) \
1243 DEFINE_EVENT(xfs_readpage_class, name, \
1244 TP_PROTO(struct inode *inode, int nr_pages), \
1245 TP_ARGS(inode, nr_pages))
1246 DEFINE_READPAGE_EVENT(xfs_vm_readpage
);
1247 DEFINE_READPAGE_EVENT(xfs_vm_readpages
);
1249 DECLARE_EVENT_CLASS(xfs_imap_class
,
1250 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t offset
, ssize_t count
,
1251 int type
, struct xfs_bmbt_irec
*irec
),
1252 TP_ARGS(ip
, offset
, count
, type
, irec
),
1255 __field(xfs_ino_t
, ino
)
1256 __field(loff_t
, size
)
1257 __field(loff_t
, offset
)
1258 __field(size_t, count
)
1260 __field(xfs_fileoff_t
, startoff
)
1261 __field(xfs_fsblock_t
, startblock
)
1262 __field(xfs_filblks_t
, blockcount
)
1265 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1266 __entry
->ino
= ip
->i_ino
;
1267 __entry
->size
= ip
->i_d
.di_size
;
1268 __entry
->offset
= offset
;
1269 __entry
->count
= count
;
1270 __entry
->type
= type
;
1271 __entry
->startoff
= irec
? irec
->br_startoff
: 0;
1272 __entry
->startblock
= irec
? irec
->br_startblock
: 0;
1273 __entry
->blockcount
= irec
? irec
->br_blockcount
: 0;
1275 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1276 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
1277 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1282 __print_symbolic(__entry
->type
, XFS_IO_TYPES
),
1284 (int64_t)__entry
->startblock
,
1285 __entry
->blockcount
)
1288 #define DEFINE_IOMAP_EVENT(name) \
1289 DEFINE_EVENT(xfs_imap_class, name, \
1290 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1291 int type, struct xfs_bmbt_irec *irec), \
1292 TP_ARGS(ip, offset, count, type, irec))
1293 DEFINE_IOMAP_EVENT(xfs_map_blocks_found
);
1294 DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc
);
1295 DEFINE_IOMAP_EVENT(xfs_get_blocks_found
);
1296 DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc
);
1297 DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct
);
1298 DEFINE_IOMAP_EVENT(xfs_iomap_alloc
);
1299 DEFINE_IOMAP_EVENT(xfs_iomap_found
);
1301 DECLARE_EVENT_CLASS(xfs_simple_io_class
,
1302 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t offset
, ssize_t count
),
1303 TP_ARGS(ip
, offset
, count
),
1306 __field(xfs_ino_t
, ino
)
1307 __field(loff_t
, isize
)
1308 __field(loff_t
, disize
)
1309 __field(loff_t
, offset
)
1310 __field(size_t, count
)
1313 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1314 __entry
->ino
= ip
->i_ino
;
1315 __entry
->isize
= VFS_I(ip
)->i_size
;
1316 __entry
->disize
= ip
->i_d
.di_size
;
1317 __entry
->offset
= offset
;
1318 __entry
->count
= count
;
1320 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1321 "offset 0x%llx count %zd",
1322 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1330 #define DEFINE_SIMPLE_IO_EVENT(name) \
1331 DEFINE_EVENT(xfs_simple_io_class, name, \
1332 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1333 TP_ARGS(ip, offset, count))
1334 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc
);
1335 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert
);
1336 DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound
);
1337 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize
);
1338 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof
);
1339 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write
);
1340 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten
);
1341 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append
);
1343 DECLARE_EVENT_CLASS(xfs_itrunc_class
,
1344 TP_PROTO(struct xfs_inode
*ip
, xfs_fsize_t new_size
),
1345 TP_ARGS(ip
, new_size
),
1348 __field(xfs_ino_t
, ino
)
1349 __field(xfs_fsize_t
, size
)
1350 __field(xfs_fsize_t
, new_size
)
1353 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1354 __entry
->ino
= ip
->i_ino
;
1355 __entry
->size
= ip
->i_d
.di_size
;
1356 __entry
->new_size
= new_size
;
1358 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1359 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1365 #define DEFINE_ITRUNC_EVENT(name) \
1366 DEFINE_EVENT(xfs_itrunc_class, name, \
1367 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1368 TP_ARGS(ip, new_size))
1369 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start
);
1370 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end
);
1372 TRACE_EVENT(xfs_pagecache_inval
,
1373 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t start
, xfs_off_t finish
),
1374 TP_ARGS(ip
, start
, finish
),
1377 __field(xfs_ino_t
, ino
)
1378 __field(xfs_fsize_t
, size
)
1379 __field(xfs_off_t
, start
)
1380 __field(xfs_off_t
, finish
)
1383 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1384 __entry
->ino
= ip
->i_ino
;
1385 __entry
->size
= ip
->i_d
.di_size
;
1386 __entry
->start
= start
;
1387 __entry
->finish
= finish
;
1389 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1390 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1397 TRACE_EVENT(xfs_bunmap
,
1398 TP_PROTO(struct xfs_inode
*ip
, xfs_fileoff_t bno
, xfs_filblks_t len
,
1399 int flags
, unsigned long caller_ip
),
1400 TP_ARGS(ip
, bno
, len
, flags
, caller_ip
),
1403 __field(xfs_ino_t
, ino
)
1404 __field(xfs_fsize_t
, size
)
1405 __field(xfs_fileoff_t
, bno
)
1406 __field(xfs_filblks_t
, len
)
1407 __field(unsigned long, caller_ip
)
1411 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1412 __entry
->ino
= ip
->i_ino
;
1413 __entry
->size
= ip
->i_d
.di_size
;
1416 __entry
->caller_ip
= caller_ip
;
1417 __entry
->flags
= flags
;
1419 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1420 "flags %s caller %ps",
1421 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1426 __print_flags(__entry
->flags
, "|", XFS_BMAPI_FLAGS
),
1427 (void *)__entry
->caller_ip
)
1431 DECLARE_EVENT_CLASS(xfs_extent_busy_class
,
1432 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
1433 xfs_agblock_t agbno
, xfs_extlen_t len
),
1434 TP_ARGS(mp
, agno
, agbno
, len
),
1437 __field(xfs_agnumber_t
, agno
)
1438 __field(xfs_agblock_t
, agbno
)
1439 __field(xfs_extlen_t
, len
)
1442 __entry
->dev
= mp
->m_super
->s_dev
;
1443 __entry
->agno
= agno
;
1444 __entry
->agbno
= agbno
;
1447 TP_printk("dev %d:%d agno %u agbno %u len %u",
1448 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1453 #define DEFINE_BUSY_EVENT(name) \
1454 DEFINE_EVENT(xfs_extent_busy_class, name, \
1455 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1456 xfs_agblock_t agbno, xfs_extlen_t len), \
1457 TP_ARGS(mp, agno, agbno, len))
1458 DEFINE_BUSY_EVENT(xfs_extent_busy
);
1459 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem
);
1460 DEFINE_BUSY_EVENT(xfs_extent_busy_force
);
1461 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse
);
1462 DEFINE_BUSY_EVENT(xfs_extent_busy_clear
);
1464 TRACE_EVENT(xfs_extent_busy_trim
,
1465 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
1466 xfs_agblock_t agbno
, xfs_extlen_t len
,
1467 xfs_agblock_t tbno
, xfs_extlen_t tlen
),
1468 TP_ARGS(mp
, agno
, agbno
, len
, tbno
, tlen
),
1471 __field(xfs_agnumber_t
, agno
)
1472 __field(xfs_agblock_t
, agbno
)
1473 __field(xfs_extlen_t
, len
)
1474 __field(xfs_agblock_t
, tbno
)
1475 __field(xfs_extlen_t
, tlen
)
1478 __entry
->dev
= mp
->m_super
->s_dev
;
1479 __entry
->agno
= agno
;
1480 __entry
->agbno
= agbno
;
1482 __entry
->tbno
= tbno
;
1483 __entry
->tlen
= tlen
;
1485 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1486 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1494 TRACE_EVENT(xfs_agf
,
1495 TP_PROTO(struct xfs_mount
*mp
, struct xfs_agf
*agf
, int flags
,
1496 unsigned long caller_ip
),
1497 TP_ARGS(mp
, agf
, flags
, caller_ip
),
1500 __field(xfs_agnumber_t
, agno
)
1502 __field(__u32
, length
)
1503 __field(__u32
, bno_root
)
1504 __field(__u32
, cnt_root
)
1505 __field(__u32
, bno_level
)
1506 __field(__u32
, cnt_level
)
1507 __field(__u32
, flfirst
)
1508 __field(__u32
, fllast
)
1509 __field(__u32
, flcount
)
1510 __field(__u32
, freeblks
)
1511 __field(__u32
, longest
)
1512 __field(unsigned long, caller_ip
)
1515 __entry
->dev
= mp
->m_super
->s_dev
;
1516 __entry
->agno
= be32_to_cpu(agf
->agf_seqno
),
1517 __entry
->flags
= flags
;
1518 __entry
->length
= be32_to_cpu(agf
->agf_length
),
1519 __entry
->bno_root
= be32_to_cpu(agf
->agf_roots
[XFS_BTNUM_BNO
]),
1520 __entry
->cnt_root
= be32_to_cpu(agf
->agf_roots
[XFS_BTNUM_CNT
]),
1521 __entry
->bno_level
=
1522 be32_to_cpu(agf
->agf_levels
[XFS_BTNUM_BNO
]),
1523 __entry
->cnt_level
=
1524 be32_to_cpu(agf
->agf_levels
[XFS_BTNUM_CNT
]),
1525 __entry
->flfirst
= be32_to_cpu(agf
->agf_flfirst
),
1526 __entry
->fllast
= be32_to_cpu(agf
->agf_fllast
),
1527 __entry
->flcount
= be32_to_cpu(agf
->agf_flcount
),
1528 __entry
->freeblks
= be32_to_cpu(agf
->agf_freeblks
),
1529 __entry
->longest
= be32_to_cpu(agf
->agf_longest
);
1530 __entry
->caller_ip
= caller_ip
;
1532 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1533 "levels b %u c %u flfirst %u fllast %u flcount %u "
1534 "freeblks %u longest %u caller %ps",
1535 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1537 __print_flags(__entry
->flags
, "|", XFS_AGF_FLAGS
),
1548 (void *)__entry
->caller_ip
)
1551 TRACE_EVENT(xfs_free_extent
,
1552 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agblock_t agbno
,
1553 xfs_extlen_t len
, enum xfs_ag_resv_type resv
, int haveleft
,
1555 TP_ARGS(mp
, agno
, agbno
, len
, resv
, haveleft
, haveright
),
1558 __field(xfs_agnumber_t
, agno
)
1559 __field(xfs_agblock_t
, agbno
)
1560 __field(xfs_extlen_t
, len
)
1562 __field(int, haveleft
)
1563 __field(int, haveright
)
1566 __entry
->dev
= mp
->m_super
->s_dev
;
1567 __entry
->agno
= agno
;
1568 __entry
->agbno
= agbno
;
1570 __entry
->resv
= resv
;
1571 __entry
->haveleft
= haveleft
;
1572 __entry
->haveright
= haveright
;
1574 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
1575 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1581 (__entry
->haveright
? "both" : "left") :
1582 (__entry
->haveright
? "right" : "none"))
1586 DECLARE_EVENT_CLASS(xfs_alloc_class
,
1587 TP_PROTO(struct xfs_alloc_arg
*args
),
1591 __field(xfs_agnumber_t
, agno
)
1592 __field(xfs_agblock_t
, agbno
)
1593 __field(xfs_extlen_t
, minlen
)
1594 __field(xfs_extlen_t
, maxlen
)
1595 __field(xfs_extlen_t
, mod
)
1596 __field(xfs_extlen_t
, prod
)
1597 __field(xfs_extlen_t
, minleft
)
1598 __field(xfs_extlen_t
, total
)
1599 __field(xfs_extlen_t
, alignment
)
1600 __field(xfs_extlen_t
, minalignslop
)
1601 __field(xfs_extlen_t
, len
)
1602 __field(short, type
)
1603 __field(short, otype
)
1604 __field(char, wasdel
)
1605 __field(char, wasfromfl
)
1607 __field(int, datatype
)
1608 __field(xfs_fsblock_t
, firstblock
)
1611 __entry
->dev
= args
->mp
->m_super
->s_dev
;
1612 __entry
->agno
= args
->agno
;
1613 __entry
->agbno
= args
->agbno
;
1614 __entry
->minlen
= args
->minlen
;
1615 __entry
->maxlen
= args
->maxlen
;
1616 __entry
->mod
= args
->mod
;
1617 __entry
->prod
= args
->prod
;
1618 __entry
->minleft
= args
->minleft
;
1619 __entry
->total
= args
->total
;
1620 __entry
->alignment
= args
->alignment
;
1621 __entry
->minalignslop
= args
->minalignslop
;
1622 __entry
->len
= args
->len
;
1623 __entry
->type
= args
->type
;
1624 __entry
->otype
= args
->otype
;
1625 __entry
->wasdel
= args
->wasdel
;
1626 __entry
->wasfromfl
= args
->wasfromfl
;
1627 __entry
->resv
= args
->resv
;
1628 __entry
->datatype
= args
->datatype
;
1629 __entry
->firstblock
= args
->firstblock
;
1631 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1632 "prod %u minleft %u total %u alignment %u minalignslop %u "
1633 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1634 "datatype 0x%x firstblock 0x%llx",
1635 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1645 __entry
->minalignslop
,
1647 __print_symbolic(__entry
->type
, XFS_ALLOC_TYPES
),
1648 __print_symbolic(__entry
->otype
, XFS_ALLOC_TYPES
),
1653 (unsigned long long)__entry
->firstblock
)
1656 #define DEFINE_ALLOC_EVENT(name) \
1657 DEFINE_EVENT(xfs_alloc_class, name, \
1658 TP_PROTO(struct xfs_alloc_arg *args), \
1660 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done
);
1661 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound
);
1662 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error
);
1663 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft
);
1664 DEFINE_ALLOC_EVENT(xfs_alloc_near_first
);
1665 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater
);
1666 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser
);
1667 DEFINE_ALLOC_EVENT(xfs_alloc_near_error
);
1668 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry
);
1669 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy
);
1670 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither
);
1671 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry
);
1672 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft
);
1673 DEFINE_ALLOC_EVENT(xfs_alloc_size_done
);
1674 DEFINE_ALLOC_EVENT(xfs_alloc_size_error
);
1675 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy
);
1676 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist
);
1677 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough
);
1678 DEFINE_ALLOC_EVENT(xfs_alloc_small_done
);
1679 DEFINE_ALLOC_EVENT(xfs_alloc_small_error
);
1680 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs
);
1681 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix
);
1682 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp
);
1683 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed
);
1684 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed
);
1686 DECLARE_EVENT_CLASS(xfs_da_class
,
1687 TP_PROTO(struct xfs_da_args
*args
),
1691 __field(xfs_ino_t
, ino
)
1692 __dynamic_array(char, name
, args
->namelen
)
1693 __field(int, namelen
)
1694 __field(xfs_dahash_t
, hashval
)
1695 __field(xfs_ino_t
, inumber
)
1696 __field(int, op_flags
)
1699 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1700 __entry
->ino
= args
->dp
->i_ino
;
1702 memcpy(__get_str(name
), args
->name
, args
->namelen
);
1703 __entry
->namelen
= args
->namelen
;
1704 __entry
->hashval
= args
->hashval
;
1705 __entry
->inumber
= args
->inumber
;
1706 __entry
->op_flags
= args
->op_flags
;
1708 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1709 "inumber 0x%llx op_flags %s",
1710 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1713 __entry
->namelen
? __get_str(name
) : NULL
,
1717 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
))
1720 #define DEFINE_DIR2_EVENT(name) \
1721 DEFINE_EVENT(xfs_da_class, name, \
1722 TP_PROTO(struct xfs_da_args *args), \
1724 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname
);
1725 DEFINE_DIR2_EVENT(xfs_dir2_sf_create
);
1726 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup
);
1727 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace
);
1728 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename
);
1729 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4
);
1730 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8
);
1731 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block
);
1732 DEFINE_DIR2_EVENT(xfs_dir2_block_addname
);
1733 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup
);
1734 DEFINE_DIR2_EVENT(xfs_dir2_block_replace
);
1735 DEFINE_DIR2_EVENT(xfs_dir2_block_removename
);
1736 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf
);
1737 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf
);
1738 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname
);
1739 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup
);
1740 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace
);
1741 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename
);
1742 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block
);
1743 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node
);
1744 DEFINE_DIR2_EVENT(xfs_dir2_node_addname
);
1745 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup
);
1746 DEFINE_DIR2_EVENT(xfs_dir2_node_replace
);
1747 DEFINE_DIR2_EVENT(xfs_dir2_node_removename
);
1748 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf
);
1750 DECLARE_EVENT_CLASS(xfs_attr_class
,
1751 TP_PROTO(struct xfs_da_args
*args
),
1755 __field(xfs_ino_t
, ino
)
1756 __dynamic_array(char, name
, args
->namelen
)
1757 __field(int, namelen
)
1758 __field(int, valuelen
)
1759 __field(xfs_dahash_t
, hashval
)
1760 __field(int, op_flags
)
1763 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1764 __entry
->ino
= args
->dp
->i_ino
;
1766 memcpy(__get_str(name
), args
->name
, args
->namelen
);
1767 __entry
->namelen
= args
->namelen
;
1768 __entry
->valuelen
= args
->valuelen
;
1769 __entry
->hashval
= args
->hashval
;
1770 __entry
->op_flags
= args
->op_flags
;
1772 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1773 "hashval 0x%x op_flags %s",
1774 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1777 __entry
->namelen
? __get_str(name
) : NULL
,
1781 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
))
1784 #define DEFINE_ATTR_EVENT(name) \
1785 DEFINE_EVENT(xfs_attr_class, name, \
1786 TP_PROTO(struct xfs_da_args *args), \
1788 DEFINE_ATTR_EVENT(xfs_attr_sf_add
);
1789 DEFINE_ATTR_EVENT(xfs_attr_sf_addname
);
1790 DEFINE_ATTR_EVENT(xfs_attr_sf_create
);
1791 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup
);
1792 DEFINE_ATTR_EVENT(xfs_attr_sf_remove
);
1793 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf
);
1795 DEFINE_ATTR_EVENT(xfs_attr_leaf_add
);
1796 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old
);
1797 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new
);
1798 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work
);
1799 DEFINE_ATTR_EVENT(xfs_attr_leaf_addname
);
1800 DEFINE_ATTR_EVENT(xfs_attr_leaf_create
);
1801 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact
);
1802 DEFINE_ATTR_EVENT(xfs_attr_leaf_get
);
1803 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup
);
1804 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace
);
1805 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove
);
1806 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename
);
1807 DEFINE_ATTR_EVENT(xfs_attr_leaf_split
);
1808 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before
);
1809 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after
);
1810 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag
);
1811 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag
);
1812 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags
);
1813 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf
);
1814 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node
);
1815 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance
);
1816 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance
);
1817 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall
);
1819 DEFINE_ATTR_EVENT(xfs_attr_node_addname
);
1820 DEFINE_ATTR_EVENT(xfs_attr_node_get
);
1821 DEFINE_ATTR_EVENT(xfs_attr_node_replace
);
1822 DEFINE_ATTR_EVENT(xfs_attr_node_removename
);
1824 DEFINE_ATTR_EVENT(xfs_attr_fillstate
);
1825 DEFINE_ATTR_EVENT(xfs_attr_refillstate
);
1827 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get
);
1828 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set
);
1829 DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove
);
1831 #define DEFINE_DA_EVENT(name) \
1832 DEFINE_EVENT(xfs_da_class, name, \
1833 TP_PROTO(struct xfs_da_args *args), \
1835 DEFINE_DA_EVENT(xfs_da_split
);
1836 DEFINE_DA_EVENT(xfs_da_join
);
1837 DEFINE_DA_EVENT(xfs_da_link_before
);
1838 DEFINE_DA_EVENT(xfs_da_link_after
);
1839 DEFINE_DA_EVENT(xfs_da_unlink_back
);
1840 DEFINE_DA_EVENT(xfs_da_unlink_forward
);
1841 DEFINE_DA_EVENT(xfs_da_root_split
);
1842 DEFINE_DA_EVENT(xfs_da_root_join
);
1843 DEFINE_DA_EVENT(xfs_da_node_add
);
1844 DEFINE_DA_EVENT(xfs_da_node_create
);
1845 DEFINE_DA_EVENT(xfs_da_node_split
);
1846 DEFINE_DA_EVENT(xfs_da_node_remove
);
1847 DEFINE_DA_EVENT(xfs_da_node_rebalance
);
1848 DEFINE_DA_EVENT(xfs_da_node_unbalance
);
1849 DEFINE_DA_EVENT(xfs_da_node_toosmall
);
1850 DEFINE_DA_EVENT(xfs_da_swap_lastblock
);
1851 DEFINE_DA_EVENT(xfs_da_grow_inode
);
1852 DEFINE_DA_EVENT(xfs_da_shrink_inode
);
1853 DEFINE_DA_EVENT(xfs_da_fixhashpath
);
1854 DEFINE_DA_EVENT(xfs_da_path_shift
);
1856 DECLARE_EVENT_CLASS(xfs_dir2_space_class
,
1857 TP_PROTO(struct xfs_da_args
*args
, int idx
),
1861 __field(xfs_ino_t
, ino
)
1862 __field(int, op_flags
)
1866 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1867 __entry
->ino
= args
->dp
->i_ino
;
1868 __entry
->op_flags
= args
->op_flags
;
1871 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1872 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1874 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
),
1878 #define DEFINE_DIR2_SPACE_EVENT(name) \
1879 DEFINE_EVENT(xfs_dir2_space_class, name, \
1880 TP_PROTO(struct xfs_da_args *args, int idx), \
1882 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add
);
1883 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove
);
1884 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode
);
1885 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode
);
1887 TRACE_EVENT(xfs_dir2_leafn_moveents
,
1888 TP_PROTO(struct xfs_da_args
*args
, int src_idx
, int dst_idx
, int count
),
1889 TP_ARGS(args
, src_idx
, dst_idx
, count
),
1892 __field(xfs_ino_t
, ino
)
1893 __field(int, op_flags
)
1894 __field(int, src_idx
)
1895 __field(int, dst_idx
)
1899 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1900 __entry
->ino
= args
->dp
->i_ino
;
1901 __entry
->op_flags
= args
->op_flags
;
1902 __entry
->src_idx
= src_idx
;
1903 __entry
->dst_idx
= dst_idx
;
1904 __entry
->count
= count
;
1906 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1907 "src_idx %d dst_idx %d count %d",
1908 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1910 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
),
1916 #define XFS_SWAPEXT_INODES \
1920 #define XFS_INODE_FORMAT_STR \
1926 DECLARE_EVENT_CLASS(xfs_swap_extent_class
,
1927 TP_PROTO(struct xfs_inode
*ip
, int which
),
1932 __field(xfs_ino_t
, ino
)
1933 __field(int, format
)
1935 __field(int, broot_size
)
1936 __field(int, fork_off
)
1939 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1940 __entry
->which
= which
;
1941 __entry
->ino
= ip
->i_ino
;
1942 __entry
->format
= ip
->i_d
.di_format
;
1943 __entry
->nex
= ip
->i_d
.di_nextents
;
1944 __entry
->broot_size
= ip
->i_df
.if_broot_bytes
;
1945 __entry
->fork_off
= XFS_IFORK_BOFF(ip
);
1947 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1948 "broot size %d, fork offset %d",
1949 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1951 __print_symbolic(__entry
->which
, XFS_SWAPEXT_INODES
),
1952 __print_symbolic(__entry
->format
, XFS_INODE_FORMAT_STR
),
1954 __entry
->broot_size
,
1958 #define DEFINE_SWAPEXT_EVENT(name) \
1959 DEFINE_EVENT(xfs_swap_extent_class, name, \
1960 TP_PROTO(struct xfs_inode *ip, int which), \
1963 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before
);
1964 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after
);
1966 TRACE_EVENT(xfs_log_recover_record
,
1967 TP_PROTO(struct xlog
*log
, struct xlog_rec_header
*rhead
, int pass
),
1968 TP_ARGS(log
, rhead
, pass
),
1971 __field(xfs_lsn_t
, lsn
)
1973 __field(int, num_logops
)
1977 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
1978 __entry
->lsn
= be64_to_cpu(rhead
->h_lsn
);
1979 __entry
->len
= be32_to_cpu(rhead
->h_len
);
1980 __entry
->num_logops
= be32_to_cpu(rhead
->h_num_logops
);
1981 __entry
->pass
= pass
;
1983 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
1984 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1985 __entry
->lsn
, __entry
->len
, __entry
->num_logops
,
1989 DECLARE_EVENT_CLASS(xfs_log_recover_item_class
,
1990 TP_PROTO(struct xlog
*log
, struct xlog_recover
*trans
,
1991 struct xlog_recover_item
*item
, int pass
),
1992 TP_ARGS(log
, trans
, item
, pass
),
1995 __field(unsigned long, item
)
1996 __field(xlog_tid_t
, tid
)
1997 __field(xfs_lsn_t
, lsn
)
2004 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2005 __entry
->item
= (unsigned long)item
;
2006 __entry
->tid
= trans
->r_log_tid
;
2007 __entry
->lsn
= trans
->r_lsn
;
2008 __entry
->type
= ITEM_TYPE(item
);
2009 __entry
->pass
= pass
;
2010 __entry
->count
= item
->ri_cnt
;
2011 __entry
->total
= item
->ri_total
;
2013 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, "
2014 "item type %s item region count/total %d/%d",
2015 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2019 (void *)__entry
->item
,
2020 __print_symbolic(__entry
->type
, XFS_LI_TYPE_DESC
),
2025 #define DEFINE_LOG_RECOVER_ITEM(name) \
2026 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2027 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2028 struct xlog_recover_item *item, int pass), \
2029 TP_ARGS(log, trans, item, pass))
2031 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add
);
2032 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont
);
2033 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head
);
2034 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail
);
2035 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover
);
2037 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class
,
2038 TP_PROTO(struct xlog
*log
, struct xfs_buf_log_format
*buf_f
),
2039 TP_ARGS(log
, buf_f
),
2042 __field(int64_t, blkno
)
2043 __field(unsigned short, len
)
2044 __field(unsigned short, flags
)
2045 __field(unsigned short, size
)
2046 __field(unsigned int, map_size
)
2049 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2050 __entry
->blkno
= buf_f
->blf_blkno
;
2051 __entry
->len
= buf_f
->blf_len
;
2052 __entry
->flags
= buf_f
->blf_flags
;
2053 __entry
->size
= buf_f
->blf_size
;
2054 __entry
->map_size
= buf_f
->blf_map_size
;
2056 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2058 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2066 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2067 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2068 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2069 TP_ARGS(log, buf_f))
2071 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel
);
2072 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel
);
2073 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add
);
2074 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc
);
2075 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover
);
2076 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip
);
2077 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf
);
2078 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf
);
2079 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf
);
2081 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class
,
2082 TP_PROTO(struct xlog
*log
, struct xfs_inode_log_format
*in_f
),
2086 __field(xfs_ino_t
, ino
)
2087 __field(unsigned short, size
)
2088 __field(int, fields
)
2089 __field(unsigned short, asize
)
2090 __field(unsigned short, dsize
)
2091 __field(int64_t, blkno
)
2093 __field(int, boffset
)
2096 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2097 __entry
->ino
= in_f
->ilf_ino
;
2098 __entry
->size
= in_f
->ilf_size
;
2099 __entry
->fields
= in_f
->ilf_fields
;
2100 __entry
->asize
= in_f
->ilf_asize
;
2101 __entry
->dsize
= in_f
->ilf_dsize
;
2102 __entry
->blkno
= in_f
->ilf_blkno
;
2103 __entry
->len
= in_f
->ilf_len
;
2104 __entry
->boffset
= in_f
->ilf_boffset
;
2106 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2107 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2108 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2118 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2119 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2120 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2123 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover
);
2124 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel
);
2125 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip
);
2127 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class
,
2128 TP_PROTO(struct xlog
*log
, struct xfs_icreate_log
*in_f
),
2132 __field(xfs_agnumber_t
, agno
)
2133 __field(xfs_agblock_t
, agbno
)
2134 __field(unsigned int, count
)
2135 __field(unsigned int, isize
)
2136 __field(xfs_agblock_t
, length
)
2137 __field(unsigned int, gen
)
2140 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2141 __entry
->agno
= be32_to_cpu(in_f
->icl_ag
);
2142 __entry
->agbno
= be32_to_cpu(in_f
->icl_agbno
);
2143 __entry
->count
= be32_to_cpu(in_f
->icl_count
);
2144 __entry
->isize
= be32_to_cpu(in_f
->icl_isize
);
2145 __entry
->length
= be32_to_cpu(in_f
->icl_length
);
2146 __entry
->gen
= be32_to_cpu(in_f
->icl_gen
);
2148 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2149 "gen %u", MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2150 __entry
->agno
, __entry
->agbno
, __entry
->count
, __entry
->isize
,
2151 __entry
->length
, __entry
->gen
)
2153 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2154 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2155 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2158 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel
);
2159 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover
);
2161 DECLARE_EVENT_CLASS(xfs_discard_class
,
2162 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2163 xfs_agblock_t agbno
, xfs_extlen_t len
),
2164 TP_ARGS(mp
, agno
, agbno
, len
),
2167 __field(xfs_agnumber_t
, agno
)
2168 __field(xfs_agblock_t
, agbno
)
2169 __field(xfs_extlen_t
, len
)
2172 __entry
->dev
= mp
->m_super
->s_dev
;
2173 __entry
->agno
= agno
;
2174 __entry
->agbno
= agbno
;
2177 TP_printk("dev %d:%d agno %u agbno %u len %u",
2178 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2184 #define DEFINE_DISCARD_EVENT(name) \
2185 DEFINE_EVENT(xfs_discard_class, name, \
2186 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2187 xfs_agblock_t agbno, xfs_extlen_t len), \
2188 TP_ARGS(mp, agno, agbno, len))
2189 DEFINE_DISCARD_EVENT(xfs_discard_extent
);
2190 DEFINE_DISCARD_EVENT(xfs_discard_toosmall
);
2191 DEFINE_DISCARD_EVENT(xfs_discard_exclude
);
2192 DEFINE_DISCARD_EVENT(xfs_discard_busy
);
2194 /* btree cursor events */
2195 DECLARE_EVENT_CLASS(xfs_btree_cur_class
,
2196 TP_PROTO(struct xfs_btree_cur
*cur
, int level
, struct xfs_buf
*bp
),
2197 TP_ARGS(cur
, level
, bp
),
2200 __field(xfs_btnum_t
, btnum
)
2202 __field(int, nlevels
)
2204 __field(xfs_daddr_t
, daddr
)
2207 __entry
->dev
= cur
->bc_mp
->m_super
->s_dev
;
2208 __entry
->btnum
= cur
->bc_btnum
;
2209 __entry
->level
= level
;
2210 __entry
->nlevels
= cur
->bc_nlevels
;
2211 __entry
->ptr
= cur
->bc_ptrs
[level
];
2212 __entry
->daddr
= bp
? bp
->b_bn
: -1;
2214 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2215 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2220 (unsigned long long)__entry
->daddr
)
2223 #define DEFINE_BTREE_CUR_EVENT(name) \
2224 DEFINE_EVENT(xfs_btree_cur_class, name, \
2225 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2226 TP_ARGS(cur, level, bp))
2227 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys
);
2228 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range
);
2231 struct xfs_defer_pending
;
2232 struct xfs_defer_ops
;
2234 DECLARE_EVENT_CLASS(xfs_defer_class
,
2235 TP_PROTO(struct xfs_mount
*mp
, struct xfs_defer_ops
*dop
),
2239 __field(void *, dop
)
2240 __field(char, committed
)
2244 __entry
->dev
= mp
? mp
->m_super
->s_dev
: 0;
2246 __entry
->committed
= dop
->dop_committed
;
2247 __entry
->low
= dop
->dop_low
;
2249 TP_printk("dev %d:%d ops %p committed %d low %d",
2250 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2255 #define DEFINE_DEFER_EVENT(name) \
2256 DEFINE_EVENT(xfs_defer_class, name, \
2257 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2260 DECLARE_EVENT_CLASS(xfs_defer_error_class
,
2261 TP_PROTO(struct xfs_mount
*mp
, struct xfs_defer_ops
*dop
, int error
),
2262 TP_ARGS(mp
, dop
, error
),
2265 __field(void *, dop
)
2266 __field(char, committed
)
2271 __entry
->dev
= mp
? mp
->m_super
->s_dev
: 0;
2273 __entry
->committed
= dop
->dop_committed
;
2274 __entry
->low
= dop
->dop_low
;
2275 __entry
->error
= error
;
2277 TP_printk("dev %d:%d ops %p committed %d low %d err %d",
2278 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2284 #define DEFINE_DEFER_ERROR_EVENT(name) \
2285 DEFINE_EVENT(xfs_defer_error_class, name, \
2286 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2287 TP_ARGS(mp, dop, error))
2289 DECLARE_EVENT_CLASS(xfs_defer_pending_class
,
2290 TP_PROTO(struct xfs_mount
*mp
, struct xfs_defer_pending
*dfp
),
2295 __field(void *, intent
)
2296 __field(char, committed
)
2300 __entry
->dev
= mp
? mp
->m_super
->s_dev
: 0;
2301 __entry
->type
= dfp
->dfp_type
->type
;
2302 __entry
->intent
= dfp
->dfp_intent
;
2303 __entry
->committed
= dfp
->dfp_done
!= NULL
;
2304 __entry
->nr
= dfp
->dfp_count
;
2306 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
2307 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2313 #define DEFINE_DEFER_PENDING_EVENT(name) \
2314 DEFINE_EVENT(xfs_defer_pending_class, name, \
2315 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2318 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class
,
2319 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2320 int type
, xfs_agblock_t agbno
, xfs_extlen_t len
),
2321 TP_ARGS(mp
, agno
, type
, agbno
, len
),
2324 __field(xfs_agnumber_t
, agno
)
2326 __field(xfs_agblock_t
, agbno
)
2327 __field(xfs_extlen_t
, len
)
2330 __entry
->dev
= mp
->m_super
->s_dev
;
2331 __entry
->agno
= agno
;
2332 __entry
->type
= type
;
2333 __entry
->agbno
= agbno
;
2336 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2337 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2343 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2344 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2345 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2347 xfs_agblock_t bno, \
2348 xfs_extlen_t len), \
2349 TP_ARGS(mp, agno, type, bno, len))
2351 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class
,
2352 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2354 xfs_agblock_t agbno
,
2357 xfs_fileoff_t offset
,
2359 xfs_exntst_t state
),
2360 TP_ARGS(mp
, agno
, op
, agbno
, ino
, whichfork
, offset
, len
, state
),
2363 __field(xfs_agnumber_t
, agno
)
2364 __field(xfs_ino_t
, ino
)
2365 __field(xfs_agblock_t
, agbno
)
2366 __field(int, whichfork
)
2367 __field(xfs_fileoff_t
, l_loff
)
2368 __field(xfs_filblks_t
, l_len
)
2369 __field(xfs_exntst_t
, l_state
)
2373 __entry
->dev
= mp
->m_super
->s_dev
;
2374 __entry
->agno
= agno
;
2376 __entry
->agbno
= agbno
;
2377 __entry
->whichfork
= whichfork
;
2378 __entry
->l_loff
= offset
;
2379 __entry
->l_len
= len
;
2380 __entry
->l_state
= state
;
2383 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2384 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2389 __entry
->whichfork
== XFS_ATTR_FORK
? "attr" : "data",
2394 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2395 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2396 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2398 xfs_agblock_t agbno, \
2401 xfs_fileoff_t offset, \
2402 xfs_filblks_t len, \
2403 xfs_exntst_t state), \
2404 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2406 DEFINE_DEFER_EVENT(xfs_defer_init
);
2407 DEFINE_DEFER_EVENT(xfs_defer_cancel
);
2408 DEFINE_DEFER_EVENT(xfs_defer_trans_roll
);
2409 DEFINE_DEFER_EVENT(xfs_defer_trans_abort
);
2410 DEFINE_DEFER_EVENT(xfs_defer_finish
);
2411 DEFINE_DEFER_EVENT(xfs_defer_finish_done
);
2413 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error
);
2414 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error
);
2416 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work
);
2417 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel
);
2418 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel
);
2419 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish
);
2420 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort
);
2422 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2423 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer
);
2424 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred
);
2426 /* rmap tracepoints */
2427 DECLARE_EVENT_CLASS(xfs_rmap_class
,
2428 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2429 xfs_agblock_t agbno
, xfs_extlen_t len
, bool unwritten
,
2430 struct xfs_owner_info
*oinfo
),
2431 TP_ARGS(mp
, agno
, agbno
, len
, unwritten
, oinfo
),
2434 __field(xfs_agnumber_t
, agno
)
2435 __field(xfs_agblock_t
, agbno
)
2436 __field(xfs_extlen_t
, len
)
2437 __field(uint64_t, owner
)
2438 __field(uint64_t, offset
)
2439 __field(unsigned long, flags
)
2442 __entry
->dev
= mp
->m_super
->s_dev
;
2443 __entry
->agno
= agno
;
2444 __entry
->agbno
= agbno
;
2446 __entry
->owner
= oinfo
->oi_owner
;
2447 __entry
->offset
= oinfo
->oi_offset
;
2448 __entry
->flags
= oinfo
->oi_flags
;
2450 __entry
->flags
|= XFS_RMAP_UNWRITTEN
;
2452 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2453 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2461 #define DEFINE_RMAP_EVENT(name) \
2462 DEFINE_EVENT(xfs_rmap_class, name, \
2463 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2464 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2465 struct xfs_owner_info *oinfo), \
2466 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2468 /* simple AG-based error/%ip tracepoint class */
2469 DECLARE_EVENT_CLASS(xfs_ag_error_class
,
2470 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, int error
,
2471 unsigned long caller_ip
),
2472 TP_ARGS(mp
, agno
, error
, caller_ip
),
2475 __field(xfs_agnumber_t
, agno
)
2477 __field(unsigned long, caller_ip
)
2480 __entry
->dev
= mp
->m_super
->s_dev
;
2481 __entry
->agno
= agno
;
2482 __entry
->error
= error
;
2483 __entry
->caller_ip
= caller_ip
;
2485 TP_printk("dev %d:%d agno %u error %d caller %ps",
2486 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2489 (char *)__entry
->caller_ip
)
2492 #define DEFINE_AG_ERROR_EVENT(name) \
2493 DEFINE_EVENT(xfs_ag_error_class, name, \
2494 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2495 unsigned long caller_ip), \
2496 TP_ARGS(mp, agno, error, caller_ip))
2498 DEFINE_RMAP_EVENT(xfs_rmap_unmap
);
2499 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done
);
2500 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error
);
2501 DEFINE_RMAP_EVENT(xfs_rmap_map
);
2502 DEFINE_RMAP_EVENT(xfs_rmap_map_done
);
2503 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error
);
2504 DEFINE_RMAP_EVENT(xfs_rmap_convert
);
2505 DEFINE_RMAP_EVENT(xfs_rmap_convert_done
);
2506 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error
);
2507 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state
);
2509 DECLARE_EVENT_CLASS(xfs_rmapbt_class
,
2510 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2511 xfs_agblock_t agbno
, xfs_extlen_t len
,
2512 uint64_t owner
, uint64_t offset
, unsigned int flags
),
2513 TP_ARGS(mp
, agno
, agbno
, len
, owner
, offset
, flags
),
2516 __field(xfs_agnumber_t
, agno
)
2517 __field(xfs_agblock_t
, agbno
)
2518 __field(xfs_extlen_t
, len
)
2519 __field(uint64_t, owner
)
2520 __field(uint64_t, offset
)
2521 __field(unsigned int, flags
)
2524 __entry
->dev
= mp
->m_super
->s_dev
;
2525 __entry
->agno
= agno
;
2526 __entry
->agbno
= agbno
;
2528 __entry
->owner
= owner
;
2529 __entry
->offset
= offset
;
2530 __entry
->flags
= flags
;
2532 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2533 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2541 #define DEFINE_RMAPBT_EVENT(name) \
2542 DEFINE_EVENT(xfs_rmapbt_class, name, \
2543 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2544 xfs_agblock_t agbno, xfs_extlen_t len, \
2545 uint64_t owner, uint64_t offset, unsigned int flags), \
2546 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2548 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2549 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer
);
2550 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred
);
2552 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block
);
2553 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block
);
2554 DEFINE_RMAPBT_EVENT(xfs_rmap_update
);
2555 DEFINE_RMAPBT_EVENT(xfs_rmap_insert
);
2556 DEFINE_RMAPBT_EVENT(xfs_rmap_delete
);
2557 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error
);
2558 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error
);
2559 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error
);
2561 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate
);
2562 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query
);
2563 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate
);
2564 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range
);
2565 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result
);
2566 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result
);
2567 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result
);
2569 /* deferred bmbt updates */
2570 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2571 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer
);
2572 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred
);
2574 /* per-AG reservation */
2575 DECLARE_EVENT_CLASS(xfs_ag_resv_class
,
2576 TP_PROTO(struct xfs_perag
*pag
, enum xfs_ag_resv_type resv
,
2578 TP_ARGS(pag
, resv
, len
),
2581 __field(xfs_agnumber_t
, agno
)
2583 __field(xfs_extlen_t
, freeblks
)
2584 __field(xfs_extlen_t
, flcount
)
2585 __field(xfs_extlen_t
, reserved
)
2586 __field(xfs_extlen_t
, asked
)
2587 __field(xfs_extlen_t
, len
)
2590 struct xfs_ag_resv
*r
= xfs_perag_resv(pag
, resv
);
2592 __entry
->dev
= pag
->pag_mount
->m_super
->s_dev
;
2593 __entry
->agno
= pag
->pag_agno
;
2594 __entry
->resv
= resv
;
2595 __entry
->freeblks
= pag
->pagf_freeblks
;
2596 __entry
->flcount
= pag
->pagf_flcount
;
2597 __entry
->reserved
= r
? r
->ar_reserved
: 0;
2598 __entry
->asked
= r
? r
->ar_asked
: 0;
2601 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u "
2602 "resv %u ask %u len %u",
2603 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2612 #define DEFINE_AG_RESV_EVENT(name) \
2613 DEFINE_EVENT(xfs_ag_resv_class, name, \
2614 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2615 xfs_extlen_t len), \
2616 TP_ARGS(pag, type, len))
2618 /* per-AG reservation tracepoints */
2619 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init
);
2620 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free
);
2621 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent
);
2622 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent
);
2623 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical
);
2624 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed
);
2626 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error
);
2627 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error
);
2629 /* refcount tracepoint classes */
2631 /* reuse the discard trace class for agbno/aglen-based traces */
2632 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2634 /* ag btree lookup tracepoint class */
2635 #define XFS_AG_BTREE_CMP_FORMAT_STR \
2636 { XFS_LOOKUP_EQ, "eq" }, \
2637 { XFS_LOOKUP_LE, "le" }, \
2638 { XFS_LOOKUP_GE, "ge" }
2639 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class
,
2640 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2641 xfs_agblock_t agbno
, xfs_lookup_t dir
),
2642 TP_ARGS(mp
, agno
, agbno
, dir
),
2645 __field(xfs_agnumber_t
, agno
)
2646 __field(xfs_agblock_t
, agbno
)
2647 __field(xfs_lookup_t
, dir
)
2650 __entry
->dev
= mp
->m_super
->s_dev
;
2651 __entry
->agno
= agno
;
2652 __entry
->agbno
= agbno
;
2655 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)",
2656 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2659 __print_symbolic(__entry
->dir
, XFS_AG_BTREE_CMP_FORMAT_STR
),
2663 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2664 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2665 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2666 xfs_agblock_t agbno, xfs_lookup_t dir), \
2667 TP_ARGS(mp, agno, agbno, dir))
2669 /* single-rcext tracepoint class */
2670 DECLARE_EVENT_CLASS(xfs_refcount_extent_class
,
2671 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2672 struct xfs_refcount_irec
*irec
),
2673 TP_ARGS(mp
, agno
, irec
),
2676 __field(xfs_agnumber_t
, agno
)
2677 __field(xfs_agblock_t
, startblock
)
2678 __field(xfs_extlen_t
, blockcount
)
2679 __field(xfs_nlink_t
, refcount
)
2682 __entry
->dev
= mp
->m_super
->s_dev
;
2683 __entry
->agno
= agno
;
2684 __entry
->startblock
= irec
->rc_startblock
;
2685 __entry
->blockcount
= irec
->rc_blockcount
;
2686 __entry
->refcount
= irec
->rc_refcount
;
2688 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u",
2689 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2691 __entry
->startblock
,
2692 __entry
->blockcount
,
2696 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2697 DEFINE_EVENT(xfs_refcount_extent_class, name, \
2698 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2699 struct xfs_refcount_irec *irec), \
2700 TP_ARGS(mp, agno, irec))
2702 /* single-rcext and an agbno tracepoint class */
2703 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class
,
2704 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2705 struct xfs_refcount_irec
*irec
, xfs_agblock_t agbno
),
2706 TP_ARGS(mp
, agno
, irec
, agbno
),
2709 __field(xfs_agnumber_t
, agno
)
2710 __field(xfs_agblock_t
, startblock
)
2711 __field(xfs_extlen_t
, blockcount
)
2712 __field(xfs_nlink_t
, refcount
)
2713 __field(xfs_agblock_t
, agbno
)
2716 __entry
->dev
= mp
->m_super
->s_dev
;
2717 __entry
->agno
= agno
;
2718 __entry
->startblock
= irec
->rc_startblock
;
2719 __entry
->blockcount
= irec
->rc_blockcount
;
2720 __entry
->refcount
= irec
->rc_refcount
;
2721 __entry
->agbno
= agbno
;
2723 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u",
2724 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2726 __entry
->startblock
,
2727 __entry
->blockcount
,
2732 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2733 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2734 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2735 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2736 TP_ARGS(mp, agno, irec, agbno))
2738 /* double-rcext tracepoint class */
2739 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class
,
2740 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2741 struct xfs_refcount_irec
*i1
, struct xfs_refcount_irec
*i2
),
2742 TP_ARGS(mp
, agno
, i1
, i2
),
2745 __field(xfs_agnumber_t
, agno
)
2746 __field(xfs_agblock_t
, i1_startblock
)
2747 __field(xfs_extlen_t
, i1_blockcount
)
2748 __field(xfs_nlink_t
, i1_refcount
)
2749 __field(xfs_agblock_t
, i2_startblock
)
2750 __field(xfs_extlen_t
, i2_blockcount
)
2751 __field(xfs_nlink_t
, i2_refcount
)
2754 __entry
->dev
= mp
->m_super
->s_dev
;
2755 __entry
->agno
= agno
;
2756 __entry
->i1_startblock
= i1
->rc_startblock
;
2757 __entry
->i1_blockcount
= i1
->rc_blockcount
;
2758 __entry
->i1_refcount
= i1
->rc_refcount
;
2759 __entry
->i2_startblock
= i2
->rc_startblock
;
2760 __entry
->i2_blockcount
= i2
->rc_blockcount
;
2761 __entry
->i2_refcount
= i2
->rc_refcount
;
2763 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2764 "agbno %u len %u refcount %u",
2765 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2767 __entry
->i1_startblock
,
2768 __entry
->i1_blockcount
,
2769 __entry
->i1_refcount
,
2770 __entry
->i2_startblock
,
2771 __entry
->i2_blockcount
,
2772 __entry
->i2_refcount
)
2775 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2776 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2777 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2778 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2779 TP_ARGS(mp, agno, i1, i2))
2781 /* double-rcext and an agbno tracepoint class */
2782 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class
,
2783 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2784 struct xfs_refcount_irec
*i1
, struct xfs_refcount_irec
*i2
,
2785 xfs_agblock_t agbno
),
2786 TP_ARGS(mp
, agno
, i1
, i2
, agbno
),
2789 __field(xfs_agnumber_t
, agno
)
2790 __field(xfs_agblock_t
, i1_startblock
)
2791 __field(xfs_extlen_t
, i1_blockcount
)
2792 __field(xfs_nlink_t
, i1_refcount
)
2793 __field(xfs_agblock_t
, i2_startblock
)
2794 __field(xfs_extlen_t
, i2_blockcount
)
2795 __field(xfs_nlink_t
, i2_refcount
)
2796 __field(xfs_agblock_t
, agbno
)
2799 __entry
->dev
= mp
->m_super
->s_dev
;
2800 __entry
->agno
= agno
;
2801 __entry
->i1_startblock
= i1
->rc_startblock
;
2802 __entry
->i1_blockcount
= i1
->rc_blockcount
;
2803 __entry
->i1_refcount
= i1
->rc_refcount
;
2804 __entry
->i2_startblock
= i2
->rc_startblock
;
2805 __entry
->i2_blockcount
= i2
->rc_blockcount
;
2806 __entry
->i2_refcount
= i2
->rc_refcount
;
2807 __entry
->agbno
= agbno
;
2809 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2810 "agbno %u len %u refcount %u @ agbno %u",
2811 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2813 __entry
->i1_startblock
,
2814 __entry
->i1_blockcount
,
2815 __entry
->i1_refcount
,
2816 __entry
->i2_startblock
,
2817 __entry
->i2_blockcount
,
2818 __entry
->i2_refcount
,
2822 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2823 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2824 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2825 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2826 xfs_agblock_t agbno), \
2827 TP_ARGS(mp, agno, i1, i2, agbno))
2829 /* triple-rcext tracepoint class */
2830 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class
,
2831 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2832 struct xfs_refcount_irec
*i1
, struct xfs_refcount_irec
*i2
,
2833 struct xfs_refcount_irec
*i3
),
2834 TP_ARGS(mp
, agno
, i1
, i2
, i3
),
2837 __field(xfs_agnumber_t
, agno
)
2838 __field(xfs_agblock_t
, i1_startblock
)
2839 __field(xfs_extlen_t
, i1_blockcount
)
2840 __field(xfs_nlink_t
, i1_refcount
)
2841 __field(xfs_agblock_t
, i2_startblock
)
2842 __field(xfs_extlen_t
, i2_blockcount
)
2843 __field(xfs_nlink_t
, i2_refcount
)
2844 __field(xfs_agblock_t
, i3_startblock
)
2845 __field(xfs_extlen_t
, i3_blockcount
)
2846 __field(xfs_nlink_t
, i3_refcount
)
2849 __entry
->dev
= mp
->m_super
->s_dev
;
2850 __entry
->agno
= agno
;
2851 __entry
->i1_startblock
= i1
->rc_startblock
;
2852 __entry
->i1_blockcount
= i1
->rc_blockcount
;
2853 __entry
->i1_refcount
= i1
->rc_refcount
;
2854 __entry
->i2_startblock
= i2
->rc_startblock
;
2855 __entry
->i2_blockcount
= i2
->rc_blockcount
;
2856 __entry
->i2_refcount
= i2
->rc_refcount
;
2857 __entry
->i3_startblock
= i3
->rc_startblock
;
2858 __entry
->i3_blockcount
= i3
->rc_blockcount
;
2859 __entry
->i3_refcount
= i3
->rc_refcount
;
2861 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2862 "agbno %u len %u refcount %u -- "
2863 "agbno %u len %u refcount %u",
2864 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2866 __entry
->i1_startblock
,
2867 __entry
->i1_blockcount
,
2868 __entry
->i1_refcount
,
2869 __entry
->i2_startblock
,
2870 __entry
->i2_blockcount
,
2871 __entry
->i2_refcount
,
2872 __entry
->i3_startblock
,
2873 __entry
->i3_blockcount
,
2874 __entry
->i3_refcount
)
2877 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2878 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
2879 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2880 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2881 struct xfs_refcount_irec *i3), \
2882 TP_ARGS(mp, agno, i1, i2, i3))
2884 /* refcount btree tracepoints */
2885 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block
);
2886 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block
);
2887 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup
);
2888 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get
);
2889 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update
);
2890 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert
);
2891 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete
);
2892 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error
);
2893 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error
);
2894 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error
);
2896 /* refcount adjustment tracepoints */
2897 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase
);
2898 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease
);
2899 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase
);
2900 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease
);
2901 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents
);
2902 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent
);
2903 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent
);
2904 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent
);
2905 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent
);
2906 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent
);
2907 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent
);
2908 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent
);
2909 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error
);
2910 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error
);
2911 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error
);
2912 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error
);
2913 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error
);
2914 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error
);
2915 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error
);
2916 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error
);
2917 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error
);
2919 /* reflink helpers */
2920 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared
);
2921 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result
);
2922 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error
);
2923 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2924 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer
);
2925 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred
);
2927 TRACE_EVENT(xfs_refcount_finish_one_leftover
,
2928 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2929 int type
, xfs_agblock_t agbno
, xfs_extlen_t len
,
2930 xfs_agblock_t new_agbno
, xfs_extlen_t new_len
),
2931 TP_ARGS(mp
, agno
, type
, agbno
, len
, new_agbno
, new_len
),
2934 __field(xfs_agnumber_t
, agno
)
2936 __field(xfs_agblock_t
, agbno
)
2937 __field(xfs_extlen_t
, len
)
2938 __field(xfs_agblock_t
, new_agbno
)
2939 __field(xfs_extlen_t
, new_len
)
2942 __entry
->dev
= mp
->m_super
->s_dev
;
2943 __entry
->agno
= agno
;
2944 __entry
->type
= type
;
2945 __entry
->agbno
= agbno
;
2947 __entry
->new_agbno
= new_agbno
;
2948 __entry
->new_len
= new_len
;
2950 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
2951 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2960 /* simple inode-based error/%ip tracepoint class */
2961 DECLARE_EVENT_CLASS(xfs_inode_error_class
,
2962 TP_PROTO(struct xfs_inode
*ip
, int error
, unsigned long caller_ip
),
2963 TP_ARGS(ip
, error
, caller_ip
),
2966 __field(xfs_ino_t
, ino
)
2968 __field(unsigned long, caller_ip
)
2971 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
2972 __entry
->ino
= ip
->i_ino
;
2973 __entry
->error
= error
;
2974 __entry
->caller_ip
= caller_ip
;
2976 TP_printk("dev %d:%d ino %llx error %d caller %ps",
2977 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2980 (char *)__entry
->caller_ip
)
2983 #define DEFINE_INODE_ERROR_EVENT(name) \
2984 DEFINE_EVENT(xfs_inode_error_class, name, \
2985 TP_PROTO(struct xfs_inode *ip, int error, \
2986 unsigned long caller_ip), \
2987 TP_ARGS(ip, error, caller_ip))
2989 /* reflink tracepoint classes */
2991 /* two-file io tracepoint class */
2992 DECLARE_EVENT_CLASS(xfs_double_io_class
,
2993 TP_PROTO(struct xfs_inode
*src
, xfs_off_t soffset
, xfs_off_t len
,
2994 struct xfs_inode
*dest
, xfs_off_t doffset
),
2995 TP_ARGS(src
, soffset
, len
, dest
, doffset
),
2998 __field(xfs_ino_t
, src_ino
)
2999 __field(loff_t
, src_isize
)
3000 __field(loff_t
, src_disize
)
3001 __field(loff_t
, src_offset
)
3002 __field(size_t, len
)
3003 __field(xfs_ino_t
, dest_ino
)
3004 __field(loff_t
, dest_isize
)
3005 __field(loff_t
, dest_disize
)
3006 __field(loff_t
, dest_offset
)
3009 __entry
->dev
= VFS_I(src
)->i_sb
->s_dev
;
3010 __entry
->src_ino
= src
->i_ino
;
3011 __entry
->src_isize
= VFS_I(src
)->i_size
;
3012 __entry
->src_disize
= src
->i_d
.di_size
;
3013 __entry
->src_offset
= soffset
;
3015 __entry
->dest_ino
= dest
->i_ino
;
3016 __entry
->dest_isize
= VFS_I(dest
)->i_size
;
3017 __entry
->dest_disize
= dest
->i_d
.di_size
;
3018 __entry
->dest_offset
= doffset
;
3020 TP_printk("dev %d:%d count %zd "
3021 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
3022 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
3023 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3027 __entry
->src_disize
,
3028 __entry
->src_offset
,
3030 __entry
->dest_isize
,
3031 __entry
->dest_disize
,
3032 __entry
->dest_offset
)
3035 #define DEFINE_DOUBLE_IO_EVENT(name) \
3036 DEFINE_EVENT(xfs_double_io_class, name, \
3037 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3038 struct xfs_inode *dest, xfs_off_t doffset), \
3039 TP_ARGS(src, soffset, len, dest, doffset))
3041 /* inode/irec events */
3042 DECLARE_EVENT_CLASS(xfs_inode_irec_class
,
3043 TP_PROTO(struct xfs_inode
*ip
, struct xfs_bmbt_irec
*irec
),
3047 __field(xfs_ino_t
, ino
)
3048 __field(xfs_fileoff_t
, lblk
)
3049 __field(xfs_extlen_t
, len
)
3050 __field(xfs_fsblock_t
, pblk
)
3054 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
3055 __entry
->ino
= ip
->i_ino
;
3056 __entry
->lblk
= irec
->br_startoff
;
3057 __entry
->len
= irec
->br_blockcount
;
3058 __entry
->pblk
= irec
->br_startblock
;
3059 __entry
->state
= irec
->br_state
;
3061 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d",
3062 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3069 #define DEFINE_INODE_IREC_EVENT(name) \
3070 DEFINE_EVENT(xfs_inode_irec_class, name, \
3071 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3074 /* refcount/reflink tracepoint definitions */
3076 /* reflink tracepoints */
3077 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag
);
3078 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag
);
3079 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size
);
3080 DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap
);
3081 TRACE_EVENT(xfs_reflink_remap_blocks_loop
,
3082 TP_PROTO(struct xfs_inode
*src
, xfs_fileoff_t soffset
,
3083 xfs_filblks_t len
, struct xfs_inode
*dest
,
3084 xfs_fileoff_t doffset
),
3085 TP_ARGS(src
, soffset
, len
, dest
, doffset
),
3088 __field(xfs_ino_t
, src_ino
)
3089 __field(xfs_fileoff_t
, src_lblk
)
3090 __field(xfs_filblks_t
, len
)
3091 __field(xfs_ino_t
, dest_ino
)
3092 __field(xfs_fileoff_t
, dest_lblk
)
3095 __entry
->dev
= VFS_I(src
)->i_sb
->s_dev
;
3096 __entry
->src_ino
= src
->i_ino
;
3097 __entry
->src_lblk
= soffset
;
3099 __entry
->dest_ino
= dest
->i_ino
;
3100 __entry
->dest_lblk
= doffset
;
3102 TP_printk("dev %d:%d len 0x%llx "
3103 "ino 0x%llx offset 0x%llx blocks -> "
3104 "ino 0x%llx offset 0x%llx blocks",
3105 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3112 TRACE_EVENT(xfs_reflink_punch_range
,
3113 TP_PROTO(struct xfs_inode
*ip
, xfs_fileoff_t lblk
,
3115 TP_ARGS(ip
, lblk
, len
),
3118 __field(xfs_ino_t
, ino
)
3119 __field(xfs_fileoff_t
, lblk
)
3120 __field(xfs_extlen_t
, len
)
3123 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
3124 __entry
->ino
= ip
->i_ino
;
3125 __entry
->lblk
= lblk
;
3128 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x",
3129 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3134 TRACE_EVENT(xfs_reflink_remap
,
3135 TP_PROTO(struct xfs_inode
*ip
, xfs_fileoff_t lblk
,
3136 xfs_extlen_t len
, xfs_fsblock_t new_pblk
),
3137 TP_ARGS(ip
, lblk
, len
, new_pblk
),
3140 __field(xfs_ino_t
, ino
)
3141 __field(xfs_fileoff_t
, lblk
)
3142 __field(xfs_extlen_t
, len
)
3143 __field(xfs_fsblock_t
, new_pblk
)
3146 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
3147 __entry
->ino
= ip
->i_ino
;
3148 __entry
->lblk
= lblk
;
3150 __entry
->new_pblk
= new_pblk
;
3152 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu",
3153 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3159 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range
);
3160 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error
);
3161 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error
);
3162 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error
);
3163 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error
);
3164 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error
);
3166 /* dedupe tracepoints */
3167 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents
);
3168 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error
);
3170 /* ioctl tracepoints */
3171 TRACE_EVENT(xfs_ioctl_clone
,
3172 TP_PROTO(struct inode
*src
, struct inode
*dest
),
3176 __field(unsigned long, src_ino
)
3177 __field(loff_t
, src_isize
)
3178 __field(unsigned long, dest_ino
)
3179 __field(loff_t
, dest_isize
)
3182 __entry
->dev
= src
->i_sb
->s_dev
;
3183 __entry
->src_ino
= src
->i_ino
;
3184 __entry
->src_isize
= i_size_read(src
);
3185 __entry
->dest_ino
= dest
->i_ino
;
3186 __entry
->dest_isize
= i_size_read(dest
);
3188 TP_printk("dev %d:%d "
3189 "ino 0x%lx isize 0x%llx -> "
3190 "ino 0x%lx isize 0x%llx",
3191 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3195 __entry
->dest_isize
)
3198 /* unshare tracepoints */
3199 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare
);
3200 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error
);
3203 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared
);
3204 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc
);
3205 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found
);
3206 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc
);
3207 DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow
);
3209 DEFINE_RW_EVENT(xfs_reflink_reserve_cow
);
3211 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write
);
3212 DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping
);
3213 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec
);
3215 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range
);
3216 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow
);
3217 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap
);
3219 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error
);
3220 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error
);
3223 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow
);
3225 /* rmap swapext tracepoints */
3226 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap
);
3227 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece
);
3228 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error
);
3231 DECLARE_EVENT_CLASS(xfs_fsmap_class
,
3232 TP_PROTO(struct xfs_mount
*mp
, u32 keydev
, xfs_agnumber_t agno
,
3233 struct xfs_rmap_irec
*rmap
),
3234 TP_ARGS(mp
, keydev
, agno
, rmap
),
3237 __field(dev_t
, keydev
)
3238 __field(xfs_agnumber_t
, agno
)
3239 __field(xfs_fsblock_t
, bno
)
3240 __field(xfs_filblks_t
, len
)
3241 __field(uint64_t, owner
)
3242 __field(uint64_t, offset
)
3243 __field(unsigned int, flags
)
3246 __entry
->dev
= mp
->m_super
->s_dev
;
3247 __entry
->keydev
= new_decode_dev(keydev
);
3248 __entry
->agno
= agno
;
3249 __entry
->bno
= rmap
->rm_startblock
;
3250 __entry
->len
= rmap
->rm_blockcount
;
3251 __entry
->owner
= rmap
->rm_owner
;
3252 __entry
->offset
= rmap
->rm_offset
;
3253 __entry
->flags
= rmap
->rm_flags
;
3255 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld offset %llu flags 0x%x",
3256 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3257 MAJOR(__entry
->keydev
), MINOR(__entry
->keydev
),
3265 #define DEFINE_FSMAP_EVENT(name) \
3266 DEFINE_EVENT(xfs_fsmap_class, name, \
3267 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3268 struct xfs_rmap_irec *rmap), \
3269 TP_ARGS(mp, keydev, agno, rmap))
3270 DEFINE_FSMAP_EVENT(xfs_fsmap_low_key
);
3271 DEFINE_FSMAP_EVENT(xfs_fsmap_high_key
);
3272 DEFINE_FSMAP_EVENT(xfs_fsmap_mapping
);
3274 DECLARE_EVENT_CLASS(xfs_getfsmap_class
,
3275 TP_PROTO(struct xfs_mount
*mp
, struct xfs_fsmap
*fsmap
),
3279 __field(dev_t
, keydev
)
3280 __field(xfs_daddr_t
, block
)
3281 __field(xfs_daddr_t
, len
)
3282 __field(uint64_t, owner
)
3283 __field(uint64_t, offset
)
3284 __field(uint64_t, flags
)
3287 __entry
->dev
= mp
->m_super
->s_dev
;
3288 __entry
->keydev
= new_decode_dev(fsmap
->fmr_device
);
3289 __entry
->block
= fsmap
->fmr_physical
;
3290 __entry
->len
= fsmap
->fmr_length
;
3291 __entry
->owner
= fsmap
->fmr_owner
;
3292 __entry
->offset
= fsmap
->fmr_offset
;
3293 __entry
->flags
= fsmap
->fmr_flags
;
3295 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld offset %llu flags 0x%llx",
3296 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3297 MAJOR(__entry
->keydev
), MINOR(__entry
->keydev
),
3304 #define DEFINE_GETFSMAP_EVENT(name) \
3305 DEFINE_EVENT(xfs_getfsmap_class, name, \
3306 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3308 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key
);
3309 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key
);
3310 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping
);
3312 #endif /* _TRACE_XFS_H */
3314 #undef TRACE_INCLUDE_PATH
3315 #define TRACE_INCLUDE_PATH .
3316 #define TRACE_INCLUDE_FILE xfs_trace
3317 #include <trace/define_trace.h>