1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
7 #define TRACE_SYSTEM xfs_scrub
9 #if !defined(_TRACE_XFS_SCRUB_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
10 #define _TRACE_XFS_SCRUB_TRACE_H
12 #include <linux/tracepoint.h>
16 * ftrace's __print_symbolic requires that all enum values be wrapped in the
17 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
18 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
21 TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi
);
22 TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi
);
23 TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi
);
24 TRACE_DEFINE_ENUM(XFS_BTNUM_INOi
);
25 TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi
);
26 TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi
);
27 TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi
);
29 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PROBE
);
30 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SB
);
31 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGF
);
32 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGFL
);
33 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGI
);
34 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BNOBT
);
35 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_CNTBT
);
36 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INOBT
);
37 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FINOBT
);
38 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RMAPBT
);
39 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_REFCNTBT
);
40 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INODE
);
41 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTD
);
42 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTA
);
43 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTC
);
44 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_DIR
);
45 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_XATTR
);
46 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SYMLINK
);
47 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PARENT
);
48 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTBITMAP
);
49 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTSUM
);
50 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_UQUOTA
);
51 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_GQUOTA
);
52 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PQUOTA
);
53 TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FSCOUNTERS
);
55 #define XFS_SCRUB_TYPE_STRINGS \
56 { XFS_SCRUB_TYPE_PROBE, "probe" }, \
57 { XFS_SCRUB_TYPE_SB, "sb" }, \
58 { XFS_SCRUB_TYPE_AGF, "agf" }, \
59 { XFS_SCRUB_TYPE_AGFL, "agfl" }, \
60 { XFS_SCRUB_TYPE_AGI, "agi" }, \
61 { XFS_SCRUB_TYPE_BNOBT, "bnobt" }, \
62 { XFS_SCRUB_TYPE_CNTBT, "cntbt" }, \
63 { XFS_SCRUB_TYPE_INOBT, "inobt" }, \
64 { XFS_SCRUB_TYPE_FINOBT, "finobt" }, \
65 { XFS_SCRUB_TYPE_RMAPBT, "rmapbt" }, \
66 { XFS_SCRUB_TYPE_REFCNTBT, "refcountbt" }, \
67 { XFS_SCRUB_TYPE_INODE, "inode" }, \
68 { XFS_SCRUB_TYPE_BMBTD, "bmapbtd" }, \
69 { XFS_SCRUB_TYPE_BMBTA, "bmapbta" }, \
70 { XFS_SCRUB_TYPE_BMBTC, "bmapbtc" }, \
71 { XFS_SCRUB_TYPE_DIR, "directory" }, \
72 { XFS_SCRUB_TYPE_XATTR, "xattr" }, \
73 { XFS_SCRUB_TYPE_SYMLINK, "symlink" }, \
74 { XFS_SCRUB_TYPE_PARENT, "parent" }, \
75 { XFS_SCRUB_TYPE_RTBITMAP, "rtbitmap" }, \
76 { XFS_SCRUB_TYPE_RTSUM, "rtsummary" }, \
77 { XFS_SCRUB_TYPE_UQUOTA, "usrquota" }, \
78 { XFS_SCRUB_TYPE_GQUOTA, "grpquota" }, \
79 { XFS_SCRUB_TYPE_PQUOTA, "prjquota" }, \
80 { XFS_SCRUB_TYPE_FSCOUNTERS, "fscounters" }
82 DECLARE_EVENT_CLASS(xchk_class
,
83 TP_PROTO(struct xfs_inode
*ip
, struct xfs_scrub_metadata
*sm
,
85 TP_ARGS(ip
, sm
, error
),
88 __field(xfs_ino_t
, ino
)
89 __field(unsigned int, type
)
90 __field(xfs_agnumber_t
, agno
)
91 __field(xfs_ino_t
, inum
)
92 __field(unsigned int, gen
)
93 __field(unsigned int, flags
)
97 __entry
->dev
= ip
->i_mount
->m_super
->s_dev
;
98 __entry
->ino
= ip
->i_ino
;
99 __entry
->type
= sm
->sm_type
;
100 __entry
->agno
= sm
->sm_agno
;
101 __entry
->inum
= sm
->sm_ino
;
102 __entry
->gen
= sm
->sm_gen
;
103 __entry
->flags
= sm
->sm_flags
;
104 __entry
->error
= error
;
106 TP_printk("dev %d:%d ino 0x%llx type %s agno %u inum %llu gen %u flags 0x%x error %d",
107 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
109 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
116 #define DEFINE_SCRUB_EVENT(name) \
117 DEFINE_EVENT(xchk_class, name, \
118 TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, \
120 TP_ARGS(ip, sm, error))
122 DEFINE_SCRUB_EVENT(xchk_start
);
123 DEFINE_SCRUB_EVENT(xchk_done
);
124 DEFINE_SCRUB_EVENT(xchk_deadlock_retry
);
125 DEFINE_SCRUB_EVENT(xrep_attempt
);
126 DEFINE_SCRUB_EVENT(xrep_done
);
128 TRACE_EVENT(xchk_op_error
,
129 TP_PROTO(struct xfs_scrub
*sc
, xfs_agnumber_t agno
,
130 xfs_agblock_t bno
, int error
, void *ret_ip
),
131 TP_ARGS(sc
, agno
, bno
, error
, ret_ip
),
134 __field(unsigned int, type
)
135 __field(xfs_agnumber_t
, agno
)
136 __field(xfs_agblock_t
, bno
)
138 __field(void *, ret_ip
)
141 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
142 __entry
->type
= sc
->sm
->sm_type
;
143 __entry
->agno
= agno
;
145 __entry
->error
= error
;
146 __entry
->ret_ip
= ret_ip
;
148 TP_printk("dev %d:%d type %s agno %u agbno %u error %d ret_ip %pS",
149 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
150 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
157 TRACE_EVENT(xchk_file_op_error
,
158 TP_PROTO(struct xfs_scrub
*sc
, int whichfork
,
159 xfs_fileoff_t offset
, int error
, void *ret_ip
),
160 TP_ARGS(sc
, whichfork
, offset
, error
, ret_ip
),
163 __field(xfs_ino_t
, ino
)
164 __field(int, whichfork
)
165 __field(unsigned int, type
)
166 __field(xfs_fileoff_t
, offset
)
168 __field(void *, ret_ip
)
171 __entry
->dev
= sc
->ip
->i_mount
->m_super
->s_dev
;
172 __entry
->ino
= sc
->ip
->i_ino
;
173 __entry
->whichfork
= whichfork
;
174 __entry
->type
= sc
->sm
->sm_type
;
175 __entry
->offset
= offset
;
176 __entry
->error
= error
;
177 __entry
->ret_ip
= ret_ip
;
179 TP_printk("dev %d:%d ino 0x%llx fork %d type %s offset %llu error %d ret_ip %pS",
180 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
183 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
189 DECLARE_EVENT_CLASS(xchk_block_error_class
,
190 TP_PROTO(struct xfs_scrub
*sc
, xfs_daddr_t daddr
, void *ret_ip
),
191 TP_ARGS(sc
, daddr
, ret_ip
),
194 __field(unsigned int, type
)
195 __field(xfs_agnumber_t
, agno
)
196 __field(xfs_agblock_t
, bno
)
197 __field(void *, ret_ip
)
204 fsbno
= XFS_DADDR_TO_FSB(sc
->mp
, daddr
);
205 agno
= XFS_FSB_TO_AGNO(sc
->mp
, fsbno
);
206 bno
= XFS_FSB_TO_AGBNO(sc
->mp
, fsbno
);
208 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
209 __entry
->type
= sc
->sm
->sm_type
;
210 __entry
->agno
= agno
;
212 __entry
->ret_ip
= ret_ip
;
214 TP_printk("dev %d:%d type %s agno %u agbno %u ret_ip %pS",
215 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
216 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
222 #define DEFINE_SCRUB_BLOCK_ERROR_EVENT(name) \
223 DEFINE_EVENT(xchk_block_error_class, name, \
224 TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, \
226 TP_ARGS(sc, daddr, ret_ip))
228 DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_fs_error
);
229 DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_error
);
230 DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_preen
);
232 DECLARE_EVENT_CLASS(xchk_ino_error_class
,
233 TP_PROTO(struct xfs_scrub
*sc
, xfs_ino_t ino
, void *ret_ip
),
234 TP_ARGS(sc
, ino
, ret_ip
),
237 __field(xfs_ino_t
, ino
)
238 __field(unsigned int, type
)
239 __field(void *, ret_ip
)
242 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
244 __entry
->type
= sc
->sm
->sm_type
;
245 __entry
->ret_ip
= ret_ip
;
247 TP_printk("dev %d:%d ino 0x%llx type %s ret_ip %pS",
248 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
250 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
254 #define DEFINE_SCRUB_INO_ERROR_EVENT(name) \
255 DEFINE_EVENT(xchk_ino_error_class, name, \
256 TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, \
258 TP_ARGS(sc, ino, ret_ip))
260 DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_error
);
261 DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_preen
);
262 DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_warning
);
264 DECLARE_EVENT_CLASS(xchk_fblock_error_class
,
265 TP_PROTO(struct xfs_scrub
*sc
, int whichfork
,
266 xfs_fileoff_t offset
, void *ret_ip
),
267 TP_ARGS(sc
, whichfork
, offset
, ret_ip
),
270 __field(xfs_ino_t
, ino
)
271 __field(int, whichfork
)
272 __field(unsigned int, type
)
273 __field(xfs_fileoff_t
, offset
)
274 __field(void *, ret_ip
)
277 __entry
->dev
= sc
->ip
->i_mount
->m_super
->s_dev
;
278 __entry
->ino
= sc
->ip
->i_ino
;
279 __entry
->whichfork
= whichfork
;
280 __entry
->type
= sc
->sm
->sm_type
;
281 __entry
->offset
= offset
;
282 __entry
->ret_ip
= ret_ip
;
284 TP_printk("dev %d:%d ino 0x%llx fork %d type %s offset %llu ret_ip %pS",
285 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
288 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
293 #define DEFINE_SCRUB_FBLOCK_ERROR_EVENT(name) \
294 DEFINE_EVENT(xchk_fblock_error_class, name, \
295 TP_PROTO(struct xfs_scrub *sc, int whichfork, \
296 xfs_fileoff_t offset, void *ret_ip), \
297 TP_ARGS(sc, whichfork, offset, ret_ip))
299 DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_error
);
300 DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_warning
);
302 TRACE_EVENT(xchk_incomplete
,
303 TP_PROTO(struct xfs_scrub
*sc
, void *ret_ip
),
307 __field(unsigned int, type
)
308 __field(void *, ret_ip
)
311 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
312 __entry
->type
= sc
->sm
->sm_type
;
313 __entry
->ret_ip
= ret_ip
;
315 TP_printk("dev %d:%d type %s ret_ip %pS",
316 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
317 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
321 TRACE_EVENT(xchk_btree_op_error
,
322 TP_PROTO(struct xfs_scrub
*sc
, struct xfs_btree_cur
*cur
,
323 int level
, int error
, void *ret_ip
),
324 TP_ARGS(sc
, cur
, level
, error
, ret_ip
),
327 __field(unsigned int, type
)
328 __field(xfs_btnum_t
, btnum
)
330 __field(xfs_agnumber_t
, agno
)
331 __field(xfs_agblock_t
, bno
)
334 __field(void *, ret_ip
)
337 xfs_fsblock_t fsbno
= xchk_btree_cur_fsbno(cur
, level
);
339 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
340 __entry
->type
= sc
->sm
->sm_type
;
341 __entry
->btnum
= cur
->bc_btnum
;
342 __entry
->level
= level
;
343 __entry
->agno
= XFS_FSB_TO_AGNO(cur
->bc_mp
, fsbno
);
344 __entry
->bno
= XFS_FSB_TO_AGBNO(cur
->bc_mp
, fsbno
);
345 __entry
->ptr
= cur
->bc_ptrs
[level
];
346 __entry
->error
= error
;
347 __entry
->ret_ip
= ret_ip
;
349 TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
350 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
351 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
352 __print_symbolic(__entry
->btnum
, XFS_BTNUM_STRINGS
),
361 TRACE_EVENT(xchk_ifork_btree_op_error
,
362 TP_PROTO(struct xfs_scrub
*sc
, struct xfs_btree_cur
*cur
,
363 int level
, int error
, void *ret_ip
),
364 TP_ARGS(sc
, cur
, level
, error
, ret_ip
),
367 __field(xfs_ino_t
, ino
)
368 __field(int, whichfork
)
369 __field(unsigned int, type
)
370 __field(xfs_btnum_t
, btnum
)
373 __field(xfs_agnumber_t
, agno
)
374 __field(xfs_agblock_t
, bno
)
376 __field(void *, ret_ip
)
379 xfs_fsblock_t fsbno
= xchk_btree_cur_fsbno(cur
, level
);
380 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
381 __entry
->ino
= sc
->ip
->i_ino
;
382 __entry
->whichfork
= cur
->bc_private
.b
.whichfork
;
383 __entry
->type
= sc
->sm
->sm_type
;
384 __entry
->btnum
= cur
->bc_btnum
;
385 __entry
->level
= level
;
386 __entry
->ptr
= cur
->bc_ptrs
[level
];
387 __entry
->agno
= XFS_FSB_TO_AGNO(cur
->bc_mp
, fsbno
);
388 __entry
->bno
= XFS_FSB_TO_AGBNO(cur
->bc_mp
, fsbno
);
389 __entry
->error
= error
;
390 __entry
->ret_ip
= ret_ip
;
392 TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
393 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
396 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
397 __print_symbolic(__entry
->btnum
, XFS_BTNUM_STRINGS
),
406 TRACE_EVENT(xchk_btree_error
,
407 TP_PROTO(struct xfs_scrub
*sc
, struct xfs_btree_cur
*cur
,
408 int level
, void *ret_ip
),
409 TP_ARGS(sc
, cur
, level
, ret_ip
),
412 __field(unsigned int, type
)
413 __field(xfs_btnum_t
, btnum
)
415 __field(xfs_agnumber_t
, agno
)
416 __field(xfs_agblock_t
, bno
)
418 __field(void *, ret_ip
)
421 xfs_fsblock_t fsbno
= xchk_btree_cur_fsbno(cur
, level
);
422 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
423 __entry
->type
= sc
->sm
->sm_type
;
424 __entry
->btnum
= cur
->bc_btnum
;
425 __entry
->level
= level
;
426 __entry
->agno
= XFS_FSB_TO_AGNO(cur
->bc_mp
, fsbno
);
427 __entry
->bno
= XFS_FSB_TO_AGBNO(cur
->bc_mp
, fsbno
);
428 __entry
->ptr
= cur
->bc_ptrs
[level
];
429 __entry
->ret_ip
= ret_ip
;
431 TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
432 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
433 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
434 __print_symbolic(__entry
->btnum
, XFS_BTNUM_STRINGS
),
442 TRACE_EVENT(xchk_ifork_btree_error
,
443 TP_PROTO(struct xfs_scrub
*sc
, struct xfs_btree_cur
*cur
,
444 int level
, void *ret_ip
),
445 TP_ARGS(sc
, cur
, level
, ret_ip
),
448 __field(xfs_ino_t
, ino
)
449 __field(int, whichfork
)
450 __field(unsigned int, type
)
451 __field(xfs_btnum_t
, btnum
)
453 __field(xfs_agnumber_t
, agno
)
454 __field(xfs_agblock_t
, bno
)
456 __field(void *, ret_ip
)
459 xfs_fsblock_t fsbno
= xchk_btree_cur_fsbno(cur
, level
);
460 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
461 __entry
->ino
= sc
->ip
->i_ino
;
462 __entry
->whichfork
= cur
->bc_private
.b
.whichfork
;
463 __entry
->type
= sc
->sm
->sm_type
;
464 __entry
->btnum
= cur
->bc_btnum
;
465 __entry
->level
= level
;
466 __entry
->agno
= XFS_FSB_TO_AGNO(cur
->bc_mp
, fsbno
);
467 __entry
->bno
= XFS_FSB_TO_AGBNO(cur
->bc_mp
, fsbno
);
468 __entry
->ptr
= cur
->bc_ptrs
[level
];
469 __entry
->ret_ip
= ret_ip
;
471 TP_printk("dev %d:%d ino 0x%llx fork %d type %s btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
472 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
475 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
476 __print_symbolic(__entry
->btnum
, XFS_BTNUM_STRINGS
),
484 DECLARE_EVENT_CLASS(xchk_sbtree_class
,
485 TP_PROTO(struct xfs_scrub
*sc
, struct xfs_btree_cur
*cur
,
487 TP_ARGS(sc
, cur
, level
),
491 __field(xfs_btnum_t
, btnum
)
492 __field(xfs_agnumber_t
, agno
)
493 __field(xfs_agblock_t
, bno
)
495 __field(int, nlevels
)
499 xfs_fsblock_t fsbno
= xchk_btree_cur_fsbno(cur
, level
);
501 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
502 __entry
->type
= sc
->sm
->sm_type
;
503 __entry
->btnum
= cur
->bc_btnum
;
504 __entry
->agno
= XFS_FSB_TO_AGNO(cur
->bc_mp
, fsbno
);
505 __entry
->bno
= XFS_FSB_TO_AGBNO(cur
->bc_mp
, fsbno
);
506 __entry
->level
= level
;
507 __entry
->nlevels
= cur
->bc_nlevels
;
508 __entry
->ptr
= cur
->bc_ptrs
[level
];
510 TP_printk("dev %d:%d type %s btree %s agno %u agbno %u level %d nlevels %d ptr %d",
511 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
512 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
513 __print_symbolic(__entry
->btnum
, XFS_BTNUM_STRINGS
),
520 #define DEFINE_SCRUB_SBTREE_EVENT(name) \
521 DEFINE_EVENT(xchk_sbtree_class, name, \
522 TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur, \
524 TP_ARGS(sc, cur, level))
526 DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_rec
);
527 DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_key
);
529 TRACE_EVENT(xchk_xref_error
,
530 TP_PROTO(struct xfs_scrub
*sc
, int error
, void *ret_ip
),
531 TP_ARGS(sc
, error
, ret_ip
),
536 __field(void *, ret_ip
)
539 __entry
->dev
= sc
->mp
->m_super
->s_dev
;
540 __entry
->type
= sc
->sm
->sm_type
;
541 __entry
->error
= error
;
542 __entry
->ret_ip
= ret_ip
;
544 TP_printk("dev %d:%d type %s xref error %d ret_ip %pS",
545 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
546 __print_symbolic(__entry
->type
, XFS_SCRUB_TYPE_STRINGS
),
551 TRACE_EVENT(xchk_iallocbt_check_cluster
,
552 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
553 xfs_agino_t startino
, xfs_daddr_t map_daddr
,
554 unsigned short map_len
, unsigned int chunk_ino
,
555 unsigned int nr_inodes
, uint16_t cluster_mask
,
556 uint16_t holemask
, unsigned int cluster_ino
),
557 TP_ARGS(mp
, agno
, startino
, map_daddr
, map_len
, chunk_ino
, nr_inodes
,
558 cluster_mask
, holemask
, cluster_ino
),
561 __field(xfs_agnumber_t
, agno
)
562 __field(xfs_agino_t
, startino
)
563 __field(xfs_daddr_t
, map_daddr
)
564 __field(unsigned short, map_len
)
565 __field(unsigned int, chunk_ino
)
566 __field(unsigned int, nr_inodes
)
567 __field(unsigned int, cluster_ino
)
568 __field(uint16_t, cluster_mask
)
569 __field(uint16_t, holemask
)
572 __entry
->dev
= mp
->m_super
->s_dev
;
573 __entry
->agno
= agno
;
574 __entry
->startino
= startino
;
575 __entry
->map_daddr
= map_daddr
;
576 __entry
->map_len
= map_len
;
577 __entry
->chunk_ino
= chunk_ino
;
578 __entry
->nr_inodes
= nr_inodes
;
579 __entry
->cluster_mask
= cluster_mask
;
580 __entry
->holemask
= holemask
;
581 __entry
->cluster_ino
= cluster_ino
;
583 TP_printk("dev %d:%d agno %d startino %u daddr 0x%llx len %d chunkino %u nr_inodes %u cluster_mask 0x%x holemask 0x%x cluster_ino %u",
584 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
591 __entry
->cluster_mask
,
593 __entry
->cluster_ino
)
596 TRACE_EVENT(xchk_fscounters_calc
,
597 TP_PROTO(struct xfs_mount
*mp
, uint64_t icount
, uint64_t ifree
,
598 uint64_t fdblocks
, uint64_t delalloc
),
599 TP_ARGS(mp
, icount
, ifree
, fdblocks
, delalloc
),
602 __field(int64_t, icount_sb
)
603 __field(uint64_t, icount_calculated
)
604 __field(int64_t, ifree_sb
)
605 __field(uint64_t, ifree_calculated
)
606 __field(int64_t, fdblocks_sb
)
607 __field(uint64_t, fdblocks_calculated
)
608 __field(uint64_t, delalloc
)
611 __entry
->dev
= mp
->m_super
->s_dev
;
612 __entry
->icount_sb
= mp
->m_sb
.sb_icount
;
613 __entry
->icount_calculated
= icount
;
614 __entry
->ifree_sb
= mp
->m_sb
.sb_ifree
;
615 __entry
->ifree_calculated
= ifree
;
616 __entry
->fdblocks_sb
= mp
->m_sb
.sb_fdblocks
;
617 __entry
->fdblocks_calculated
= fdblocks
;
618 __entry
->delalloc
= delalloc
;
620 TP_printk("dev %d:%d icount %lld:%llu ifree %lld::%llu fdblocks %lld::%llu delalloc %llu",
621 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
623 __entry
->icount_calculated
,
625 __entry
->ifree_calculated
,
626 __entry
->fdblocks_sb
,
627 __entry
->fdblocks_calculated
,
631 TRACE_EVENT(xchk_fscounters_within_range
,
632 TP_PROTO(struct xfs_mount
*mp
, uint64_t expected
, int64_t curr_value
,
634 TP_ARGS(mp
, expected
, curr_value
, old_value
),
637 __field(uint64_t, expected
)
638 __field(int64_t, curr_value
)
639 __field(int64_t, old_value
)
642 __entry
->dev
= mp
->m_super
->s_dev
;
643 __entry
->expected
= expected
;
644 __entry
->curr_value
= curr_value
;
645 __entry
->old_value
= old_value
;
647 TP_printk("dev %d:%d expected %llu curr_value %lld old_value %lld",
648 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
654 /* repair tracepoints */
655 #if IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR)
657 DECLARE_EVENT_CLASS(xrep_extent_class
,
658 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
659 xfs_agblock_t agbno
, xfs_extlen_t len
),
660 TP_ARGS(mp
, agno
, agbno
, len
),
663 __field(xfs_agnumber_t
, agno
)
664 __field(xfs_agblock_t
, agbno
)
665 __field(xfs_extlen_t
, len
)
668 __entry
->dev
= mp
->m_super
->s_dev
;
669 __entry
->agno
= agno
;
670 __entry
->agbno
= agbno
;
673 TP_printk("dev %d:%d agno %u agbno %u len %u",
674 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
679 #define DEFINE_REPAIR_EXTENT_EVENT(name) \
680 DEFINE_EVENT(xrep_extent_class, name, \
681 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
682 xfs_agblock_t agbno, xfs_extlen_t len), \
683 TP_ARGS(mp, agno, agbno, len))
684 DEFINE_REPAIR_EXTENT_EVENT(xrep_dispose_btree_extent
);
685 DEFINE_REPAIR_EXTENT_EVENT(xrep_agfl_insert
);
687 DECLARE_EVENT_CLASS(xrep_rmap_class
,
688 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
689 xfs_agblock_t agbno
, xfs_extlen_t len
,
690 uint64_t owner
, uint64_t offset
, unsigned int flags
),
691 TP_ARGS(mp
, agno
, agbno
, len
, owner
, offset
, flags
),
694 __field(xfs_agnumber_t
, agno
)
695 __field(xfs_agblock_t
, agbno
)
696 __field(xfs_extlen_t
, len
)
697 __field(uint64_t, owner
)
698 __field(uint64_t, offset
)
699 __field(unsigned int, flags
)
702 __entry
->dev
= mp
->m_super
->s_dev
;
703 __entry
->agno
= agno
;
704 __entry
->agbno
= agbno
;
706 __entry
->owner
= owner
;
707 __entry
->offset
= offset
;
708 __entry
->flags
= flags
;
710 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
711 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
719 #define DEFINE_REPAIR_RMAP_EVENT(name) \
720 DEFINE_EVENT(xrep_rmap_class, name, \
721 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
722 xfs_agblock_t agbno, xfs_extlen_t len, \
723 uint64_t owner, uint64_t offset, unsigned int flags), \
724 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
725 DEFINE_REPAIR_RMAP_EVENT(xrep_alloc_extent_fn
);
726 DEFINE_REPAIR_RMAP_EVENT(xrep_ialloc_extent_fn
);
727 DEFINE_REPAIR_RMAP_EVENT(xrep_rmap_extent_fn
);
728 DEFINE_REPAIR_RMAP_EVENT(xrep_bmap_extent_fn
);
730 TRACE_EVENT(xrep_refcount_extent_fn
,
731 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
732 struct xfs_refcount_irec
*irec
),
733 TP_ARGS(mp
, agno
, irec
),
736 __field(xfs_agnumber_t
, agno
)
737 __field(xfs_agblock_t
, startblock
)
738 __field(xfs_extlen_t
, blockcount
)
739 __field(xfs_nlink_t
, refcount
)
742 __entry
->dev
= mp
->m_super
->s_dev
;
743 __entry
->agno
= agno
;
744 __entry
->startblock
= irec
->rc_startblock
;
745 __entry
->blockcount
= irec
->rc_blockcount
;
746 __entry
->refcount
= irec
->rc_refcount
;
748 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u",
749 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
756 TRACE_EVENT(xrep_init_btblock
,
757 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agblock_t agbno
,
759 TP_ARGS(mp
, agno
, agbno
, btnum
),
762 __field(xfs_agnumber_t
, agno
)
763 __field(xfs_agblock_t
, agbno
)
764 __field(uint32_t, btnum
)
767 __entry
->dev
= mp
->m_super
->s_dev
;
768 __entry
->agno
= agno
;
769 __entry
->agbno
= agbno
;
770 __entry
->btnum
= btnum
;
772 TP_printk("dev %d:%d agno %u agbno %u btree %s",
773 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
776 __print_symbolic(__entry
->btnum
, XFS_BTNUM_STRINGS
))
778 TRACE_EVENT(xrep_findroot_block
,
779 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agblock_t agbno
,
780 uint32_t magic
, uint16_t level
),
781 TP_ARGS(mp
, agno
, agbno
, magic
, level
),
784 __field(xfs_agnumber_t
, agno
)
785 __field(xfs_agblock_t
, agbno
)
786 __field(uint32_t, magic
)
787 __field(uint16_t, level
)
790 __entry
->dev
= mp
->m_super
->s_dev
;
791 __entry
->agno
= agno
;
792 __entry
->agbno
= agbno
;
793 __entry
->magic
= magic
;
794 __entry
->level
= level
;
796 TP_printk("dev %d:%d agno %u agbno %u magic 0x%x level %u",
797 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
803 TRACE_EVENT(xrep_calc_ag_resblks
,
804 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
805 xfs_agino_t icount
, xfs_agblock_t aglen
, xfs_agblock_t freelen
,
806 xfs_agblock_t usedlen
),
807 TP_ARGS(mp
, agno
, icount
, aglen
, freelen
, usedlen
),
810 __field(xfs_agnumber_t
, agno
)
811 __field(xfs_agino_t
, icount
)
812 __field(xfs_agblock_t
, aglen
)
813 __field(xfs_agblock_t
, freelen
)
814 __field(xfs_agblock_t
, usedlen
)
817 __entry
->dev
= mp
->m_super
->s_dev
;
818 __entry
->agno
= agno
;
819 __entry
->icount
= icount
;
820 __entry
->aglen
= aglen
;
821 __entry
->freelen
= freelen
;
822 __entry
->usedlen
= usedlen
;
824 TP_printk("dev %d:%d agno %d icount %u aglen %u freelen %u usedlen %u",
825 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
832 TRACE_EVENT(xrep_calc_ag_resblks_btsize
,
833 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
834 xfs_agblock_t bnobt_sz
, xfs_agblock_t inobt_sz
,
835 xfs_agblock_t rmapbt_sz
, xfs_agblock_t refcbt_sz
),
836 TP_ARGS(mp
, agno
, bnobt_sz
, inobt_sz
, rmapbt_sz
, refcbt_sz
),
839 __field(xfs_agnumber_t
, agno
)
840 __field(xfs_agblock_t
, bnobt_sz
)
841 __field(xfs_agblock_t
, inobt_sz
)
842 __field(xfs_agblock_t
, rmapbt_sz
)
843 __field(xfs_agblock_t
, refcbt_sz
)
846 __entry
->dev
= mp
->m_super
->s_dev
;
847 __entry
->agno
= agno
;
848 __entry
->bnobt_sz
= bnobt_sz
;
849 __entry
->inobt_sz
= inobt_sz
;
850 __entry
->rmapbt_sz
= rmapbt_sz
;
851 __entry
->refcbt_sz
= refcbt_sz
;
853 TP_printk("dev %d:%d agno %d bno %u ino %u rmap %u refcount %u",
854 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
861 TRACE_EVENT(xrep_reset_counters
,
862 TP_PROTO(struct xfs_mount
*mp
),
868 __entry
->dev
= mp
->m_super
->s_dev
;
870 TP_printk("dev %d:%d",
871 MAJOR(__entry
->dev
), MINOR(__entry
->dev
))
874 TRACE_EVENT(xrep_ialloc_insert
,
875 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
876 xfs_agino_t startino
, uint16_t holemask
, uint8_t count
,
877 uint8_t freecount
, uint64_t freemask
),
878 TP_ARGS(mp
, agno
, startino
, holemask
, count
, freecount
, freemask
),
881 __field(xfs_agnumber_t
, agno
)
882 __field(xfs_agino_t
, startino
)
883 __field(uint16_t, holemask
)
884 __field(uint8_t, count
)
885 __field(uint8_t, freecount
)
886 __field(uint64_t, freemask
)
889 __entry
->dev
= mp
->m_super
->s_dev
;
890 __entry
->agno
= agno
;
891 __entry
->startino
= startino
;
892 __entry
->holemask
= holemask
;
893 __entry
->count
= count
;
894 __entry
->freecount
= freecount
;
895 __entry
->freemask
= freemask
;
897 TP_printk("dev %d:%d agno %d startino %u holemask 0x%x count %u freecount %u freemask 0x%llx",
898 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
907 #endif /* IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR) */
909 #endif /* _TRACE_XFS_SCRUB_TRACE_H */
911 #undef TRACE_INCLUDE_PATH
912 #define TRACE_INCLUDE_PATH .
913 #define TRACE_INCLUDE_FILE scrub/trace
914 #include <trace/define_trace.h>