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
;
44 DECLARE_EVENT_CLASS(xfs_attr_list_class
,
45 TP_PROTO(struct xfs_attr_list_context
*ctx
),
49 __field(xfs_ino_t
, ino
)
53 __field(void *, alist
)
61 __entry
->dev
= VFS_I(ctx
->dp
)->i_sb
->s_dev
;
62 __entry
->ino
= ctx
->dp
->i_ino
;
63 __entry
->hashval
= ctx
->cursor
->hashval
;
64 __entry
->blkno
= ctx
->cursor
->blkno
;
65 __entry
->offset
= ctx
->cursor
->offset
;
66 __entry
->alist
= ctx
->alist
;
67 __entry
->bufsize
= ctx
->bufsize
;
68 __entry
->count
= ctx
->count
;
69 __entry
->firstu
= ctx
->firstu
;
70 __entry
->flags
= ctx
->flags
;
72 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
73 "alist 0x%p size %u count %u firstu %u flags %d %s",
74 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
85 __print_flags(__entry
->flags
, "|", XFS_ATTR_FLAGS
)
89 #define DEFINE_ATTR_LIST_EVENT(name) \
90 DEFINE_EVENT(xfs_attr_list_class, name, \
91 TP_PROTO(struct xfs_attr_list_context *ctx), \
93 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf
);
94 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all
);
95 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf
);
96 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end
);
97 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full
);
98 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add
);
99 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk
);
100 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound
);
101 DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list
);
102 DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list
);
104 DECLARE_EVENT_CLASS(xfs_perag_class
,
105 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, int refcount
,
106 unsigned long caller_ip
),
107 TP_ARGS(mp
, agno
, refcount
, caller_ip
),
110 __field(xfs_agnumber_t
, agno
)
111 __field(int, refcount
)
112 __field(unsigned long, caller_ip
)
115 __entry
->dev
= mp
->m_super
->s_dev
;
116 __entry
->agno
= agno
;
117 __entry
->refcount
= refcount
;
118 __entry
->caller_ip
= caller_ip
;
120 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
121 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
124 (char *)__entry
->caller_ip
)
127 #define DEFINE_PERAG_REF_EVENT(name) \
128 DEFINE_EVENT(xfs_perag_class, name, \
129 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
130 unsigned long caller_ip), \
131 TP_ARGS(mp, agno, refcount, caller_ip))
132 DEFINE_PERAG_REF_EVENT(xfs_perag_get
);
133 DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag
);
134 DEFINE_PERAG_REF_EVENT(xfs_perag_put
);
135 DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim
);
136 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim
);
137 DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks
);
138 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks
);
139 DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks
);
140 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks
);
142 DECLARE_EVENT_CLASS(xfs_ag_class
,
143 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
),
147 __field(xfs_agnumber_t
, agno
)
150 __entry
->dev
= mp
->m_super
->s_dev
;
151 __entry
->agno
= agno
;
153 TP_printk("dev %d:%d agno %u",
154 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
157 #define DEFINE_AG_EVENT(name) \
158 DEFINE_EVENT(xfs_ag_class, name, \
159 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
162 DEFINE_AG_EVENT(xfs_read_agf
);
163 DEFINE_AG_EVENT(xfs_alloc_read_agf
);
164 DEFINE_AG_EVENT(xfs_read_agi
);
165 DEFINE_AG_EVENT(xfs_ialloc_read_agi
);
167 TRACE_EVENT(xfs_attr_list_node_descend
,
168 TP_PROTO(struct xfs_attr_list_context
*ctx
,
169 struct xfs_da_node_entry
*btree
),
173 __field(xfs_ino_t
, ino
)
174 __field(u32
, hashval
)
177 __field(void *, alist
)
178 __field(int, bufsize
)
183 __field(u32
, bt_hashval
)
184 __field(u32
, bt_before
)
187 __entry
->dev
= VFS_I(ctx
->dp
)->i_sb
->s_dev
;
188 __entry
->ino
= ctx
->dp
->i_ino
;
189 __entry
->hashval
= ctx
->cursor
->hashval
;
190 __entry
->blkno
= ctx
->cursor
->blkno
;
191 __entry
->offset
= ctx
->cursor
->offset
;
192 __entry
->alist
= ctx
->alist
;
193 __entry
->bufsize
= ctx
->bufsize
;
194 __entry
->count
= ctx
->count
;
195 __entry
->firstu
= ctx
->firstu
;
196 __entry
->flags
= ctx
->flags
;
197 __entry
->bt_hashval
= be32_to_cpu(btree
->hashval
);
198 __entry
->bt_before
= be32_to_cpu(btree
->before
);
200 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
201 "alist 0x%p size %u count %u firstu %u flags %d %s "
202 "node hashval %u, node before %u",
203 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
214 __print_flags(__entry
->flags
, "|", XFS_ATTR_FLAGS
),
219 TRACE_EVENT(xfs_iext_insert
,
220 TP_PROTO(struct xfs_inode
*ip
, xfs_extnum_t idx
,
221 struct xfs_bmbt_irec
*r
, int state
, unsigned long caller_ip
),
222 TP_ARGS(ip
, idx
, r
, state
, caller_ip
),
225 __field(xfs_ino_t
, ino
)
226 __field(xfs_extnum_t
, idx
)
227 __field(xfs_fileoff_t
, startoff
)
228 __field(xfs_fsblock_t
, startblock
)
229 __field(xfs_filblks_t
, blockcount
)
230 __field(xfs_exntst_t
, state
)
231 __field(int, bmap_state
)
232 __field(unsigned long, caller_ip
)
235 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
236 __entry
->ino
= ip
->i_ino
;
238 __entry
->startoff
= r
->br_startoff
;
239 __entry
->startblock
= r
->br_startblock
;
240 __entry
->blockcount
= r
->br_blockcount
;
241 __entry
->state
= r
->br_state
;
242 __entry
->bmap_state
= state
;
243 __entry
->caller_ip
= caller_ip
;
245 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
246 "offset %lld block %lld count %lld flag %d caller %ps",
247 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
249 __print_flags(__entry
->bmap_state
, "|", XFS_BMAP_EXT_FLAGS
),
252 (__int64_t
)__entry
->startblock
,
255 (char *)__entry
->caller_ip
)
258 DECLARE_EVENT_CLASS(xfs_bmap_class
,
259 TP_PROTO(struct xfs_inode
*ip
, xfs_extnum_t idx
, int state
,
260 unsigned long caller_ip
),
261 TP_ARGS(ip
, idx
, state
, caller_ip
),
264 __field(xfs_ino_t
, ino
)
265 __field(xfs_extnum_t
, idx
)
266 __field(xfs_fileoff_t
, startoff
)
267 __field(xfs_fsblock_t
, startblock
)
268 __field(xfs_filblks_t
, blockcount
)
269 __field(xfs_exntst_t
, state
)
270 __field(int, bmap_state
)
271 __field(unsigned long, caller_ip
)
274 struct xfs_ifork
*ifp
;
275 struct xfs_bmbt_irec r
;
277 ifp
= xfs_iext_state_to_fork(ip
, state
);
278 xfs_bmbt_get_all(xfs_iext_get_ext(ifp
, idx
), &r
);
279 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
280 __entry
->ino
= ip
->i_ino
;
282 __entry
->startoff
= r
.br_startoff
;
283 __entry
->startblock
= r
.br_startblock
;
284 __entry
->blockcount
= r
.br_blockcount
;
285 __entry
->state
= r
.br_state
;
286 __entry
->bmap_state
= state
;
287 __entry
->caller_ip
= caller_ip
;
289 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
290 "offset %lld block %lld count %lld flag %d caller %ps",
291 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
293 __print_flags(__entry
->bmap_state
, "|", XFS_BMAP_EXT_FLAGS
),
296 (__int64_t
)__entry
->startblock
,
299 (char *)__entry
->caller_ip
)
302 #define DEFINE_BMAP_EVENT(name) \
303 DEFINE_EVENT(xfs_bmap_class, name, \
304 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
305 unsigned long caller_ip), \
306 TP_ARGS(ip, idx, state, caller_ip))
307 DEFINE_BMAP_EVENT(xfs_iext_remove
);
308 DEFINE_BMAP_EVENT(xfs_bmap_pre_update
);
309 DEFINE_BMAP_EVENT(xfs_bmap_post_update
);
310 DEFINE_BMAP_EVENT(xfs_extlist
);
312 DECLARE_EVENT_CLASS(xfs_buf_class
,
313 TP_PROTO(struct xfs_buf
*bp
, unsigned long caller_ip
),
314 TP_ARGS(bp
, caller_ip
),
317 __field(xfs_daddr_t
, bno
)
320 __field(int, pincount
)
321 __field(unsigned, lockval
)
322 __field(unsigned, flags
)
323 __field(unsigned long, caller_ip
)
326 __entry
->dev
= bp
->b_target
->bt_dev
;
327 __entry
->bno
= bp
->b_bn
;
328 __entry
->nblks
= bp
->b_length
;
329 __entry
->hold
= atomic_read(&bp
->b_hold
);
330 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
331 __entry
->lockval
= bp
->b_sema
.count
;
332 __entry
->flags
= bp
->b_flags
;
333 __entry
->caller_ip
= caller_ip
;
335 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
336 "lock %d flags %s caller %ps",
337 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
338 (unsigned long long)__entry
->bno
,
343 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
344 (void *)__entry
->caller_ip
)
347 #define DEFINE_BUF_EVENT(name) \
348 DEFINE_EVENT(xfs_buf_class, name, \
349 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
350 TP_ARGS(bp, caller_ip))
351 DEFINE_BUF_EVENT(xfs_buf_init
);
352 DEFINE_BUF_EVENT(xfs_buf_free
);
353 DEFINE_BUF_EVENT(xfs_buf_hold
);
354 DEFINE_BUF_EVENT(xfs_buf_rele
);
355 DEFINE_BUF_EVENT(xfs_buf_iodone
);
356 DEFINE_BUF_EVENT(xfs_buf_submit
);
357 DEFINE_BUF_EVENT(xfs_buf_submit_wait
);
358 DEFINE_BUF_EVENT(xfs_buf_bawrite
);
359 DEFINE_BUF_EVENT(xfs_buf_lock
);
360 DEFINE_BUF_EVENT(xfs_buf_lock_done
);
361 DEFINE_BUF_EVENT(xfs_buf_trylock_fail
);
362 DEFINE_BUF_EVENT(xfs_buf_trylock
);
363 DEFINE_BUF_EVENT(xfs_buf_unlock
);
364 DEFINE_BUF_EVENT(xfs_buf_iowait
);
365 DEFINE_BUF_EVENT(xfs_buf_iowait_done
);
366 DEFINE_BUF_EVENT(xfs_buf_delwri_queue
);
367 DEFINE_BUF_EVENT(xfs_buf_delwri_queued
);
368 DEFINE_BUF_EVENT(xfs_buf_delwri_split
);
369 DEFINE_BUF_EVENT(xfs_buf_get_uncached
);
370 DEFINE_BUF_EVENT(xfs_bdstrat_shut
);
371 DEFINE_BUF_EVENT(xfs_buf_item_relse
);
372 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async
);
373 DEFINE_BUF_EVENT(xfs_buf_error_relse
);
374 DEFINE_BUF_EVENT(xfs_buf_wait_buftarg
);
375 DEFINE_BUF_EVENT(xfs_trans_read_buf_io
);
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_da_btree_corrupt
);
381 DEFINE_BUF_EVENT(xfs_reset_dqcounts
);
382 DEFINE_BUF_EVENT(xfs_inode_item_push
);
384 /* pass flags explicitly */
385 DECLARE_EVENT_CLASS(xfs_buf_flags_class
,
386 TP_PROTO(struct xfs_buf
*bp
, unsigned flags
, unsigned long caller_ip
),
387 TP_ARGS(bp
, flags
, caller_ip
),
390 __field(xfs_daddr_t
, bno
)
391 __field(size_t, buffer_length
)
393 __field(int, pincount
)
394 __field(unsigned, lockval
)
395 __field(unsigned, flags
)
396 __field(unsigned long, caller_ip
)
399 __entry
->dev
= bp
->b_target
->bt_dev
;
400 __entry
->bno
= bp
->b_bn
;
401 __entry
->buffer_length
= BBTOB(bp
->b_length
);
402 __entry
->flags
= flags
;
403 __entry
->hold
= atomic_read(&bp
->b_hold
);
404 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
405 __entry
->lockval
= bp
->b_sema
.count
;
406 __entry
->caller_ip
= caller_ip
;
408 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
409 "lock %d flags %s caller %ps",
410 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
411 (unsigned long long)__entry
->bno
,
412 __entry
->buffer_length
,
416 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
417 (void *)__entry
->caller_ip
)
420 #define DEFINE_BUF_FLAGS_EVENT(name) \
421 DEFINE_EVENT(xfs_buf_flags_class, name, \
422 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
423 TP_ARGS(bp, flags, caller_ip))
424 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find
);
425 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get
);
426 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read
);
428 TRACE_EVENT(xfs_buf_ioerror
,
429 TP_PROTO(struct xfs_buf
*bp
, int error
, unsigned long caller_ip
),
430 TP_ARGS(bp
, error
, caller_ip
),
433 __field(xfs_daddr_t
, bno
)
434 __field(size_t, buffer_length
)
435 __field(unsigned, flags
)
437 __field(int, pincount
)
438 __field(unsigned, lockval
)
440 __field(unsigned long, caller_ip
)
443 __entry
->dev
= bp
->b_target
->bt_dev
;
444 __entry
->bno
= bp
->b_bn
;
445 __entry
->buffer_length
= BBTOB(bp
->b_length
);
446 __entry
->hold
= atomic_read(&bp
->b_hold
);
447 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
448 __entry
->lockval
= bp
->b_sema
.count
;
449 __entry
->error
= error
;
450 __entry
->flags
= bp
->b_flags
;
451 __entry
->caller_ip
= caller_ip
;
453 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
454 "lock %d error %d flags %s caller %ps",
455 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
456 (unsigned long long)__entry
->bno
,
457 __entry
->buffer_length
,
462 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
463 (void *)__entry
->caller_ip
)
466 DECLARE_EVENT_CLASS(xfs_buf_item_class
,
467 TP_PROTO(struct xfs_buf_log_item
*bip
),
471 __field(xfs_daddr_t
, buf_bno
)
472 __field(size_t, buf_len
)
473 __field(int, buf_hold
)
474 __field(int, buf_pincount
)
475 __field(int, buf_lockval
)
476 __field(unsigned, buf_flags
)
477 __field(unsigned, bli_recur
)
478 __field(int, bli_refcount
)
479 __field(unsigned, bli_flags
)
480 __field(void *, li_desc
)
481 __field(unsigned, li_flags
)
484 __entry
->dev
= bip
->bli_buf
->b_target
->bt_dev
;
485 __entry
->bli_flags
= bip
->bli_flags
;
486 __entry
->bli_recur
= bip
->bli_recur
;
487 __entry
->bli_refcount
= atomic_read(&bip
->bli_refcount
);
488 __entry
->buf_bno
= bip
->bli_buf
->b_bn
;
489 __entry
->buf_len
= BBTOB(bip
->bli_buf
->b_length
);
490 __entry
->buf_flags
= bip
->bli_buf
->b_flags
;
491 __entry
->buf_hold
= atomic_read(&bip
->bli_buf
->b_hold
);
492 __entry
->buf_pincount
= atomic_read(&bip
->bli_buf
->b_pin_count
);
493 __entry
->buf_lockval
= bip
->bli_buf
->b_sema
.count
;
494 __entry
->li_desc
= bip
->bli_item
.li_desc
;
495 __entry
->li_flags
= bip
->bli_item
.li_flags
;
497 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
498 "lock %d flags %s recur %d refcount %d bliflags %s "
499 "lidesc 0x%p liflags %s",
500 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
501 (unsigned long long)__entry
->buf_bno
,
504 __entry
->buf_pincount
,
505 __entry
->buf_lockval
,
506 __print_flags(__entry
->buf_flags
, "|", XFS_BUF_FLAGS
),
508 __entry
->bli_refcount
,
509 __print_flags(__entry
->bli_flags
, "|", XFS_BLI_FLAGS
),
511 __print_flags(__entry
->li_flags
, "|", XFS_LI_FLAGS
))
514 #define DEFINE_BUF_ITEM_EVENT(name) \
515 DEFINE_EVENT(xfs_buf_item_class, name, \
516 TP_PROTO(struct xfs_buf_log_item *bip), \
518 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size
);
519 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered
);
520 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale
);
521 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format
);
522 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered
);
523 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale
);
524 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered
);
525 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin
);
526 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin
);
527 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale
);
528 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock
);
529 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale
);
530 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed
);
531 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push
);
532 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf
);
533 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur
);
534 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb
);
535 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur
);
536 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf
);
537 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur
);
538 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf
);
539 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse
);
540 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin
);
541 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold
);
542 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release
);
543 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval
);
544 DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered
);
546 DECLARE_EVENT_CLASS(xfs_filestream_class
,
547 TP_PROTO(struct xfs_inode
*ip
, xfs_agnumber_t agno
),
551 __field(xfs_ino_t
, ino
)
552 __field(xfs_agnumber_t
, agno
)
553 __field(int, streams
)
556 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
557 __entry
->ino
= ip
->i_ino
;
558 __entry
->agno
= agno
;
559 __entry
->streams
= xfs_filestream_peek_ag(ip
->i_mount
, agno
);
561 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
562 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
567 #define DEFINE_FILESTREAM_EVENT(name) \
568 DEFINE_EVENT(xfs_filestream_class, name, \
569 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
571 DEFINE_FILESTREAM_EVENT(xfs_filestream_free
);
572 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup
);
573 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan
);
575 TRACE_EVENT(xfs_filestream_pick
,
576 TP_PROTO(struct xfs_inode
*ip
, xfs_agnumber_t agno
,
577 xfs_extlen_t free
, int nscan
),
578 TP_ARGS(ip
, agno
, free
, nscan
),
581 __field(xfs_ino_t
, ino
)
582 __field(xfs_agnumber_t
, agno
)
583 __field(int, streams
)
584 __field(xfs_extlen_t
, free
)
588 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
589 __entry
->ino
= ip
->i_ino
;
590 __entry
->agno
= agno
;
591 __entry
->streams
= xfs_filestream_peek_ag(ip
->i_mount
, agno
);
592 __entry
->free
= free
;
593 __entry
->nscan
= nscan
;
595 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
596 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
604 DECLARE_EVENT_CLASS(xfs_lock_class
,
605 TP_PROTO(struct xfs_inode
*ip
, unsigned lock_flags
,
606 unsigned long caller_ip
),
607 TP_ARGS(ip
, lock_flags
, caller_ip
),
610 __field(xfs_ino_t
, ino
)
611 __field(int, lock_flags
)
612 __field(unsigned long, caller_ip
)
615 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
616 __entry
->ino
= ip
->i_ino
;
617 __entry
->lock_flags
= lock_flags
;
618 __entry
->caller_ip
= caller_ip
;
620 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
621 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
623 __print_flags(__entry
->lock_flags
, "|", XFS_LOCK_FLAGS
),
624 (void *)__entry
->caller_ip
)
627 #define DEFINE_LOCK_EVENT(name) \
628 DEFINE_EVENT(xfs_lock_class, name, \
629 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
630 unsigned long caller_ip), \
631 TP_ARGS(ip, lock_flags, caller_ip))
632 DEFINE_LOCK_EVENT(xfs_ilock
);
633 DEFINE_LOCK_EVENT(xfs_ilock_nowait
);
634 DEFINE_LOCK_EVENT(xfs_ilock_demote
);
635 DEFINE_LOCK_EVENT(xfs_iunlock
);
637 DECLARE_EVENT_CLASS(xfs_inode_class
,
638 TP_PROTO(struct xfs_inode
*ip
),
642 __field(xfs_ino_t
, ino
)
645 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
646 __entry
->ino
= ip
->i_ino
;
648 TP_printk("dev %d:%d ino 0x%llx",
649 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
653 #define DEFINE_INODE_EVENT(name) \
654 DEFINE_EVENT(xfs_inode_class, name, \
655 TP_PROTO(struct xfs_inode *ip), \
657 DEFINE_INODE_EVENT(xfs_iget_skip
);
658 DEFINE_INODE_EVENT(xfs_iget_reclaim
);
659 DEFINE_INODE_EVENT(xfs_iget_reclaim_fail
);
660 DEFINE_INODE_EVENT(xfs_iget_hit
);
661 DEFINE_INODE_EVENT(xfs_iget_miss
);
663 DEFINE_INODE_EVENT(xfs_getattr
);
664 DEFINE_INODE_EVENT(xfs_setattr
);
665 DEFINE_INODE_EVENT(xfs_readlink
);
666 DEFINE_INODE_EVENT(xfs_inactive_symlink
);
667 DEFINE_INODE_EVENT(xfs_alloc_file_space
);
668 DEFINE_INODE_EVENT(xfs_free_file_space
);
669 DEFINE_INODE_EVENT(xfs_zero_file_space
);
670 DEFINE_INODE_EVENT(xfs_collapse_file_space
);
671 DEFINE_INODE_EVENT(xfs_insert_file_space
);
672 DEFINE_INODE_EVENT(xfs_readdir
);
673 #ifdef CONFIG_XFS_POSIX_ACL
674 DEFINE_INODE_EVENT(xfs_get_acl
);
676 DEFINE_INODE_EVENT(xfs_vm_bmap
);
677 DEFINE_INODE_EVENT(xfs_file_ioctl
);
678 DEFINE_INODE_EVENT(xfs_file_compat_ioctl
);
679 DEFINE_INODE_EVENT(xfs_ioctl_setattr
);
680 DEFINE_INODE_EVENT(xfs_dir_fsync
);
681 DEFINE_INODE_EVENT(xfs_file_fsync
);
682 DEFINE_INODE_EVENT(xfs_destroy_inode
);
683 DEFINE_INODE_EVENT(xfs_evict_inode
);
684 DEFINE_INODE_EVENT(xfs_update_time
);
686 DEFINE_INODE_EVENT(xfs_dquot_dqalloc
);
687 DEFINE_INODE_EVENT(xfs_dquot_dqdetach
);
689 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag
);
690 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag
);
691 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid
);
692 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag
);
693 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag
);
694 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid
);
696 DEFINE_INODE_EVENT(xfs_filemap_fault
);
697 DEFINE_INODE_EVENT(xfs_filemap_pmd_fault
);
698 DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite
);
699 DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite
);
701 DECLARE_EVENT_CLASS(xfs_iref_class
,
702 TP_PROTO(struct xfs_inode
*ip
, unsigned long caller_ip
),
703 TP_ARGS(ip
, caller_ip
),
706 __field(xfs_ino_t
, ino
)
708 __field(int, pincount
)
709 __field(unsigned long, caller_ip
)
712 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
713 __entry
->ino
= ip
->i_ino
;
714 __entry
->count
= atomic_read(&VFS_I(ip
)->i_count
);
715 __entry
->pincount
= atomic_read(&ip
->i_pincount
);
716 __entry
->caller_ip
= caller_ip
;
718 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
719 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
723 (char *)__entry
->caller_ip
)
726 TRACE_EVENT(xfs_iomap_prealloc_size
,
727 TP_PROTO(struct xfs_inode
*ip
, xfs_fsblock_t blocks
, int shift
,
728 unsigned int writeio_blocks
),
729 TP_ARGS(ip
, blocks
, shift
, writeio_blocks
),
732 __field(xfs_ino_t
, ino
)
733 __field(xfs_fsblock_t
, blocks
)
735 __field(unsigned int, writeio_blocks
)
738 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
739 __entry
->ino
= ip
->i_ino
;
740 __entry
->blocks
= blocks
;
741 __entry
->shift
= shift
;
742 __entry
->writeio_blocks
= writeio_blocks
;
744 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
745 "m_writeio_blocks %u",
746 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->ino
,
747 __entry
->blocks
, __entry
->shift
, __entry
->writeio_blocks
)
750 TRACE_EVENT(xfs_irec_merge_pre
,
751 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agino_t agino
,
752 uint16_t holemask
, xfs_agino_t nagino
, uint16_t nholemask
),
753 TP_ARGS(mp
, agno
, agino
, holemask
, nagino
, nholemask
),
756 __field(xfs_agnumber_t
, agno
)
757 __field(xfs_agino_t
, agino
)
758 __field(uint16_t, holemask
)
759 __field(xfs_agino_t
, nagino
)
760 __field(uint16_t, nholemask
)
763 __entry
->dev
= mp
->m_super
->s_dev
;
764 __entry
->agno
= agno
;
765 __entry
->agino
= agino
;
766 __entry
->holemask
= holemask
;
767 __entry
->nagino
= nagino
;
768 __entry
->nholemask
= holemask
;
770 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
771 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->agno
,
772 __entry
->agino
, __entry
->holemask
, __entry
->nagino
,
776 TRACE_EVENT(xfs_irec_merge_post
,
777 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agino_t agino
,
779 TP_ARGS(mp
, agno
, agino
, holemask
),
782 __field(xfs_agnumber_t
, agno
)
783 __field(xfs_agino_t
, agino
)
784 __field(uint16_t, holemask
)
787 __entry
->dev
= mp
->m_super
->s_dev
;
788 __entry
->agno
= agno
;
789 __entry
->agino
= agino
;
790 __entry
->holemask
= holemask
;
792 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry
->dev
),
793 MINOR(__entry
->dev
), __entry
->agno
, __entry
->agino
,
797 #define DEFINE_IREF_EVENT(name) \
798 DEFINE_EVENT(xfs_iref_class, name, \
799 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
800 TP_ARGS(ip, caller_ip))
801 DEFINE_IREF_EVENT(xfs_ihold
);
802 DEFINE_IREF_EVENT(xfs_irele
);
803 DEFINE_IREF_EVENT(xfs_inode_pin
);
804 DEFINE_IREF_EVENT(xfs_inode_unpin
);
805 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait
);
807 DECLARE_EVENT_CLASS(xfs_namespace_class
,
808 TP_PROTO(struct xfs_inode
*dp
, struct xfs_name
*name
),
812 __field(xfs_ino_t
, dp_ino
)
813 __field(int, namelen
)
814 __dynamic_array(char, name
, name
->len
)
817 __entry
->dev
= VFS_I(dp
)->i_sb
->s_dev
;
818 __entry
->dp_ino
= dp
->i_ino
;
819 __entry
->namelen
= name
->len
;
820 memcpy(__get_str(name
), name
->name
, name
->len
);
822 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
823 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
829 #define DEFINE_NAMESPACE_EVENT(name) \
830 DEFINE_EVENT(xfs_namespace_class, name, \
831 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
833 DEFINE_NAMESPACE_EVENT(xfs_remove
);
834 DEFINE_NAMESPACE_EVENT(xfs_link
);
835 DEFINE_NAMESPACE_EVENT(xfs_lookup
);
836 DEFINE_NAMESPACE_EVENT(xfs_create
);
837 DEFINE_NAMESPACE_EVENT(xfs_symlink
);
839 TRACE_EVENT(xfs_rename
,
840 TP_PROTO(struct xfs_inode
*src_dp
, struct xfs_inode
*target_dp
,
841 struct xfs_name
*src_name
, struct xfs_name
*target_name
),
842 TP_ARGS(src_dp
, target_dp
, src_name
, target_name
),
845 __field(xfs_ino_t
, src_dp_ino
)
846 __field(xfs_ino_t
, target_dp_ino
)
847 __field(int, src_namelen
)
848 __field(int, target_namelen
)
849 __dynamic_array(char, src_name
, src_name
->len
)
850 __dynamic_array(char, target_name
, target_name
->len
)
853 __entry
->dev
= VFS_I(src_dp
)->i_sb
->s_dev
;
854 __entry
->src_dp_ino
= src_dp
->i_ino
;
855 __entry
->target_dp_ino
= target_dp
->i_ino
;
856 __entry
->src_namelen
= src_name
->len
;
857 __entry
->target_namelen
= target_name
->len
;
858 memcpy(__get_str(src_name
), src_name
->name
, src_name
->len
);
859 memcpy(__get_str(target_name
), target_name
->name
,
862 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
863 " src name %.*s target name %.*s",
864 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
866 __entry
->target_dp_ino
,
867 __entry
->src_namelen
,
869 __entry
->target_namelen
,
870 __get_str(target_name
))
873 DECLARE_EVENT_CLASS(xfs_dquot_class
,
874 TP_PROTO(struct xfs_dquot
*dqp
),
879 __field(unsigned, flags
)
880 __field(unsigned, nrefs
)
881 __field(unsigned long long, res_bcount
)
882 __field(unsigned long long, bcount
)
883 __field(unsigned long long, icount
)
884 __field(unsigned long long, blk_hardlimit
)
885 __field(unsigned long long, blk_softlimit
)
886 __field(unsigned long long, ino_hardlimit
)
887 __field(unsigned long long, ino_softlimit
)
890 __entry
->dev
= dqp
->q_mount
->m_super
->s_dev
;
891 __entry
->id
= be32_to_cpu(dqp
->q_core
.d_id
);
892 __entry
->flags
= dqp
->dq_flags
;
893 __entry
->nrefs
= dqp
->q_nrefs
;
894 __entry
->res_bcount
= dqp
->q_res_bcount
;
895 __entry
->bcount
= be64_to_cpu(dqp
->q_core
.d_bcount
);
896 __entry
->icount
= be64_to_cpu(dqp
->q_core
.d_icount
);
897 __entry
->blk_hardlimit
=
898 be64_to_cpu(dqp
->q_core
.d_blk_hardlimit
);
899 __entry
->blk_softlimit
=
900 be64_to_cpu(dqp
->q_core
.d_blk_softlimit
);
901 __entry
->ino_hardlimit
=
902 be64_to_cpu(dqp
->q_core
.d_ino_hardlimit
);
903 __entry
->ino_softlimit
=
904 be64_to_cpu(dqp
->q_core
.d_ino_softlimit
);
906 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
907 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
908 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
909 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
911 __print_flags(__entry
->flags
, "|", XFS_DQ_FLAGS
),
915 __entry
->blk_hardlimit
,
916 __entry
->blk_softlimit
,
918 __entry
->ino_hardlimit
,
919 __entry
->ino_softlimit
)
922 #define DEFINE_DQUOT_EVENT(name) \
923 DEFINE_EVENT(xfs_dquot_class, name, \
924 TP_PROTO(struct xfs_dquot *dqp), \
926 DEFINE_DQUOT_EVENT(xfs_dqadjust
);
927 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want
);
928 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty
);
929 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy
);
930 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done
);
931 DEFINE_DQUOT_EVENT(xfs_dqattach_found
);
932 DEFINE_DQUOT_EVENT(xfs_dqattach_get
);
933 DEFINE_DQUOT_EVENT(xfs_dqalloc
);
934 DEFINE_DQUOT_EVENT(xfs_dqtobp_read
);
935 DEFINE_DQUOT_EVENT(xfs_dqread
);
936 DEFINE_DQUOT_EVENT(xfs_dqread_fail
);
937 DEFINE_DQUOT_EVENT(xfs_dqget_hit
);
938 DEFINE_DQUOT_EVENT(xfs_dqget_miss
);
939 DEFINE_DQUOT_EVENT(xfs_dqget_freeing
);
940 DEFINE_DQUOT_EVENT(xfs_dqget_dup
);
941 DEFINE_DQUOT_EVENT(xfs_dqput
);
942 DEFINE_DQUOT_EVENT(xfs_dqput_wait
);
943 DEFINE_DQUOT_EVENT(xfs_dqput_free
);
944 DEFINE_DQUOT_EVENT(xfs_dqrele
);
945 DEFINE_DQUOT_EVENT(xfs_dqflush
);
946 DEFINE_DQUOT_EVENT(xfs_dqflush_force
);
947 DEFINE_DQUOT_EVENT(xfs_dqflush_done
);
949 DECLARE_EVENT_CLASS(xfs_loggrant_class
,
950 TP_PROTO(struct xlog
*log
, struct xlog_ticket
*tic
),
956 __field(int, curr_res
)
957 __field(int, unit_res
)
958 __field(unsigned int, flags
)
959 __field(int, reserveq
)
961 __field(int, grant_reserve_cycle
)
962 __field(int, grant_reserve_bytes
)
963 __field(int, grant_write_cycle
)
964 __field(int, grant_write_bytes
)
965 __field(int, curr_cycle
)
966 __field(int, curr_block
)
967 __field(xfs_lsn_t
, tail_lsn
)
970 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
971 __entry
->ocnt
= tic
->t_ocnt
;
972 __entry
->cnt
= tic
->t_cnt
;
973 __entry
->curr_res
= tic
->t_curr_res
;
974 __entry
->unit_res
= tic
->t_unit_res
;
975 __entry
->flags
= tic
->t_flags
;
976 __entry
->reserveq
= list_empty(&log
->l_reserve_head
.waiters
);
977 __entry
->writeq
= list_empty(&log
->l_write_head
.waiters
);
978 xlog_crack_grant_head(&log
->l_reserve_head
.grant
,
979 &__entry
->grant_reserve_cycle
,
980 &__entry
->grant_reserve_bytes
);
981 xlog_crack_grant_head(&log
->l_write_head
.grant
,
982 &__entry
->grant_write_cycle
,
983 &__entry
->grant_write_bytes
);
984 __entry
->curr_cycle
= log
->l_curr_cycle
;
985 __entry
->curr_block
= log
->l_curr_block
;
986 __entry
->tail_lsn
= atomic64_read(&log
->l_tail_lsn
);
988 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
989 "t_unit_res %u t_flags %s reserveq %s "
990 "writeq %s grant_reserve_cycle %d "
991 "grant_reserve_bytes %d grant_write_cycle %d "
992 "grant_write_bytes %d curr_cycle %d curr_block %d "
993 "tail_cycle %d tail_block %d",
994 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
999 __print_flags(__entry
->flags
, "|", XLOG_TIC_FLAGS
),
1000 __entry
->reserveq
? "empty" : "active",
1001 __entry
->writeq
? "empty" : "active",
1002 __entry
->grant_reserve_cycle
,
1003 __entry
->grant_reserve_bytes
,
1004 __entry
->grant_write_cycle
,
1005 __entry
->grant_write_bytes
,
1006 __entry
->curr_cycle
,
1007 __entry
->curr_block
,
1008 CYCLE_LSN(__entry
->tail_lsn
),
1009 BLOCK_LSN(__entry
->tail_lsn
)
1013 #define DEFINE_LOGGRANT_EVENT(name) \
1014 DEFINE_EVENT(xfs_loggrant_class, name, \
1015 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1017 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm
);
1018 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm
);
1019 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write
);
1020 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep
);
1021 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake
);
1022 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up
);
1023 DEFINE_LOGGRANT_EVENT(xfs_log_reserve
);
1024 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit
);
1025 DEFINE_LOGGRANT_EVENT(xfs_log_regrant
);
1026 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit
);
1027 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter
);
1028 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit
);
1029 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub
);
1030 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter
);
1031 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit
);
1032 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub
);
1034 DECLARE_EVENT_CLASS(xfs_log_item_class
,
1035 TP_PROTO(struct xfs_log_item
*lip
),
1039 __field(void *, lip
)
1041 __field(uint
, flags
)
1042 __field(xfs_lsn_t
, lsn
)
1045 __entry
->dev
= lip
->li_mountp
->m_super
->s_dev
;
1047 __entry
->type
= lip
->li_type
;
1048 __entry
->flags
= lip
->li_flags
;
1049 __entry
->lsn
= lip
->li_lsn
;
1051 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1052 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1054 CYCLE_LSN(__entry
->lsn
), BLOCK_LSN(__entry
->lsn
),
1055 __print_symbolic(__entry
->type
, XFS_LI_TYPE_DESC
),
1056 __print_flags(__entry
->flags
, "|", XFS_LI_FLAGS
))
1059 TRACE_EVENT(xfs_log_force
,
1060 TP_PROTO(struct xfs_mount
*mp
, xfs_lsn_t lsn
, unsigned long caller_ip
),
1061 TP_ARGS(mp
, lsn
, caller_ip
),
1064 __field(xfs_lsn_t
, lsn
)
1065 __field(unsigned long, caller_ip
)
1068 __entry
->dev
= mp
->m_super
->s_dev
;
1070 __entry
->caller_ip
= caller_ip
;
1072 TP_printk("dev %d:%d lsn 0x%llx caller %ps",
1073 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1074 __entry
->lsn
, (void *)__entry
->caller_ip
)
1077 #define DEFINE_LOG_ITEM_EVENT(name) \
1078 DEFINE_EVENT(xfs_log_item_class, name, \
1079 TP_PROTO(struct xfs_log_item *lip), \
1081 DEFINE_LOG_ITEM_EVENT(xfs_ail_push
);
1082 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned
);
1083 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked
);
1084 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing
);
1086 DECLARE_EVENT_CLASS(xfs_ail_class
,
1087 TP_PROTO(struct xfs_log_item
*lip
, xfs_lsn_t old_lsn
, xfs_lsn_t new_lsn
),
1088 TP_ARGS(lip
, old_lsn
, new_lsn
),
1091 __field(void *, lip
)
1093 __field(uint
, flags
)
1094 __field(xfs_lsn_t
, old_lsn
)
1095 __field(xfs_lsn_t
, new_lsn
)
1098 __entry
->dev
= lip
->li_mountp
->m_super
->s_dev
;
1100 __entry
->type
= lip
->li_type
;
1101 __entry
->flags
= lip
->li_flags
;
1102 __entry
->old_lsn
= old_lsn
;
1103 __entry
->new_lsn
= new_lsn
;
1105 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1106 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1108 CYCLE_LSN(__entry
->old_lsn
), BLOCK_LSN(__entry
->old_lsn
),
1109 CYCLE_LSN(__entry
->new_lsn
), BLOCK_LSN(__entry
->new_lsn
),
1110 __print_symbolic(__entry
->type
, XFS_LI_TYPE_DESC
),
1111 __print_flags(__entry
->flags
, "|", XFS_LI_FLAGS
))
1114 #define DEFINE_AIL_EVENT(name) \
1115 DEFINE_EVENT(xfs_ail_class, name, \
1116 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1117 TP_ARGS(lip, old_lsn, new_lsn))
1118 DEFINE_AIL_EVENT(xfs_ail_insert
);
1119 DEFINE_AIL_EVENT(xfs_ail_move
);
1120 DEFINE_AIL_EVENT(xfs_ail_delete
);
1122 TRACE_EVENT(xfs_log_assign_tail_lsn
,
1123 TP_PROTO(struct xlog
*log
, xfs_lsn_t new_lsn
),
1124 TP_ARGS(log
, new_lsn
),
1127 __field(xfs_lsn_t
, new_lsn
)
1128 __field(xfs_lsn_t
, old_lsn
)
1129 __field(xfs_lsn_t
, last_sync_lsn
)
1132 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
1133 __entry
->new_lsn
= new_lsn
;
1134 __entry
->old_lsn
= atomic64_read(&log
->l_tail_lsn
);
1135 __entry
->last_sync_lsn
= atomic64_read(&log
->l_last_sync_lsn
);
1137 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1138 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1139 CYCLE_LSN(__entry
->new_lsn
), BLOCK_LSN(__entry
->new_lsn
),
1140 CYCLE_LSN(__entry
->old_lsn
), BLOCK_LSN(__entry
->old_lsn
),
1141 CYCLE_LSN(__entry
->last_sync_lsn
), BLOCK_LSN(__entry
->last_sync_lsn
))
1144 DECLARE_EVENT_CLASS(xfs_file_class
,
1145 TP_PROTO(struct xfs_inode
*ip
, size_t count
, loff_t offset
),
1146 TP_ARGS(ip
, count
, offset
),
1149 __field(xfs_ino_t
, ino
)
1150 __field(xfs_fsize_t
, size
)
1151 __field(loff_t
, offset
)
1152 __field(size_t, count
)
1155 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1156 __entry
->ino
= ip
->i_ino
;
1157 __entry
->size
= ip
->i_d
.di_size
;
1158 __entry
->offset
= offset
;
1159 __entry
->count
= count
;
1161 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
1162 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1169 #define DEFINE_RW_EVENT(name) \
1170 DEFINE_EVENT(xfs_file_class, name, \
1171 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1172 TP_ARGS(ip, count, offset))
1173 DEFINE_RW_EVENT(xfs_file_buffered_read
);
1174 DEFINE_RW_EVENT(xfs_file_direct_read
);
1175 DEFINE_RW_EVENT(xfs_file_dax_read
);
1176 DEFINE_RW_EVENT(xfs_file_buffered_write
);
1177 DEFINE_RW_EVENT(xfs_file_direct_write
);
1178 DEFINE_RW_EVENT(xfs_file_dax_write
);
1180 DECLARE_EVENT_CLASS(xfs_page_class
,
1181 TP_PROTO(struct inode
*inode
, struct page
*page
, unsigned long off
,
1183 TP_ARGS(inode
, page
, off
, len
),
1186 __field(xfs_ino_t
, ino
)
1187 __field(pgoff_t
, pgoff
)
1188 __field(loff_t
, size
)
1189 __field(unsigned long, offset
)
1190 __field(unsigned int, length
)
1191 __field(int, delalloc
)
1192 __field(int, unwritten
)
1195 int delalloc
= -1, unwritten
= -1;
1197 if (page_has_buffers(page
))
1198 xfs_count_page_state(page
, &delalloc
, &unwritten
);
1199 __entry
->dev
= inode
->i_sb
->s_dev
;
1200 __entry
->ino
= XFS_I(inode
)->i_ino
;
1201 __entry
->pgoff
= page_offset(page
);
1202 __entry
->size
= i_size_read(inode
);
1203 __entry
->offset
= off
;
1204 __entry
->length
= len
;
1205 __entry
->delalloc
= delalloc
;
1206 __entry
->unwritten
= unwritten
;
1208 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
1209 "length %x delalloc %d unwritten %d",
1210 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1220 #define DEFINE_PAGE_EVENT(name) \
1221 DEFINE_EVENT(xfs_page_class, name, \
1222 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1223 unsigned int len), \
1224 TP_ARGS(inode, page, off, len))
1225 DEFINE_PAGE_EVENT(xfs_writepage
);
1226 DEFINE_PAGE_EVENT(xfs_releasepage
);
1227 DEFINE_PAGE_EVENT(xfs_invalidatepage
);
1229 DECLARE_EVENT_CLASS(xfs_readpage_class
,
1230 TP_PROTO(struct inode
*inode
, int nr_pages
),
1231 TP_ARGS(inode
, nr_pages
),
1234 __field(xfs_ino_t
, ino
)
1235 __field(int, nr_pages
)
1238 __entry
->dev
= inode
->i_sb
->s_dev
;
1239 __entry
->ino
= inode
->i_ino
;
1240 __entry
->nr_pages
= nr_pages
;
1242 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1243 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1248 #define DEFINE_READPAGE_EVENT(name) \
1249 DEFINE_EVENT(xfs_readpage_class, name, \
1250 TP_PROTO(struct inode *inode, int nr_pages), \
1251 TP_ARGS(inode, nr_pages))
1252 DEFINE_READPAGE_EVENT(xfs_vm_readpage
);
1253 DEFINE_READPAGE_EVENT(xfs_vm_readpages
);
1255 DECLARE_EVENT_CLASS(xfs_imap_class
,
1256 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t offset
, ssize_t count
,
1257 int type
, struct xfs_bmbt_irec
*irec
),
1258 TP_ARGS(ip
, offset
, count
, type
, irec
),
1261 __field(xfs_ino_t
, ino
)
1262 __field(loff_t
, size
)
1263 __field(loff_t
, offset
)
1264 __field(size_t, count
)
1266 __field(xfs_fileoff_t
, startoff
)
1267 __field(xfs_fsblock_t
, startblock
)
1268 __field(xfs_filblks_t
, blockcount
)
1271 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1272 __entry
->ino
= ip
->i_ino
;
1273 __entry
->size
= ip
->i_d
.di_size
;
1274 __entry
->offset
= offset
;
1275 __entry
->count
= count
;
1276 __entry
->type
= type
;
1277 __entry
->startoff
= irec
? irec
->br_startoff
: 0;
1278 __entry
->startblock
= irec
? irec
->br_startblock
: 0;
1279 __entry
->blockcount
= irec
? irec
->br_blockcount
: 0;
1281 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1282 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
1283 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1288 __print_symbolic(__entry
->type
, XFS_IO_TYPES
),
1290 (__int64_t
)__entry
->startblock
,
1291 __entry
->blockcount
)
1294 #define DEFINE_IOMAP_EVENT(name) \
1295 DEFINE_EVENT(xfs_imap_class, name, \
1296 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1297 int type, struct xfs_bmbt_irec *irec), \
1298 TP_ARGS(ip, offset, count, type, irec))
1299 DEFINE_IOMAP_EVENT(xfs_map_blocks_found
);
1300 DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc
);
1301 DEFINE_IOMAP_EVENT(xfs_get_blocks_found
);
1302 DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc
);
1303 DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct
);
1304 DEFINE_IOMAP_EVENT(xfs_iomap_alloc
);
1305 DEFINE_IOMAP_EVENT(xfs_iomap_found
);
1307 DECLARE_EVENT_CLASS(xfs_simple_io_class
,
1308 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t offset
, ssize_t count
),
1309 TP_ARGS(ip
, offset
, count
),
1312 __field(xfs_ino_t
, ino
)
1313 __field(loff_t
, isize
)
1314 __field(loff_t
, disize
)
1315 __field(loff_t
, offset
)
1316 __field(size_t, count
)
1319 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1320 __entry
->ino
= ip
->i_ino
;
1321 __entry
->isize
= VFS_I(ip
)->i_size
;
1322 __entry
->disize
= ip
->i_d
.di_size
;
1323 __entry
->offset
= offset
;
1324 __entry
->count
= count
;
1326 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1327 "offset 0x%llx count %zd",
1328 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1336 #define DEFINE_SIMPLE_IO_EVENT(name) \
1337 DEFINE_EVENT(xfs_simple_io_class, name, \
1338 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1339 TP_ARGS(ip, offset, count))
1340 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc
);
1341 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert
);
1342 DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound
);
1343 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize
);
1344 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof
);
1345 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write
);
1346 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten
);
1347 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append
);
1349 DECLARE_EVENT_CLASS(xfs_itrunc_class
,
1350 TP_PROTO(struct xfs_inode
*ip
, xfs_fsize_t new_size
),
1351 TP_ARGS(ip
, new_size
),
1354 __field(xfs_ino_t
, ino
)
1355 __field(xfs_fsize_t
, size
)
1356 __field(xfs_fsize_t
, new_size
)
1359 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1360 __entry
->ino
= ip
->i_ino
;
1361 __entry
->size
= ip
->i_d
.di_size
;
1362 __entry
->new_size
= new_size
;
1364 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1365 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1371 #define DEFINE_ITRUNC_EVENT(name) \
1372 DEFINE_EVENT(xfs_itrunc_class, name, \
1373 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1374 TP_ARGS(ip, new_size))
1375 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start
);
1376 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end
);
1378 TRACE_EVENT(xfs_pagecache_inval
,
1379 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t start
, xfs_off_t finish
),
1380 TP_ARGS(ip
, start
, finish
),
1383 __field(xfs_ino_t
, ino
)
1384 __field(xfs_fsize_t
, size
)
1385 __field(xfs_off_t
, start
)
1386 __field(xfs_off_t
, finish
)
1389 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1390 __entry
->ino
= ip
->i_ino
;
1391 __entry
->size
= ip
->i_d
.di_size
;
1392 __entry
->start
= start
;
1393 __entry
->finish
= finish
;
1395 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1396 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1403 TRACE_EVENT(xfs_bunmap
,
1404 TP_PROTO(struct xfs_inode
*ip
, xfs_fileoff_t bno
, xfs_filblks_t len
,
1405 int flags
, unsigned long caller_ip
),
1406 TP_ARGS(ip
, bno
, len
, flags
, caller_ip
),
1409 __field(xfs_ino_t
, ino
)
1410 __field(xfs_fsize_t
, size
)
1411 __field(xfs_fileoff_t
, bno
)
1412 __field(xfs_filblks_t
, len
)
1413 __field(unsigned long, caller_ip
)
1417 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1418 __entry
->ino
= ip
->i_ino
;
1419 __entry
->size
= ip
->i_d
.di_size
;
1422 __entry
->caller_ip
= caller_ip
;
1423 __entry
->flags
= flags
;
1425 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1426 "flags %s caller %ps",
1427 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1432 __print_flags(__entry
->flags
, "|", XFS_BMAPI_FLAGS
),
1433 (void *)__entry
->caller_ip
)
1437 DECLARE_EVENT_CLASS(xfs_extent_busy_class
,
1438 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
1439 xfs_agblock_t agbno
, xfs_extlen_t len
),
1440 TP_ARGS(mp
, agno
, agbno
, len
),
1443 __field(xfs_agnumber_t
, agno
)
1444 __field(xfs_agblock_t
, agbno
)
1445 __field(xfs_extlen_t
, len
)
1448 __entry
->dev
= mp
->m_super
->s_dev
;
1449 __entry
->agno
= agno
;
1450 __entry
->agbno
= agbno
;
1453 TP_printk("dev %d:%d agno %u agbno %u len %u",
1454 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1459 #define DEFINE_BUSY_EVENT(name) \
1460 DEFINE_EVENT(xfs_extent_busy_class, name, \
1461 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1462 xfs_agblock_t agbno, xfs_extlen_t len), \
1463 TP_ARGS(mp, agno, agbno, len))
1464 DEFINE_BUSY_EVENT(xfs_extent_busy
);
1465 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem
);
1466 DEFINE_BUSY_EVENT(xfs_extent_busy_force
);
1467 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse
);
1468 DEFINE_BUSY_EVENT(xfs_extent_busy_clear
);
1470 TRACE_EVENT(xfs_extent_busy_trim
,
1471 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
1472 xfs_agblock_t agbno
, xfs_extlen_t len
,
1473 xfs_agblock_t tbno
, xfs_extlen_t tlen
),
1474 TP_ARGS(mp
, agno
, agbno
, len
, tbno
, tlen
),
1477 __field(xfs_agnumber_t
, agno
)
1478 __field(xfs_agblock_t
, agbno
)
1479 __field(xfs_extlen_t
, len
)
1480 __field(xfs_agblock_t
, tbno
)
1481 __field(xfs_extlen_t
, tlen
)
1484 __entry
->dev
= mp
->m_super
->s_dev
;
1485 __entry
->agno
= agno
;
1486 __entry
->agbno
= agbno
;
1488 __entry
->tbno
= tbno
;
1489 __entry
->tlen
= tlen
;
1491 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1492 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1500 TRACE_EVENT(xfs_trans_commit_lsn
,
1501 TP_PROTO(struct xfs_trans
*trans
),
1505 __field(struct xfs_trans
*, tp
)
1506 __field(xfs_lsn_t
, lsn
)
1509 __entry
->dev
= trans
->t_mountp
->m_super
->s_dev
;
1510 __entry
->tp
= trans
;
1511 __entry
->lsn
= trans
->t_commit_lsn
;
1513 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1514 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1519 TRACE_EVENT(xfs_agf
,
1520 TP_PROTO(struct xfs_mount
*mp
, struct xfs_agf
*agf
, int flags
,
1521 unsigned long caller_ip
),
1522 TP_ARGS(mp
, agf
, flags
, caller_ip
),
1525 __field(xfs_agnumber_t
, agno
)
1527 __field(__u32
, length
)
1528 __field(__u32
, bno_root
)
1529 __field(__u32
, cnt_root
)
1530 __field(__u32
, bno_level
)
1531 __field(__u32
, cnt_level
)
1532 __field(__u32
, flfirst
)
1533 __field(__u32
, fllast
)
1534 __field(__u32
, flcount
)
1535 __field(__u32
, freeblks
)
1536 __field(__u32
, longest
)
1537 __field(unsigned long, caller_ip
)
1540 __entry
->dev
= mp
->m_super
->s_dev
;
1541 __entry
->agno
= be32_to_cpu(agf
->agf_seqno
),
1542 __entry
->flags
= flags
;
1543 __entry
->length
= be32_to_cpu(agf
->agf_length
),
1544 __entry
->bno_root
= be32_to_cpu(agf
->agf_roots
[XFS_BTNUM_BNO
]),
1545 __entry
->cnt_root
= be32_to_cpu(agf
->agf_roots
[XFS_BTNUM_CNT
]),
1546 __entry
->bno_level
=
1547 be32_to_cpu(agf
->agf_levels
[XFS_BTNUM_BNO
]),
1548 __entry
->cnt_level
=
1549 be32_to_cpu(agf
->agf_levels
[XFS_BTNUM_CNT
]),
1550 __entry
->flfirst
= be32_to_cpu(agf
->agf_flfirst
),
1551 __entry
->fllast
= be32_to_cpu(agf
->agf_fllast
),
1552 __entry
->flcount
= be32_to_cpu(agf
->agf_flcount
),
1553 __entry
->freeblks
= be32_to_cpu(agf
->agf_freeblks
),
1554 __entry
->longest
= be32_to_cpu(agf
->agf_longest
);
1555 __entry
->caller_ip
= caller_ip
;
1557 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1558 "levels b %u c %u flfirst %u fllast %u flcount %u "
1559 "freeblks %u longest %u caller %ps",
1560 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1562 __print_flags(__entry
->flags
, "|", XFS_AGF_FLAGS
),
1573 (void *)__entry
->caller_ip
)
1576 TRACE_EVENT(xfs_free_extent
,
1577 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agblock_t agbno
,
1578 xfs_extlen_t len
, enum xfs_ag_resv_type resv
, int haveleft
,
1580 TP_ARGS(mp
, agno
, agbno
, len
, resv
, haveleft
, haveright
),
1583 __field(xfs_agnumber_t
, agno
)
1584 __field(xfs_agblock_t
, agbno
)
1585 __field(xfs_extlen_t
, len
)
1587 __field(int, haveleft
)
1588 __field(int, haveright
)
1591 __entry
->dev
= mp
->m_super
->s_dev
;
1592 __entry
->agno
= agno
;
1593 __entry
->agbno
= agbno
;
1595 __entry
->resv
= resv
;
1596 __entry
->haveleft
= haveleft
;
1597 __entry
->haveright
= haveright
;
1599 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
1600 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1606 (__entry
->haveright
? "both" : "left") :
1607 (__entry
->haveright
? "right" : "none"))
1611 DECLARE_EVENT_CLASS(xfs_alloc_class
,
1612 TP_PROTO(struct xfs_alloc_arg
*args
),
1616 __field(xfs_agnumber_t
, agno
)
1617 __field(xfs_agblock_t
, agbno
)
1618 __field(xfs_extlen_t
, minlen
)
1619 __field(xfs_extlen_t
, maxlen
)
1620 __field(xfs_extlen_t
, mod
)
1621 __field(xfs_extlen_t
, prod
)
1622 __field(xfs_extlen_t
, minleft
)
1623 __field(xfs_extlen_t
, total
)
1624 __field(xfs_extlen_t
, alignment
)
1625 __field(xfs_extlen_t
, minalignslop
)
1626 __field(xfs_extlen_t
, len
)
1627 __field(short, type
)
1628 __field(short, otype
)
1629 __field(char, wasdel
)
1630 __field(char, wasfromfl
)
1632 __field(int, datatype
)
1633 __field(xfs_fsblock_t
, firstblock
)
1636 __entry
->dev
= args
->mp
->m_super
->s_dev
;
1637 __entry
->agno
= args
->agno
;
1638 __entry
->agbno
= args
->agbno
;
1639 __entry
->minlen
= args
->minlen
;
1640 __entry
->maxlen
= args
->maxlen
;
1641 __entry
->mod
= args
->mod
;
1642 __entry
->prod
= args
->prod
;
1643 __entry
->minleft
= args
->minleft
;
1644 __entry
->total
= args
->total
;
1645 __entry
->alignment
= args
->alignment
;
1646 __entry
->minalignslop
= args
->minalignslop
;
1647 __entry
->len
= args
->len
;
1648 __entry
->type
= args
->type
;
1649 __entry
->otype
= args
->otype
;
1650 __entry
->wasdel
= args
->wasdel
;
1651 __entry
->wasfromfl
= args
->wasfromfl
;
1652 __entry
->resv
= args
->resv
;
1653 __entry
->datatype
= args
->datatype
;
1654 __entry
->firstblock
= args
->firstblock
;
1656 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1657 "prod %u minleft %u total %u alignment %u minalignslop %u "
1658 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1659 "datatype 0x%x firstblock 0x%llx",
1660 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1670 __entry
->minalignslop
,
1672 __print_symbolic(__entry
->type
, XFS_ALLOC_TYPES
),
1673 __print_symbolic(__entry
->otype
, XFS_ALLOC_TYPES
),
1678 (unsigned long long)__entry
->firstblock
)
1681 #define DEFINE_ALLOC_EVENT(name) \
1682 DEFINE_EVENT(xfs_alloc_class, name, \
1683 TP_PROTO(struct xfs_alloc_arg *args), \
1685 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done
);
1686 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound
);
1687 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error
);
1688 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft
);
1689 DEFINE_ALLOC_EVENT(xfs_alloc_near_first
);
1690 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater
);
1691 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser
);
1692 DEFINE_ALLOC_EVENT(xfs_alloc_near_error
);
1693 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry
);
1694 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy
);
1695 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither
);
1696 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry
);
1697 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft
);
1698 DEFINE_ALLOC_EVENT(xfs_alloc_size_done
);
1699 DEFINE_ALLOC_EVENT(xfs_alloc_size_error
);
1700 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy
);
1701 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist
);
1702 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough
);
1703 DEFINE_ALLOC_EVENT(xfs_alloc_small_done
);
1704 DEFINE_ALLOC_EVENT(xfs_alloc_small_error
);
1705 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs
);
1706 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix
);
1707 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp
);
1708 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed
);
1709 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed
);
1711 DECLARE_EVENT_CLASS(xfs_da_class
,
1712 TP_PROTO(struct xfs_da_args
*args
),
1716 __field(xfs_ino_t
, ino
)
1717 __dynamic_array(char, name
, args
->namelen
)
1718 __field(int, namelen
)
1719 __field(xfs_dahash_t
, hashval
)
1720 __field(xfs_ino_t
, inumber
)
1721 __field(int, op_flags
)
1724 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1725 __entry
->ino
= args
->dp
->i_ino
;
1727 memcpy(__get_str(name
), args
->name
, args
->namelen
);
1728 __entry
->namelen
= args
->namelen
;
1729 __entry
->hashval
= args
->hashval
;
1730 __entry
->inumber
= args
->inumber
;
1731 __entry
->op_flags
= args
->op_flags
;
1733 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1734 "inumber 0x%llx op_flags %s",
1735 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1738 __entry
->namelen
? __get_str(name
) : NULL
,
1742 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
))
1745 #define DEFINE_DIR2_EVENT(name) \
1746 DEFINE_EVENT(xfs_da_class, name, \
1747 TP_PROTO(struct xfs_da_args *args), \
1749 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname
);
1750 DEFINE_DIR2_EVENT(xfs_dir2_sf_create
);
1751 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup
);
1752 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace
);
1753 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename
);
1754 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4
);
1755 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8
);
1756 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block
);
1757 DEFINE_DIR2_EVENT(xfs_dir2_block_addname
);
1758 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup
);
1759 DEFINE_DIR2_EVENT(xfs_dir2_block_replace
);
1760 DEFINE_DIR2_EVENT(xfs_dir2_block_removename
);
1761 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf
);
1762 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf
);
1763 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname
);
1764 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup
);
1765 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace
);
1766 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename
);
1767 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block
);
1768 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node
);
1769 DEFINE_DIR2_EVENT(xfs_dir2_node_addname
);
1770 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup
);
1771 DEFINE_DIR2_EVENT(xfs_dir2_node_replace
);
1772 DEFINE_DIR2_EVENT(xfs_dir2_node_removename
);
1773 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf
);
1775 DECLARE_EVENT_CLASS(xfs_attr_class
,
1776 TP_PROTO(struct xfs_da_args
*args
),
1780 __field(xfs_ino_t
, ino
)
1781 __dynamic_array(char, name
, args
->namelen
)
1782 __field(int, namelen
)
1783 __field(int, valuelen
)
1784 __field(xfs_dahash_t
, hashval
)
1785 __field(int, op_flags
)
1788 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1789 __entry
->ino
= args
->dp
->i_ino
;
1791 memcpy(__get_str(name
), args
->name
, args
->namelen
);
1792 __entry
->namelen
= args
->namelen
;
1793 __entry
->valuelen
= args
->valuelen
;
1794 __entry
->hashval
= args
->hashval
;
1795 __entry
->op_flags
= args
->op_flags
;
1797 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1798 "hashval 0x%x op_flags %s",
1799 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1802 __entry
->namelen
? __get_str(name
) : NULL
,
1806 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
))
1809 #define DEFINE_ATTR_EVENT(name) \
1810 DEFINE_EVENT(xfs_attr_class, name, \
1811 TP_PROTO(struct xfs_da_args *args), \
1813 DEFINE_ATTR_EVENT(xfs_attr_sf_add
);
1814 DEFINE_ATTR_EVENT(xfs_attr_sf_addname
);
1815 DEFINE_ATTR_EVENT(xfs_attr_sf_create
);
1816 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup
);
1817 DEFINE_ATTR_EVENT(xfs_attr_sf_remove
);
1818 DEFINE_ATTR_EVENT(xfs_attr_sf_removename
);
1819 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf
);
1821 DEFINE_ATTR_EVENT(xfs_attr_leaf_add
);
1822 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old
);
1823 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new
);
1824 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work
);
1825 DEFINE_ATTR_EVENT(xfs_attr_leaf_addname
);
1826 DEFINE_ATTR_EVENT(xfs_attr_leaf_create
);
1827 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact
);
1828 DEFINE_ATTR_EVENT(xfs_attr_leaf_get
);
1829 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup
);
1830 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace
);
1831 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove
);
1832 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename
);
1833 DEFINE_ATTR_EVENT(xfs_attr_leaf_split
);
1834 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before
);
1835 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after
);
1836 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag
);
1837 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag
);
1838 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags
);
1839 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf
);
1840 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node
);
1841 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance
);
1842 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance
);
1843 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall
);
1845 DEFINE_ATTR_EVENT(xfs_attr_node_addname
);
1846 DEFINE_ATTR_EVENT(xfs_attr_node_get
);
1847 DEFINE_ATTR_EVENT(xfs_attr_node_lookup
);
1848 DEFINE_ATTR_EVENT(xfs_attr_node_replace
);
1849 DEFINE_ATTR_EVENT(xfs_attr_node_removename
);
1851 DEFINE_ATTR_EVENT(xfs_attr_fillstate
);
1852 DEFINE_ATTR_EVENT(xfs_attr_refillstate
);
1854 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get
);
1855 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set
);
1856 DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove
);
1858 #define DEFINE_DA_EVENT(name) \
1859 DEFINE_EVENT(xfs_da_class, name, \
1860 TP_PROTO(struct xfs_da_args *args), \
1862 DEFINE_DA_EVENT(xfs_da_split
);
1863 DEFINE_DA_EVENT(xfs_da_join
);
1864 DEFINE_DA_EVENT(xfs_da_link_before
);
1865 DEFINE_DA_EVENT(xfs_da_link_after
);
1866 DEFINE_DA_EVENT(xfs_da_unlink_back
);
1867 DEFINE_DA_EVENT(xfs_da_unlink_forward
);
1868 DEFINE_DA_EVENT(xfs_da_root_split
);
1869 DEFINE_DA_EVENT(xfs_da_root_join
);
1870 DEFINE_DA_EVENT(xfs_da_node_add
);
1871 DEFINE_DA_EVENT(xfs_da_node_create
);
1872 DEFINE_DA_EVENT(xfs_da_node_split
);
1873 DEFINE_DA_EVENT(xfs_da_node_remove
);
1874 DEFINE_DA_EVENT(xfs_da_node_rebalance
);
1875 DEFINE_DA_EVENT(xfs_da_node_unbalance
);
1876 DEFINE_DA_EVENT(xfs_da_node_toosmall
);
1877 DEFINE_DA_EVENT(xfs_da_swap_lastblock
);
1878 DEFINE_DA_EVENT(xfs_da_grow_inode
);
1879 DEFINE_DA_EVENT(xfs_da_shrink_inode
);
1880 DEFINE_DA_EVENT(xfs_da_fixhashpath
);
1881 DEFINE_DA_EVENT(xfs_da_path_shift
);
1883 DECLARE_EVENT_CLASS(xfs_dir2_space_class
,
1884 TP_PROTO(struct xfs_da_args
*args
, int idx
),
1888 __field(xfs_ino_t
, ino
)
1889 __field(int, op_flags
)
1893 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1894 __entry
->ino
= args
->dp
->i_ino
;
1895 __entry
->op_flags
= args
->op_flags
;
1898 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1899 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1901 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
),
1905 #define DEFINE_DIR2_SPACE_EVENT(name) \
1906 DEFINE_EVENT(xfs_dir2_space_class, name, \
1907 TP_PROTO(struct xfs_da_args *args, int idx), \
1909 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add
);
1910 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove
);
1911 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode
);
1912 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode
);
1914 TRACE_EVENT(xfs_dir2_leafn_moveents
,
1915 TP_PROTO(struct xfs_da_args
*args
, int src_idx
, int dst_idx
, int count
),
1916 TP_ARGS(args
, src_idx
, dst_idx
, count
),
1919 __field(xfs_ino_t
, ino
)
1920 __field(int, op_flags
)
1921 __field(int, src_idx
)
1922 __field(int, dst_idx
)
1926 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1927 __entry
->ino
= args
->dp
->i_ino
;
1928 __entry
->op_flags
= args
->op_flags
;
1929 __entry
->src_idx
= src_idx
;
1930 __entry
->dst_idx
= dst_idx
;
1931 __entry
->count
= count
;
1933 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1934 "src_idx %d dst_idx %d count %d",
1935 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1937 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
),
1943 #define XFS_SWAPEXT_INODES \
1947 #define XFS_INODE_FORMAT_STR \
1953 DECLARE_EVENT_CLASS(xfs_swap_extent_class
,
1954 TP_PROTO(struct xfs_inode
*ip
, int which
),
1959 __field(xfs_ino_t
, ino
)
1960 __field(int, format
)
1962 __field(int, broot_size
)
1963 __field(int, fork_off
)
1966 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1967 __entry
->which
= which
;
1968 __entry
->ino
= ip
->i_ino
;
1969 __entry
->format
= ip
->i_d
.di_format
;
1970 __entry
->nex
= ip
->i_d
.di_nextents
;
1971 __entry
->broot_size
= ip
->i_df
.if_broot_bytes
;
1972 __entry
->fork_off
= XFS_IFORK_BOFF(ip
);
1974 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1975 "broot size %d, fork offset %d",
1976 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1978 __print_symbolic(__entry
->which
, XFS_SWAPEXT_INODES
),
1979 __print_symbolic(__entry
->format
, XFS_INODE_FORMAT_STR
),
1981 __entry
->broot_size
,
1985 #define DEFINE_SWAPEXT_EVENT(name) \
1986 DEFINE_EVENT(xfs_swap_extent_class, name, \
1987 TP_PROTO(struct xfs_inode *ip, int which), \
1990 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before
);
1991 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after
);
1993 TRACE_EVENT(xfs_log_recover_record
,
1994 TP_PROTO(struct xlog
*log
, struct xlog_rec_header
*rhead
, int pass
),
1995 TP_ARGS(log
, rhead
, pass
),
1998 __field(xfs_lsn_t
, lsn
)
2000 __field(int, num_logops
)
2004 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2005 __entry
->lsn
= be64_to_cpu(rhead
->h_lsn
);
2006 __entry
->len
= be32_to_cpu(rhead
->h_len
);
2007 __entry
->num_logops
= be32_to_cpu(rhead
->h_num_logops
);
2008 __entry
->pass
= pass
;
2010 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2011 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2012 __entry
->lsn
, __entry
->len
, __entry
->num_logops
,
2016 DECLARE_EVENT_CLASS(xfs_log_recover_item_class
,
2017 TP_PROTO(struct xlog
*log
, struct xlog_recover
*trans
,
2018 struct xlog_recover_item
*item
, int pass
),
2019 TP_ARGS(log
, trans
, item
, pass
),
2022 __field(unsigned long, item
)
2023 __field(xlog_tid_t
, tid
)
2024 __field(xfs_lsn_t
, lsn
)
2031 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2032 __entry
->item
= (unsigned long)item
;
2033 __entry
->tid
= trans
->r_log_tid
;
2034 __entry
->lsn
= trans
->r_lsn
;
2035 __entry
->type
= ITEM_TYPE(item
);
2036 __entry
->pass
= pass
;
2037 __entry
->count
= item
->ri_cnt
;
2038 __entry
->total
= item
->ri_total
;
2040 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, "
2041 "item type %s item region count/total %d/%d",
2042 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2046 (void *)__entry
->item
,
2047 __print_symbolic(__entry
->type
, XFS_LI_TYPE_DESC
),
2052 #define DEFINE_LOG_RECOVER_ITEM(name) \
2053 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2054 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2055 struct xlog_recover_item *item, int pass), \
2056 TP_ARGS(log, trans, item, pass))
2058 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add
);
2059 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont
);
2060 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head
);
2061 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail
);
2062 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover
);
2064 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class
,
2065 TP_PROTO(struct xlog
*log
, struct xfs_buf_log_format
*buf_f
),
2066 TP_ARGS(log
, buf_f
),
2069 __field(__int64_t
, blkno
)
2070 __field(unsigned short, len
)
2071 __field(unsigned short, flags
)
2072 __field(unsigned short, size
)
2073 __field(unsigned int, map_size
)
2076 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2077 __entry
->blkno
= buf_f
->blf_blkno
;
2078 __entry
->len
= buf_f
->blf_len
;
2079 __entry
->flags
= buf_f
->blf_flags
;
2080 __entry
->size
= buf_f
->blf_size
;
2081 __entry
->map_size
= buf_f
->blf_map_size
;
2083 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2085 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2093 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2094 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2095 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2096 TP_ARGS(log, buf_f))
2098 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel
);
2099 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel
);
2100 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add
);
2101 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc
);
2102 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover
);
2103 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip
);
2104 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf
);
2105 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf
);
2106 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf
);
2108 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class
,
2109 TP_PROTO(struct xlog
*log
, struct xfs_inode_log_format
*in_f
),
2113 __field(xfs_ino_t
, ino
)
2114 __field(unsigned short, size
)
2115 __field(int, fields
)
2116 __field(unsigned short, asize
)
2117 __field(unsigned short, dsize
)
2118 __field(__int64_t
, blkno
)
2120 __field(int, boffset
)
2123 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2124 __entry
->ino
= in_f
->ilf_ino
;
2125 __entry
->size
= in_f
->ilf_size
;
2126 __entry
->fields
= in_f
->ilf_fields
;
2127 __entry
->asize
= in_f
->ilf_asize
;
2128 __entry
->dsize
= in_f
->ilf_dsize
;
2129 __entry
->blkno
= in_f
->ilf_blkno
;
2130 __entry
->len
= in_f
->ilf_len
;
2131 __entry
->boffset
= in_f
->ilf_boffset
;
2133 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2134 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2135 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2145 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2146 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2147 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2150 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover
);
2151 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel
);
2152 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip
);
2154 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class
,
2155 TP_PROTO(struct xlog
*log
, struct xfs_icreate_log
*in_f
),
2159 __field(xfs_agnumber_t
, agno
)
2160 __field(xfs_agblock_t
, agbno
)
2161 __field(unsigned int, count
)
2162 __field(unsigned int, isize
)
2163 __field(xfs_agblock_t
, length
)
2164 __field(unsigned int, gen
)
2167 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
2168 __entry
->agno
= be32_to_cpu(in_f
->icl_ag
);
2169 __entry
->agbno
= be32_to_cpu(in_f
->icl_agbno
);
2170 __entry
->count
= be32_to_cpu(in_f
->icl_count
);
2171 __entry
->isize
= be32_to_cpu(in_f
->icl_isize
);
2172 __entry
->length
= be32_to_cpu(in_f
->icl_length
);
2173 __entry
->gen
= be32_to_cpu(in_f
->icl_gen
);
2175 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2176 "gen %u", MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2177 __entry
->agno
, __entry
->agbno
, __entry
->count
, __entry
->isize
,
2178 __entry
->length
, __entry
->gen
)
2180 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2181 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2182 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2185 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel
);
2186 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover
);
2188 DECLARE_EVENT_CLASS(xfs_discard_class
,
2189 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2190 xfs_agblock_t agbno
, xfs_extlen_t len
),
2191 TP_ARGS(mp
, agno
, agbno
, len
),
2194 __field(xfs_agnumber_t
, agno
)
2195 __field(xfs_agblock_t
, agbno
)
2196 __field(xfs_extlen_t
, len
)
2199 __entry
->dev
= mp
->m_super
->s_dev
;
2200 __entry
->agno
= agno
;
2201 __entry
->agbno
= agbno
;
2204 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2205 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2211 #define DEFINE_DISCARD_EVENT(name) \
2212 DEFINE_EVENT(xfs_discard_class, name, \
2213 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2214 xfs_agblock_t agbno, xfs_extlen_t len), \
2215 TP_ARGS(mp, agno, agbno, len))
2216 DEFINE_DISCARD_EVENT(xfs_discard_extent
);
2217 DEFINE_DISCARD_EVENT(xfs_discard_toosmall
);
2218 DEFINE_DISCARD_EVENT(xfs_discard_exclude
);
2219 DEFINE_DISCARD_EVENT(xfs_discard_busy
);
2221 /* btree cursor events */
2222 DECLARE_EVENT_CLASS(xfs_btree_cur_class
,
2223 TP_PROTO(struct xfs_btree_cur
*cur
, int level
, struct xfs_buf
*bp
),
2224 TP_ARGS(cur
, level
, bp
),
2227 __field(xfs_btnum_t
, btnum
)
2229 __field(int, nlevels
)
2231 __field(xfs_daddr_t
, daddr
)
2234 __entry
->dev
= cur
->bc_mp
->m_super
->s_dev
;
2235 __entry
->btnum
= cur
->bc_btnum
;
2236 __entry
->level
= level
;
2237 __entry
->nlevels
= cur
->bc_nlevels
;
2238 __entry
->ptr
= cur
->bc_ptrs
[level
];
2239 __entry
->daddr
= bp
? bp
->b_bn
: -1;
2241 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2242 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2247 (unsigned long long)__entry
->daddr
)
2250 #define DEFINE_BTREE_CUR_EVENT(name) \
2251 DEFINE_EVENT(xfs_btree_cur_class, name, \
2252 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2253 TP_ARGS(cur, level, bp))
2254 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys
);
2255 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range
);
2258 struct xfs_defer_pending
;
2259 struct xfs_defer_intake
;
2260 struct xfs_defer_ops
;
2262 DECLARE_EVENT_CLASS(xfs_defer_class
,
2263 TP_PROTO(struct xfs_mount
*mp
, struct xfs_defer_ops
*dop
),
2267 __field(void *, dop
)
2268 __field(bool, committed
)
2272 __entry
->dev
= mp
? mp
->m_super
->s_dev
: 0;
2274 __entry
->committed
= dop
->dop_committed
;
2275 __entry
->low
= dop
->dop_low
;
2277 TP_printk("dev %d:%d ops %p committed %d low %d\n",
2278 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2283 #define DEFINE_DEFER_EVENT(name) \
2284 DEFINE_EVENT(xfs_defer_class, name, \
2285 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2288 DECLARE_EVENT_CLASS(xfs_defer_error_class
,
2289 TP_PROTO(struct xfs_mount
*mp
, struct xfs_defer_ops
*dop
, int error
),
2290 TP_ARGS(mp
, dop
, error
),
2293 __field(void *, dop
)
2294 __field(bool, committed
)
2299 __entry
->dev
= mp
? mp
->m_super
->s_dev
: 0;
2301 __entry
->committed
= dop
->dop_committed
;
2302 __entry
->low
= dop
->dop_low
;
2303 __entry
->error
= error
;
2305 TP_printk("dev %d:%d ops %p committed %d low %d err %d\n",
2306 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2312 #define DEFINE_DEFER_ERROR_EVENT(name) \
2313 DEFINE_EVENT(xfs_defer_error_class, name, \
2314 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2315 TP_ARGS(mp, dop, error))
2317 DECLARE_EVENT_CLASS(xfs_defer_pending_class
,
2318 TP_PROTO(struct xfs_mount
*mp
, struct xfs_defer_pending
*dfp
),
2323 __field(void *, intent
)
2324 __field(bool, committed
)
2328 __entry
->dev
= mp
? mp
->m_super
->s_dev
: 0;
2329 __entry
->type
= dfp
->dfp_type
->type
;
2330 __entry
->intent
= dfp
->dfp_intent
;
2331 __entry
->committed
= dfp
->dfp_done
!= NULL
;
2332 __entry
->nr
= dfp
->dfp_count
;
2334 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d\n",
2335 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2341 #define DEFINE_DEFER_PENDING_EVENT(name) \
2342 DEFINE_EVENT(xfs_defer_pending_class, name, \
2343 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2346 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class
,
2347 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2348 int type
, xfs_agblock_t agbno
, xfs_extlen_t len
),
2349 TP_ARGS(mp
, agno
, type
, agbno
, len
),
2352 __field(xfs_agnumber_t
, agno
)
2354 __field(xfs_agblock_t
, agbno
)
2355 __field(xfs_extlen_t
, len
)
2358 __entry
->dev
= mp
->m_super
->s_dev
;
2359 __entry
->agno
= agno
;
2360 __entry
->type
= type
;
2361 __entry
->agbno
= agbno
;
2364 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2365 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2371 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2372 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2373 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2375 xfs_agblock_t bno, \
2376 xfs_extlen_t len), \
2377 TP_ARGS(mp, agno, type, bno, len))
2379 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class
,
2380 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2382 xfs_agblock_t agbno
,
2385 xfs_fileoff_t offset
,
2387 xfs_exntst_t state
),
2388 TP_ARGS(mp
, agno
, op
, agbno
, ino
, whichfork
, offset
, len
, state
),
2391 __field(xfs_agnumber_t
, agno
)
2392 __field(xfs_ino_t
, ino
)
2393 __field(xfs_agblock_t
, agbno
)
2394 __field(int, whichfork
)
2395 __field(xfs_fileoff_t
, l_loff
)
2396 __field(xfs_filblks_t
, l_len
)
2397 __field(xfs_exntst_t
, l_state
)
2401 __entry
->dev
= mp
->m_super
->s_dev
;
2402 __entry
->agno
= agno
;
2404 __entry
->agbno
= agbno
;
2405 __entry
->whichfork
= whichfork
;
2406 __entry
->l_loff
= offset
;
2407 __entry
->l_len
= len
;
2408 __entry
->l_state
= state
;
2411 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2412 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2417 __entry
->whichfork
== XFS_ATTR_FORK
? "attr" : "data",
2422 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2423 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2424 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2426 xfs_agblock_t agbno, \
2429 xfs_fileoff_t offset, \
2430 xfs_filblks_t len, \
2431 xfs_exntst_t state), \
2432 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2434 DEFINE_DEFER_EVENT(xfs_defer_init
);
2435 DEFINE_DEFER_EVENT(xfs_defer_cancel
);
2436 DEFINE_DEFER_EVENT(xfs_defer_trans_roll
);
2437 DEFINE_DEFER_EVENT(xfs_defer_trans_abort
);
2438 DEFINE_DEFER_EVENT(xfs_defer_finish
);
2439 DEFINE_DEFER_EVENT(xfs_defer_finish_done
);
2441 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error
);
2442 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error
);
2443 DEFINE_DEFER_ERROR_EVENT(xfs_defer_op_finish_error
);
2445 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work
);
2446 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel
);
2447 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_commit
);
2448 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel
);
2449 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish
);
2450 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort
);
2452 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2453 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer
);
2454 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred
);
2456 /* rmap tracepoints */
2457 DECLARE_EVENT_CLASS(xfs_rmap_class
,
2458 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2459 xfs_agblock_t agbno
, xfs_extlen_t len
, bool unwritten
,
2460 struct xfs_owner_info
*oinfo
),
2461 TP_ARGS(mp
, agno
, agbno
, len
, unwritten
, oinfo
),
2464 __field(xfs_agnumber_t
, agno
)
2465 __field(xfs_agblock_t
, agbno
)
2466 __field(xfs_extlen_t
, len
)
2467 __field(uint64_t, owner
)
2468 __field(uint64_t, offset
)
2469 __field(unsigned long, flags
)
2472 __entry
->dev
= mp
->m_super
->s_dev
;
2473 __entry
->agno
= agno
;
2474 __entry
->agbno
= agbno
;
2476 __entry
->owner
= oinfo
->oi_owner
;
2477 __entry
->offset
= oinfo
->oi_offset
;
2478 __entry
->flags
= oinfo
->oi_flags
;
2480 __entry
->flags
|= XFS_RMAP_UNWRITTEN
;
2482 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2483 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2491 #define DEFINE_RMAP_EVENT(name) \
2492 DEFINE_EVENT(xfs_rmap_class, name, \
2493 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2494 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2495 struct xfs_owner_info *oinfo), \
2496 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2498 /* simple AG-based error/%ip tracepoint class */
2499 DECLARE_EVENT_CLASS(xfs_ag_error_class
,
2500 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, int error
,
2501 unsigned long caller_ip
),
2502 TP_ARGS(mp
, agno
, error
, caller_ip
),
2505 __field(xfs_agnumber_t
, agno
)
2507 __field(unsigned long, caller_ip
)
2510 __entry
->dev
= mp
->m_super
->s_dev
;
2511 __entry
->agno
= agno
;
2512 __entry
->error
= error
;
2513 __entry
->caller_ip
= caller_ip
;
2515 TP_printk("dev %d:%d agno %u error %d caller %ps",
2516 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2519 (char *)__entry
->caller_ip
)
2522 #define DEFINE_AG_ERROR_EVENT(name) \
2523 DEFINE_EVENT(xfs_ag_error_class, name, \
2524 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2525 unsigned long caller_ip), \
2526 TP_ARGS(mp, agno, error, caller_ip))
2528 DEFINE_RMAP_EVENT(xfs_rmap_unmap
);
2529 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done
);
2530 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error
);
2531 DEFINE_RMAP_EVENT(xfs_rmap_map
);
2532 DEFINE_RMAP_EVENT(xfs_rmap_map_done
);
2533 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error
);
2534 DEFINE_RMAP_EVENT(xfs_rmap_convert
);
2535 DEFINE_RMAP_EVENT(xfs_rmap_convert_done
);
2536 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error
);
2537 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state
);
2539 DECLARE_EVENT_CLASS(xfs_rmapbt_class
,
2540 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2541 xfs_agblock_t agbno
, xfs_extlen_t len
,
2542 uint64_t owner
, uint64_t offset
, unsigned int flags
),
2543 TP_ARGS(mp
, agno
, agbno
, len
, owner
, offset
, flags
),
2546 __field(xfs_agnumber_t
, agno
)
2547 __field(xfs_agblock_t
, agbno
)
2548 __field(xfs_extlen_t
, len
)
2549 __field(uint64_t, owner
)
2550 __field(uint64_t, offset
)
2551 __field(unsigned int, flags
)
2554 __entry
->dev
= mp
->m_super
->s_dev
;
2555 __entry
->agno
= agno
;
2556 __entry
->agbno
= agbno
;
2558 __entry
->owner
= owner
;
2559 __entry
->offset
= offset
;
2560 __entry
->flags
= flags
;
2562 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2563 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2571 #define DEFINE_RMAPBT_EVENT(name) \
2572 DEFINE_EVENT(xfs_rmapbt_class, name, \
2573 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2574 xfs_agblock_t agbno, xfs_extlen_t len, \
2575 uint64_t owner, uint64_t offset, unsigned int flags), \
2576 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2578 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2579 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer
);
2580 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred
);
2582 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block
);
2583 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block
);
2584 DEFINE_RMAPBT_EVENT(xfs_rmap_update
);
2585 DEFINE_RMAPBT_EVENT(xfs_rmap_insert
);
2586 DEFINE_RMAPBT_EVENT(xfs_rmap_delete
);
2587 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error
);
2588 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error
);
2589 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error
);
2591 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate
);
2592 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query
);
2593 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate
);
2594 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range
);
2595 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result
);
2596 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result
);
2597 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result
);
2599 /* deferred bmbt updates */
2600 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2601 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer
);
2602 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred
);
2604 /* per-AG reservation */
2605 DECLARE_EVENT_CLASS(xfs_ag_resv_class
,
2606 TP_PROTO(struct xfs_perag
*pag
, enum xfs_ag_resv_type resv
,
2608 TP_ARGS(pag
, resv
, len
),
2611 __field(xfs_agnumber_t
, agno
)
2613 __field(xfs_extlen_t
, freeblks
)
2614 __field(xfs_extlen_t
, flcount
)
2615 __field(xfs_extlen_t
, reserved
)
2616 __field(xfs_extlen_t
, asked
)
2617 __field(xfs_extlen_t
, len
)
2620 struct xfs_ag_resv
*r
= xfs_perag_resv(pag
, resv
);
2622 __entry
->dev
= pag
->pag_mount
->m_super
->s_dev
;
2623 __entry
->agno
= pag
->pag_agno
;
2624 __entry
->resv
= resv
;
2625 __entry
->freeblks
= pag
->pagf_freeblks
;
2626 __entry
->flcount
= pag
->pagf_flcount
;
2627 __entry
->reserved
= r
? r
->ar_reserved
: 0;
2628 __entry
->asked
= r
? r
->ar_asked
: 0;
2631 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u resv %u ask %u len %u\n",
2632 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2641 #define DEFINE_AG_RESV_EVENT(name) \
2642 DEFINE_EVENT(xfs_ag_resv_class, name, \
2643 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2644 xfs_extlen_t len), \
2645 TP_ARGS(pag, type, len))
2647 /* per-AG reservation tracepoints */
2648 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init
);
2649 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free
);
2650 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent
);
2651 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent
);
2652 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical
);
2653 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed
);
2655 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error
);
2656 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error
);
2658 /* refcount tracepoint classes */
2660 /* reuse the discard trace class for agbno/aglen-based traces */
2661 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2663 /* ag btree lookup tracepoint class */
2664 #define XFS_AG_BTREE_CMP_FORMAT_STR \
2665 { XFS_LOOKUP_EQ, "eq" }, \
2666 { XFS_LOOKUP_LE, "le" }, \
2667 { XFS_LOOKUP_GE, "ge" }
2668 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class
,
2669 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2670 xfs_agblock_t agbno
, xfs_lookup_t dir
),
2671 TP_ARGS(mp
, agno
, agbno
, dir
),
2674 __field(xfs_agnumber_t
, agno
)
2675 __field(xfs_agblock_t
, agbno
)
2676 __field(xfs_lookup_t
, dir
)
2679 __entry
->dev
= mp
->m_super
->s_dev
;
2680 __entry
->agno
= agno
;
2681 __entry
->agbno
= agbno
;
2684 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)\n",
2685 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2688 __print_symbolic(__entry
->dir
, XFS_AG_BTREE_CMP_FORMAT_STR
),
2692 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2693 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2694 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2695 xfs_agblock_t agbno, xfs_lookup_t dir), \
2696 TP_ARGS(mp, agno, agbno, dir))
2698 /* single-rcext tracepoint class */
2699 DECLARE_EVENT_CLASS(xfs_refcount_extent_class
,
2700 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2701 struct xfs_refcount_irec
*irec
),
2702 TP_ARGS(mp
, agno
, irec
),
2705 __field(xfs_agnumber_t
, agno
)
2706 __field(xfs_agblock_t
, startblock
)
2707 __field(xfs_extlen_t
, blockcount
)
2708 __field(xfs_nlink_t
, refcount
)
2711 __entry
->dev
= mp
->m_super
->s_dev
;
2712 __entry
->agno
= agno
;
2713 __entry
->startblock
= irec
->rc_startblock
;
2714 __entry
->blockcount
= irec
->rc_blockcount
;
2715 __entry
->refcount
= irec
->rc_refcount
;
2717 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u\n",
2718 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2720 __entry
->startblock
,
2721 __entry
->blockcount
,
2725 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2726 DEFINE_EVENT(xfs_refcount_extent_class, name, \
2727 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2728 struct xfs_refcount_irec *irec), \
2729 TP_ARGS(mp, agno, irec))
2731 /* single-rcext and an agbno tracepoint class */
2732 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class
,
2733 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2734 struct xfs_refcount_irec
*irec
, xfs_agblock_t agbno
),
2735 TP_ARGS(mp
, agno
, irec
, agbno
),
2738 __field(xfs_agnumber_t
, agno
)
2739 __field(xfs_agblock_t
, startblock
)
2740 __field(xfs_extlen_t
, blockcount
)
2741 __field(xfs_nlink_t
, refcount
)
2742 __field(xfs_agblock_t
, agbno
)
2745 __entry
->dev
= mp
->m_super
->s_dev
;
2746 __entry
->agno
= agno
;
2747 __entry
->startblock
= irec
->rc_startblock
;
2748 __entry
->blockcount
= irec
->rc_blockcount
;
2749 __entry
->refcount
= irec
->rc_refcount
;
2750 __entry
->agbno
= agbno
;
2752 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u\n",
2753 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2755 __entry
->startblock
,
2756 __entry
->blockcount
,
2761 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2762 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2763 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2764 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2765 TP_ARGS(mp, agno, irec, agbno))
2767 /* double-rcext tracepoint class */
2768 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class
,
2769 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2770 struct xfs_refcount_irec
*i1
, struct xfs_refcount_irec
*i2
),
2771 TP_ARGS(mp
, agno
, i1
, i2
),
2774 __field(xfs_agnumber_t
, agno
)
2775 __field(xfs_agblock_t
, i1_startblock
)
2776 __field(xfs_extlen_t
, i1_blockcount
)
2777 __field(xfs_nlink_t
, i1_refcount
)
2778 __field(xfs_agblock_t
, i2_startblock
)
2779 __field(xfs_extlen_t
, i2_blockcount
)
2780 __field(xfs_nlink_t
, i2_refcount
)
2783 __entry
->dev
= mp
->m_super
->s_dev
;
2784 __entry
->agno
= agno
;
2785 __entry
->i1_startblock
= i1
->rc_startblock
;
2786 __entry
->i1_blockcount
= i1
->rc_blockcount
;
2787 __entry
->i1_refcount
= i1
->rc_refcount
;
2788 __entry
->i2_startblock
= i2
->rc_startblock
;
2789 __entry
->i2_blockcount
= i2
->rc_blockcount
;
2790 __entry
->i2_refcount
= i2
->rc_refcount
;
2792 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2793 "agbno %u len %u refcount %u\n",
2794 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2796 __entry
->i1_startblock
,
2797 __entry
->i1_blockcount
,
2798 __entry
->i1_refcount
,
2799 __entry
->i2_startblock
,
2800 __entry
->i2_blockcount
,
2801 __entry
->i2_refcount
)
2804 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2805 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2806 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2807 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2808 TP_ARGS(mp, agno, i1, i2))
2810 /* double-rcext and an agbno tracepoint class */
2811 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class
,
2812 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2813 struct xfs_refcount_irec
*i1
, struct xfs_refcount_irec
*i2
,
2814 xfs_agblock_t agbno
),
2815 TP_ARGS(mp
, agno
, i1
, i2
, agbno
),
2818 __field(xfs_agnumber_t
, agno
)
2819 __field(xfs_agblock_t
, i1_startblock
)
2820 __field(xfs_extlen_t
, i1_blockcount
)
2821 __field(xfs_nlink_t
, i1_refcount
)
2822 __field(xfs_agblock_t
, i2_startblock
)
2823 __field(xfs_extlen_t
, i2_blockcount
)
2824 __field(xfs_nlink_t
, i2_refcount
)
2825 __field(xfs_agblock_t
, agbno
)
2828 __entry
->dev
= mp
->m_super
->s_dev
;
2829 __entry
->agno
= agno
;
2830 __entry
->i1_startblock
= i1
->rc_startblock
;
2831 __entry
->i1_blockcount
= i1
->rc_blockcount
;
2832 __entry
->i1_refcount
= i1
->rc_refcount
;
2833 __entry
->i2_startblock
= i2
->rc_startblock
;
2834 __entry
->i2_blockcount
= i2
->rc_blockcount
;
2835 __entry
->i2_refcount
= i2
->rc_refcount
;
2836 __entry
->agbno
= agbno
;
2838 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2839 "agbno %u len %u refcount %u @ agbno %u\n",
2840 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2842 __entry
->i1_startblock
,
2843 __entry
->i1_blockcount
,
2844 __entry
->i1_refcount
,
2845 __entry
->i2_startblock
,
2846 __entry
->i2_blockcount
,
2847 __entry
->i2_refcount
,
2851 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2852 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2853 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2854 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2855 xfs_agblock_t agbno), \
2856 TP_ARGS(mp, agno, i1, i2, agbno))
2858 /* triple-rcext tracepoint class */
2859 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class
,
2860 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2861 struct xfs_refcount_irec
*i1
, struct xfs_refcount_irec
*i2
,
2862 struct xfs_refcount_irec
*i3
),
2863 TP_ARGS(mp
, agno
, i1
, i2
, i3
),
2866 __field(xfs_agnumber_t
, agno
)
2867 __field(xfs_agblock_t
, i1_startblock
)
2868 __field(xfs_extlen_t
, i1_blockcount
)
2869 __field(xfs_nlink_t
, i1_refcount
)
2870 __field(xfs_agblock_t
, i2_startblock
)
2871 __field(xfs_extlen_t
, i2_blockcount
)
2872 __field(xfs_nlink_t
, i2_refcount
)
2873 __field(xfs_agblock_t
, i3_startblock
)
2874 __field(xfs_extlen_t
, i3_blockcount
)
2875 __field(xfs_nlink_t
, i3_refcount
)
2878 __entry
->dev
= mp
->m_super
->s_dev
;
2879 __entry
->agno
= agno
;
2880 __entry
->i1_startblock
= i1
->rc_startblock
;
2881 __entry
->i1_blockcount
= i1
->rc_blockcount
;
2882 __entry
->i1_refcount
= i1
->rc_refcount
;
2883 __entry
->i2_startblock
= i2
->rc_startblock
;
2884 __entry
->i2_blockcount
= i2
->rc_blockcount
;
2885 __entry
->i2_refcount
= i2
->rc_refcount
;
2886 __entry
->i3_startblock
= i3
->rc_startblock
;
2887 __entry
->i3_blockcount
= i3
->rc_blockcount
;
2888 __entry
->i3_refcount
= i3
->rc_refcount
;
2890 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2891 "agbno %u len %u refcount %u -- "
2892 "agbno %u len %u refcount %u\n",
2893 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2895 __entry
->i1_startblock
,
2896 __entry
->i1_blockcount
,
2897 __entry
->i1_refcount
,
2898 __entry
->i2_startblock
,
2899 __entry
->i2_blockcount
,
2900 __entry
->i2_refcount
,
2901 __entry
->i3_startblock
,
2902 __entry
->i3_blockcount
,
2903 __entry
->i3_refcount
)
2906 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2907 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
2908 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2909 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2910 struct xfs_refcount_irec *i3), \
2911 TP_ARGS(mp, agno, i1, i2, i3))
2913 /* refcount btree tracepoints */
2914 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block
);
2915 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block
);
2916 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup
);
2917 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get
);
2918 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update
);
2919 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert
);
2920 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete
);
2921 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error
);
2922 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error
);
2923 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error
);
2925 /* refcount adjustment tracepoints */
2926 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase
);
2927 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease
);
2928 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase
);
2929 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease
);
2930 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents
);
2931 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent
);
2932 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent
);
2933 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent
);
2934 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent
);
2935 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent
);
2936 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent
);
2937 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent
);
2938 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error
);
2939 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error
);
2940 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error
);
2941 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error
);
2942 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error
);
2943 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error
);
2944 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error
);
2945 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error
);
2946 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error
);
2948 /* reflink helpers */
2949 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared
);
2950 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result
);
2951 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error
);
2952 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2953 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer
);
2954 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred
);
2956 TRACE_EVENT(xfs_refcount_finish_one_leftover
,
2957 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
2958 int type
, xfs_agblock_t agbno
, xfs_extlen_t len
,
2959 xfs_agblock_t new_agbno
, xfs_extlen_t new_len
),
2960 TP_ARGS(mp
, agno
, type
, agbno
, len
, new_agbno
, new_len
),
2963 __field(xfs_agnumber_t
, agno
)
2965 __field(xfs_agblock_t
, agbno
)
2966 __field(xfs_extlen_t
, len
)
2967 __field(xfs_agblock_t
, new_agbno
)
2968 __field(xfs_extlen_t
, new_len
)
2971 __entry
->dev
= mp
->m_super
->s_dev
;
2972 __entry
->agno
= agno
;
2973 __entry
->type
= type
;
2974 __entry
->agbno
= agbno
;
2976 __entry
->new_agbno
= new_agbno
;
2977 __entry
->new_len
= new_len
;
2979 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
2980 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2989 /* simple inode-based error/%ip tracepoint class */
2990 DECLARE_EVENT_CLASS(xfs_inode_error_class
,
2991 TP_PROTO(struct xfs_inode
*ip
, int error
, unsigned long caller_ip
),
2992 TP_ARGS(ip
, error
, caller_ip
),
2995 __field(xfs_ino_t
, ino
)
2997 __field(unsigned long, caller_ip
)
3000 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
3001 __entry
->ino
= ip
->i_ino
;
3002 __entry
->error
= error
;
3003 __entry
->caller_ip
= caller_ip
;
3005 TP_printk("dev %d:%d ino %llx error %d caller %ps",
3006 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3009 (char *)__entry
->caller_ip
)
3012 #define DEFINE_INODE_ERROR_EVENT(name) \
3013 DEFINE_EVENT(xfs_inode_error_class, name, \
3014 TP_PROTO(struct xfs_inode *ip, int error, \
3015 unsigned long caller_ip), \
3016 TP_ARGS(ip, error, caller_ip))
3018 /* reflink allocator */
3019 TRACE_EVENT(xfs_bmap_remap_alloc
,
3020 TP_PROTO(struct xfs_inode
*ip
, xfs_fsblock_t fsbno
,
3022 TP_ARGS(ip
, fsbno
, len
),
3025 __field(xfs_ino_t
, ino
)
3026 __field(xfs_fsblock_t
, fsbno
)
3027 __field(xfs_extlen_t
, len
)
3030 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
3031 __entry
->ino
= ip
->i_ino
;
3032 __entry
->fsbno
= fsbno
;
3035 TP_printk("dev %d:%d ino 0x%llx fsbno 0x%llx len %x",
3036 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3041 DEFINE_INODE_ERROR_EVENT(xfs_bmap_remap_alloc_error
);
3043 /* reflink tracepoint classes */
3045 /* two-file io tracepoint class */
3046 DECLARE_EVENT_CLASS(xfs_double_io_class
,
3047 TP_PROTO(struct xfs_inode
*src
, xfs_off_t soffset
, xfs_off_t len
,
3048 struct xfs_inode
*dest
, xfs_off_t doffset
),
3049 TP_ARGS(src
, soffset
, len
, dest
, doffset
),
3052 __field(xfs_ino_t
, src_ino
)
3053 __field(loff_t
, src_isize
)
3054 __field(loff_t
, src_disize
)
3055 __field(loff_t
, src_offset
)
3056 __field(size_t, len
)
3057 __field(xfs_ino_t
, dest_ino
)
3058 __field(loff_t
, dest_isize
)
3059 __field(loff_t
, dest_disize
)
3060 __field(loff_t
, dest_offset
)
3063 __entry
->dev
= VFS_I(src
)->i_sb
->s_dev
;
3064 __entry
->src_ino
= src
->i_ino
;
3065 __entry
->src_isize
= VFS_I(src
)->i_size
;
3066 __entry
->src_disize
= src
->i_d
.di_size
;
3067 __entry
->src_offset
= soffset
;
3069 __entry
->dest_ino
= dest
->i_ino
;
3070 __entry
->dest_isize
= VFS_I(dest
)->i_size
;
3071 __entry
->dest_disize
= dest
->i_d
.di_size
;
3072 __entry
->dest_offset
= doffset
;
3074 TP_printk("dev %d:%d count %zd "
3075 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
3076 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
3077 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3081 __entry
->src_disize
,
3082 __entry
->src_offset
,
3084 __entry
->dest_isize
,
3085 __entry
->dest_disize
,
3086 __entry
->dest_offset
)
3089 #define DEFINE_DOUBLE_IO_EVENT(name) \
3090 DEFINE_EVENT(xfs_double_io_class, name, \
3091 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3092 struct xfs_inode *dest, xfs_off_t doffset), \
3093 TP_ARGS(src, soffset, len, dest, doffset))
3095 /* two-file vfs io tracepoint class */
3096 DECLARE_EVENT_CLASS(xfs_double_vfs_io_class
,
3097 TP_PROTO(struct inode
*src
, u64 soffset
, u64 len
,
3098 struct inode
*dest
, u64 doffset
),
3099 TP_ARGS(src
, soffset
, len
, dest
, doffset
),
3102 __field(unsigned long, src_ino
)
3103 __field(loff_t
, src_isize
)
3104 __field(loff_t
, src_offset
)
3105 __field(size_t, len
)
3106 __field(unsigned long, dest_ino
)
3107 __field(loff_t
, dest_isize
)
3108 __field(loff_t
, dest_offset
)
3111 __entry
->dev
= src
->i_sb
->s_dev
;
3112 __entry
->src_ino
= src
->i_ino
;
3113 __entry
->src_isize
= i_size_read(src
);
3114 __entry
->src_offset
= soffset
;
3116 __entry
->dest_ino
= dest
->i_ino
;
3117 __entry
->dest_isize
= i_size_read(dest
);
3118 __entry
->dest_offset
= doffset
;
3120 TP_printk("dev %d:%d count %zd "
3121 "ino 0x%lx isize 0x%llx offset 0x%llx -> "
3122 "ino 0x%lx isize 0x%llx offset 0x%llx",
3123 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3127 __entry
->src_offset
,
3129 __entry
->dest_isize
,
3130 __entry
->dest_offset
)
3133 #define DEFINE_DOUBLE_VFS_IO_EVENT(name) \
3134 DEFINE_EVENT(xfs_double_vfs_io_class, name, \
3135 TP_PROTO(struct inode *src, u64 soffset, u64 len, \
3136 struct inode *dest, u64 doffset), \
3137 TP_ARGS(src, soffset, len, dest, doffset))
3139 /* CoW write tracepoint */
3140 DECLARE_EVENT_CLASS(xfs_copy_on_write_class
,
3141 TP_PROTO(struct xfs_inode
*ip
, xfs_fileoff_t lblk
, xfs_fsblock_t pblk
,
3142 xfs_extlen_t len
, xfs_fsblock_t new_pblk
),
3143 TP_ARGS(ip
, lblk
, pblk
, len
, new_pblk
),
3146 __field(xfs_ino_t
, ino
)
3147 __field(xfs_fileoff_t
, lblk
)
3148 __field(xfs_fsblock_t
, pblk
)
3149 __field(xfs_extlen_t
, len
)
3150 __field(xfs_fsblock_t
, new_pblk
)
3153 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
3154 __entry
->ino
= ip
->i_ino
;
3155 __entry
->lblk
= lblk
;
3156 __entry
->pblk
= pblk
;
3158 __entry
->new_pblk
= new_pblk
;
3160 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx pblk 0x%llx "
3161 "len 0x%x new_pblk %llu",
3162 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3170 #define DEFINE_COW_EVENT(name) \
3171 DEFINE_EVENT(xfs_copy_on_write_class, name, \
3172 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, xfs_fsblock_t pblk, \
3173 xfs_extlen_t len, xfs_fsblock_t new_pblk), \
3174 TP_ARGS(ip, lblk, pblk, len, new_pblk))
3176 /* inode/irec events */
3177 DECLARE_EVENT_CLASS(xfs_inode_irec_class
,
3178 TP_PROTO(struct xfs_inode
*ip
, struct xfs_bmbt_irec
*irec
),
3182 __field(xfs_ino_t
, ino
)
3183 __field(xfs_fileoff_t
, lblk
)
3184 __field(xfs_extlen_t
, len
)
3185 __field(xfs_fsblock_t
, pblk
)
3188 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
3189 __entry
->ino
= ip
->i_ino
;
3190 __entry
->lblk
= irec
->br_startoff
;
3191 __entry
->len
= irec
->br_blockcount
;
3192 __entry
->pblk
= irec
->br_startblock
;
3194 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu",
3195 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3201 #define DEFINE_INODE_IREC_EVENT(name) \
3202 DEFINE_EVENT(xfs_inode_irec_class, name, \
3203 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3206 /* refcount/reflink tracepoint definitions */
3208 /* reflink tracepoints */
3209 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag
);
3210 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag
);
3211 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size
);
3212 DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap
);
3213 TRACE_EVENT(xfs_reflink_remap_blocks_loop
,
3214 TP_PROTO(struct xfs_inode
*src
, xfs_fileoff_t soffset
,
3215 xfs_filblks_t len
, struct xfs_inode
*dest
,
3216 xfs_fileoff_t doffset
),
3217 TP_ARGS(src
, soffset
, len
, dest
, doffset
),
3220 __field(xfs_ino_t
, src_ino
)
3221 __field(xfs_fileoff_t
, src_lblk
)
3222 __field(xfs_filblks_t
, len
)
3223 __field(xfs_ino_t
, dest_ino
)
3224 __field(xfs_fileoff_t
, dest_lblk
)
3227 __entry
->dev
= VFS_I(src
)->i_sb
->s_dev
;
3228 __entry
->src_ino
= src
->i_ino
;
3229 __entry
->src_lblk
= soffset
;
3231 __entry
->dest_ino
= dest
->i_ino
;
3232 __entry
->dest_lblk
= doffset
;
3234 TP_printk("dev %d:%d len 0x%llx "
3235 "ino 0x%llx offset 0x%llx blocks -> "
3236 "ino 0x%llx offset 0x%llx blocks",
3237 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3244 TRACE_EVENT(xfs_reflink_punch_range
,
3245 TP_PROTO(struct xfs_inode
*ip
, xfs_fileoff_t lblk
,
3247 TP_ARGS(ip
, lblk
, len
),
3250 __field(xfs_ino_t
, ino
)
3251 __field(xfs_fileoff_t
, lblk
)
3252 __field(xfs_extlen_t
, len
)
3255 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
3256 __entry
->ino
= ip
->i_ino
;
3257 __entry
->lblk
= lblk
;
3260 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x",
3261 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3266 TRACE_EVENT(xfs_reflink_remap
,
3267 TP_PROTO(struct xfs_inode
*ip
, xfs_fileoff_t lblk
,
3268 xfs_extlen_t len
, xfs_fsblock_t new_pblk
),
3269 TP_ARGS(ip
, lblk
, len
, new_pblk
),
3272 __field(xfs_ino_t
, ino
)
3273 __field(xfs_fileoff_t
, lblk
)
3274 __field(xfs_extlen_t
, len
)
3275 __field(xfs_fsblock_t
, new_pblk
)
3278 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
3279 __entry
->ino
= ip
->i_ino
;
3280 __entry
->lblk
= lblk
;
3282 __entry
->new_pblk
= new_pblk
;
3284 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu",
3285 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3291 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range
);
3292 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error
);
3293 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error
);
3294 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error
);
3295 DEFINE_INODE_ERROR_EVENT(xfs_reflink_reflink_main_loop_error
);
3296 DEFINE_INODE_ERROR_EVENT(xfs_reflink_read_iomap_error
);
3297 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error
);
3298 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error
);
3300 /* dedupe tracepoints */
3301 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents
);
3302 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error
);
3304 /* ioctl tracepoints */
3305 DEFINE_DOUBLE_VFS_IO_EVENT(xfs_ioctl_reflink
);
3306 DEFINE_DOUBLE_VFS_IO_EVENT(xfs_ioctl_clone_range
);
3307 DEFINE_DOUBLE_VFS_IO_EVENT(xfs_ioctl_file_extent_same
);
3308 TRACE_EVENT(xfs_ioctl_clone
,
3309 TP_PROTO(struct inode
*src
, struct inode
*dest
),
3313 __field(unsigned long, src_ino
)
3314 __field(loff_t
, src_isize
)
3315 __field(unsigned long, dest_ino
)
3316 __field(loff_t
, dest_isize
)
3319 __entry
->dev
= src
->i_sb
->s_dev
;
3320 __entry
->src_ino
= src
->i_ino
;
3321 __entry
->src_isize
= i_size_read(src
);
3322 __entry
->dest_ino
= dest
->i_ino
;
3323 __entry
->dest_isize
= i_size_read(dest
);
3325 TP_printk("dev %d:%d "
3326 "ino 0x%lx isize 0x%llx -> "
3327 "ino 0x%lx isize 0x%llx\n",
3328 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
3332 __entry
->dest_isize
)
3335 /* unshare tracepoints */
3336 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare
);
3337 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cow_eof_block
);
3338 DEFINE_PAGE_EVENT(xfs_reflink_unshare_page
);
3339 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error
);
3340 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cow_eof_block_error
);
3341 DEFINE_INODE_ERROR_EVENT(xfs_reflink_dirty_page_error
);
3344 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared
);
3345 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc
);
3346 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found
);
3347 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc
);
3349 DEFINE_RW_EVENT(xfs_reflink_reserve_cow_range
);
3350 DEFINE_RW_EVENT(xfs_reflink_allocate_cow_range
);
3352 DEFINE_INODE_IREC_EVENT(xfs_reflink_bounce_dio_write
);
3353 DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping
);
3354 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec
);
3356 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range
);
3357 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow
);
3358 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap
);
3359 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_piece
);
3361 DEFINE_INODE_ERROR_EVENT(xfs_reflink_reserve_cow_range_error
);
3362 DEFINE_INODE_ERROR_EVENT(xfs_reflink_allocate_cow_range_error
);
3363 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error
);
3364 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error
);
3366 DEFINE_COW_EVENT(xfs_reflink_fork_buf
);
3367 DEFINE_COW_EVENT(xfs_reflink_finish_fork_buf
);
3368 DEFINE_INODE_ERROR_EVENT(xfs_reflink_fork_buf_error
);
3369 DEFINE_INODE_ERROR_EVENT(xfs_reflink_finish_fork_buf_error
);
3371 DEFINE_INODE_EVENT(xfs_reflink_cancel_pending_cow
);
3372 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow
);
3373 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_pending_cow_error
);
3375 /* rmap swapext tracepoints */
3376 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap
);
3377 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece
);
3378 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error
);
3380 #endif /* _TRACE_XFS_H */
3382 #undef TRACE_INCLUDE_PATH
3383 #define TRACE_INCLUDE_PATH .
3384 #define TRACE_INCLUDE_FILE xfs_trace
3385 #include <trace/define_trace.h>