blob: 3362bae28b46bfa53262dbd51d9421670a9146ac [file] [log] [blame]
Dave Chinner0b61f8a2018-06-05 19:42:14 -07001// SPDX-License-Identifier: GPL-2.0+
Darrick J. Wong36fd6e82017-10-17 21:37:34 -07002/*
3 * Copyright (C) 2017 Oracle. All Rights Reserved.
Darrick J. Wong36fd6e82017-10-17 21:37:34 -07004 * Author: Darrick J. Wong <darrick.wong@oracle.com>
Darrick J. Wong36fd6e82017-10-17 21:37:34 -07005 */
6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM xfs_scrub
8
9#if !defined(_TRACE_XFS_SCRUB_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
10#define _TRACE_XFS_SCRUB_TRACE_H
11
12#include <linux/tracepoint.h>
Darrick J. Wong4700d222017-10-17 21:37:36 -070013#include "xfs_bit.h"
Darrick J. Wong36fd6e82017-10-17 21:37:34 -070014
Darrick J. Wongc4942132018-12-18 14:32:31 -080015/*
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
19 * code.
20 */
21TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
22TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
23TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
24TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
25TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
26TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
27TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
28
Darrick J. Wong86d163d2018-12-18 14:32:31 -080029TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PROBE);
30TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SB);
31TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGF);
32TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGFL);
33TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGI);
34TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BNOBT);
35TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_CNTBT);
36TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INOBT);
37TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FINOBT);
38TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RMAPBT);
39TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_REFCNTBT);
40TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INODE);
41TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTD);
42TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTA);
43TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTC);
44TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_DIR);
45TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_XATTR);
46TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SYMLINK);
47TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PARENT);
48TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTBITMAP);
49TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTSUM);
50TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_UQUOTA);
51TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_GQUOTA);
52TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PQUOTA);
Darrick J. Wong75efa572019-04-25 18:26:24 -070053TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FSCOUNTERS);
Darrick J. Wong86d163d2018-12-18 14:32:31 -080054
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" }, \
Darrick J. Wong75efa572019-04-25 18:26:24 -070079 { XFS_SCRUB_TYPE_PQUOTA, "prjquota" }, \
80 { XFS_SCRUB_TYPE_FSCOUNTERS, "fscounters" }
Darrick J. Wong86d163d2018-12-18 14:32:31 -080081
Darrick J. Wongc517b3a2018-07-19 12:29:11 -070082DECLARE_EVENT_CLASS(xchk_class,
Darrick J. Wonga5637182017-10-17 21:37:35 -070083 TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
84 int error),
85 TP_ARGS(ip, sm, error),
86 TP_STRUCT__entry(
87 __field(dev_t, dev)
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)
94 __field(int, error)
95 ),
96 TP_fast_assign(
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;
105 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800106 TP_printk("dev %d:%d ino 0x%llx type %s agno %u inum %llu gen %u flags 0x%x error %d",
Darrick J. Wonga5637182017-10-17 21:37:35 -0700107 MAJOR(__entry->dev), MINOR(__entry->dev),
108 __entry->ino,
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800109 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wonga5637182017-10-17 21:37:35 -0700110 __entry->agno,
111 __entry->inum,
112 __entry->gen,
113 __entry->flags,
114 __entry->error)
115)
116#define DEFINE_SCRUB_EVENT(name) \
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700117DEFINE_EVENT(xchk_class, name, \
Darrick J. Wonga5637182017-10-17 21:37:35 -0700118 TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, \
119 int error), \
120 TP_ARGS(ip, sm, error))
121
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700122DEFINE_SCRUB_EVENT(xchk_start);
123DEFINE_SCRUB_EVENT(xchk_done);
124DEFINE_SCRUB_EVENT(xchk_deadlock_retry);
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700125DEFINE_SCRUB_EVENT(xrep_attempt);
126DEFINE_SCRUB_EVENT(xrep_done);
Darrick J. Wong4700d222017-10-17 21:37:36 -0700127
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700128TRACE_EVENT(xchk_op_error,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700129 TP_PROTO(struct xfs_scrub *sc, xfs_agnumber_t agno,
Darrick J. Wong4700d222017-10-17 21:37:36 -0700130 xfs_agblock_t bno, int error, void *ret_ip),
131 TP_ARGS(sc, agno, bno, error, ret_ip),
132 TP_STRUCT__entry(
133 __field(dev_t, dev)
134 __field(unsigned int, type)
135 __field(xfs_agnumber_t, agno)
136 __field(xfs_agblock_t, bno)
137 __field(int, error)
138 __field(void *, ret_ip)
139 ),
140 TP_fast_assign(
141 __entry->dev = sc->mp->m_super->s_dev;
142 __entry->type = sc->sm->sm_type;
143 __entry->agno = agno;
144 __entry->bno = bno;
145 __entry->error = error;
146 __entry->ret_ip = ret_ip;
147 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800148 TP_printk("dev %d:%d type %s agno %u agbno %u error %d ret_ip %pS",
Darrick J. Wong4700d222017-10-17 21:37:36 -0700149 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800150 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wong4700d222017-10-17 21:37:36 -0700151 __entry->agno,
152 __entry->bno,
153 __entry->error,
154 __entry->ret_ip)
155);
156
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700157TRACE_EVENT(xchk_file_op_error,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700158 TP_PROTO(struct xfs_scrub *sc, int whichfork,
Darrick J. Wong4700d222017-10-17 21:37:36 -0700159 xfs_fileoff_t offset, int error, void *ret_ip),
160 TP_ARGS(sc, whichfork, offset, error, ret_ip),
161 TP_STRUCT__entry(
162 __field(dev_t, dev)
163 __field(xfs_ino_t, ino)
164 __field(int, whichfork)
165 __field(unsigned int, type)
166 __field(xfs_fileoff_t, offset)
167 __field(int, error)
168 __field(void *, ret_ip)
169 ),
170 TP_fast_assign(
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;
178 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800179 TP_printk("dev %d:%d ino 0x%llx fork %d type %s offset %llu error %d ret_ip %pS",
Darrick J. Wong4700d222017-10-17 21:37:36 -0700180 MAJOR(__entry->dev), MINOR(__entry->dev),
181 __entry->ino,
182 __entry->whichfork,
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800183 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wong4700d222017-10-17 21:37:36 -0700184 __entry->offset,
185 __entry->error,
186 __entry->ret_ip)
187);
188
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700189DECLARE_EVENT_CLASS(xchk_block_error_class,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700190 TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, void *ret_ip),
Darrick J. Wong4700d222017-10-17 21:37:36 -0700191 TP_ARGS(sc, daddr, ret_ip),
192 TP_STRUCT__entry(
193 __field(dev_t, dev)
194 __field(unsigned int, type)
195 __field(xfs_agnumber_t, agno)
196 __field(xfs_agblock_t, bno)
197 __field(void *, ret_ip)
198 ),
199 TP_fast_assign(
200 xfs_fsblock_t fsbno;
201 xfs_agnumber_t agno;
202 xfs_agblock_t bno;
203
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);
207
208 __entry->dev = sc->mp->m_super->s_dev;
209 __entry->type = sc->sm->sm_type;
210 __entry->agno = agno;
211 __entry->bno = bno;
212 __entry->ret_ip = ret_ip;
213 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800214 TP_printk("dev %d:%d type %s agno %u agbno %u ret_ip %pS",
Darrick J. Wong4700d222017-10-17 21:37:36 -0700215 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800216 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wong4700d222017-10-17 21:37:36 -0700217 __entry->agno,
218 __entry->bno,
219 __entry->ret_ip)
220)
221
222#define DEFINE_SCRUB_BLOCK_ERROR_EVENT(name) \
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700223DEFINE_EVENT(xchk_block_error_class, name, \
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700224 TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, \
Darrick J. Wong4700d222017-10-17 21:37:36 -0700225 void *ret_ip), \
226 TP_ARGS(sc, daddr, ret_ip))
227
Darrick J. Wong75efa572019-04-25 18:26:24 -0700228DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_fs_error);
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700229DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_error);
230DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_preen);
Darrick J. Wong4700d222017-10-17 21:37:36 -0700231
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700232DECLARE_EVENT_CLASS(xchk_ino_error_class,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700233 TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, void *ret_ip),
Darrick J. Wong7e56d9e2018-03-23 10:06:54 -0700234 TP_ARGS(sc, ino, ret_ip),
Darrick J. Wong4700d222017-10-17 21:37:36 -0700235 TP_STRUCT__entry(
236 __field(dev_t, dev)
237 __field(xfs_ino_t, ino)
238 __field(unsigned int, type)
Darrick J. Wong4700d222017-10-17 21:37:36 -0700239 __field(void *, ret_ip)
240 ),
241 TP_fast_assign(
Darrick J. Wong4700d222017-10-17 21:37:36 -0700242 __entry->dev = sc->mp->m_super->s_dev;
243 __entry->ino = ino;
244 __entry->type = sc->sm->sm_type;
Darrick J. Wong4700d222017-10-17 21:37:36 -0700245 __entry->ret_ip = ret_ip;
246 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800247 TP_printk("dev %d:%d ino 0x%llx type %s ret_ip %pS",
Darrick J. Wong4700d222017-10-17 21:37:36 -0700248 MAJOR(__entry->dev), MINOR(__entry->dev),
249 __entry->ino,
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800250 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wong4700d222017-10-17 21:37:36 -0700251 __entry->ret_ip)
252)
253
254#define DEFINE_SCRUB_INO_ERROR_EVENT(name) \
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700255DEFINE_EVENT(xchk_ino_error_class, name, \
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700256 TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, \
Darrick J. Wong7e56d9e2018-03-23 10:06:54 -0700257 void *ret_ip), \
258 TP_ARGS(sc, ino, ret_ip))
Darrick J. Wong4700d222017-10-17 21:37:36 -0700259
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700260DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_error);
261DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_preen);
262DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_warning);
Darrick J. Wong4700d222017-10-17 21:37:36 -0700263
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700264DECLARE_EVENT_CLASS(xchk_fblock_error_class,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700265 TP_PROTO(struct xfs_scrub *sc, int whichfork,
Darrick J. Wong4700d222017-10-17 21:37:36 -0700266 xfs_fileoff_t offset, void *ret_ip),
267 TP_ARGS(sc, whichfork, offset, ret_ip),
268 TP_STRUCT__entry(
269 __field(dev_t, dev)
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)
275 ),
276 TP_fast_assign(
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;
283 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800284 TP_printk("dev %d:%d ino 0x%llx fork %d type %s offset %llu ret_ip %pS",
Darrick J. Wong4700d222017-10-17 21:37:36 -0700285 MAJOR(__entry->dev), MINOR(__entry->dev),
286 __entry->ino,
287 __entry->whichfork,
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800288 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wong4700d222017-10-17 21:37:36 -0700289 __entry->offset,
290 __entry->ret_ip)
291);
292
293#define DEFINE_SCRUB_FBLOCK_ERROR_EVENT(name) \
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700294DEFINE_EVENT(xchk_fblock_error_class, name, \
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700295 TP_PROTO(struct xfs_scrub *sc, int whichfork, \
Darrick J. Wong4700d222017-10-17 21:37:36 -0700296 xfs_fileoff_t offset, void *ret_ip), \
297 TP_ARGS(sc, whichfork, offset, ret_ip))
298
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700299DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_error);
300DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_warning);
Darrick J. Wong4700d222017-10-17 21:37:36 -0700301
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700302TRACE_EVENT(xchk_incomplete,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700303 TP_PROTO(struct xfs_scrub *sc, void *ret_ip),
Darrick J. Wong4700d222017-10-17 21:37:36 -0700304 TP_ARGS(sc, ret_ip),
305 TP_STRUCT__entry(
306 __field(dev_t, dev)
307 __field(unsigned int, type)
308 __field(void *, ret_ip)
309 ),
310 TP_fast_assign(
311 __entry->dev = sc->mp->m_super->s_dev;
312 __entry->type = sc->sm->sm_type;
313 __entry->ret_ip = ret_ip;
314 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800315 TP_printk("dev %d:%d type %s ret_ip %pS",
Darrick J. Wong4700d222017-10-17 21:37:36 -0700316 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800317 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wong4700d222017-10-17 21:37:36 -0700318 __entry->ret_ip)
319);
Darrick J. Wonga5637182017-10-17 21:37:35 -0700320
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700321TRACE_EVENT(xchk_btree_op_error,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700322 TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700323 int level, int error, void *ret_ip),
324 TP_ARGS(sc, cur, level, error, ret_ip),
325 TP_STRUCT__entry(
326 __field(dev_t, dev)
327 __field(unsigned int, type)
328 __field(xfs_btnum_t, btnum)
329 __field(int, level)
330 __field(xfs_agnumber_t, agno)
331 __field(xfs_agblock_t, bno)
332 __field(int, ptr);
333 __field(int, error)
334 __field(void *, ret_ip)
335 ),
336 TP_fast_assign(
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700337 xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700338
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;
348 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800349 TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno %u agbno %u error %d ret_ip %pS",
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700350 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800351 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wongc4942132018-12-18 14:32:31 -0800352 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700353 __entry->level,
354 __entry->ptr,
355 __entry->agno,
356 __entry->bno,
357 __entry->error,
358 __entry->ret_ip)
359);
360
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700361TRACE_EVENT(xchk_ifork_btree_op_error,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700362 TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700363 int level, int error, void *ret_ip),
364 TP_ARGS(sc, cur, level, error, ret_ip),
365 TP_STRUCT__entry(
366 __field(dev_t, dev)
367 __field(xfs_ino_t, ino)
368 __field(int, whichfork)
369 __field(unsigned int, type)
370 __field(xfs_btnum_t, btnum)
371 __field(int, level)
372 __field(int, ptr)
373 __field(xfs_agnumber_t, agno)
374 __field(xfs_agblock_t, bno)
375 __field(int, error)
376 __field(void *, ret_ip)
377 ),
378 TP_fast_assign(
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700379 xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700380 __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;
391 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800392 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",
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700393 MAJOR(__entry->dev), MINOR(__entry->dev),
394 __entry->ino,
395 __entry->whichfork,
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800396 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wongc4942132018-12-18 14:32:31 -0800397 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700398 __entry->level,
399 __entry->ptr,
400 __entry->agno,
401 __entry->bno,
402 __entry->error,
403 __entry->ret_ip)
404);
405
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700406TRACE_EVENT(xchk_btree_error,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700407 TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700408 int level, void *ret_ip),
409 TP_ARGS(sc, cur, level, ret_ip),
410 TP_STRUCT__entry(
411 __field(dev_t, dev)
412 __field(unsigned int, type)
413 __field(xfs_btnum_t, btnum)
414 __field(int, level)
415 __field(xfs_agnumber_t, agno)
416 __field(xfs_agblock_t, bno)
417 __field(int, ptr);
418 __field(void *, ret_ip)
419 ),
420 TP_fast_assign(
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700421 xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700422 __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;
430 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800431 TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno %u agbno %u ret_ip %pS",
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700432 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800433 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wongc4942132018-12-18 14:32:31 -0800434 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700435 __entry->level,
436 __entry->ptr,
437 __entry->agno,
438 __entry->bno,
439 __entry->ret_ip)
440);
441
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700442TRACE_EVENT(xchk_ifork_btree_error,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700443 TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700444 int level, void *ret_ip),
445 TP_ARGS(sc, cur, level, ret_ip),
446 TP_STRUCT__entry(
447 __field(dev_t, dev)
448 __field(xfs_ino_t, ino)
449 __field(int, whichfork)
450 __field(unsigned int, type)
451 __field(xfs_btnum_t, btnum)
452 __field(int, level)
453 __field(xfs_agnumber_t, agno)
454 __field(xfs_agblock_t, bno)
455 __field(int, ptr);
456 __field(void *, ret_ip)
457 ),
458 TP_fast_assign(
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700459 xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700460 __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;
470 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800471 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",
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700472 MAJOR(__entry->dev), MINOR(__entry->dev),
473 __entry->ino,
474 __entry->whichfork,
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800475 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wongc4942132018-12-18 14:32:31 -0800476 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong537964bc2017-10-17 21:37:37 -0700477 __entry->level,
478 __entry->ptr,
479 __entry->agno,
480 __entry->bno,
481 __entry->ret_ip)
482);
483
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700484DECLARE_EVENT_CLASS(xchk_sbtree_class,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700485 TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
Darrick J. Wong37f3fa72017-10-17 21:37:37 -0700486 int level),
487 TP_ARGS(sc, cur, level),
488 TP_STRUCT__entry(
489 __field(dev_t, dev)
490 __field(int, type)
491 __field(xfs_btnum_t, btnum)
492 __field(xfs_agnumber_t, agno)
493 __field(xfs_agblock_t, bno)
494 __field(int, level)
495 __field(int, nlevels)
496 __field(int, ptr)
497 ),
498 TP_fast_assign(
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700499 xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
Darrick J. Wong37f3fa72017-10-17 21:37:37 -0700500
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];
509 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800510 TP_printk("dev %d:%d type %s btree %s agno %u agbno %u level %d nlevels %d ptr %d",
Darrick J. Wong37f3fa72017-10-17 21:37:37 -0700511 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800512 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wongc4942132018-12-18 14:32:31 -0800513 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong37f3fa72017-10-17 21:37:37 -0700514 __entry->agno,
515 __entry->bno,
516 __entry->level,
517 __entry->nlevels,
518 __entry->ptr)
519)
520#define DEFINE_SCRUB_SBTREE_EVENT(name) \
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700521DEFINE_EVENT(xchk_sbtree_class, name, \
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700522 TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur, \
Darrick J. Wong37f3fa72017-10-17 21:37:37 -0700523 int level), \
524 TP_ARGS(sc, cur, level))
525
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700526DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_rec);
527DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_key);
Darrick J. Wong37f3fa72017-10-17 21:37:37 -0700528
Darrick J. Wongc517b3a2018-07-19 12:29:11 -0700529TRACE_EVENT(xchk_xref_error,
Darrick J. Wong1d8a7482018-07-19 12:29:12 -0700530 TP_PROTO(struct xfs_scrub *sc, int error, void *ret_ip),
Darrick J. Wong64b125632018-01-16 18:52:14 -0800531 TP_ARGS(sc, error, ret_ip),
532 TP_STRUCT__entry(
533 __field(dev_t, dev)
534 __field(int, type)
535 __field(int, error)
536 __field(void *, ret_ip)
537 ),
538 TP_fast_assign(
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;
543 ),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800544 TP_printk("dev %d:%d type %s xref error %d ret_ip %pS",
Darrick J. Wong64b125632018-01-16 18:52:14 -0800545 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wong86d163d2018-12-18 14:32:31 -0800546 __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
Darrick J. Wong64b125632018-01-16 18:52:14 -0800547 __entry->error,
548 __entry->ret_ip)
549);
550
Darrick J. Wongb9454fe2019-02-01 09:08:51 -0800551TRACE_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),
559 TP_STRUCT__entry(
560 __field(dev_t, dev)
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)
570 ),
571 TP_fast_assign(
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;
582 ),
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),
585 __entry->agno,
586 __entry->startino,
587 __entry->map_daddr,
588 __entry->map_len,
589 __entry->chunk_ino,
590 __entry->nr_inodes,
591 __entry->cluster_mask,
592 __entry->holemask,
593 __entry->cluster_ino)
594)
595
Darrick J. Wong75efa572019-04-25 18:26:24 -0700596TRACE_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),
600 TP_STRUCT__entry(
601 __field(dev_t, dev)
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)
609 ),
610 TP_fast_assign(
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;
619 ),
620 TP_printk("dev %d:%d icount %lld:%llu ifree %lld::%llu fdblocks %lld::%llu delalloc %llu",
621 MAJOR(__entry->dev), MINOR(__entry->dev),
622 __entry->icount_sb,
623 __entry->icount_calculated,
624 __entry->ifree_sb,
625 __entry->ifree_calculated,
626 __entry->fdblocks_sb,
627 __entry->fdblocks_calculated,
628 __entry->delalloc)
629)
630
631TRACE_EVENT(xchk_fscounters_within_range,
632 TP_PROTO(struct xfs_mount *mp, uint64_t expected, int64_t curr_value,
633 int64_t old_value),
634 TP_ARGS(mp, expected, curr_value, old_value),
635 TP_STRUCT__entry(
636 __field(dev_t, dev)
637 __field(uint64_t, expected)
638 __field(int64_t, curr_value)
639 __field(int64_t, old_value)
640 ),
641 TP_fast_assign(
642 __entry->dev = mp->m_super->s_dev;
643 __entry->expected = expected;
644 __entry->curr_value = curr_value;
645 __entry->old_value = old_value;
646 ),
647 TP_printk("dev %d:%d expected %llu curr_value %lld old_value %lld",
648 MAJOR(__entry->dev), MINOR(__entry->dev),
649 __entry->expected,
650 __entry->curr_value,
651 __entry->old_value)
652)
653
Darrick J. Wong718fa742018-05-14 06:34:35 -0700654/* repair tracepoints */
655#if IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR)
656
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700657DECLARE_EVENT_CLASS(xrep_extent_class,
Darrick J. Wong718fa742018-05-14 06:34:35 -0700658 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),
661 TP_STRUCT__entry(
662 __field(dev_t, dev)
663 __field(xfs_agnumber_t, agno)
664 __field(xfs_agblock_t, agbno)
665 __field(xfs_extlen_t, len)
666 ),
667 TP_fast_assign(
668 __entry->dev = mp->m_super->s_dev;
669 __entry->agno = agno;
670 __entry->agbno = agbno;
671 __entry->len = len;
672 ),
673 TP_printk("dev %d:%d agno %u agbno %u len %u",
674 MAJOR(__entry->dev), MINOR(__entry->dev),
675 __entry->agno,
676 __entry->agbno,
677 __entry->len)
678);
679#define DEFINE_REPAIR_EXTENT_EVENT(name) \
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700680DEFINE_EVENT(xrep_extent_class, name, \
Darrick J. Wong718fa742018-05-14 06:34:35 -0700681 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))
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700684DEFINE_REPAIR_EXTENT_EVENT(xrep_dispose_btree_extent);
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700685DEFINE_REPAIR_EXTENT_EVENT(xrep_agfl_insert);
Darrick J. Wong718fa742018-05-14 06:34:35 -0700686
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700687DECLARE_EVENT_CLASS(xrep_rmap_class,
Darrick J. Wong718fa742018-05-14 06:34:35 -0700688 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),
692 TP_STRUCT__entry(
693 __field(dev_t, dev)
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)
700 ),
701 TP_fast_assign(
702 __entry->dev = mp->m_super->s_dev;
703 __entry->agno = agno;
704 __entry->agbno = agbno;
705 __entry->len = len;
706 __entry->owner = owner;
707 __entry->offset = offset;
708 __entry->flags = flags;
709 ),
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),
712 __entry->agno,
713 __entry->agbno,
714 __entry->len,
715 __entry->owner,
716 __entry->offset,
717 __entry->flags)
718);
719#define DEFINE_REPAIR_RMAP_EVENT(name) \
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700720DEFINE_EVENT(xrep_rmap_class, name, \
Darrick J. Wong718fa742018-05-14 06:34:35 -0700721 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))
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700725DEFINE_REPAIR_RMAP_EVENT(xrep_alloc_extent_fn);
726DEFINE_REPAIR_RMAP_EVENT(xrep_ialloc_extent_fn);
727DEFINE_REPAIR_RMAP_EVENT(xrep_rmap_extent_fn);
728DEFINE_REPAIR_RMAP_EVENT(xrep_bmap_extent_fn);
Darrick J. Wong718fa742018-05-14 06:34:35 -0700729
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700730TRACE_EVENT(xrep_refcount_extent_fn,
Darrick J. Wong718fa742018-05-14 06:34:35 -0700731 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
732 struct xfs_refcount_irec *irec),
733 TP_ARGS(mp, agno, irec),
734 TP_STRUCT__entry(
735 __field(dev_t, dev)
736 __field(xfs_agnumber_t, agno)
737 __field(xfs_agblock_t, startblock)
738 __field(xfs_extlen_t, blockcount)
739 __field(xfs_nlink_t, refcount)
740 ),
741 TP_fast_assign(
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;
747 ),
748 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u",
749 MAJOR(__entry->dev), MINOR(__entry->dev),
750 __entry->agno,
751 __entry->startblock,
752 __entry->blockcount,
753 __entry->refcount)
754)
755
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700756TRACE_EVENT(xrep_init_btblock,
Darrick J. Wong718fa742018-05-14 06:34:35 -0700757 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
758 xfs_btnum_t btnum),
759 TP_ARGS(mp, agno, agbno, btnum),
760 TP_STRUCT__entry(
761 __field(dev_t, dev)
762 __field(xfs_agnumber_t, agno)
763 __field(xfs_agblock_t, agbno)
764 __field(uint32_t, btnum)
765 ),
766 TP_fast_assign(
767 __entry->dev = mp->m_super->s_dev;
768 __entry->agno = agno;
769 __entry->agbno = agbno;
770 __entry->btnum = btnum;
771 ),
Darrick J. Wongc4942132018-12-18 14:32:31 -0800772 TP_printk("dev %d:%d agno %u agbno %u btree %s",
Darrick J. Wong718fa742018-05-14 06:34:35 -0700773 MAJOR(__entry->dev), MINOR(__entry->dev),
774 __entry->agno,
775 __entry->agbno,
Darrick J. Wongc4942132018-12-18 14:32:31 -0800776 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS))
Darrick J. Wong718fa742018-05-14 06:34:35 -0700777)
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700778TRACE_EVENT(xrep_findroot_block,
Darrick J. Wong718fa742018-05-14 06:34:35 -0700779 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),
782 TP_STRUCT__entry(
783 __field(dev_t, dev)
784 __field(xfs_agnumber_t, agno)
785 __field(xfs_agblock_t, agbno)
786 __field(uint32_t, magic)
787 __field(uint16_t, level)
788 ),
789 TP_fast_assign(
790 __entry->dev = mp->m_super->s_dev;
791 __entry->agno = agno;
792 __entry->agbno = agbno;
793 __entry->magic = magic;
794 __entry->level = level;
795 ),
796 TP_printk("dev %d:%d agno %u agbno %u magic 0x%x level %u",
797 MAJOR(__entry->dev), MINOR(__entry->dev),
798 __entry->agno,
799 __entry->agbno,
800 __entry->magic,
801 __entry->level)
802)
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700803TRACE_EVENT(xrep_calc_ag_resblks,
Darrick J. Wong718fa742018-05-14 06:34:35 -0700804 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),
808 TP_STRUCT__entry(
809 __field(dev_t, dev)
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)
815 ),
816 TP_fast_assign(
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;
823 ),
824 TP_printk("dev %d:%d agno %d icount %u aglen %u freelen %u usedlen %u",
825 MAJOR(__entry->dev), MINOR(__entry->dev),
826 __entry->agno,
827 __entry->icount,
828 __entry->aglen,
829 __entry->freelen,
830 __entry->usedlen)
831)
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700832TRACE_EVENT(xrep_calc_ag_resblks_btsize,
Darrick J. Wong718fa742018-05-14 06:34:35 -0700833 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),
837 TP_STRUCT__entry(
838 __field(dev_t, dev)
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)
844 ),
845 TP_fast_assign(
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;
852 ),
853 TP_printk("dev %d:%d agno %d bno %u ino %u rmap %u refcount %u",
854 MAJOR(__entry->dev), MINOR(__entry->dev),
855 __entry->agno,
856 __entry->bnobt_sz,
857 __entry->inobt_sz,
858 __entry->rmapbt_sz,
859 __entry->refcbt_sz)
860)
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700861TRACE_EVENT(xrep_reset_counters,
Darrick J. Wong718fa742018-05-14 06:34:35 -0700862 TP_PROTO(struct xfs_mount *mp),
863 TP_ARGS(mp),
864 TP_STRUCT__entry(
865 __field(dev_t, dev)
866 ),
867 TP_fast_assign(
868 __entry->dev = mp->m_super->s_dev;
869 ),
870 TP_printk("dev %d:%d",
871 MAJOR(__entry->dev), MINOR(__entry->dev))
872)
873
Darrick J. Wongb5e21962018-07-19 12:29:11 -0700874TRACE_EVENT(xrep_ialloc_insert,
Darrick J. Wong718fa742018-05-14 06:34:35 -0700875 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),
879 TP_STRUCT__entry(
880 __field(dev_t, dev)
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)
887 ),
888 TP_fast_assign(
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;
896 ),
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),
899 __entry->agno,
900 __entry->startino,
901 __entry->holemask,
902 __entry->count,
903 __entry->freecount,
904 __entry->freemask)
905)
906
907#endif /* IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR) */
908
Darrick J. Wong36fd6e82017-10-17 21:37:34 -0700909#endif /* _TRACE_XFS_SCRUB_TRACE_H */
910
911#undef TRACE_INCLUDE_PATH
912#define TRACE_INCLUDE_PATH .
913#define TRACE_INCLUDE_FILE scrub/trace
914#include <trace/define_trace.h>