Line data Source code
1 : // SPDX-License-Identifier: GPL-2.0-or-later
2 : /*
3 : * Copyright (C) 2017-2023 Oracle. All Rights Reserved.
4 : * Author: Darrick J. Wong <djwong@kernel.org>
5 : *
6 : * NOTE: none of these tracepoints shall be considered a stable kernel ABI
7 : * as they can change at any time. See xfs_trace.h for documentation of
8 : * specific units found in tracepoint output.
9 : */
10 : #undef TRACE_SYSTEM
11 : #define TRACE_SYSTEM xfs_scrub
12 :
13 : #if !defined(_TRACE_XFS_SCRUB_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
14 : #define _TRACE_XFS_SCRUB_TRACE_H
15 :
16 : #include <linux/tracepoint.h>
17 : #include "xfs_bit.h"
18 : #include "xfs_quota_defs.h"
19 :
20 : struct xfs_scrub;
21 : struct xfile;
22 : struct xfarray;
23 : struct xfarray_sortinfo;
24 : struct xchk_iscan;
25 : struct xchk_nlink;
26 : struct xchk_fscounters;
27 : struct xfbtree;
28 : struct xfbtree_config;
29 : struct xfs_rmap_update_params;
30 : struct xfs_parent_name_irec;
31 : enum xchk_dirpath_outcome;
32 : struct xchk_dirtree;
33 : struct xchk_dirtree_outcomes;
34 :
35 : /*
36 : * ftrace's __print_symbolic requires that all enum values be wrapped in the
37 : * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
38 : * ring buffer. Somehow this was only worth mentioning in the ftrace sample
39 : * code.
40 : */
41 : TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
42 : TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
43 : TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
44 : TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
45 : TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
46 : TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
47 : TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
48 : TRACE_DEFINE_ENUM(XFS_BTNUM_RCBAGi);
49 : TRACE_DEFINE_ENUM(XFS_BTNUM_RTRMAPi);
50 : TRACE_DEFINE_ENUM(XFS_BTNUM_RTREFCi);
51 :
52 : TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_SHARED);
53 : TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_COW);
54 :
55 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PROBE);
56 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SB);
57 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGF);
58 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGFL);
59 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGI);
60 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BNOBT);
61 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_CNTBT);
62 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INOBT);
63 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FINOBT);
64 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RMAPBT);
65 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_REFCNTBT);
66 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INODE);
67 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTD);
68 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTA);
69 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTC);
70 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_DIR);
71 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_XATTR);
72 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SYMLINK);
73 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PARENT);
74 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTBITMAP);
75 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTSUM);
76 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_UQUOTA);
77 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_GQUOTA);
78 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PQUOTA);
79 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FSCOUNTERS);
80 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_QUOTACHECK);
81 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_NLINKS);
82 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_HEALTHY);
83 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_DIRTREE);
84 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RGSUPER);
85 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RGBITMAP);
86 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTRMAPBT);
87 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTREFCBT);
88 : TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BARRIER);
89 :
90 : #define XFS_SCRUB_TYPE_STRINGS \
91 : { XFS_SCRUB_TYPE_PROBE, "probe" }, \
92 : { XFS_SCRUB_TYPE_SB, "sb" }, \
93 : { XFS_SCRUB_TYPE_AGF, "agf" }, \
94 : { XFS_SCRUB_TYPE_AGFL, "agfl" }, \
95 : { XFS_SCRUB_TYPE_AGI, "agi" }, \
96 : { XFS_SCRUB_TYPE_BNOBT, "bnobt" }, \
97 : { XFS_SCRUB_TYPE_CNTBT, "cntbt" }, \
98 : { XFS_SCRUB_TYPE_INOBT, "inobt" }, \
99 : { XFS_SCRUB_TYPE_FINOBT, "finobt" }, \
100 : { XFS_SCRUB_TYPE_RMAPBT, "rmapbt" }, \
101 : { XFS_SCRUB_TYPE_REFCNTBT, "refcountbt" }, \
102 : { XFS_SCRUB_TYPE_INODE, "inode" }, \
103 : { XFS_SCRUB_TYPE_BMBTD, "bmapbtd" }, \
104 : { XFS_SCRUB_TYPE_BMBTA, "bmapbta" }, \
105 : { XFS_SCRUB_TYPE_BMBTC, "bmapbtc" }, \
106 : { XFS_SCRUB_TYPE_DIR, "directory" }, \
107 : { XFS_SCRUB_TYPE_XATTR, "xattr" }, \
108 : { XFS_SCRUB_TYPE_SYMLINK, "symlink" }, \
109 : { XFS_SCRUB_TYPE_PARENT, "parent" }, \
110 : { XFS_SCRUB_TYPE_RTBITMAP, "rtbitmap" }, \
111 : { XFS_SCRUB_TYPE_RTSUM, "rtsummary" }, \
112 : { XFS_SCRUB_TYPE_UQUOTA, "usrquota" }, \
113 : { XFS_SCRUB_TYPE_GQUOTA, "grpquota" }, \
114 : { XFS_SCRUB_TYPE_PQUOTA, "prjquota" }, \
115 : { XFS_SCRUB_TYPE_FSCOUNTERS, "fscounters" }, \
116 : { XFS_SCRUB_TYPE_QUOTACHECK, "quotacheck" }, \
117 : { XFS_SCRUB_TYPE_NLINKS, "nlinks" }, \
118 : { XFS_SCRUB_TYPE_HEALTHY, "healthy" }, \
119 : { XFS_SCRUB_TYPE_DIRTREE, "dirtree" }, \
120 : { XFS_SCRUB_TYPE_RGSUPER, "rgsuper" }, \
121 : { XFS_SCRUB_TYPE_RGBITMAP, "rgbitmap" }, \
122 : { XFS_SCRUB_TYPE_RTRMAPBT, "rtrmapbt" }, \
123 : { XFS_SCRUB_TYPE_RTREFCBT, "rtrefcountbt" }, \
124 : { XFS_SCRUB_TYPE_BARRIER, "barrier" }
125 :
126 : const char *xchk_type_string(unsigned int type);
127 :
128 : #define XFS_SCRUB_FLAG_STRINGS \
129 : { XFS_SCRUB_IFLAG_REPAIR, "repair" }, \
130 : { XFS_SCRUB_OFLAG_CORRUPT, "corrupt" }, \
131 : { XFS_SCRUB_OFLAG_PREEN, "preen" }, \
132 : { XFS_SCRUB_OFLAG_XFAIL, "xfail" }, \
133 : { XFS_SCRUB_OFLAG_XCORRUPT, "xcorrupt" }, \
134 : { XFS_SCRUB_OFLAG_INCOMPLETE, "incomplete" }, \
135 : { XFS_SCRUB_OFLAG_WARNING, "warning" }, \
136 : { XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED, "norepair" }, \
137 : { XFS_SCRUB_IFLAG_FORCE_REBUILD, "rebuild" }
138 :
139 : #define XFS_SCRUB_STATE_STRINGS \
140 : { XCHK_TRY_HARDER, "try_harder" }, \
141 : { XCHK_HAVE_FREEZE_PROT, "nofreeze" }, \
142 : { XCHK_FSGATES_DRAIN, "fsgates_drain" }, \
143 : { XCHK_NEED_DRAIN, "need_drain" }, \
144 : { XCHK_FSGATES_QUOTA, "fsgates_quota" }, \
145 : { XCHK_FSGATES_DIRENTS, "fsgates_dirents" }, \
146 : { XCHK_FSGATES_RMAP, "fsgates_rmap" }, \
147 : { XREP_FSGATES_LARP, "fsgates_larp" }, \
148 : { XREP_FSGATES_ATOMIC_XCHG, "fsgates_atomic_swapext" }, \
149 : { XREP_RESET_PERAG_RESV, "reset_perag_resv" }, \
150 : { XREP_ALREADY_FIXED, "already_fixed" }
151 :
152 0 : DECLARE_EVENT_CLASS(xchk_class,
153 : TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
154 : int error),
155 : TP_ARGS(ip, sm, error),
156 : TP_STRUCT__entry(
157 : __field(dev_t, dev)
158 : __field(xfs_ino_t, ino)
159 : __field(unsigned int, type)
160 : __field(xfs_agnumber_t, agno)
161 : __field(xfs_ino_t, inum)
162 : __field(unsigned int, gen)
163 : __field(unsigned int, flags)
164 : __field(int, error)
165 : ),
166 : TP_fast_assign(
167 : __entry->dev = ip->i_mount->m_super->s_dev;
168 : __entry->ino = ip->i_ino;
169 : __entry->type = sm->sm_type;
170 : __entry->agno = sm->sm_agno;
171 : __entry->inum = sm->sm_ino;
172 : __entry->gen = sm->sm_gen;
173 : __entry->flags = sm->sm_flags;
174 : __entry->error = error;
175 : ),
176 : TP_printk("dev %d:%d ino 0x%llx type %s agno 0x%x inum 0x%llx gen 0x%x flags (%s) error %d",
177 : MAJOR(__entry->dev), MINOR(__entry->dev),
178 : __entry->ino,
179 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
180 : __entry->agno,
181 : __entry->inum,
182 : __entry->gen,
183 : __print_flags(__entry->flags, "|", XFS_SCRUB_FLAG_STRINGS),
184 : __entry->error)
185 : )
186 : #define DEFINE_SCRUB_EVENT(name) \
187 : DEFINE_EVENT(xchk_class, name, \
188 : TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, \
189 : int error), \
190 : TP_ARGS(ip, sm, error))
191 :
192 504201774 : DEFINE_SCRUB_EVENT(xchk_start);
193 504661250 : DEFINE_SCRUB_EVENT(xchk_done);
194 22485 : DEFINE_SCRUB_EVENT(xchk_deadlock_retry);
195 11450080 : DEFINE_SCRUB_EVENT(xchk_dirtree_start);
196 11457988 : DEFINE_SCRUB_EVENT(xchk_dirtree_done);
197 1743659 : DEFINE_SCRUB_EVENT(xrep_attempt);
198 1743644 : DEFINE_SCRUB_EVENT(xrep_done);
199 :
200 0 : DECLARE_EVENT_CLASS(xchk_fsgate_class,
201 : TP_PROTO(struct xfs_scrub *sc, unsigned int fsgate_flags),
202 : TP_ARGS(sc, fsgate_flags),
203 : TP_STRUCT__entry(
204 : __field(dev_t, dev)
205 : __field(unsigned int, type)
206 : __field(unsigned int, fsgate_flags)
207 : ),
208 : TP_fast_assign(
209 : __entry->dev = sc->mp->m_super->s_dev;
210 : __entry->type = sc->sm->sm_type;
211 : __entry->fsgate_flags = fsgate_flags;
212 : ),
213 : TP_printk("dev %d:%d type %s fsgates '%s'",
214 : MAJOR(__entry->dev), MINOR(__entry->dev),
215 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
216 : __print_flags(__entry->fsgate_flags, "|", XFS_SCRUB_STATE_STRINGS))
217 : )
218 :
219 : #define DEFINE_SCRUB_FSHOOK_EVENT(name) \
220 : DEFINE_EVENT(xchk_fsgate_class, name, \
221 : TP_PROTO(struct xfs_scrub *sc, unsigned int fsgates_flags), \
222 : TP_ARGS(sc, fsgates_flags))
223 :
224 12823927 : DEFINE_SCRUB_FSHOOK_EVENT(xchk_fsgates_enable);
225 12112527 : DEFINE_SCRUB_FSHOOK_EVENT(xchk_fsgates_disable);
226 :
227 0 : DECLARE_EVENT_CLASS(xchk_vector_head_class,
228 : TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_vec_head *vhead),
229 : TP_ARGS(ip, vhead),
230 : TP_STRUCT__entry(
231 : __field(dev_t, dev)
232 : __field(xfs_ino_t, ino)
233 : __field(xfs_agnumber_t, agno)
234 : __field(xfs_ino_t, inum)
235 : __field(unsigned int, gen)
236 : __field(unsigned int, flags)
237 : __field(unsigned short, rest_us)
238 : __field(unsigned short, nr_vecs)
239 : ),
240 : TP_fast_assign(
241 : __entry->dev = ip->i_mount->m_super->s_dev;
242 : __entry->ino = ip->i_ino;
243 : __entry->agno = vhead->svh_agno;
244 : __entry->inum = vhead->svh_ino;
245 : __entry->gen = vhead->svh_gen;
246 : __entry->flags = vhead->svh_flags;
247 : __entry->rest_us = vhead->svh_rest_us;
248 : __entry->nr_vecs = vhead->svh_nr;
249 : ),
250 : TP_printk("dev %d:%d ino 0x%llx agno 0x%x inum 0x%llx gen 0x%x flags 0x%x rest_us %u nr_vecs %u",
251 : MAJOR(__entry->dev), MINOR(__entry->dev),
252 : __entry->ino,
253 : __entry->agno,
254 : __entry->inum,
255 : __entry->gen,
256 : __entry->flags,
257 : __entry->rest_us,
258 : __entry->nr_vecs)
259 : )
260 : #define DEFINE_SCRUBV_HEAD_EVENT(name) \
261 : DEFINE_EVENT(xchk_vector_head_class, name, \
262 : TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_vec_head *vhead), \
263 : TP_ARGS(ip, vhead))
264 :
265 89749011 : DEFINE_SCRUBV_HEAD_EVENT(xchk_scrubv_start);
266 :
267 0 : DECLARE_EVENT_CLASS(xchk_vector_class,
268 : TP_PROTO(struct xfs_mount *mp, struct xfs_scrub_vec_head *vhead,
269 : struct xfs_scrub_vec *v),
270 : TP_ARGS(mp, vhead, v),
271 : TP_STRUCT__entry(
272 : __field(dev_t, dev)
273 : __field(unsigned int, vec_nr)
274 : __field(unsigned int, vec_type)
275 : __field(unsigned int, vec_flags)
276 : __field(int, vec_ret)
277 : ),
278 : TP_fast_assign(
279 : __entry->dev = mp->m_super->s_dev;
280 : __entry->vec_nr = v - vhead->svh_vecs;
281 : __entry->vec_type = v->sv_type;
282 : __entry->vec_flags = v->sv_flags;
283 : __entry->vec_ret = v->sv_ret;
284 : ),
285 : TP_printk("dev %d:%d vec[%u] type %s flags 0x%x ret %d",
286 : MAJOR(__entry->dev), MINOR(__entry->dev),
287 : __entry->vec_nr,
288 : __print_symbolic(__entry->vec_type, XFS_SCRUB_TYPE_STRINGS),
289 : __entry->vec_flags,
290 : __entry->vec_ret)
291 : )
292 : #define DEFINE_SCRUBV_EVENT(name) \
293 : DEFINE_EVENT(xchk_vector_class, name, \
294 : TP_PROTO(struct xfs_mount *mp, struct xfs_scrub_vec_head *vhead, \
295 : struct xfs_scrub_vec *v), \
296 : TP_ARGS(mp, vhead, v))
297 :
298 14 : DEFINE_SCRUBV_EVENT(xchk_scrubv_barrier_fail);
299 735698862 : DEFINE_SCRUBV_EVENT(xchk_scrubv_item);
300 :
301 55 : TRACE_EVENT(xchk_op_error,
302 : TP_PROTO(struct xfs_scrub *sc, xfs_agnumber_t agno,
303 : xfs_agblock_t bno, int error, void *ret_ip),
304 : TP_ARGS(sc, agno, bno, error, ret_ip),
305 : TP_STRUCT__entry(
306 : __field(dev_t, dev)
307 : __field(unsigned int, type)
308 : __field(xfs_agnumber_t, agno)
309 : __field(xfs_agblock_t, bno)
310 : __field(int, error)
311 : __field(void *, ret_ip)
312 : ),
313 : TP_fast_assign(
314 : __entry->dev = sc->mp->m_super->s_dev;
315 : __entry->type = sc->sm->sm_type;
316 : __entry->agno = agno;
317 : __entry->bno = bno;
318 : __entry->error = error;
319 : __entry->ret_ip = ret_ip;
320 : ),
321 : TP_printk("dev %d:%d type %s agno 0x%x agbno 0x%x error %d ret_ip %pS",
322 : MAJOR(__entry->dev), MINOR(__entry->dev),
323 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
324 : __entry->agno,
325 : __entry->bno,
326 : __entry->error,
327 : __entry->ret_ip)
328 : );
329 :
330 2 : TRACE_EVENT(xchk_file_op_error,
331 : TP_PROTO(struct xfs_scrub *sc, int whichfork,
332 : xfs_fileoff_t offset, int error, void *ret_ip),
333 : TP_ARGS(sc, whichfork, offset, error, ret_ip),
334 : TP_STRUCT__entry(
335 : __field(dev_t, dev)
336 : __field(xfs_ino_t, ino)
337 : __field(int, whichfork)
338 : __field(unsigned int, type)
339 : __field(xfs_fileoff_t, offset)
340 : __field(int, error)
341 : __field(void *, ret_ip)
342 : ),
343 : TP_fast_assign(
344 : __entry->dev = sc->ip->i_mount->m_super->s_dev;
345 : __entry->ino = sc->ip->i_ino;
346 : __entry->whichfork = whichfork;
347 : __entry->type = sc->sm->sm_type;
348 : __entry->offset = offset;
349 : __entry->error = error;
350 : __entry->ret_ip = ret_ip;
351 : ),
352 : TP_printk("dev %d:%d ino 0x%llx fork %s type %s fileoff 0x%llx error %d ret_ip %pS",
353 : MAJOR(__entry->dev), MINOR(__entry->dev),
354 : __entry->ino,
355 : __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
356 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
357 : __entry->offset,
358 : __entry->error,
359 : __entry->ret_ip)
360 : );
361 :
362 0 : DECLARE_EVENT_CLASS(xchk_block_error_class,
363 : TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, void *ret_ip),
364 : TP_ARGS(sc, daddr, ret_ip),
365 : TP_STRUCT__entry(
366 : __field(dev_t, dev)
367 : __field(unsigned int, type)
368 : __field(xfs_agnumber_t, agno)
369 : __field(xfs_agblock_t, agbno)
370 : __field(void *, ret_ip)
371 : ),
372 : TP_fast_assign(
373 : __entry->dev = sc->mp->m_super->s_dev;
374 : __entry->type = sc->sm->sm_type;
375 : __entry->agno = xfs_daddr_to_agno(sc->mp, daddr);
376 : __entry->agbno = xfs_daddr_to_agbno(sc->mp, daddr);
377 : __entry->ret_ip = ret_ip;
378 : ),
379 : TP_printk("dev %d:%d type %s agno 0x%x agbno 0x%x ret_ip %pS",
380 : MAJOR(__entry->dev), MINOR(__entry->dev),
381 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
382 : __entry->agno,
383 : __entry->agbno,
384 : __entry->ret_ip)
385 : )
386 :
387 : #define DEFINE_SCRUB_BLOCK_ERROR_EVENT(name) \
388 : DEFINE_EVENT(xchk_block_error_class, name, \
389 : TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, \
390 : void *ret_ip), \
391 : TP_ARGS(sc, daddr, ret_ip))
392 :
393 0 : DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_fs_error);
394 0 : DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_error);
395 285316 : DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_preen);
396 :
397 0 : DECLARE_EVENT_CLASS(xchk_ino_error_class,
398 : TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, void *ret_ip),
399 : TP_ARGS(sc, ino, ret_ip),
400 : TP_STRUCT__entry(
401 : __field(dev_t, dev)
402 : __field(xfs_ino_t, ino)
403 : __field(unsigned int, type)
404 : __field(void *, ret_ip)
405 : ),
406 : TP_fast_assign(
407 : __entry->dev = sc->mp->m_super->s_dev;
408 : __entry->ino = ino;
409 : __entry->type = sc->sm->sm_type;
410 : __entry->ret_ip = ret_ip;
411 : ),
412 : TP_printk("dev %d:%d ino 0x%llx type %s ret_ip %pS",
413 : MAJOR(__entry->dev), MINOR(__entry->dev),
414 : __entry->ino,
415 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
416 : __entry->ret_ip)
417 : )
418 :
419 : #define DEFINE_SCRUB_INO_ERROR_EVENT(name) \
420 : DEFINE_EVENT(xchk_ino_error_class, name, \
421 : TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, \
422 : void *ret_ip), \
423 : TP_ARGS(sc, ino, ret_ip))
424 :
425 0 : DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_error);
426 3005284 : DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_preen);
427 0 : DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_warning);
428 :
429 0 : DECLARE_EVENT_CLASS(xchk_fblock_error_class,
430 : TP_PROTO(struct xfs_scrub *sc, int whichfork,
431 : xfs_fileoff_t offset, void *ret_ip),
432 : TP_ARGS(sc, whichfork, offset, ret_ip),
433 : TP_STRUCT__entry(
434 : __field(dev_t, dev)
435 : __field(xfs_ino_t, ino)
436 : __field(int, whichfork)
437 : __field(unsigned int, type)
438 : __field(xfs_fileoff_t, offset)
439 : __field(void *, ret_ip)
440 : ),
441 : TP_fast_assign(
442 : __entry->dev = sc->ip->i_mount->m_super->s_dev;
443 : __entry->ino = sc->ip->i_ino;
444 : __entry->whichfork = whichfork;
445 : __entry->type = sc->sm->sm_type;
446 : __entry->offset = offset;
447 : __entry->ret_ip = ret_ip;
448 : ),
449 : TP_printk("dev %d:%d ino 0x%llx fork %s type %s fileoff 0x%llx ret_ip %pS",
450 : MAJOR(__entry->dev), MINOR(__entry->dev),
451 : __entry->ino,
452 : __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
453 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
454 : __entry->offset,
455 : __entry->ret_ip)
456 : );
457 :
458 : #define DEFINE_SCRUB_FBLOCK_ERROR_EVENT(name) \
459 : DEFINE_EVENT(xchk_fblock_error_class, name, \
460 : TP_PROTO(struct xfs_scrub *sc, int whichfork, \
461 : xfs_fileoff_t offset, void *ret_ip), \
462 : TP_ARGS(sc, whichfork, offset, ret_ip))
463 :
464 6 : DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_error);
465 27 : DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_warning);
466 1899710 : DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_preen);
467 :
468 : #ifdef CONFIG_XFS_QUOTA
469 0 : TRACE_EVENT(xchk_qcheck_error,
470 : TP_PROTO(struct xfs_scrub *sc, xfs_dqtype_t dqtype, xfs_dqid_t id,
471 : void *ret_ip),
472 : TP_ARGS(sc, dqtype, id, ret_ip),
473 : TP_STRUCT__entry(
474 : __field(dev_t, dev)
475 : __field(xfs_dqtype_t, dqtype)
476 : __field(xfs_dqid_t, id)
477 : __field(void *, ret_ip)
478 : ),
479 : TP_fast_assign(
480 : __entry->dev = sc->mp->m_super->s_dev;
481 : __entry->dqtype = dqtype;
482 : __entry->id = id;
483 : __entry->ret_ip = ret_ip;
484 : ),
485 : TP_printk("dev %d:%d dquot type %s id 0x%x ret_ip %pS",
486 : MAJOR(__entry->dev), MINOR(__entry->dev),
487 : __print_symbolic(__entry->dqtype, XFS_DQTYPE_STRINGS),
488 : __entry->id,
489 : __entry->ret_ip)
490 : );
491 : #endif /* CONFIG_XFS_QUOTA */
492 :
493 51 : TRACE_EVENT(xchk_incomplete,
494 : TP_PROTO(struct xfs_scrub *sc, void *ret_ip),
495 : TP_ARGS(sc, ret_ip),
496 : TP_STRUCT__entry(
497 : __field(dev_t, dev)
498 : __field(unsigned int, type)
499 : __field(void *, ret_ip)
500 : ),
501 : TP_fast_assign(
502 : __entry->dev = sc->mp->m_super->s_dev;
503 : __entry->type = sc->sm->sm_type;
504 : __entry->ret_ip = ret_ip;
505 : ),
506 : TP_printk("dev %d:%d type %s ret_ip %pS",
507 : MAJOR(__entry->dev), MINOR(__entry->dev),
508 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
509 : __entry->ret_ip)
510 : );
511 :
512 0 : TRACE_EVENT(xchk_btree_op_error,
513 : TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
514 : int level, int error, void *ret_ip),
515 : TP_ARGS(sc, cur, level, error, ret_ip),
516 : TP_STRUCT__entry(
517 : __field(dev_t, dev)
518 : __field(unsigned int, type)
519 : __field(xfs_btnum_t, btnum)
520 : __field(int, level)
521 : __field(xfs_agnumber_t, agno)
522 : __field(xfs_agblock_t, bno)
523 : __field(int, ptr)
524 : __field(int, error)
525 : __field(void *, ret_ip)
526 : ),
527 : TP_fast_assign(
528 : xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
529 :
530 : __entry->dev = sc->mp->m_super->s_dev;
531 : __entry->type = sc->sm->sm_type;
532 : __entry->btnum = cur->bc_btnum;
533 : __entry->level = level;
534 : __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
535 : __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
536 : __entry->ptr = cur->bc_levels[level].ptr;
537 : __entry->error = error;
538 : __entry->ret_ip = ret_ip;
539 : ),
540 : TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x error %d ret_ip %pS",
541 : MAJOR(__entry->dev), MINOR(__entry->dev),
542 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
543 : __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
544 : __entry->level,
545 : __entry->ptr,
546 : __entry->agno,
547 : __entry->bno,
548 : __entry->error,
549 : __entry->ret_ip)
550 : );
551 :
552 0 : TRACE_EVENT(xchk_ifork_btree_op_error,
553 : TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
554 : int level, int error, void *ret_ip),
555 : TP_ARGS(sc, cur, level, error, ret_ip),
556 : TP_STRUCT__entry(
557 : __field(dev_t, dev)
558 : __field(xfs_ino_t, ino)
559 : __field(int, whichfork)
560 : __field(unsigned int, type)
561 : __field(xfs_btnum_t, btnum)
562 : __field(int, level)
563 : __field(int, ptr)
564 : __field(xfs_agnumber_t, agno)
565 : __field(xfs_agblock_t, bno)
566 : __field(int, error)
567 : __field(void *, ret_ip)
568 : ),
569 : TP_fast_assign(
570 : xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
571 : __entry->dev = sc->mp->m_super->s_dev;
572 : __entry->ino = cur->bc_ino.ip->i_ino;
573 : __entry->whichfork = cur->bc_ino.whichfork;
574 : __entry->type = sc->sm->sm_type;
575 : __entry->btnum = cur->bc_btnum;
576 : __entry->level = level;
577 : __entry->ptr = cur->bc_levels[level].ptr;
578 : __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
579 : __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
580 : __entry->error = error;
581 : __entry->ret_ip = ret_ip;
582 : ),
583 : TP_printk("dev %d:%d ino 0x%llx fork %s type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x error %d ret_ip %pS",
584 : MAJOR(__entry->dev), MINOR(__entry->dev),
585 : __entry->ino,
586 : __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
587 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
588 : __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
589 : __entry->level,
590 : __entry->ptr,
591 : __entry->agno,
592 : __entry->bno,
593 : __entry->error,
594 : __entry->ret_ip)
595 : );
596 :
597 0 : TRACE_EVENT(xchk_btree_error,
598 : TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
599 : int level, void *ret_ip),
600 : TP_ARGS(sc, cur, level, ret_ip),
601 : TP_STRUCT__entry(
602 : __field(dev_t, dev)
603 : __field(unsigned int, type)
604 : __field(xfs_btnum_t, btnum)
605 : __field(int, level)
606 : __field(xfs_agnumber_t, agno)
607 : __field(xfs_agblock_t, bno)
608 : __field(int, ptr)
609 : __field(void *, ret_ip)
610 : ),
611 : TP_fast_assign(
612 : xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
613 : __entry->dev = sc->mp->m_super->s_dev;
614 : __entry->type = sc->sm->sm_type;
615 : __entry->btnum = cur->bc_btnum;
616 : __entry->level = level;
617 : __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
618 : __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
619 : __entry->ptr = cur->bc_levels[level].ptr;
620 : __entry->ret_ip = ret_ip;
621 : ),
622 : TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x ret_ip %pS",
623 : MAJOR(__entry->dev), MINOR(__entry->dev),
624 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
625 : __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
626 : __entry->level,
627 : __entry->ptr,
628 : __entry->agno,
629 : __entry->bno,
630 : __entry->ret_ip)
631 : );
632 :
633 0 : TRACE_EVENT(xchk_ifork_btree_error,
634 : TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
635 : int level, void *ret_ip),
636 : TP_ARGS(sc, cur, level, ret_ip),
637 : TP_STRUCT__entry(
638 : __field(dev_t, dev)
639 : __field(xfs_ino_t, ino)
640 : __field(int, whichfork)
641 : __field(unsigned int, type)
642 : __field(xfs_btnum_t, btnum)
643 : __field(int, level)
644 : __field(xfs_agnumber_t, agno)
645 : __field(xfs_agblock_t, bno)
646 : __field(int, ptr)
647 : __field(void *, ret_ip)
648 : ),
649 : TP_fast_assign(
650 : xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
651 : __entry->dev = sc->mp->m_super->s_dev;
652 : __entry->ino = sc->ip->i_ino;
653 : __entry->whichfork = cur->bc_ino.whichfork;
654 : __entry->type = sc->sm->sm_type;
655 : __entry->btnum = cur->bc_btnum;
656 : __entry->level = level;
657 : __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
658 : __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
659 : __entry->ptr = cur->bc_levels[level].ptr;
660 : __entry->ret_ip = ret_ip;
661 : ),
662 : TP_printk("dev %d:%d ino 0x%llx fork %s type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x ret_ip %pS",
663 : MAJOR(__entry->dev), MINOR(__entry->dev),
664 : __entry->ino,
665 : __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
666 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
667 : __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
668 : __entry->level,
669 : __entry->ptr,
670 : __entry->agno,
671 : __entry->bno,
672 : __entry->ret_ip)
673 : );
674 :
675 0 : DECLARE_EVENT_CLASS(xchk_sbtree_class,
676 : TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
677 : int level),
678 : TP_ARGS(sc, cur, level),
679 : TP_STRUCT__entry(
680 : __field(dev_t, dev)
681 : __field(int, type)
682 : __field(xfs_btnum_t, btnum)
683 : __field(xfs_agnumber_t, agno)
684 : __field(xfs_agblock_t, bno)
685 : __field(int, level)
686 : __field(int, nlevels)
687 : __field(int, ptr)
688 : ),
689 : TP_fast_assign(
690 : xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
691 :
692 : __entry->dev = sc->mp->m_super->s_dev;
693 : __entry->type = sc->sm->sm_type;
694 : __entry->btnum = cur->bc_btnum;
695 : __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
696 : __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
697 : __entry->level = level;
698 : __entry->nlevels = cur->bc_nlevels;
699 : __entry->ptr = cur->bc_levels[level].ptr;
700 : ),
701 : TP_printk("dev %d:%d type %s btree %s agno 0x%x agbno 0x%x level %d nlevels %d ptr %d",
702 : MAJOR(__entry->dev), MINOR(__entry->dev),
703 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
704 : __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
705 : __entry->agno,
706 : __entry->bno,
707 : __entry->level,
708 : __entry->nlevels,
709 : __entry->ptr)
710 : )
711 : #define DEFINE_SCRUB_SBTREE_EVENT(name) \
712 : DEFINE_EVENT(xchk_sbtree_class, name, \
713 : TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur, \
714 : int level), \
715 : TP_ARGS(sc, cur, level))
716 :
717 2513565932 : DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_rec);
718 16109064 : DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_key);
719 :
720 0 : TRACE_EVENT(xchk_xref_error,
721 : TP_PROTO(struct xfs_scrub *sc, int error, void *ret_ip),
722 : TP_ARGS(sc, error, ret_ip),
723 : TP_STRUCT__entry(
724 : __field(dev_t, dev)
725 : __field(int, type)
726 : __field(int, error)
727 : __field(void *, ret_ip)
728 : ),
729 : TP_fast_assign(
730 : __entry->dev = sc->mp->m_super->s_dev;
731 : __entry->type = sc->sm->sm_type;
732 : __entry->error = error;
733 : __entry->ret_ip = ret_ip;
734 : ),
735 : TP_printk("dev %d:%d type %s xref error %d ret_ip %pS",
736 : MAJOR(__entry->dev), MINOR(__entry->dev),
737 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
738 : __entry->error,
739 : __entry->ret_ip)
740 : );
741 :
742 117903461 : TRACE_EVENT(xchk_iallocbt_check_cluster,
743 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
744 : xfs_agino_t startino, xfs_daddr_t map_daddr,
745 : unsigned short map_len, unsigned int chunk_ino,
746 : unsigned int nr_inodes, uint16_t cluster_mask,
747 : uint16_t holemask, unsigned int cluster_ino),
748 : TP_ARGS(mp, agno, startino, map_daddr, map_len, chunk_ino, nr_inodes,
749 : cluster_mask, holemask, cluster_ino),
750 : TP_STRUCT__entry(
751 : __field(dev_t, dev)
752 : __field(xfs_agnumber_t, agno)
753 : __field(xfs_agino_t, startino)
754 : __field(xfs_daddr_t, map_daddr)
755 : __field(unsigned short, map_len)
756 : __field(unsigned int, chunk_ino)
757 : __field(unsigned int, nr_inodes)
758 : __field(unsigned int, cluster_ino)
759 : __field(uint16_t, cluster_mask)
760 : __field(uint16_t, holemask)
761 : ),
762 : TP_fast_assign(
763 : __entry->dev = mp->m_super->s_dev;
764 : __entry->agno = agno;
765 : __entry->startino = startino;
766 : __entry->map_daddr = map_daddr;
767 : __entry->map_len = map_len;
768 : __entry->chunk_ino = chunk_ino;
769 : __entry->nr_inodes = nr_inodes;
770 : __entry->cluster_mask = cluster_mask;
771 : __entry->holemask = holemask;
772 : __entry->cluster_ino = cluster_ino;
773 : ),
774 : TP_printk("dev %d:%d agno 0x%x startino 0x%x daddr 0x%llx bbcount 0x%x chunkino 0x%x nr_inodes %u cluster_mask 0x%x holemask 0x%x cluster_ino 0x%x",
775 : MAJOR(__entry->dev), MINOR(__entry->dev),
776 : __entry->agno,
777 : __entry->startino,
778 : __entry->map_daddr,
779 : __entry->map_len,
780 : __entry->chunk_ino,
781 : __entry->nr_inodes,
782 : __entry->cluster_mask,
783 : __entry->holemask,
784 : __entry->cluster_ino)
785 : )
786 :
787 3292822091 : TRACE_EVENT(xchk_inode_is_allocated,
788 : TP_PROTO(struct xfs_inode *ip),
789 : TP_ARGS(ip),
790 : TP_STRUCT__entry(
791 : __field(dev_t, dev)
792 : __field(xfs_ino_t, ino)
793 : __field(unsigned long, iflags)
794 : __field(umode_t, mode)
795 : ),
796 : TP_fast_assign(
797 : __entry->dev = VFS_I(ip)->i_sb->s_dev;
798 : __entry->ino = ip->i_ino;
799 : __entry->iflags = ip->i_flags;
800 : __entry->mode = VFS_I(ip)->i_mode;
801 : ),
802 : TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx mode 0x%x",
803 : MAJOR(__entry->dev), MINOR(__entry->dev),
804 : __entry->ino,
805 : __entry->iflags,
806 : __entry->mode)
807 : );
808 :
809 94933 : TRACE_EVENT(xchk_fscounters_calc,
810 : TP_PROTO(struct xfs_mount *mp, uint64_t icount, uint64_t ifree,
811 : uint64_t fdblocks, uint64_t delalloc),
812 : TP_ARGS(mp, icount, ifree, fdblocks, delalloc),
813 : TP_STRUCT__entry(
814 : __field(dev_t, dev)
815 : __field(int64_t, icount_sb)
816 : __field(uint64_t, icount_calculated)
817 : __field(int64_t, ifree_sb)
818 : __field(uint64_t, ifree_calculated)
819 : __field(int64_t, fdblocks_sb)
820 : __field(uint64_t, fdblocks_calculated)
821 : __field(uint64_t, delalloc)
822 : ),
823 : TP_fast_assign(
824 : __entry->dev = mp->m_super->s_dev;
825 : __entry->icount_sb = mp->m_sb.sb_icount;
826 : __entry->icount_calculated = icount;
827 : __entry->ifree_sb = mp->m_sb.sb_ifree;
828 : __entry->ifree_calculated = ifree;
829 : __entry->fdblocks_sb = mp->m_sb.sb_fdblocks;
830 : __entry->fdblocks_calculated = fdblocks;
831 : __entry->delalloc = delalloc;
832 : ),
833 : TP_printk("dev %d:%d icount %lld:%llu ifree %lld::%llu fdblocks %lld::%llu delalloc %llu",
834 : MAJOR(__entry->dev), MINOR(__entry->dev),
835 : __entry->icount_sb,
836 : __entry->icount_calculated,
837 : __entry->ifree_sb,
838 : __entry->ifree_calculated,
839 : __entry->fdblocks_sb,
840 : __entry->fdblocks_calculated,
841 : __entry->delalloc)
842 : )
843 :
844 379732 : TRACE_EVENT(xchk_fscounters_within_range,
845 : TP_PROTO(struct xfs_mount *mp, uint64_t expected, int64_t curr_value,
846 : int64_t old_value),
847 : TP_ARGS(mp, expected, curr_value, old_value),
848 : TP_STRUCT__entry(
849 : __field(dev_t, dev)
850 : __field(uint64_t, expected)
851 : __field(int64_t, curr_value)
852 : __field(int64_t, old_value)
853 : ),
854 : TP_fast_assign(
855 : __entry->dev = mp->m_super->s_dev;
856 : __entry->expected = expected;
857 : __entry->curr_value = curr_value;
858 : __entry->old_value = old_value;
859 : ),
860 : TP_printk("dev %d:%d expected %llu curr_value %lld old_value %lld",
861 : MAJOR(__entry->dev), MINOR(__entry->dev),
862 : __entry->expected,
863 : __entry->curr_value,
864 : __entry->old_value)
865 : )
866 :
867 0 : DECLARE_EVENT_CLASS(xchk_fsfreeze_class,
868 : TP_PROTO(struct xfs_scrub *sc, int error),
869 : TP_ARGS(sc, error),
870 : TP_STRUCT__entry(
871 : __field(dev_t, dev)
872 : __field(unsigned int, type)
873 : __field(int, error)
874 : ),
875 : TP_fast_assign(
876 : __entry->dev = sc->mp->m_super->s_dev;
877 : __entry->type = sc->sm->sm_type;
878 : __entry->error = error;
879 : ),
880 : TP_printk("dev %d:%d type %s error %d",
881 : MAJOR(__entry->dev), MINOR(__entry->dev),
882 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
883 : __entry->error)
884 : );
885 : #define DEFINE_XCHK_FSFREEZE_EVENT(name) \
886 : DEFINE_EVENT(xchk_fsfreeze_class, name, \
887 : TP_PROTO(struct xfs_scrub *sc, int error), \
888 : TP_ARGS(sc, error))
889 31383 : DEFINE_XCHK_FSFREEZE_EVENT(xchk_fsfreeze);
890 31383 : DEFINE_XCHK_FSFREEZE_EVENT(xchk_fsthaw);
891 :
892 0 : TRACE_EVENT(xchk_refcount_incorrect,
893 : TP_PROTO(struct xfs_perag *pag, const struct xfs_refcount_irec *irec,
894 : xfs_nlink_t seen),
895 : TP_ARGS(pag, irec, seen),
896 : TP_STRUCT__entry(
897 : __field(dev_t, dev)
898 : __field(xfs_agnumber_t, agno)
899 : __field(enum xfs_refc_domain, domain)
900 : __field(xfs_agblock_t, startblock)
901 : __field(xfs_extlen_t, blockcount)
902 : __field(xfs_nlink_t, refcount)
903 : __field(xfs_nlink_t, seen)
904 : ),
905 : TP_fast_assign(
906 : __entry->dev = pag->pag_mount->m_super->s_dev;
907 : __entry->agno = pag->pag_agno;
908 : __entry->domain = irec->rc_domain;
909 : __entry->startblock = irec->rc_startblock;
910 : __entry->blockcount = irec->rc_blockcount;
911 : __entry->refcount = irec->rc_refcount;
912 : __entry->seen = seen;
913 : ),
914 : TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u seen %u",
915 : MAJOR(__entry->dev), MINOR(__entry->dev),
916 : __entry->agno,
917 : __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
918 : __entry->startblock,
919 : __entry->blockcount,
920 : __entry->refcount,
921 : __entry->seen)
922 : )
923 :
924 202654037 : TRACE_EVENT(xfile_create,
925 : TP_PROTO(struct xfile *xf),
926 : TP_ARGS(xf),
927 : TP_STRUCT__entry(
928 : __field(dev_t, dev)
929 : __field(unsigned long, ino)
930 : __array(char, pathname, 256)
931 : ),
932 : TP_fast_assign(
933 : char pathname[257];
934 : char *path;
935 :
936 : __entry->ino = file_inode(xf->file)->i_ino;
937 : memset(pathname, 0, sizeof(pathname));
938 : path = file_path(xf->file, pathname, sizeof(pathname) - 1);
939 : if (IS_ERR(path))
940 : path = "(unknown)";
941 : strncpy(__entry->pathname, path, sizeof(__entry->pathname));
942 : ),
943 : TP_printk("xfino 0x%lx path '%s'",
944 : __entry->ino,
945 : __entry->pathname)
946 : );
947 :
948 202683876 : TRACE_EVENT(xfile_destroy,
949 : TP_PROTO(struct xfile *xf),
950 : TP_ARGS(xf),
951 : TP_STRUCT__entry(
952 : __field(unsigned long, ino)
953 : __field(unsigned long long, bytes)
954 : __field(loff_t, size)
955 : ),
956 : TP_fast_assign(
957 : struct xfile_stat statbuf;
958 : int ret;
959 :
960 : ret = xfile_stat(xf, &statbuf);
961 : if (!ret) {
962 : __entry->bytes = statbuf.bytes;
963 : __entry->size = statbuf.size;
964 : } else {
965 : __entry->bytes = -1;
966 : __entry->size = -1;
967 : }
968 : __entry->ino = file_inode(xf->file)->i_ino;
969 : ),
970 : TP_printk("xfino 0x%lx mem_bytes 0x%llx isize 0x%llx",
971 : __entry->ino,
972 : __entry->bytes,
973 : __entry->size)
974 : );
975 :
976 0 : DECLARE_EVENT_CLASS(xfile_class,
977 : TP_PROTO(struct xfile *xf, loff_t pos, unsigned long long bytecount),
978 : TP_ARGS(xf, pos, bytecount),
979 : TP_STRUCT__entry(
980 : __field(unsigned long, ino)
981 : __field(unsigned long long, bytes_used)
982 : __field(loff_t, pos)
983 : __field(loff_t, size)
984 : __field(unsigned long long, bytecount)
985 : ),
986 : TP_fast_assign(
987 : struct xfile_stat statbuf;
988 : int ret;
989 :
990 : ret = xfile_stat(xf, &statbuf);
991 : if (!ret) {
992 : __entry->bytes_used = statbuf.bytes;
993 : __entry->size = statbuf.size;
994 : } else {
995 : __entry->bytes_used = -1;
996 : __entry->size = -1;
997 : }
998 : __entry->ino = file_inode(xf->file)->i_ino;
999 : __entry->pos = pos;
1000 : __entry->bytecount = bytecount;
1001 : ),
1002 : TP_printk("xfino 0x%lx mem_bytes 0x%llx pos 0x%llx bytecount 0x%llx isize 0x%llx",
1003 : __entry->ino,
1004 : __entry->bytes_used,
1005 : __entry->pos,
1006 : __entry->bytecount,
1007 : __entry->size)
1008 : );
1009 : #define DEFINE_XFILE_EVENT(name) \
1010 : DEFINE_EVENT(xfile_class, name, \
1011 : TP_PROTO(struct xfile *xf, loff_t pos, unsigned long long bytecount), \
1012 : TP_ARGS(xf, pos, bytecount))
1013 21179459531 : DEFINE_XFILE_EVENT(xfile_pread);
1014 4985159339 : DEFINE_XFILE_EVENT(xfile_pwrite);
1015 9278256 : DEFINE_XFILE_EVENT(xfile_seek_data);
1016 26224758535 : DEFINE_XFILE_EVENT(xfile_get_page);
1017 181483289 : DEFINE_XFILE_EVENT(xfile_discard);
1018 11191 : DEFINE_XFILE_EVENT(xfile_prealloc);
1019 :
1020 0 : DECLARE_EVENT_CLASS(xfile_page_class,
1021 : TP_PROTO(struct xfile *xf, loff_t pos, struct page *page),
1022 : TP_ARGS(xf, pos, page),
1023 : TP_STRUCT__entry(
1024 : __field(unsigned long, ino)
1025 : __field(unsigned long long, bytes_used)
1026 : __field(loff_t, pos)
1027 : __field(loff_t, size)
1028 : __field(unsigned long long, bytecount)
1029 : __field(pgoff_t, pgoff)
1030 : ),
1031 : TP_fast_assign(
1032 : struct xfile_stat statbuf;
1033 : int ret;
1034 :
1035 : ret = xfile_stat(xf, &statbuf);
1036 : if (!ret) {
1037 : __entry->bytes_used = statbuf.bytes;
1038 : __entry->size = statbuf.size;
1039 : } else {
1040 : __entry->bytes_used = -1;
1041 : __entry->size = -1;
1042 : }
1043 : __entry->ino = file_inode(xf->file)->i_ino;
1044 : __entry->pos = pos;
1045 : __entry->bytecount = page_size(page);
1046 : __entry->pgoff = page_offset(page);
1047 : ),
1048 : TP_printk("xfino 0x%lx mem_bytes 0x%llx pos 0x%llx bytecount 0x%llx pgoff 0x%lx isize 0x%llx",
1049 : __entry->ino,
1050 : __entry->bytes_used,
1051 : __entry->pos,
1052 : __entry->bytecount,
1053 : __entry->pgoff,
1054 : __entry->size)
1055 : );
1056 : #define DEFINE_XFILE_PAGE_EVENT(name) \
1057 : DEFINE_EVENT(xfile_page_class, name, \
1058 : TP_PROTO(struct xfile *xf, loff_t pos, struct page *page), \
1059 : TP_ARGS(xf, pos, page))
1060 0 : DEFINE_XFILE_PAGE_EVENT(xfile_got_page);
1061 26248618176 : DEFINE_XFILE_PAGE_EVENT(xfile_put_page);
1062 :
1063 101556497 : TRACE_EVENT(xfarray_create,
1064 : TP_PROTO(struct xfarray *xfa, unsigned long long required_capacity),
1065 : TP_ARGS(xfa, required_capacity),
1066 : TP_STRUCT__entry(
1067 : __field(unsigned long, ino)
1068 : __field(uint64_t, max_nr)
1069 : __field(size_t, obj_size)
1070 : __field(int, obj_size_log)
1071 : __field(unsigned long long, required_capacity)
1072 : ),
1073 : TP_fast_assign(
1074 : __entry->max_nr = xfa->max_nr;
1075 : __entry->obj_size = xfa->obj_size;
1076 : __entry->obj_size_log = xfa->obj_size_log;
1077 : __entry->ino = file_inode(xfa->xfile->file)->i_ino;
1078 : __entry->required_capacity = required_capacity;
1079 : ),
1080 : TP_printk("xfino 0x%lx max_nr %llu reqd_nr %llu objsz %zu objszlog %d",
1081 : __entry->ino,
1082 : __entry->max_nr,
1083 : __entry->required_capacity,
1084 : __entry->obj_size,
1085 : __entry->obj_size_log)
1086 : );
1087 :
1088 7863 : TRACE_EVENT(xfarray_isort,
1089 : TP_PROTO(struct xfarray_sortinfo *si, uint64_t lo, uint64_t hi),
1090 : TP_ARGS(si, lo, hi),
1091 : TP_STRUCT__entry(
1092 : __field(unsigned long, ino)
1093 : __field(unsigned long long, lo)
1094 : __field(unsigned long long, hi)
1095 : ),
1096 : TP_fast_assign(
1097 : __entry->ino = file_inode(si->array->xfile->file)->i_ino;
1098 : __entry->lo = lo;
1099 : __entry->hi = hi;
1100 : ),
1101 : TP_printk("xfino 0x%lx lo %llu hi %llu elts %llu",
1102 : __entry->ino,
1103 : __entry->lo,
1104 : __entry->hi,
1105 : __entry->hi - __entry->lo)
1106 : );
1107 :
1108 424060 : TRACE_EVENT(xfarray_pagesort,
1109 : TP_PROTO(struct xfarray_sortinfo *si, uint64_t lo, uint64_t hi),
1110 : TP_ARGS(si, lo, hi),
1111 : TP_STRUCT__entry(
1112 : __field(unsigned long, ino)
1113 : __field(unsigned long long, lo)
1114 : __field(unsigned long long, hi)
1115 : ),
1116 : TP_fast_assign(
1117 : __entry->ino = file_inode(si->array->xfile->file)->i_ino;
1118 : __entry->lo = lo;
1119 : __entry->hi = hi;
1120 : ),
1121 : TP_printk("xfino 0x%lx lo %llu hi %llu elts %llu",
1122 : __entry->ino,
1123 : __entry->lo,
1124 : __entry->hi,
1125 : __entry->hi - __entry->lo)
1126 : );
1127 :
1128 522639 : TRACE_EVENT(xfarray_qsort,
1129 : TP_PROTO(struct xfarray_sortinfo *si, uint64_t lo, uint64_t hi),
1130 : TP_ARGS(si, lo, hi),
1131 : TP_STRUCT__entry(
1132 : __field(unsigned long, ino)
1133 : __field(unsigned long long, lo)
1134 : __field(unsigned long long, hi)
1135 : __field(int, stack_depth)
1136 : __field(int, max_stack_depth)
1137 : ),
1138 : TP_fast_assign(
1139 : __entry->ino = file_inode(si->array->xfile->file)->i_ino;
1140 : __entry->lo = lo;
1141 : __entry->hi = hi;
1142 : __entry->stack_depth = si->stack_depth;
1143 : __entry->max_stack_depth = si->max_stack_depth;
1144 : ),
1145 : TP_printk("xfino 0x%lx lo %llu hi %llu elts %llu stack %d/%d",
1146 : __entry->ino,
1147 : __entry->lo,
1148 : __entry->hi,
1149 : __entry->hi - __entry->lo,
1150 : __entry->stack_depth,
1151 : __entry->max_stack_depth)
1152 : );
1153 :
1154 341207 : TRACE_EVENT(xfarray_sort,
1155 : TP_PROTO(struct xfarray_sortinfo *si, size_t bytes),
1156 : TP_ARGS(si, bytes),
1157 : TP_STRUCT__entry(
1158 : __field(unsigned long, ino)
1159 : __field(unsigned long long, nr)
1160 : __field(size_t, obj_size)
1161 : __field(size_t, bytes)
1162 : __field(unsigned int, max_stack_depth)
1163 : ),
1164 : TP_fast_assign(
1165 : __entry->nr = si->array->nr;
1166 : __entry->obj_size = si->array->obj_size;
1167 : __entry->ino = file_inode(si->array->xfile->file)->i_ino;
1168 : __entry->bytes = bytes;
1169 : __entry->max_stack_depth = si->max_stack_depth;
1170 : ),
1171 : TP_printk("xfino 0x%lx nr %llu objsz %zu stack %u bytes %zu",
1172 : __entry->ino,
1173 : __entry->nr,
1174 : __entry->obj_size,
1175 : __entry->max_stack_depth,
1176 : __entry->bytes)
1177 : );
1178 :
1179 341206 : TRACE_EVENT(xfarray_sort_stats,
1180 : TP_PROTO(struct xfarray_sortinfo *si, int error),
1181 : TP_ARGS(si, error),
1182 : TP_STRUCT__entry(
1183 : __field(unsigned long, ino)
1184 : #ifdef DEBUG
1185 : __field(unsigned long long, loads)
1186 : __field(unsigned long long, stores)
1187 : __field(unsigned long long, compares)
1188 : __field(unsigned long long, heapsorts)
1189 : #endif
1190 : __field(unsigned int, max_stack_depth)
1191 : __field(unsigned int, max_stack_used)
1192 : __field(int, error)
1193 : ),
1194 : TP_fast_assign(
1195 : __entry->ino = file_inode(si->array->xfile->file)->i_ino;
1196 : #ifdef DEBUG
1197 : __entry->loads = si->loads;
1198 : __entry->stores = si->stores;
1199 : __entry->compares = si->compares;
1200 : __entry->heapsorts = si->heapsorts;
1201 : #endif
1202 : __entry->max_stack_depth = si->max_stack_depth;
1203 : __entry->max_stack_used = si->max_stack_used;
1204 : __entry->error = error;
1205 : ),
1206 : TP_printk(
1207 : #ifdef DEBUG
1208 : "xfino 0x%lx loads %llu stores %llu compares %llu heapsorts %llu stack_depth %u/%u error %d",
1209 : #else
1210 : "xfino 0x%lx stack_depth %u/%u error %d",
1211 : #endif
1212 : __entry->ino,
1213 : #ifdef DEBUG
1214 : __entry->loads,
1215 : __entry->stores,
1216 : __entry->compares,
1217 : __entry->heapsorts,
1218 : #endif
1219 : __entry->max_stack_used,
1220 : __entry->max_stack_depth,
1221 : __entry->error)
1222 : );
1223 :
1224 : #ifdef CONFIG_XFS_RT
1225 7382430 : TRACE_EVENT(xchk_rtsum_record_free,
1226 : TP_PROTO(struct xfs_mount *mp, xfs_rtxnum_t start,
1227 : xfs_rtbxlen_t len, unsigned int log, loff_t pos,
1228 : union xfs_suminfo_ondisk *v),
1229 : TP_ARGS(mp, start, len, log, pos, v),
1230 : TP_STRUCT__entry(
1231 : __field(dev_t, dev)
1232 : __field(dev_t, rtdev)
1233 : __field(xfs_rtxnum_t, start)
1234 : __field(unsigned long long, len)
1235 : __field(unsigned int, log)
1236 : __field(loff_t, pos)
1237 : __field(xfs_suminfo_t, v)
1238 : ),
1239 : TP_fast_assign(
1240 : __entry->dev = mp->m_super->s_dev;
1241 : __entry->rtdev = mp->m_rtdev_targp->bt_dev;
1242 : __entry->start = start;
1243 : __entry->len = len;
1244 : __entry->log = log;
1245 : __entry->pos = pos;
1246 : __entry->v = xfs_suminfo_get(mp, v);
1247 : ),
1248 : TP_printk("dev %d:%d rtdev %d:%d rtx 0x%llx rtxcount 0x%llx log %u rsumpos 0x%llx sumcount %u",
1249 : MAJOR(__entry->dev), MINOR(__entry->dev),
1250 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
1251 : __entry->start,
1252 : __entry->len,
1253 : __entry->log,
1254 : __entry->pos,
1255 : __entry->v)
1256 : );
1257 : #endif /* CONFIG_XFS_RT */
1258 :
1259 0 : DECLARE_EVENT_CLASS(xchk_iscan_class,
1260 : TP_PROTO(struct xchk_iscan *iscan),
1261 : TP_ARGS(iscan),
1262 : TP_STRUCT__entry(
1263 : __field(dev_t, dev)
1264 : __field(xfs_ino_t, cursor)
1265 : __field(xfs_ino_t, visited)
1266 : ),
1267 : TP_fast_assign(
1268 : __entry->dev = iscan->sc->mp->m_super->s_dev;
1269 : __entry->cursor = iscan->cursor_ino;
1270 : __entry->visited = iscan->__visited_ino;
1271 : ),
1272 : TP_printk("dev %d:%d iscan cursor 0x%llx visited 0x%llx",
1273 : MAJOR(__entry->dev), MINOR(__entry->dev),
1274 : __entry->cursor,
1275 : __entry->visited)
1276 : )
1277 : #define DEFINE_ISCAN_EVENT(name) \
1278 : DEFINE_EVENT(xchk_iscan_class, name, \
1279 : TP_PROTO(struct xchk_iscan *iscan), \
1280 : TP_ARGS(iscan))
1281 93938483 : DEFINE_ISCAN_EVENT(xchk_iscan_move_cursor);
1282 4921378131 : DEFINE_ISCAN_EVENT(xchk_iscan_visit);
1283 92943317 : DEFINE_ISCAN_EVENT(xchk_iscan_skip);
1284 870042 : DEFINE_ISCAN_EVENT(xchk_iscan_advance_ag);
1285 :
1286 0 : DECLARE_EVENT_CLASS(xchk_iscan_ino_class,
1287 : TP_PROTO(struct xchk_iscan *iscan, xfs_ino_t ino),
1288 : TP_ARGS(iscan, ino),
1289 : TP_STRUCT__entry(
1290 : __field(dev_t, dev)
1291 : __field(xfs_ino_t, startino)
1292 : __field(xfs_ino_t, cursor)
1293 : __field(xfs_ino_t, visited)
1294 : __field(xfs_ino_t, ino)
1295 : ),
1296 : TP_fast_assign(
1297 : __entry->dev = iscan->sc->mp->m_super->s_dev;
1298 : __entry->startino = iscan->scan_start_ino;
1299 : __entry->cursor = iscan->cursor_ino;
1300 : __entry->visited = iscan->__visited_ino;
1301 : __entry->ino = ino;
1302 : ),
1303 : TP_printk("dev %d:%d iscan start 0x%llx cursor 0x%llx visited 0x%llx ino 0x%llx",
1304 : MAJOR(__entry->dev), MINOR(__entry->dev),
1305 : __entry->startino,
1306 : __entry->cursor,
1307 : __entry->visited,
1308 : __entry->ino)
1309 : )
1310 : #define DEFINE_ISCAN_INO_EVENT(name) \
1311 : DEFINE_EVENT(xchk_iscan_ino_class, name, \
1312 : TP_PROTO(struct xchk_iscan *iscan, xfs_ino_t ino), \
1313 : TP_ARGS(iscan, ino))
1314 25328524 : DEFINE_ISCAN_INO_EVENT(xchk_iscan_want_live_update);
1315 211566 : DEFINE_ISCAN_INO_EVENT(xchk_iscan_start);
1316 :
1317 93066838 : TRACE_EVENT(xchk_iscan_iget,
1318 : TP_PROTO(struct xchk_iscan *iscan, int error),
1319 : TP_ARGS(iscan, error),
1320 : TP_STRUCT__entry(
1321 : __field(dev_t, dev)
1322 : __field(xfs_ino_t, cursor)
1323 : __field(xfs_ino_t, visited)
1324 : __field(int, error)
1325 : ),
1326 : TP_fast_assign(
1327 : __entry->dev = iscan->sc->mp->m_super->s_dev;
1328 : __entry->cursor = iscan->cursor_ino;
1329 : __entry->visited = iscan->__visited_ino;
1330 : __entry->error = error;
1331 : ),
1332 : TP_printk("dev %d:%d iscan cursor 0x%llx visited 0x%llx error %d",
1333 : MAJOR(__entry->dev), MINOR(__entry->dev),
1334 : __entry->cursor,
1335 : __entry->visited,
1336 : __entry->error)
1337 : );
1338 :
1339 92940952 : TRACE_EVENT(xchk_iscan_iget_batch,
1340 : TP_PROTO(struct xfs_mount *mp, struct xchk_iscan *iscan,
1341 : unsigned int nr, unsigned int avail),
1342 : TP_ARGS(mp, iscan, nr, avail),
1343 : TP_STRUCT__entry(
1344 : __field(dev_t, dev)
1345 : __field(xfs_ino_t, cursor)
1346 : __field(xfs_ino_t, visited)
1347 : __field(unsigned int, nr)
1348 : __field(unsigned int, avail)
1349 : __field(unsigned int, unavail)
1350 : __field(xfs_ino_t, batch_ino)
1351 : __field(unsigned long long, skipmask)
1352 : ),
1353 : TP_fast_assign(
1354 : __entry->dev = mp->m_super->s_dev;
1355 : __entry->cursor = iscan->cursor_ino;
1356 : __entry->visited = iscan->__visited_ino;
1357 : __entry->nr = nr;
1358 : __entry->avail = avail;
1359 : __entry->unavail = hweight64(iscan->__skipped_inomask);
1360 : __entry->batch_ino = iscan->__batch_ino;
1361 : __entry->skipmask = iscan->__skipped_inomask;
1362 : ),
1363 : TP_printk("dev %d:%d iscan cursor 0x%llx visited 0x%llx batchino 0x%llx skipmask 0x%llx nr %u avail %u unavail %u",
1364 : MAJOR(__entry->dev), MINOR(__entry->dev),
1365 : __entry->cursor,
1366 : __entry->visited,
1367 : __entry->batch_ino,
1368 : __entry->skipmask,
1369 : __entry->nr,
1370 : __entry->avail,
1371 : __entry->unavail)
1372 : );
1373 :
1374 123151 : TRACE_EVENT(xchk_iscan_iget_retry_wait,
1375 : TP_PROTO(struct xchk_iscan *iscan),
1376 : TP_ARGS(iscan),
1377 : TP_STRUCT__entry(
1378 : __field(dev_t, dev)
1379 : __field(xfs_ino_t, cursor)
1380 : __field(xfs_ino_t, visited)
1381 : __field(unsigned int, retry_delay)
1382 : __field(unsigned long, remaining)
1383 : __field(unsigned int, iget_timeout)
1384 : ),
1385 : TP_fast_assign(
1386 : __entry->dev = iscan->sc->mp->m_super->s_dev;
1387 : __entry->cursor = iscan->cursor_ino;
1388 : __entry->visited = iscan->__visited_ino;
1389 : __entry->retry_delay = iscan->iget_retry_delay;
1390 : __entry->remaining = jiffies_to_msecs(iscan->__iget_deadline - jiffies);
1391 : __entry->iget_timeout = iscan->iget_timeout;
1392 : ),
1393 : TP_printk("dev %d:%d iscan cursor 0x%llx visited 0x%llx remaining %lu timeout %u delay %u",
1394 : MAJOR(__entry->dev), MINOR(__entry->dev),
1395 : __entry->cursor,
1396 : __entry->visited,
1397 : __entry->remaining,
1398 : __entry->iget_timeout,
1399 : __entry->retry_delay)
1400 : );
1401 :
1402 842182731 : TRACE_EVENT(xchk_nlinks_collect_dirent,
1403 : TP_PROTO(struct xfs_mount *mp, struct xfs_inode *dp,
1404 : xfs_ino_t ino, const struct xfs_name *name),
1405 : TP_ARGS(mp, dp, ino, name),
1406 : TP_STRUCT__entry(
1407 : __field(dev_t, dev)
1408 : __field(xfs_ino_t, dir)
1409 : __field(xfs_ino_t, ino)
1410 : __field(unsigned int, namelen)
1411 : __dynamic_array(char, name, name->len)
1412 : ),
1413 : TP_fast_assign(
1414 : __entry->dev = mp->m_super->s_dev;
1415 : __entry->dir = dp->i_ino;
1416 : __entry->ino = ino;
1417 : __entry->namelen = name->len;
1418 : memcpy(__get_str(name), name->name, name->len);
1419 : ),
1420 : TP_printk("dev %d:%d dir 0x%llx -> ino 0x%llx name '%.*s'",
1421 : MAJOR(__entry->dev), MINOR(__entry->dev),
1422 : __entry->dir,
1423 : __entry->ino,
1424 : __entry->namelen,
1425 : __get_str(name))
1426 : );
1427 :
1428 154771167 : TRACE_EVENT(xchk_nlinks_collect_pptr,
1429 : TP_PROTO(struct xfs_mount *mp, struct xfs_inode *dp,
1430 : const struct xfs_parent_name_irec *pptr),
1431 : TP_ARGS(mp, dp, pptr),
1432 : TP_STRUCT__entry(
1433 : __field(dev_t, dev)
1434 : __field(xfs_ino_t, dir)
1435 : __field(xfs_ino_t, ino)
1436 : __field(unsigned int, namelen)
1437 : __dynamic_array(char, name, pptr->p_namelen)
1438 : ),
1439 : TP_fast_assign(
1440 : __entry->dev = mp->m_super->s_dev;
1441 : __entry->dir = dp->i_ino;
1442 : __entry->ino = pptr->p_ino;
1443 : __entry->namelen = pptr->p_namelen;
1444 : memcpy(__get_str(name), pptr->p_name, pptr->p_namelen);
1445 : ),
1446 : TP_printk("dev %d:%d dir 0x%llx -> ino 0x%llx name '%.*s'",
1447 : MAJOR(__entry->dev), MINOR(__entry->dev),
1448 : __entry->dir,
1449 : __entry->ino,
1450 : __entry->namelen,
1451 : __get_str(name))
1452 : );
1453 :
1454 292 : TRACE_EVENT(xchk_nlinks_collect_metafile,
1455 : TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino),
1456 : TP_ARGS(mp, ino),
1457 : TP_STRUCT__entry(
1458 : __field(dev_t, dev)
1459 : __field(xfs_ino_t, ino)
1460 : ),
1461 : TP_fast_assign(
1462 : __entry->dev = mp->m_super->s_dev;
1463 : __entry->ino = ino;
1464 : ),
1465 : TP_printk("dev %d:%d ino 0x%llx",
1466 : MAJOR(__entry->dev), MINOR(__entry->dev),
1467 : __entry->ino)
1468 : );
1469 :
1470 10020235 : TRACE_EVENT(xchk_nlinks_live_update,
1471 : TP_PROTO(struct xfs_mount *mp, const struct xfs_inode *dp,
1472 : int action, xfs_ino_t ino, int delta,
1473 : const char *name, unsigned int namelen),
1474 : TP_ARGS(mp, dp, action, ino, delta, name, namelen),
1475 : TP_STRUCT__entry(
1476 : __field(dev_t, dev)
1477 : __field(xfs_ino_t, dir)
1478 : __field(int, action)
1479 : __field(xfs_ino_t, ino)
1480 : __field(int, delta)
1481 : __field(unsigned int, namelen)
1482 : __dynamic_array(char, name, namelen)
1483 : ),
1484 : TP_fast_assign(
1485 : __entry->dev = mp->m_super->s_dev;
1486 : __entry->dir = dp ? dp->i_ino : NULLFSINO;
1487 : __entry->action = action;
1488 : __entry->ino = ino;
1489 : __entry->delta = delta;
1490 : __entry->namelen = namelen;
1491 : memcpy(__get_str(name), name, namelen);
1492 : ),
1493 : TP_printk("dev %d:%d dir 0x%llx ino 0x%llx nlink_delta %d name '%.*s'",
1494 : MAJOR(__entry->dev), MINOR(__entry->dev),
1495 : __entry->dir,
1496 : __entry->ino,
1497 : __entry->delta,
1498 : __entry->namelen,
1499 : __get_str(name))
1500 : );
1501 :
1502 266 : TRACE_EVENT(xchk_nlinks_check_zero,
1503 : TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino,
1504 : const struct xchk_nlink *live),
1505 : TP_ARGS(mp, ino, live),
1506 : TP_STRUCT__entry(
1507 : __field(dev_t, dev)
1508 : __field(xfs_ino_t, ino)
1509 : __field(xfs_nlink_t, parents)
1510 : __field(xfs_nlink_t, backrefs)
1511 : __field(xfs_nlink_t, children)
1512 : ),
1513 : TP_fast_assign(
1514 : __entry->dev = mp->m_super->s_dev;
1515 : __entry->ino = ino;
1516 : __entry->parents = live->parents;
1517 : __entry->backrefs = live->backrefs;
1518 : __entry->children = live->children;
1519 : ),
1520 : TP_printk("dev %d:%d ino 0x%llx parents %u backrefs %u children %u",
1521 : MAJOR(__entry->dev), MINOR(__entry->dev),
1522 : __entry->ino,
1523 : __entry->parents,
1524 : __entry->backrefs,
1525 : __entry->children)
1526 : );
1527 :
1528 852698880 : TRACE_EVENT(xchk_nlinks_update_incore,
1529 : TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino,
1530 : const struct xchk_nlink *live, int parents_delta,
1531 : int backrefs_delta, int children_delta),
1532 : TP_ARGS(mp, ino, live, parents_delta, backrefs_delta, children_delta),
1533 : TP_STRUCT__entry(
1534 : __field(dev_t, dev)
1535 : __field(xfs_ino_t, ino)
1536 : __field(xfs_nlink_t, parents)
1537 : __field(xfs_nlink_t, backrefs)
1538 : __field(xfs_nlink_t, children)
1539 : __field(int, parents_delta)
1540 : __field(int, backrefs_delta)
1541 : __field(int, children_delta)
1542 : ),
1543 : TP_fast_assign(
1544 : __entry->dev = mp->m_super->s_dev;
1545 : __entry->ino = ino;
1546 : __entry->parents = live->parents;
1547 : __entry->backrefs = live->backrefs;
1548 : __entry->children = live->children;
1549 : __entry->parents_delta = parents_delta;
1550 : __entry->backrefs_delta = backrefs_delta;
1551 : __entry->children_delta = children_delta;
1552 : ),
1553 : TP_printk("dev %d:%d ino 0x%llx parents %d:%u backrefs %d:%u children %d:%u",
1554 : MAJOR(__entry->dev), MINOR(__entry->dev),
1555 : __entry->ino,
1556 : __entry->parents_delta,
1557 : __entry->parents,
1558 : __entry->backrefs_delta,
1559 : __entry->backrefs,
1560 : __entry->children_delta,
1561 : __entry->children)
1562 : );
1563 :
1564 0 : DECLARE_EVENT_CLASS(xchk_nlinks_diff_class,
1565 : TP_PROTO(struct xfs_mount *mp, struct xfs_inode *ip,
1566 : const struct xchk_nlink *live),
1567 : TP_ARGS(mp, ip, live),
1568 : TP_STRUCT__entry(
1569 : __field(dev_t, dev)
1570 : __field(xfs_ino_t, ino)
1571 : __field(uint8_t, ftype)
1572 : __field(xfs_nlink_t, nlink)
1573 : __field(xfs_nlink_t, parents)
1574 : __field(xfs_nlink_t, backrefs)
1575 : __field(xfs_nlink_t, children)
1576 : ),
1577 : TP_fast_assign(
1578 : __entry->dev = mp->m_super->s_dev;
1579 : __entry->ino = ip->i_ino;
1580 : __entry->ftype = xfs_mode_to_ftype(VFS_I(ip)->i_mode);
1581 : __entry->nlink = VFS_I(ip)->i_nlink;
1582 : __entry->parents = live->parents;
1583 : __entry->backrefs = live->backrefs;
1584 : __entry->children = live->children;
1585 : ),
1586 : TP_printk("dev %d:%d ino 0x%llx ftype %s nlink %u parents %u backrefs %u children %u",
1587 : MAJOR(__entry->dev), MINOR(__entry->dev),
1588 : __entry->ino,
1589 : __print_symbolic(__entry->ftype, XFS_DIR3_FTYPE_STR),
1590 : __entry->nlink,
1591 : __entry->parents,
1592 : __entry->backrefs,
1593 : __entry->children)
1594 : );
1595 : #define DEFINE_SCRUB_NLINKS_DIFF_EVENT(name) \
1596 : DEFINE_EVENT(xchk_nlinks_diff_class, name, \
1597 : TP_PROTO(struct xfs_mount *mp, struct xfs_inode *ip, \
1598 : const struct xchk_nlink *live), \
1599 : TP_ARGS(mp, ip, live))
1600 439545632 : DEFINE_SCRUB_NLINKS_DIFF_EVENT(xchk_nlinks_compare_inode);
1601 :
1602 0 : DECLARE_EVENT_CLASS(xchk_pptr_class,
1603 : TP_PROTO(struct xfs_inode *ip, const unsigned char *name,
1604 : unsigned int namelen, xfs_ino_t parent_ino),
1605 : TP_ARGS(ip, name, namelen, parent_ino),
1606 : TP_STRUCT__entry(
1607 : __field(dev_t, dev)
1608 : __field(xfs_ino_t, ino)
1609 : __field(unsigned int, namelen)
1610 : __dynamic_array(char, name, namelen)
1611 : __field(xfs_ino_t, parent_ino)
1612 : ),
1613 : TP_fast_assign(
1614 : __entry->dev = ip->i_mount->m_super->s_dev;
1615 : __entry->ino = ip->i_ino;
1616 : __entry->namelen = namelen;
1617 : memcpy(__get_str(name), name, namelen);
1618 : __entry->parent_ino = parent_ino;
1619 : ),
1620 : TP_printk("dev %d:%d ino 0x%llx name '%.*s' parent_ino 0x%llx",
1621 : MAJOR(__entry->dev), MINOR(__entry->dev),
1622 : __entry->ino,
1623 : __entry->namelen,
1624 : __get_str(name),
1625 : __entry->parent_ino)
1626 : )
1627 : #define DEFINE_XCHK_PPTR_EVENT(name) \
1628 : DEFINE_EVENT(xchk_pptr_class, name, \
1629 : TP_PROTO(struct xfs_inode *ip, const unsigned char *name, \
1630 : unsigned int namelen, xfs_ino_t parent_ino), \
1631 : TP_ARGS(ip, name, namelen, parent_ino))
1632 31138 : DEFINE_XCHK_PPTR_EVENT(xchk_dir_defer);
1633 0 : DEFINE_XCHK_PPTR_EVENT(xchk_dir_slowpath);
1634 22538547 : DEFINE_XCHK_PPTR_EVENT(xchk_parent_defer);
1635 0 : DEFINE_XCHK_PPTR_EVENT(xchk_parent_slowpath);
1636 :
1637 0 : DECLARE_EVENT_CLASS(xchk_dirtree_class,
1638 : TP_PROTO(struct xfs_scrub *sc, struct xfs_inode *ip,
1639 : unsigned int path_nr,
1640 : const struct xfs_parent_name_irec *pptr),
1641 : TP_ARGS(sc, ip, path_nr, pptr),
1642 : TP_STRUCT__entry(
1643 : __field(dev_t, dev)
1644 : __field(unsigned int, path_nr)
1645 : __field(xfs_ino_t, child_ino)
1646 : __field(unsigned int, child_gen)
1647 : __field(xfs_ino_t, parent_ino)
1648 : __field(unsigned int, parent_gen)
1649 : __field(unsigned int, namelen)
1650 : __dynamic_array(char, name, pptr->p_namelen)
1651 : ),
1652 : TP_fast_assign(
1653 : __entry->dev = sc->mp->m_super->s_dev;
1654 : __entry->path_nr = path_nr;
1655 : __entry->child_ino = ip->i_ino;
1656 : __entry->child_gen = VFS_I(ip)->i_generation;
1657 : __entry->parent_ino = pptr->p_ino;
1658 : __entry->parent_gen = pptr->p_gen;
1659 : __entry->namelen = pptr->p_namelen;
1660 : memcpy(__get_str(name), pptr->p_name, pptr->p_namelen);
1661 : ),
1662 : TP_printk("dev %d:%d path %u child_ino 0x%llx child_gen 0x%x parent_ino 0x%llx parent_gen 0x%x name '%.*s'",
1663 : MAJOR(__entry->dev), MINOR(__entry->dev),
1664 : __entry->path_nr,
1665 : __entry->child_ino,
1666 : __entry->child_gen,
1667 : __entry->parent_ino,
1668 : __entry->parent_gen,
1669 : __entry->namelen,
1670 : __get_str(name))
1671 : );
1672 : #define DEFINE_XCHK_DIRTREE_EVENT(name) \
1673 : DEFINE_EVENT(xchk_dirtree_class, name, \
1674 : TP_PROTO(struct xfs_scrub *sc, struct xfs_inode *ip, \
1675 : unsigned int path_nr, \
1676 : const struct xfs_parent_name_irec *pptr), \
1677 : TP_ARGS(sc, ip, path_nr, pptr))
1678 11445017 : DEFINE_XCHK_DIRTREE_EVENT(xchk_dirtree_create_path);
1679 11436720 : DEFINE_XCHK_DIRTREE_EVENT(xchk_dirpath_walk_upwards);
1680 :
1681 0 : DECLARE_EVENT_CLASS(xchk_dirpath_class,
1682 : TP_PROTO(struct xfs_scrub *sc, struct xfs_inode *ip,
1683 : unsigned int path_nr, unsigned int step_nr,
1684 : const struct xfs_parent_name_irec *pptr),
1685 : TP_ARGS(sc, ip, path_nr, step_nr, pptr),
1686 : TP_STRUCT__entry(
1687 : __field(dev_t, dev)
1688 : __field(unsigned int, path_nr)
1689 : __field(unsigned int, step_nr)
1690 : __field(xfs_ino_t, child_ino)
1691 : __field(unsigned int, child_gen)
1692 : __field(xfs_ino_t, parent_ino)
1693 : __field(unsigned int, parent_gen)
1694 : __field(unsigned int, namelen)
1695 : __dynamic_array(char, name, pptr->p_namelen)
1696 : ),
1697 : TP_fast_assign(
1698 : __entry->dev = sc->mp->m_super->s_dev;
1699 : __entry->path_nr = path_nr;
1700 : __entry->step_nr = step_nr;
1701 : __entry->child_ino = ip->i_ino;
1702 : __entry->child_gen = VFS_I(ip)->i_generation;
1703 : __entry->parent_ino = pptr->p_ino;
1704 : __entry->parent_gen = pptr->p_gen;
1705 : __entry->namelen = pptr->p_namelen;
1706 : memcpy(__get_str(name), pptr->p_name, pptr->p_namelen);
1707 : ),
1708 : TP_printk("dev %d:%d path %u step %u child_ino 0x%llx child_gen 0x%x parent_ino 0x%llx parent_gen 0x%x name '%.*s'",
1709 : MAJOR(__entry->dev), MINOR(__entry->dev),
1710 : __entry->path_nr,
1711 : __entry->step_nr,
1712 : __entry->child_ino,
1713 : __entry->child_gen,
1714 : __entry->parent_ino,
1715 : __entry->parent_gen,
1716 : __entry->namelen,
1717 : __get_str(name))
1718 : );
1719 : #define DEFINE_XCHK_DIRPATH_EVENT(name) \
1720 : DEFINE_EVENT(xchk_dirpath_class, name, \
1721 : TP_PROTO(struct xfs_scrub *sc, struct xfs_inode *ip, \
1722 : unsigned int path_nr, unsigned int step_nr, \
1723 : const struct xfs_parent_name_irec *pptr), \
1724 : TP_ARGS(sc, ip, path_nr, step_nr, pptr))
1725 0 : DEFINE_XCHK_DIRPATH_EVENT(xchk_dirpath_disappeared);
1726 0 : DEFINE_XCHK_DIRPATH_EVENT(xchk_dirpath_badgen);
1727 0 : DEFINE_XCHK_DIRPATH_EVENT(xchk_dirpath_nondir_parent);
1728 0 : DEFINE_XCHK_DIRPATH_EVENT(xchk_dirpath_unlinked_parent);
1729 1057491734 : DEFINE_XCHK_DIRPATH_EVENT(xchk_dirpath_found_next_step);
1730 0 : DEFINE_XCHK_DIRPATH_EVENT(xchk_dirpath_crosses_tree);
1731 :
1732 : TRACE_DEFINE_ENUM(XCHK_DIRPATH_SCANNING);
1733 : TRACE_DEFINE_ENUM(XCHK_DIRPATH_DELETE);
1734 : TRACE_DEFINE_ENUM(XCHK_DIRPATH_CORRUPT);
1735 : TRACE_DEFINE_ENUM(XCHK_DIRPATH_LOOP);
1736 : TRACE_DEFINE_ENUM(XCHK_DIRPATH_STALE);
1737 : TRACE_DEFINE_ENUM(XCHK_DIRPATH_OK);
1738 : TRACE_DEFINE_ENUM(XREP_DIRPATH_DELETING);
1739 : TRACE_DEFINE_ENUM(XREP_DIRPATH_DELETED);
1740 : TRACE_DEFINE_ENUM(XREP_DIRPATH_ADOPTING);
1741 : TRACE_DEFINE_ENUM(XREP_DIRPATH_ADOPTED);
1742 :
1743 : #define XCHK_DIRPATH_OUTCOME_STRINGS \
1744 : { XCHK_DIRPATH_SCANNING, "scanning" }, \
1745 : { XCHK_DIRPATH_DELETE, "delete" }, \
1746 : { XCHK_DIRPATH_CORRUPT, "corrupt" }, \
1747 : { XCHK_DIRPATH_LOOP, "loop" }, \
1748 : { XCHK_DIRPATH_STALE, "stale" }, \
1749 : { XCHK_DIRPATH_OK, "ok" }, \
1750 : { XREP_DIRPATH_DELETING, "deleting" }, \
1751 : { XREP_DIRPATH_DELETED, "deleted" }, \
1752 : { XREP_DIRPATH_ADOPTING, "adopting" }, \
1753 : { XREP_DIRPATH_ADOPTED, "adopted" }
1754 :
1755 0 : DECLARE_EVENT_CLASS(xchk_dirpath_outcome_class,
1756 : TP_PROTO(struct xfs_scrub *sc, unsigned long long path_nr,
1757 : unsigned int nr_steps, \
1758 : unsigned int outcome),
1759 : TP_ARGS(sc, path_nr, nr_steps, outcome),
1760 : TP_STRUCT__entry(
1761 : __field(dev_t, dev)
1762 : __field(unsigned long long, path_nr)
1763 : __field(unsigned int, nr_steps)
1764 : __field(unsigned int, outcome)
1765 : ),
1766 : TP_fast_assign(
1767 : __entry->dev = sc->mp->m_super->s_dev;
1768 : __entry->path_nr = path_nr;
1769 : __entry->nr_steps = nr_steps;
1770 : __entry->outcome = outcome;
1771 : ),
1772 : TP_printk("dev %d:%d path %llu steps %u outcome %s",
1773 : MAJOR(__entry->dev), MINOR(__entry->dev),
1774 : __entry->path_nr,
1775 : __entry->nr_steps,
1776 : __print_symbolic(__entry->outcome, XCHK_DIRPATH_OUTCOME_STRINGS))
1777 : );
1778 : #define DEFINE_XCHK_DIRPATH_OUTCOME_EVENT(name) \
1779 : DEFINE_EVENT(xchk_dirpath_outcome_class, name, \
1780 : TP_PROTO(struct xfs_scrub *sc, unsigned long long path_nr, \
1781 : unsigned int nr_steps, \
1782 : unsigned int outcome), \
1783 : TP_ARGS(sc, path_nr, nr_steps, outcome))
1784 11446465 : DEFINE_XCHK_DIRPATH_OUTCOME_EVENT(xchk_dirpath_set_outcome);
1785 11500866 : DEFINE_XCHK_DIRPATH_OUTCOME_EVENT(xchk_dirpath_evaluate_path);
1786 :
1787 0 : DECLARE_EVENT_CLASS(xchk_dirtree_evaluate_class,
1788 : TP_PROTO(const struct xchk_dirtree *dl,
1789 : const struct xchk_dirtree_outcomes *oc),
1790 : TP_ARGS(dl, oc),
1791 : TP_STRUCT__entry(
1792 : __field(dev_t, dev)
1793 : __field(xfs_ino_t, ino)
1794 : __field(xfs_ino_t, rootino)
1795 : __field(unsigned int, nr_paths)
1796 : __field(unsigned int, bad)
1797 : __field(unsigned int, suspect)
1798 : __field(unsigned int, good)
1799 : __field(bool, needs_adoption)
1800 : ),
1801 : TP_fast_assign(
1802 : __entry->dev = dl->sc->mp->m_super->s_dev;
1803 : __entry->ino = dl->sc->ip->i_ino;
1804 : __entry->rootino = dl->root_ino;
1805 : __entry->nr_paths = dl->nr_paths;
1806 : __entry->bad = oc->bad;
1807 : __entry->suspect = oc->suspect;
1808 : __entry->good = oc->good;
1809 : __entry->needs_adoption = oc->needs_adoption ? 1 : 0;
1810 : ),
1811 : TP_printk("dev %d:%d ino 0x%llx rootino 0x%llx nr_paths %u bad %u suspect %u good %u adopt? %d",
1812 : MAJOR(__entry->dev), MINOR(__entry->dev),
1813 : __entry->ino,
1814 : __entry->rootino,
1815 : __entry->nr_paths,
1816 : __entry->bad,
1817 : __entry->suspect,
1818 : __entry->good,
1819 : __entry->needs_adoption)
1820 : );
1821 : #define DEFINE_XCHK_DIRTREE_EVALUATE_EVENT(name) \
1822 : DEFINE_EVENT(xchk_dirtree_evaluate_class, name, \
1823 : TP_PROTO(const struct xchk_dirtree *dl, \
1824 : const struct xchk_dirtree_outcomes *oc), \
1825 : TP_ARGS(dl, oc))
1826 11514220 : DEFINE_XCHK_DIRTREE_EVALUATE_EVENT(xchk_dirtree_evaluate);
1827 :
1828 3282 : TRACE_EVENT(xchk_dirpath_changed,
1829 : TP_PROTO(struct xfs_scrub *sc, unsigned int path_nr,
1830 : unsigned int step_nr, const struct xfs_inode *dp,
1831 : const struct xfs_inode *ip, const struct xfs_name *xname),
1832 : TP_ARGS(sc, path_nr, step_nr, dp, ip, xname),
1833 : TP_STRUCT__entry(
1834 : __field(dev_t, dev)
1835 : __field(unsigned int, path_nr)
1836 : __field(unsigned int, step_nr)
1837 : __field(xfs_ino_t, child_ino)
1838 : __field(xfs_ino_t, parent_ino)
1839 : __field(unsigned int, namelen)
1840 : __dynamic_array(char, name, xname->len)
1841 : ),
1842 : TP_fast_assign(
1843 : __entry->dev = sc->mp->m_super->s_dev;
1844 : __entry->path_nr = path_nr;
1845 : __entry->step_nr = step_nr;
1846 : __entry->child_ino = ip->i_ino;
1847 : __entry->parent_ino = dp->i_ino;
1848 : __entry->namelen = xname->len;
1849 : memcpy(__get_str(name), xname->name, xname->len);
1850 : ),
1851 : TP_printk("dev %d:%d path %u step %u child_ino 0x%llx parent_ino 0x%llx name '%.*s'",
1852 : MAJOR(__entry->dev), MINOR(__entry->dev),
1853 : __entry->path_nr,
1854 : __entry->step_nr,
1855 : __entry->child_ino,
1856 : __entry->parent_ino,
1857 : __entry->namelen,
1858 : __get_str(name))
1859 : );
1860 :
1861 9720159 : TRACE_EVENT(xchk_dirtree_live_update,
1862 : TP_PROTO(struct xfs_scrub *sc, const struct xfs_inode *dp,
1863 : int action, const struct xfs_inode *ip, int delta,
1864 : const struct xfs_name *xname),
1865 : TP_ARGS(sc, dp, action, ip, delta, xname),
1866 : TP_STRUCT__entry(
1867 : __field(dev_t, dev)
1868 : __field(xfs_ino_t, parent_ino)
1869 : __field(int, action)
1870 : __field(xfs_ino_t, child_ino)
1871 : __field(int, delta)
1872 : __field(unsigned int, namelen)
1873 : __dynamic_array(char, name, xname->len)
1874 : ),
1875 : TP_fast_assign(
1876 : __entry->dev = sc->mp->m_super->s_dev;
1877 : __entry->parent_ino = dp->i_ino;
1878 : __entry->action = action;
1879 : __entry->child_ino = ip->i_ino;
1880 : __entry->delta = delta;
1881 : __entry->namelen = xname->len;
1882 : memcpy(__get_str(name), xname->name, xname->len);
1883 : ),
1884 : TP_printk("dev %d:%d parent_ino 0x%llx child_ino 0x%llx nlink_delta %d name '%.*s'",
1885 : MAJOR(__entry->dev), MINOR(__entry->dev),
1886 : __entry->parent_ino,
1887 : __entry->child_ino,
1888 : __entry->delta,
1889 : __entry->namelen,
1890 : __get_str(name))
1891 : );
1892 :
1893 : /* repair tracepoints */
1894 : #if IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR)
1895 :
1896 0 : DECLARE_EVENT_CLASS(xrep_extent_class,
1897 : TP_PROTO(struct xfs_perag *pag, xfs_agblock_t agbno, xfs_extlen_t len),
1898 : TP_ARGS(pag, agbno, len),
1899 : TP_STRUCT__entry(
1900 : __field(dev_t, dev)
1901 : __field(xfs_agnumber_t, agno)
1902 : __field(xfs_agblock_t, agbno)
1903 : __field(xfs_extlen_t, len)
1904 : ),
1905 : TP_fast_assign(
1906 : __entry->dev = pag->pag_mount->m_super->s_dev;
1907 : __entry->agno = pag->pag_agno;
1908 : __entry->agbno = agbno;
1909 : __entry->len = len;
1910 : ),
1911 : TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
1912 : MAJOR(__entry->dev), MINOR(__entry->dev),
1913 : __entry->agno,
1914 : __entry->agbno,
1915 : __entry->len)
1916 : );
1917 : #define DEFINE_REPAIR_EXTENT_EVENT(name) \
1918 : DEFINE_EVENT(xrep_extent_class, name, \
1919 : TP_PROTO(struct xfs_perag *pag, xfs_agblock_t agbno, xfs_extlen_t len), \
1920 : TP_ARGS(pag, agbno, len))
1921 0 : DEFINE_REPAIR_EXTENT_EVENT(xreap_dispose_unmap_extent);
1922 455845 : DEFINE_REPAIR_EXTENT_EVENT(xreap_dispose_free_extent);
1923 298787 : DEFINE_REPAIR_EXTENT_EVENT(xreap_agextent_binval);
1924 157060 : DEFINE_REPAIR_EXTENT_EVENT(xreap_bmapi_binval);
1925 915504 : DEFINE_REPAIR_EXTENT_EVENT(xrep_agfl_insert);
1926 :
1927 : #ifdef CONFIG_XFS_RT
1928 0 : DECLARE_EVENT_CLASS(xrep_rtgroup_extent_class,
1929 : TP_PROTO(struct xfs_rtgroup *rtg, xfs_rgblock_t rgbno,
1930 : xfs_extlen_t len),
1931 : TP_ARGS(rtg, rgbno, len),
1932 : TP_STRUCT__entry(
1933 : __field(dev_t, dev)
1934 : __field(dev_t, rtdev)
1935 : __field(xfs_rgnumber_t, rgno)
1936 : __field(xfs_rgblock_t, rgbno)
1937 : __field(xfs_extlen_t, len)
1938 : ),
1939 : TP_fast_assign(
1940 : __entry->dev = rtg->rtg_mount->m_super->s_dev;
1941 : __entry->rtdev = rtg->rtg_mount->m_rtdev_targp->bt_dev;
1942 : __entry->rgno = rtg->rtg_rgno;
1943 : __entry->rgbno = rgbno;
1944 : __entry->len = len;
1945 : ),
1946 : TP_printk("dev %d:%d rtdev %d:%d rgno 0x%x rgbno 0x%x fsbcount 0x%x",
1947 : MAJOR(__entry->dev), MINOR(__entry->dev),
1948 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
1949 : __entry->rgno,
1950 : __entry->rgbno,
1951 : __entry->len)
1952 : );
1953 : #define DEFINE_REPAIR_RTGROUP_EXTENT_EVENT(name) \
1954 : DEFINE_EVENT(xrep_rtgroup_extent_class, name, \
1955 : TP_PROTO(struct xfs_rtgroup *rtg, xfs_rgblock_t rgbno, \
1956 : xfs_extlen_t len), \
1957 : TP_ARGS(rtg, rgbno, len))
1958 0 : DEFINE_REPAIR_RTGROUP_EXTENT_EVENT(xreap_dispose_unmap_rtextent);
1959 2673 : DEFINE_REPAIR_RTGROUP_EXTENT_EVENT(xreap_dispose_free_rtextent);
1960 : #endif /* CONFIG_XFS_RT */
1961 :
1962 0 : DECLARE_EVENT_CLASS(xrep_reap_find_class,
1963 : TP_PROTO(struct xfs_perag *pag, xfs_agblock_t agbno, xfs_extlen_t len,
1964 : bool crosslinked),
1965 : TP_ARGS(pag, agbno, len, crosslinked),
1966 : TP_STRUCT__entry(
1967 : __field(dev_t, dev)
1968 : __field(xfs_agnumber_t, agno)
1969 : __field(xfs_agblock_t, agbno)
1970 : __field(xfs_extlen_t, len)
1971 : __field(bool, crosslinked)
1972 : ),
1973 : TP_fast_assign(
1974 : __entry->dev = pag->pag_mount->m_super->s_dev;
1975 : __entry->agno = pag->pag_agno;
1976 : __entry->agbno = agbno;
1977 : __entry->len = len;
1978 : __entry->crosslinked = crosslinked;
1979 : ),
1980 : TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x crosslinked %d",
1981 : MAJOR(__entry->dev), MINOR(__entry->dev),
1982 : __entry->agno,
1983 : __entry->agbno,
1984 : __entry->len,
1985 : __entry->crosslinked ? 1 : 0)
1986 : );
1987 : #define DEFINE_REPAIR_REAP_FIND_EVENT(name) \
1988 : DEFINE_EVENT(xrep_reap_find_class, name, \
1989 : TP_PROTO(struct xfs_perag *pag, xfs_agblock_t agbno, xfs_extlen_t len, \
1990 : bool crosslinked), \
1991 : TP_ARGS(pag, agbno, len, crosslinked))
1992 298787 : DEFINE_REPAIR_REAP_FIND_EVENT(xreap_agextent_select);
1993 157060 : DEFINE_REPAIR_REAP_FIND_EVENT(xreap_bmapi_select);
1994 :
1995 : #ifdef CONFIG_XFS_RT
1996 0 : DECLARE_EVENT_CLASS(xrep_rtgroup_reap_find_class,
1997 : TP_PROTO(struct xfs_rtgroup *rtg, xfs_rgblock_t rgbno, xfs_extlen_t len,
1998 : bool crosslinked),
1999 : TP_ARGS(rtg, rgbno, len, crosslinked),
2000 : TP_STRUCT__entry(
2001 : __field(dev_t, dev)
2002 : __field(dev_t, rtdev)
2003 : __field(xfs_rgnumber_t, rgno)
2004 : __field(xfs_rgblock_t, rgbno)
2005 : __field(xfs_extlen_t, len)
2006 : __field(bool, crosslinked)
2007 : ),
2008 : TP_fast_assign(
2009 : __entry->dev = rtg->rtg_mount->m_super->s_dev;
2010 : __entry->rtdev = rtg->rtg_mount->m_rtdev_targp->bt_dev;
2011 : __entry->rgno = rtg->rtg_rgno;
2012 : __entry->rgbno = rgbno;
2013 : __entry->len = len;
2014 : __entry->crosslinked = crosslinked;
2015 : ),
2016 : TP_printk("dev %d:%d rtdev %d:%d rgno 0x%x rgbno 0x%x fsbcount 0x%x crosslinked %d",
2017 : MAJOR(__entry->dev), MINOR(__entry->dev),
2018 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
2019 : __entry->rgno,
2020 : __entry->rgbno,
2021 : __entry->len,
2022 : __entry->crosslinked ? 1 : 0)
2023 : );
2024 : #define DEFINE_REPAIR_RTGROUP_REAP_FIND_EVENT(name) \
2025 : DEFINE_EVENT(xrep_rtgroup_reap_find_class, name, \
2026 : TP_PROTO(struct xfs_rtgroup *rtg, xfs_rgblock_t rgbno, \
2027 : xfs_extlen_t len, bool crosslinked), \
2028 : TP_ARGS(rtg, rgbno, len, crosslinked))
2029 2673 : DEFINE_REPAIR_RTGROUP_REAP_FIND_EVENT(xreap_rgextent_select);
2030 : #endif /* CONFIG_XFS_RT */
2031 :
2032 0 : DECLARE_EVENT_CLASS(xrep_rmap_class,
2033 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2034 : xfs_agblock_t agbno, xfs_extlen_t len,
2035 : uint64_t owner, uint64_t offset, unsigned int flags),
2036 : TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2037 : TP_STRUCT__entry(
2038 : __field(dev_t, dev)
2039 : __field(xfs_agnumber_t, agno)
2040 : __field(xfs_agblock_t, agbno)
2041 : __field(xfs_extlen_t, len)
2042 : __field(uint64_t, owner)
2043 : __field(uint64_t, offset)
2044 : __field(unsigned int, flags)
2045 : ),
2046 : TP_fast_assign(
2047 : __entry->dev = mp->m_super->s_dev;
2048 : __entry->agno = agno;
2049 : __entry->agbno = agbno;
2050 : __entry->len = len;
2051 : __entry->owner = owner;
2052 : __entry->offset = offset;
2053 : __entry->flags = flags;
2054 : ),
2055 : TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
2056 : MAJOR(__entry->dev), MINOR(__entry->dev),
2057 : __entry->agno,
2058 : __entry->agbno,
2059 : __entry->len,
2060 : __entry->owner,
2061 : __entry->offset,
2062 : __entry->flags)
2063 : );
2064 : #define DEFINE_REPAIR_RMAP_EVENT(name) \
2065 : DEFINE_EVENT(xrep_rmap_class, name, \
2066 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2067 : xfs_agblock_t agbno, xfs_extlen_t len, \
2068 : uint64_t owner, uint64_t offset, unsigned int flags), \
2069 : TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2070 8578304 : DEFINE_REPAIR_RMAP_EVENT(xrep_ibt_walk_rmap);
2071 0 : DEFINE_REPAIR_RMAP_EVENT(xrep_bmap_walk_rmap);
2072 :
2073 48283610 : TRACE_EVENT(xrep_abt_found,
2074 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2075 : const struct xfs_alloc_rec_incore *rec),
2076 : TP_ARGS(mp, agno, rec),
2077 : TP_STRUCT__entry(
2078 : __field(dev_t, dev)
2079 : __field(xfs_agnumber_t, agno)
2080 : __field(xfs_agblock_t, startblock)
2081 : __field(xfs_extlen_t, blockcount)
2082 : ),
2083 : TP_fast_assign(
2084 : __entry->dev = mp->m_super->s_dev;
2085 : __entry->agno = agno;
2086 : __entry->startblock = rec->ar_startblock;
2087 : __entry->blockcount = rec->ar_blockcount;
2088 : ),
2089 : TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
2090 : MAJOR(__entry->dev), MINOR(__entry->dev),
2091 : __entry->agno,
2092 : __entry->startblock,
2093 : __entry->blockcount)
2094 : )
2095 :
2096 8691630 : TRACE_EVENT(xrep_ibt_found,
2097 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2098 : const struct xfs_inobt_rec_incore *rec),
2099 : TP_ARGS(mp, agno, rec),
2100 : TP_STRUCT__entry(
2101 : __field(dev_t, dev)
2102 : __field(xfs_agnumber_t, agno)
2103 : __field(xfs_agino_t, startino)
2104 : __field(uint16_t, holemask)
2105 : __field(uint8_t, count)
2106 : __field(uint8_t, freecount)
2107 : __field(uint64_t, freemask)
2108 : ),
2109 : TP_fast_assign(
2110 : __entry->dev = mp->m_super->s_dev;
2111 : __entry->agno = agno;
2112 : __entry->startino = rec->ir_startino;
2113 : __entry->holemask = rec->ir_holemask;
2114 : __entry->count = rec->ir_count;
2115 : __entry->freecount = rec->ir_freecount;
2116 : __entry->freemask = rec->ir_free;
2117 : ),
2118 : TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x count 0x%x freecount 0x%x freemask 0x%llx",
2119 : MAJOR(__entry->dev), MINOR(__entry->dev),
2120 : __entry->agno,
2121 : __entry->startino,
2122 : __entry->holemask,
2123 : __entry->count,
2124 : __entry->freecount,
2125 : __entry->freemask)
2126 : )
2127 :
2128 1459038 : TRACE_EVENT(xrep_refc_found,
2129 : TP_PROTO(struct xfs_perag *pag, const struct xfs_refcount_irec *rec),
2130 : TP_ARGS(pag, rec),
2131 : TP_STRUCT__entry(
2132 : __field(dev_t, dev)
2133 : __field(xfs_agnumber_t, agno)
2134 : __field(enum xfs_refc_domain, domain)
2135 : __field(xfs_agblock_t, startblock)
2136 : __field(xfs_extlen_t, blockcount)
2137 : __field(xfs_nlink_t, refcount)
2138 : ),
2139 : TP_fast_assign(
2140 : __entry->dev = pag->pag_mount->m_super->s_dev;
2141 : __entry->agno = pag->pag_agno;
2142 : __entry->domain = rec->rc_domain;
2143 : __entry->startblock = rec->rc_startblock;
2144 : __entry->blockcount = rec->rc_blockcount;
2145 : __entry->refcount = rec->rc_refcount;
2146 : ),
2147 : TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u",
2148 : MAJOR(__entry->dev), MINOR(__entry->dev),
2149 : __entry->agno,
2150 : __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
2151 : __entry->startblock,
2152 : __entry->blockcount,
2153 : __entry->refcount)
2154 : )
2155 :
2156 62883519 : TRACE_EVENT(xrep_bmap_found,
2157 : TP_PROTO(struct xfs_inode *ip, int whichfork,
2158 : struct xfs_bmbt_irec *irec),
2159 : TP_ARGS(ip, whichfork, irec),
2160 : TP_STRUCT__entry(
2161 : __field(dev_t, dev)
2162 : __field(xfs_ino_t, ino)
2163 : __field(int, whichfork)
2164 : __field(xfs_fileoff_t, lblk)
2165 : __field(xfs_filblks_t, len)
2166 : __field(xfs_fsblock_t, pblk)
2167 : __field(int, state)
2168 : ),
2169 : TP_fast_assign(
2170 : __entry->dev = VFS_I(ip)->i_sb->s_dev;
2171 : __entry->ino = ip->i_ino;
2172 : __entry->whichfork = whichfork;
2173 : __entry->lblk = irec->br_startoff;
2174 : __entry->len = irec->br_blockcount;
2175 : __entry->pblk = irec->br_startblock;
2176 : __entry->state = irec->br_state;
2177 : ),
2178 : TP_printk("dev %d:%d ino 0x%llx whichfork %s fileoff 0x%llx fsbcount 0x%llx startblock 0x%llx state %d",
2179 : MAJOR(__entry->dev), MINOR(__entry->dev),
2180 : __entry->ino,
2181 : __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
2182 : __entry->lblk,
2183 : __entry->len,
2184 : __entry->pblk,
2185 : __entry->state)
2186 : );
2187 :
2188 19457149 : TRACE_EVENT(xrep_rmap_found,
2189 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2190 : const struct xfs_rmap_irec *rec),
2191 : TP_ARGS(mp, agno, rec),
2192 : TP_STRUCT__entry(
2193 : __field(dev_t, dev)
2194 : __field(xfs_agnumber_t, agno)
2195 : __field(xfs_agblock_t, agbno)
2196 : __field(xfs_extlen_t, len)
2197 : __field(uint64_t, owner)
2198 : __field(uint64_t, offset)
2199 : __field(unsigned int, flags)
2200 : ),
2201 : TP_fast_assign(
2202 : __entry->dev = mp->m_super->s_dev;
2203 : __entry->agno = agno;
2204 : __entry->agbno = rec->rm_startblock;
2205 : __entry->len = rec->rm_blockcount;
2206 : __entry->owner = rec->rm_owner;
2207 : __entry->offset = rec->rm_offset;
2208 : __entry->flags = rec->rm_flags;
2209 : ),
2210 : TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
2211 : MAJOR(__entry->dev), MINOR(__entry->dev),
2212 : __entry->agno,
2213 : __entry->agbno,
2214 : __entry->len,
2215 : __entry->owner,
2216 : __entry->offset,
2217 : __entry->flags)
2218 : );
2219 :
2220 1061873 : TRACE_EVENT(xrep_findroot_block,
2221 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
2222 : uint32_t magic, uint16_t level),
2223 : TP_ARGS(mp, agno, agbno, magic, level),
2224 : TP_STRUCT__entry(
2225 : __field(dev_t, dev)
2226 : __field(xfs_agnumber_t, agno)
2227 : __field(xfs_agblock_t, agbno)
2228 : __field(uint32_t, magic)
2229 : __field(uint16_t, level)
2230 : ),
2231 : TP_fast_assign(
2232 : __entry->dev = mp->m_super->s_dev;
2233 : __entry->agno = agno;
2234 : __entry->agbno = agbno;
2235 : __entry->magic = magic;
2236 : __entry->level = level;
2237 : ),
2238 : TP_printk("dev %d:%d agno 0x%x agbno 0x%x magic 0x%x level %u",
2239 : MAJOR(__entry->dev), MINOR(__entry->dev),
2240 : __entry->agno,
2241 : __entry->agbno,
2242 : __entry->magic,
2243 : __entry->level)
2244 : )
2245 1570332 : TRACE_EVENT(xrep_calc_ag_resblks,
2246 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2247 : xfs_agino_t icount, xfs_agblock_t aglen, xfs_agblock_t freelen,
2248 : xfs_agblock_t usedlen),
2249 : TP_ARGS(mp, agno, icount, aglen, freelen, usedlen),
2250 : TP_STRUCT__entry(
2251 : __field(dev_t, dev)
2252 : __field(xfs_agnumber_t, agno)
2253 : __field(xfs_agino_t, icount)
2254 : __field(xfs_agblock_t, aglen)
2255 : __field(xfs_agblock_t, freelen)
2256 : __field(xfs_agblock_t, usedlen)
2257 : ),
2258 : TP_fast_assign(
2259 : __entry->dev = mp->m_super->s_dev;
2260 : __entry->agno = agno;
2261 : __entry->icount = icount;
2262 : __entry->aglen = aglen;
2263 : __entry->freelen = freelen;
2264 : __entry->usedlen = usedlen;
2265 : ),
2266 : TP_printk("dev %d:%d agno 0x%x icount %u aglen %u freelen %u usedlen %u",
2267 : MAJOR(__entry->dev), MINOR(__entry->dev),
2268 : __entry->agno,
2269 : __entry->icount,
2270 : __entry->aglen,
2271 : __entry->freelen,
2272 : __entry->usedlen)
2273 : )
2274 1570290 : TRACE_EVENT(xrep_calc_ag_resblks_btsize,
2275 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2276 : xfs_agblock_t bnobt_sz, xfs_agblock_t inobt_sz,
2277 : xfs_agblock_t rmapbt_sz, xfs_agblock_t refcbt_sz),
2278 : TP_ARGS(mp, agno, bnobt_sz, inobt_sz, rmapbt_sz, refcbt_sz),
2279 : TP_STRUCT__entry(
2280 : __field(dev_t, dev)
2281 : __field(xfs_agnumber_t, agno)
2282 : __field(xfs_agblock_t, bnobt_sz)
2283 : __field(xfs_agblock_t, inobt_sz)
2284 : __field(xfs_agblock_t, rmapbt_sz)
2285 : __field(xfs_agblock_t, refcbt_sz)
2286 : ),
2287 : TP_fast_assign(
2288 : __entry->dev = mp->m_super->s_dev;
2289 : __entry->agno = agno;
2290 : __entry->bnobt_sz = bnobt_sz;
2291 : __entry->inobt_sz = inobt_sz;
2292 : __entry->rmapbt_sz = rmapbt_sz;
2293 : __entry->refcbt_sz = refcbt_sz;
2294 : ),
2295 : TP_printk("dev %d:%d agno 0x%x bnobt %u inobt %u rmapbt %u refcountbt %u",
2296 : MAJOR(__entry->dev), MINOR(__entry->dev),
2297 : __entry->agno,
2298 : __entry->bnobt_sz,
2299 : __entry->inobt_sz,
2300 : __entry->rmapbt_sz,
2301 : __entry->refcbt_sz)
2302 : )
2303 :
2304 : #ifdef CONFIG_XFS_RT
2305 43547 : TRACE_EVENT(xrep_calc_rtgroup_resblks_btsize,
2306 : TP_PROTO(struct xfs_mount *mp, xfs_rgnumber_t rgno,
2307 : xfs_rgblock_t usedlen, xfs_rgblock_t rmapbt_sz),
2308 : TP_ARGS(mp, rgno, usedlen, rmapbt_sz),
2309 : TP_STRUCT__entry(
2310 : __field(dev_t, dev)
2311 : __field(xfs_rgnumber_t, rgno)
2312 : __field(xfs_rgblock_t, usedlen)
2313 : __field(xfs_rgblock_t, rmapbt_sz)
2314 : ),
2315 : TP_fast_assign(
2316 : __entry->dev = mp->m_super->s_dev;
2317 : __entry->rgno = rgno;
2318 : __entry->usedlen = usedlen;
2319 : __entry->rmapbt_sz = rmapbt_sz;
2320 : ),
2321 : TP_printk("dev %d:%d rgno 0x%x usedlen %u rmapbt %u",
2322 : MAJOR(__entry->dev), MINOR(__entry->dev),
2323 : __entry->rgno,
2324 : __entry->usedlen,
2325 : __entry->rmapbt_sz)
2326 : );
2327 : #endif /* CONFIG_XFS_RT */
2328 :
2329 15578 : TRACE_EVENT(xrep_reset_counters,
2330 : TP_PROTO(struct xfs_mount *mp, struct xchk_fscounters *fsc),
2331 : TP_ARGS(mp, fsc),
2332 : TP_STRUCT__entry(
2333 : __field(dev_t, dev)
2334 : __field(uint64_t, icount)
2335 : __field(uint64_t, ifree)
2336 : __field(uint64_t, fdblocks)
2337 : __field(uint64_t, frextents)
2338 : ),
2339 : TP_fast_assign(
2340 : __entry->dev = mp->m_super->s_dev;
2341 : __entry->icount = fsc->icount;
2342 : __entry->ifree = fsc->ifree;
2343 : __entry->fdblocks = fsc->fdblocks;
2344 : __entry->frextents = fsc->frextents;
2345 : ),
2346 : TP_printk("dev %d:%d icount %llu ifree %llu fdblocks %llu frextents %llu",
2347 : MAJOR(__entry->dev), MINOR(__entry->dev),
2348 : __entry->icount,
2349 : __entry->ifree,
2350 : __entry->fdblocks,
2351 : __entry->frextents)
2352 : )
2353 :
2354 0 : DECLARE_EVENT_CLASS(xrep_newbt_extent_class,
2355 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2356 : xfs_agblock_t agbno, xfs_extlen_t len,
2357 : int64_t owner),
2358 : TP_ARGS(mp, agno, agbno, len, owner),
2359 : TP_STRUCT__entry(
2360 : __field(dev_t, dev)
2361 : __field(xfs_agnumber_t, agno)
2362 : __field(xfs_agblock_t, agbno)
2363 : __field(xfs_extlen_t, len)
2364 : __field(int64_t, owner)
2365 : ),
2366 : TP_fast_assign(
2367 : __entry->dev = mp->m_super->s_dev;
2368 : __entry->agno = agno;
2369 : __entry->agbno = agbno;
2370 : __entry->len = len;
2371 : __entry->owner = owner;
2372 : ),
2373 : TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx",
2374 : MAJOR(__entry->dev), MINOR(__entry->dev),
2375 : __entry->agno,
2376 : __entry->agbno,
2377 : __entry->len,
2378 : __entry->owner)
2379 : );
2380 : #define DEFINE_NEWBT_EXTENT_EVENT(name) \
2381 : DEFINE_EVENT(xrep_newbt_extent_class, name, \
2382 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2383 : xfs_agblock_t agbno, xfs_extlen_t len, \
2384 : int64_t owner), \
2385 : TP_ARGS(mp, agno, agbno, len, owner))
2386 270485 : DEFINE_NEWBT_EXTENT_EVENT(xrep_newbt_alloc_ag_blocks);
2387 56588 : DEFINE_NEWBT_EXTENT_EVENT(xrep_newbt_alloc_file_blocks);
2388 0 : DEFINE_NEWBT_EXTENT_EVENT(xrep_newbt_free_blocks);
2389 1187496 : DEFINE_NEWBT_EXTENT_EVENT(xrep_newbt_claim_block);
2390 :
2391 0 : DECLARE_EVENT_CLASS(xrep_dinode_class,
2392 : TP_PROTO(struct xfs_scrub *sc, struct xfs_dinode *dip),
2393 : TP_ARGS(sc, dip),
2394 : TP_STRUCT__entry(
2395 : __field(dev_t, dev)
2396 : __field(xfs_ino_t, ino)
2397 : __field(uint16_t, mode)
2398 : __field(uint8_t, version)
2399 : __field(uint8_t, format)
2400 : __field(uint32_t, uid)
2401 : __field(uint32_t, gid)
2402 : __field(uint64_t, size)
2403 : __field(uint64_t, nblocks)
2404 : __field(uint32_t, extsize)
2405 : __field(uint32_t, nextents)
2406 : __field(uint16_t, anextents)
2407 : __field(uint8_t, forkoff)
2408 : __field(uint8_t, aformat)
2409 : __field(uint16_t, flags)
2410 : __field(uint32_t, gen)
2411 : __field(uint64_t, flags2)
2412 : __field(uint32_t, cowextsize)
2413 : ),
2414 : TP_fast_assign(
2415 : __entry->dev = sc->mp->m_super->s_dev;
2416 : __entry->ino = sc->sm->sm_ino;
2417 : __entry->mode = be16_to_cpu(dip->di_mode);
2418 : __entry->version = dip->di_version;
2419 : __entry->format = dip->di_format;
2420 : __entry->uid = be32_to_cpu(dip->di_uid);
2421 : __entry->gid = be32_to_cpu(dip->di_gid);
2422 : __entry->size = be64_to_cpu(dip->di_size);
2423 : __entry->nblocks = be64_to_cpu(dip->di_nblocks);
2424 : __entry->extsize = be32_to_cpu(dip->di_extsize);
2425 : __entry->nextents = be32_to_cpu(dip->di_nextents);
2426 : __entry->anextents = be16_to_cpu(dip->di_anextents);
2427 : __entry->forkoff = dip->di_forkoff;
2428 : __entry->aformat = dip->di_aformat;
2429 : __entry->flags = be16_to_cpu(dip->di_flags);
2430 : __entry->gen = be32_to_cpu(dip->di_gen);
2431 : __entry->flags2 = be64_to_cpu(dip->di_flags2);
2432 : __entry->cowextsize = be32_to_cpu(dip->di_cowextsize);
2433 : ),
2434 : TP_printk("dev %d:%d ino 0x%llx mode 0x%x version %u format %u uid %u gid %u disize 0x%llx nblocks 0x%llx extsize %u nextents %u anextents %u forkoff 0x%x aformat %u flags 0x%x gen 0x%x flags2 0x%llx cowextsize %u",
2435 : MAJOR(__entry->dev), MINOR(__entry->dev),
2436 : __entry->ino,
2437 : __entry->mode,
2438 : __entry->version,
2439 : __entry->format,
2440 : __entry->uid,
2441 : __entry->gid,
2442 : __entry->size,
2443 : __entry->nblocks,
2444 : __entry->extsize,
2445 : __entry->nextents,
2446 : __entry->anextents,
2447 : __entry->forkoff,
2448 : __entry->aformat,
2449 : __entry->flags,
2450 : __entry->gen,
2451 : __entry->flags2,
2452 : __entry->cowextsize)
2453 : )
2454 :
2455 : #define DEFINE_REPAIR_DINODE_EVENT(name) \
2456 : DEFINE_EVENT(xrep_dinode_class, name, \
2457 : TP_PROTO(struct xfs_scrub *sc, struct xfs_dinode *dip), \
2458 : TP_ARGS(sc, dip))
2459 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_header);
2460 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_mode);
2461 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_flags);
2462 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_size);
2463 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_extsize_hints);
2464 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_zap_symlink);
2465 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_zap_dir);
2466 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_fixed);
2467 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_zap_forks);
2468 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_zap_dfork);
2469 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_zap_afork);
2470 0 : DEFINE_REPAIR_DINODE_EVENT(xrep_dinode_ensure_forkoff);
2471 :
2472 0 : DECLARE_EVENT_CLASS(xrep_inode_class,
2473 : TP_PROTO(struct xfs_scrub *sc),
2474 : TP_ARGS(sc),
2475 : TP_STRUCT__entry(
2476 : __field(dev_t, dev)
2477 : __field(xfs_ino_t, ino)
2478 : __field(xfs_fsize_t, size)
2479 : __field(xfs_rfsblock_t, nblocks)
2480 : __field(uint16_t, flags)
2481 : __field(uint64_t, flags2)
2482 : __field(uint32_t, nextents)
2483 : __field(uint8_t, format)
2484 : __field(uint32_t, anextents)
2485 : __field(uint8_t, aformat)
2486 : ),
2487 : TP_fast_assign(
2488 : __entry->dev = sc->mp->m_super->s_dev;
2489 : __entry->ino = sc->sm->sm_ino;
2490 : __entry->size = sc->ip->i_disk_size;
2491 : __entry->nblocks = sc->ip->i_nblocks;
2492 : __entry->flags = sc->ip->i_diflags;
2493 : __entry->flags2 = sc->ip->i_diflags2;
2494 : __entry->nextents = sc->ip->i_df.if_nextents;
2495 : __entry->format = sc->ip->i_df.if_format;
2496 : __entry->anextents = sc->ip->i_af.if_nextents;
2497 : __entry->aformat = sc->ip->i_af.if_format;
2498 : ),
2499 : TP_printk("dev %d:%d ino 0x%llx disize 0x%llx nblocks 0%llx flags 0x%x flags2 0x%llx nextents %u format %u anextents %u aformat %u",
2500 : MAJOR(__entry->dev), MINOR(__entry->dev),
2501 : __entry->ino,
2502 : __entry->size,
2503 : __entry->nblocks,
2504 : __entry->flags,
2505 : __entry->flags2,
2506 : __entry->nextents,
2507 : __entry->format,
2508 : __entry->anextents,
2509 : __entry->aformat)
2510 : )
2511 :
2512 : #define DEFINE_REPAIR_INODE_EVENT(name) \
2513 : DEFINE_EVENT(xrep_inode_class, name, \
2514 : TP_PROTO(struct xfs_scrub *sc), \
2515 : TP_ARGS(sc))
2516 0 : DEFINE_REPAIR_INODE_EVENT(xrep_inode_blockcounts);
2517 0 : DEFINE_REPAIR_INODE_EVENT(xrep_inode_ids);
2518 0 : DEFINE_REPAIR_INODE_EVENT(xrep_inode_flags);
2519 0 : DEFINE_REPAIR_INODE_EVENT(xrep_inode_blockdir_size);
2520 0 : DEFINE_REPAIR_INODE_EVENT(xrep_inode_sfdir_size);
2521 0 : DEFINE_REPAIR_INODE_EVENT(xrep_inode_size);
2522 0 : DEFINE_REPAIR_INODE_EVENT(xrep_inode_fixed);
2523 :
2524 0 : TRACE_EVENT(xrep_dinode_count_rmaps,
2525 : TP_PROTO(struct xfs_scrub *sc, xfs_rfsblock_t data_blocks,
2526 : xfs_rfsblock_t rt_blocks, xfs_rfsblock_t attr_blocks,
2527 : xfs_extnum_t data_extents, xfs_extnum_t rt_extents,
2528 : xfs_aextnum_t attr_extents, xfs_fsblock_t block0),
2529 : TP_ARGS(sc, data_blocks, rt_blocks, attr_blocks, data_extents,
2530 : rt_extents, attr_extents, block0),
2531 : TP_STRUCT__entry(
2532 : __field(dev_t, dev)
2533 : __field(xfs_ino_t, ino)
2534 : __field(xfs_rfsblock_t, data_blocks)
2535 : __field(xfs_rfsblock_t, rt_blocks)
2536 : __field(xfs_rfsblock_t, attr_blocks)
2537 : __field(xfs_extnum_t, data_extents)
2538 : __field(xfs_extnum_t, rt_extents)
2539 : __field(xfs_aextnum_t, attr_extents)
2540 : __field(xfs_fsblock_t, block0)
2541 : ),
2542 : TP_fast_assign(
2543 : __entry->dev = sc->mp->m_super->s_dev;
2544 : __entry->ino = sc->sm->sm_ino;
2545 : __entry->data_blocks = data_blocks;
2546 : __entry->rt_blocks = rt_blocks;
2547 : __entry->attr_blocks = attr_blocks;
2548 : __entry->data_extents = data_extents;
2549 : __entry->rt_extents = rt_extents;
2550 : __entry->attr_extents = attr_extents;
2551 : __entry->block0 = block0;
2552 : ),
2553 : TP_printk("dev %d:%d ino 0x%llx dblocks 0x%llx rtblocks 0x%llx ablocks 0x%llx dextents %llu rtextents %llu aextents %u startblock0 0x%llx",
2554 : MAJOR(__entry->dev), MINOR(__entry->dev),
2555 : __entry->ino,
2556 : __entry->data_blocks,
2557 : __entry->rt_blocks,
2558 : __entry->attr_blocks,
2559 : __entry->data_extents,
2560 : __entry->rt_extents,
2561 : __entry->attr_extents,
2562 : __entry->block0)
2563 : );
2564 :
2565 3786 : TRACE_EVENT(xrep_cow_mark_file_range,
2566 : TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t startblock,
2567 : xfs_fileoff_t startoff, xfs_filblks_t blockcount),
2568 : TP_ARGS(ip, startblock, startoff, blockcount),
2569 : TP_STRUCT__entry(
2570 : __field(dev_t, dev)
2571 : __field(xfs_ino_t, ino)
2572 : __field(xfs_fsblock_t, startblock)
2573 : __field(xfs_fileoff_t, startoff)
2574 : __field(xfs_filblks_t, blockcount)
2575 : ),
2576 : TP_fast_assign(
2577 : __entry->dev = ip->i_mount->m_super->s_dev;
2578 : __entry->ino = ip->i_ino;
2579 : __entry->startoff = startoff;
2580 : __entry->startblock = startblock;
2581 : __entry->blockcount = blockcount;
2582 : ),
2583 : TP_printk("dev %d:%d ino 0x%llx fileoff 0x%llx startblock 0x%llx fsbcount 0x%llx",
2584 : MAJOR(__entry->dev), MINOR(__entry->dev),
2585 : __entry->ino,
2586 : __entry->startoff,
2587 : __entry->startblock,
2588 : __entry->blockcount)
2589 : );
2590 :
2591 4047 : TRACE_EVENT(xrep_cow_replace_mapping,
2592 : TP_PROTO(struct xfs_inode *ip, const struct xfs_bmbt_irec *irec,
2593 : xfs_fsblock_t new_startblock, xfs_extlen_t new_blockcount),
2594 : TP_ARGS(ip, irec, new_startblock, new_blockcount),
2595 : TP_STRUCT__entry(
2596 : __field(dev_t, dev)
2597 : __field(xfs_ino_t, ino)
2598 : __field(xfs_fsblock_t, startblock)
2599 : __field(xfs_fileoff_t, startoff)
2600 : __field(xfs_filblks_t, blockcount)
2601 : __field(xfs_exntst_t, state)
2602 : __field(xfs_fsblock_t, new_startblock)
2603 : __field(xfs_extlen_t, new_blockcount)
2604 : ),
2605 : TP_fast_assign(
2606 : __entry->dev = ip->i_mount->m_super->s_dev;
2607 : __entry->ino = ip->i_ino;
2608 : __entry->startoff = irec->br_startoff;
2609 : __entry->startblock = irec->br_startblock;
2610 : __entry->blockcount = irec->br_blockcount;
2611 : __entry->state = irec->br_state;
2612 : __entry->new_startblock = new_startblock;
2613 : __entry->new_blockcount = new_blockcount;
2614 : ),
2615 : TP_printk("dev %d:%d ino 0x%llx startoff 0x%llx startblock 0x%llx fsbcount 0x%llx state 0x%x new_startblock 0x%llx new_fsbcount 0x%x",
2616 : MAJOR(__entry->dev), MINOR(__entry->dev),
2617 : __entry->ino,
2618 : __entry->startoff,
2619 : __entry->startblock,
2620 : __entry->blockcount,
2621 : __entry->state,
2622 : __entry->new_startblock,
2623 : __entry->new_blockcount)
2624 : );
2625 :
2626 0 : TRACE_EVENT(xrep_cow_free_staging,
2627 : TP_PROTO(struct xfs_perag *pag, xfs_agblock_t agbno,
2628 : xfs_extlen_t blockcount),
2629 : TP_ARGS(pag, agbno, blockcount),
2630 : TP_STRUCT__entry(
2631 : __field(dev_t, dev)
2632 : __field(xfs_agnumber_t, agno)
2633 : __field(xfs_agblock_t, agbno)
2634 : __field(xfs_extlen_t, blockcount)
2635 : ),
2636 : TP_fast_assign(
2637 : __entry->dev = pag->pag_mount->m_super->s_dev;
2638 : __entry->agno = pag->pag_agno;
2639 : __entry->agbno = agbno;
2640 : __entry->blockcount = blockcount;
2641 : ),
2642 : TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
2643 : MAJOR(__entry->dev), MINOR(__entry->dev),
2644 : __entry->agno,
2645 : __entry->agbno,
2646 : __entry->blockcount)
2647 : );
2648 :
2649 : #ifdef CONFIG_XFS_QUOTA
2650 0 : DECLARE_EVENT_CLASS(xrep_dquot_class,
2651 : TP_PROTO(struct xfs_mount *mp, uint8_t type, uint32_t id),
2652 : TP_ARGS(mp, type, id),
2653 : TP_STRUCT__entry(
2654 : __field(dev_t, dev)
2655 : __field(uint8_t, type)
2656 : __field(uint32_t, id)
2657 : ),
2658 : TP_fast_assign(
2659 : __entry->dev = mp->m_super->s_dev;
2660 : __entry->id = id;
2661 : __entry->type = type;
2662 : ),
2663 : TP_printk("dev %d:%d type %s id 0x%x",
2664 : MAJOR(__entry->dev), MINOR(__entry->dev),
2665 : __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
2666 : __entry->id)
2667 : );
2668 :
2669 : #define DEFINE_XREP_DQUOT_EVENT(name) \
2670 : DEFINE_EVENT(xrep_dquot_class, name, \
2671 : TP_PROTO(struct xfs_mount *mp, uint8_t type, uint32_t id), \
2672 : TP_ARGS(mp, type, id))
2673 0 : DEFINE_XREP_DQUOT_EVENT(xrep_dquot_item);
2674 0 : DEFINE_XREP_DQUOT_EVENT(xrep_disk_dquot);
2675 0 : DEFINE_XREP_DQUOT_EVENT(xrep_quotacheck_dquot);
2676 : #endif /* CONFIG_XFS_QUOTA */
2677 :
2678 0 : DEFINE_SCRUB_NLINKS_DIFF_EVENT(xrep_nlinks_update_inode);
2679 0 : DEFINE_SCRUB_NLINKS_DIFF_EVENT(xrep_nlinks_unfixable_inode);
2680 :
2681 78479 : TRACE_EVENT(xfbtree_create,
2682 : TP_PROTO(struct xfs_mount *mp, const struct xfbtree_config *cfg,
2683 : struct xfbtree *xfbt),
2684 : TP_ARGS(mp, cfg, xfbt),
2685 : TP_STRUCT__entry(
2686 : __field(const void *, btree_ops)
2687 : __field(unsigned long, xfino)
2688 : __field(unsigned int, leaf_mxr)
2689 : __field(unsigned int, leaf_mnr)
2690 : __field(unsigned int, node_mxr)
2691 : __field(unsigned int, node_mnr)
2692 : __field(unsigned long long, owner)
2693 : ),
2694 : TP_fast_assign(
2695 : __entry->btree_ops = cfg->btree_ops;
2696 : __entry->xfino = xfbtree_ino(xfbt);
2697 : __entry->leaf_mxr = xfbt->maxrecs[0];
2698 : __entry->node_mxr = xfbt->maxrecs[1];
2699 : __entry->leaf_mnr = xfbt->minrecs[0];
2700 : __entry->node_mnr = xfbt->minrecs[1];
2701 : __entry->owner = cfg->owner;
2702 : ),
2703 : TP_printk("xfino 0x%lx btree_ops %pS owner 0x%llx leaf_mxr %u leaf_mnr %u node_mxr %u node_mnr %u",
2704 : __entry->xfino,
2705 : __entry->btree_ops,
2706 : __entry->owner,
2707 : __entry->leaf_mxr,
2708 : __entry->leaf_mnr,
2709 : __entry->node_mxr,
2710 : __entry->node_mnr)
2711 : );
2712 :
2713 0 : DECLARE_EVENT_CLASS(xfbtree_buf_class,
2714 : TP_PROTO(struct xfbtree *xfbt, struct xfs_buf *bp),
2715 : TP_ARGS(xfbt, bp),
2716 : TP_STRUCT__entry(
2717 : __field(unsigned long, xfino)
2718 : __field(xfs_daddr_t, bno)
2719 : __field(int, nblks)
2720 : __field(int, hold)
2721 : __field(int, pincount)
2722 : __field(unsigned, lockval)
2723 : __field(unsigned, flags)
2724 : ),
2725 : TP_fast_assign(
2726 : __entry->xfino = xfbtree_ino(xfbt);
2727 : __entry->bno = xfs_buf_daddr(bp);
2728 : __entry->nblks = bp->b_length;
2729 : __entry->hold = atomic_read(&bp->b_hold);
2730 : __entry->pincount = atomic_read(&bp->b_pin_count);
2731 : __entry->lockval = bp->b_sema.count;
2732 : __entry->flags = bp->b_flags;
2733 : ),
2734 : TP_printk("xfino 0x%lx daddr 0x%llx bbcount 0x%x hold %d pincount %d "
2735 : "lock %d flags %s",
2736 : __entry->xfino,
2737 : (unsigned long long)__entry->bno,
2738 : __entry->nblks,
2739 : __entry->hold,
2740 : __entry->pincount,
2741 : __entry->lockval,
2742 : __print_flags(__entry->flags, "|", XFS_BUF_FLAGS))
2743 : )
2744 :
2745 : #define DEFINE_XFBTREE_BUF_EVENT(name) \
2746 : DEFINE_EVENT(xfbtree_buf_class, name, \
2747 : TP_PROTO(struct xfbtree *xfbt, struct xfs_buf *bp), \
2748 : TP_ARGS(xfbt, bp))
2749 78472 : DEFINE_XFBTREE_BUF_EVENT(xfbtree_create_root_buf);
2750 758903859 : DEFINE_XFBTREE_BUF_EVENT(xfbtree_trans_commit_buf);
2751 0 : DEFINE_XFBTREE_BUF_EVENT(xfbtree_trans_cancel_buf);
2752 :
2753 0 : DECLARE_EVENT_CLASS(xfbtree_freesp_class,
2754 : TP_PROTO(struct xfbtree *xfbt, struct xfs_btree_cur *cur,
2755 : xfs_fileoff_t fileoff),
2756 : TP_ARGS(xfbt, cur, fileoff),
2757 : TP_STRUCT__entry(
2758 : __field(unsigned long, xfino)
2759 : __field(xfs_btnum_t, btnum)
2760 : __field(int, nlevels)
2761 : __field(xfs_fileoff_t, fileoff)
2762 : ),
2763 : TP_fast_assign(
2764 : __entry->xfino = xfbtree_ino(xfbt);
2765 : __entry->btnum = cur->bc_btnum;
2766 : __entry->nlevels = cur->bc_nlevels;
2767 : __entry->fileoff = fileoff;
2768 : ),
2769 : TP_printk("xfino 0x%lx btree %s nlevels %d fileoff 0x%llx",
2770 : __entry->xfino,
2771 : __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
2772 : __entry->nlevels,
2773 : (unsigned long long)__entry->fileoff)
2774 : )
2775 :
2776 : #define DEFINE_XFBTREE_FREESP_EVENT(name) \
2777 : DEFINE_EVENT(xfbtree_freesp_class, name, \
2778 : TP_PROTO(struct xfbtree *xfbt, struct xfs_btree_cur *cur, \
2779 : xfs_fileoff_t fileoff), \
2780 : TP_ARGS(xfbt, cur, fileoff))
2781 11191 : DEFINE_XFBTREE_FREESP_EVENT(xfbtree_alloc_block);
2782 2 : DEFINE_XFBTREE_FREESP_EVENT(xfbtree_free_block);
2783 :
2784 : TRACE_DEFINE_ENUM(XFS_RMAP_MAP);
2785 : TRACE_DEFINE_ENUM(XFS_RMAP_MAP_SHARED);
2786 : TRACE_DEFINE_ENUM(XFS_RMAP_UNMAP);
2787 : TRACE_DEFINE_ENUM(XFS_RMAP_UNMAP_SHARED);
2788 : TRACE_DEFINE_ENUM(XFS_RMAP_CONVERT);
2789 : TRACE_DEFINE_ENUM(XFS_RMAP_CONVERT_SHARED);
2790 : TRACE_DEFINE_ENUM(XFS_RMAP_ALLOC);
2791 : TRACE_DEFINE_ENUM(XFS_RMAP_FREE);
2792 :
2793 127729 : TRACE_EVENT(xrep_rmap_live_update,
2794 : TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int op,
2795 : const struct xfs_rmap_update_params *p),
2796 : TP_ARGS(mp, agno, op, p),
2797 : TP_STRUCT__entry(
2798 : __field(dev_t, dev)
2799 : __field(xfs_agnumber_t, agno)
2800 : __field(unsigned int, op)
2801 : __field(xfs_agblock_t, agbno)
2802 : __field(xfs_extlen_t, len)
2803 : __field(uint64_t, owner)
2804 : __field(uint64_t, offset)
2805 : __field(unsigned int, flags)
2806 : ),
2807 : TP_fast_assign(
2808 : __entry->dev = mp->m_super->s_dev;
2809 : __entry->agno = agno;
2810 : __entry->op = op;
2811 : __entry->agbno = p->startblock;
2812 : __entry->len = p->blockcount;
2813 : xfs_owner_info_unpack(&p->oinfo, &__entry->owner,
2814 : &__entry->offset, &__entry->flags);
2815 : if (p->unwritten)
2816 : __entry->flags |= XFS_RMAP_UNWRITTEN;
2817 : ),
2818 : TP_printk("dev %d:%d agno 0x%x op %d agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
2819 : MAJOR(__entry->dev), MINOR(__entry->dev),
2820 : __entry->agno,
2821 : __entry->op,
2822 : __entry->agbno,
2823 : __entry->len,
2824 : __entry->owner,
2825 : __entry->offset,
2826 : __entry->flags)
2827 : );
2828 :
2829 554909 : TRACE_EVENT(xrep_tempfile_create,
2830 : TP_PROTO(struct xfs_scrub *sc),
2831 : TP_ARGS(sc),
2832 : TP_STRUCT__entry(
2833 : __field(dev_t, dev)
2834 : __field(xfs_ino_t, ino)
2835 : __field(unsigned int, type)
2836 : __field(xfs_agnumber_t, agno)
2837 : __field(xfs_ino_t, inum)
2838 : __field(unsigned int, gen)
2839 : __field(unsigned int, flags)
2840 : __field(xfs_ino_t, temp_inum)
2841 : ),
2842 : TP_fast_assign(
2843 : __entry->dev = sc->mp->m_super->s_dev;
2844 : __entry->ino = sc->file ? XFS_I(file_inode(sc->file))->i_ino : 0;
2845 : __entry->type = sc->sm->sm_type;
2846 : __entry->agno = sc->sm->sm_agno;
2847 : __entry->inum = sc->sm->sm_ino;
2848 : __entry->gen = sc->sm->sm_gen;
2849 : __entry->flags = sc->sm->sm_flags;
2850 : __entry->temp_inum = sc->tempip->i_ino;
2851 : ),
2852 : TP_printk("dev %d:%d ino 0x%llx type %s inum 0x%llx gen 0x%x flags 0x%x temp_inum 0x%llx",
2853 : MAJOR(__entry->dev), MINOR(__entry->dev),
2854 : __entry->ino,
2855 : __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
2856 : __entry->inum,
2857 : __entry->gen,
2858 : __entry->flags,
2859 : __entry->temp_inum)
2860 : );
2861 :
2862 0 : DECLARE_EVENT_CLASS(xrep_tempfile_class,
2863 : TP_PROTO(struct xfs_scrub *sc, int whichfork,
2864 : struct xfs_bmbt_irec *irec),
2865 : TP_ARGS(sc, whichfork, irec),
2866 : TP_STRUCT__entry(
2867 : __field(dev_t, dev)
2868 : __field(xfs_ino_t, ino)
2869 : __field(int, whichfork)
2870 : __field(xfs_fileoff_t, lblk)
2871 : __field(xfs_filblks_t, len)
2872 : __field(xfs_fsblock_t, pblk)
2873 : __field(int, state)
2874 : ),
2875 : TP_fast_assign(
2876 : __entry->dev = sc->mp->m_super->s_dev;
2877 : __entry->ino = sc->tempip->i_ino;
2878 : __entry->whichfork = whichfork;
2879 : __entry->lblk = irec->br_startoff;
2880 : __entry->len = irec->br_blockcount;
2881 : __entry->pblk = irec->br_startblock;
2882 : __entry->state = irec->br_state;
2883 : ),
2884 : TP_printk("dev %d:%d ino 0x%llx whichfork %s fileoff 0x%llx fsbcount 0x%llx startblock 0x%llx state %d",
2885 : MAJOR(__entry->dev), MINOR(__entry->dev),
2886 : __entry->ino,
2887 : __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
2888 : __entry->lblk,
2889 : __entry->len,
2890 : __entry->pblk,
2891 : __entry->state)
2892 : );
2893 : #define DEFINE_XREP_TEMPFILE_EVENT(name) \
2894 : DEFINE_EVENT(xrep_tempfile_class, name, \
2895 : TP_PROTO(struct xfs_scrub *sc, int whichfork, \
2896 : struct xfs_bmbt_irec *irec), \
2897 : TP_ARGS(sc, whichfork, irec))
2898 54169 : DEFINE_XREP_TEMPFILE_EVENT(xrep_tempfile_prealloc);
2899 1955561 : DEFINE_XREP_TEMPFILE_EVENT(xrep_tempfile_copyin);
2900 :
2901 157060 : TRACE_EVENT(xreap_ifork_extent,
2902 : TP_PROTO(struct xfs_scrub *sc, struct xfs_inode *ip, int whichfork,
2903 : const struct xfs_bmbt_irec *irec),
2904 : TP_ARGS(sc, ip, whichfork, irec),
2905 : TP_STRUCT__entry(
2906 : __field(dev_t, dev)
2907 : __field(xfs_ino_t, ino)
2908 : __field(int, whichfork)
2909 : __field(xfs_fileoff_t, fileoff)
2910 : __field(xfs_filblks_t, len)
2911 : __field(xfs_agnumber_t, agno)
2912 : __field(xfs_agblock_t, agbno)
2913 : __field(int, state)
2914 : ),
2915 : TP_fast_assign(
2916 : __entry->dev = sc->mp->m_super->s_dev;
2917 : __entry->ino = ip->i_ino;
2918 : __entry->whichfork = whichfork;
2919 : __entry->fileoff = irec->br_startoff;
2920 : __entry->len = irec->br_blockcount;
2921 : __entry->agno = XFS_FSB_TO_AGNO(sc->mp, irec->br_startblock);
2922 : __entry->agbno = XFS_FSB_TO_AGBNO(sc->mp, irec->br_startblock);
2923 : __entry->state = irec->br_state;
2924 : ),
2925 : TP_printk("dev %d:%d ip 0x%llx whichfork %s agno 0x%x agbno 0x%x fileoff 0x%llx fsbcount 0x%llx state 0x%x",
2926 : MAJOR(__entry->dev), MINOR(__entry->dev),
2927 : __entry->ino,
2928 : __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
2929 : __entry->agno,
2930 : __entry->agbno,
2931 : __entry->fileoff,
2932 : __entry->len,
2933 : __entry->state)
2934 : );
2935 :
2936 157060 : TRACE_EVENT(xreap_bmapi_binval_scan,
2937 : TP_PROTO(struct xfs_scrub *sc, const struct xfs_bmbt_irec *irec,
2938 : xfs_extlen_t scan_blocks),
2939 : TP_ARGS(sc, irec, scan_blocks),
2940 : TP_STRUCT__entry(
2941 : __field(dev_t, dev)
2942 : __field(xfs_filblks_t, len)
2943 : __field(xfs_agnumber_t, agno)
2944 : __field(xfs_agblock_t, agbno)
2945 : __field(xfs_extlen_t, scan_blocks)
2946 : ),
2947 : TP_fast_assign(
2948 : __entry->dev = sc->mp->m_super->s_dev;
2949 : __entry->len = irec->br_blockcount;
2950 : __entry->agno = XFS_FSB_TO_AGNO(sc->mp, irec->br_startblock);
2951 : __entry->agbno = XFS_FSB_TO_AGBNO(sc->mp, irec->br_startblock);
2952 : __entry->scan_blocks = scan_blocks;
2953 : ),
2954 : TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%llx scan_blocks 0x%x",
2955 : MAJOR(__entry->dev), MINOR(__entry->dev),
2956 : __entry->agno,
2957 : __entry->agbno,
2958 : __entry->len,
2959 : __entry->scan_blocks)
2960 : );
2961 :
2962 42558 : TRACE_EVENT(xrep_xattr_recover_leafblock,
2963 : TP_PROTO(struct xfs_inode *ip, xfs_dablk_t dabno, uint16_t magic),
2964 : TP_ARGS(ip, dabno, magic),
2965 : TP_STRUCT__entry(
2966 : __field(dev_t, dev)
2967 : __field(xfs_ino_t, ino)
2968 : __field(xfs_dablk_t, dabno)
2969 : __field(uint16_t, magic)
2970 : ),
2971 : TP_fast_assign(
2972 : __entry->dev = ip->i_mount->m_super->s_dev;
2973 : __entry->ino = ip->i_ino;
2974 : __entry->dabno = dabno;
2975 : __entry->magic = magic;
2976 : ),
2977 : TP_printk("dev %d:%d ino 0x%llx dablk 0x%x magic 0x%x",
2978 : MAJOR(__entry->dev), MINOR(__entry->dev),
2979 : __entry->ino,
2980 : __entry->dabno,
2981 : __entry->magic)
2982 : );
2983 :
2984 0 : DECLARE_EVENT_CLASS(xrep_xattr_salvage_class,
2985 : TP_PROTO(struct xfs_inode *ip, unsigned int flags, char *name,
2986 : unsigned int namelen, unsigned int valuelen),
2987 : TP_ARGS(ip, flags, name, namelen, valuelen),
2988 : TP_STRUCT__entry(
2989 : __field(dev_t, dev)
2990 : __field(xfs_ino_t, ino)
2991 : __field(unsigned int, flags)
2992 : __field(unsigned int, namelen)
2993 : __dynamic_array(char, name, namelen)
2994 : __field(unsigned int, valuelen)
2995 : ),
2996 : TP_fast_assign(
2997 : __entry->dev = ip->i_mount->m_super->s_dev;
2998 : __entry->ino = ip->i_ino;
2999 : __entry->flags = flags;
3000 : __entry->namelen = namelen;
3001 : memcpy(__get_str(name), name, namelen);
3002 : __entry->valuelen = valuelen;
3003 : ),
3004 : TP_printk("dev %d:%d ino 0x%llx flags %s name '%.*s' valuelen 0x%x",
3005 : MAJOR(__entry->dev), MINOR(__entry->dev),
3006 : __entry->ino,
3007 : __print_flags(__entry->flags, "|", XFS_ATTR_NAMESPACE_STR),
3008 : __entry->namelen,
3009 : __get_str(name),
3010 : __entry->valuelen)
3011 : );
3012 : #define DEFINE_XREP_XATTR_SALVAGE_EVENT(name) \
3013 : DEFINE_EVENT(xrep_xattr_salvage_class, name, \
3014 : TP_PROTO(struct xfs_inode *ip, unsigned int flags, char *name, \
3015 : unsigned int namelen, unsigned int valuelen), \
3016 : TP_ARGS(ip, flags, name, namelen, valuelen))
3017 901931 : DEFINE_XREP_XATTR_SALVAGE_EVENT(xrep_xattr_salvage_rec);
3018 901931 : DEFINE_XREP_XATTR_SALVAGE_EVENT(xrep_xattr_insert_rec);
3019 15719 : DEFINE_XREP_XATTR_SALVAGE_EVENT(xrep_parent_stash_xattr);
3020 15719 : DEFINE_XREP_XATTR_SALVAGE_EVENT(xrep_parent_insert_xattr);
3021 :
3022 0 : DECLARE_EVENT_CLASS(xrep_pptr_salvage_class,
3023 : TP_PROTO(struct xfs_inode *ip, unsigned int flags, const void *name,
3024 : unsigned int namelen, const void *value, unsigned int valuelen),
3025 : TP_ARGS(ip, flags, name, namelen, value, valuelen),
3026 : TP_STRUCT__entry(
3027 : __field(dev_t, dev)
3028 : __field(xfs_ino_t, ino)
3029 : __field(xfs_ino_t, parent_ino)
3030 : __field(unsigned int, parent_gen)
3031 : __field(unsigned int, namelen)
3032 : __dynamic_array(char, name, valuelen)
3033 : ),
3034 : TP_fast_assign(
3035 : struct xfs_parent_name_irec pptr;
3036 :
3037 : xfs_parent_irec_from_disk(&pptr, name, value, valuelen);
3038 :
3039 : __entry->dev = ip->i_mount->m_super->s_dev;
3040 : __entry->ino = ip->i_ino;
3041 : __entry->parent_ino = pptr.p_ino;
3042 : __entry->parent_gen = pptr.p_gen;
3043 : __entry->namelen = pptr.p_namelen;
3044 : memcpy(__get_str(name), pptr.p_name, pptr.p_namelen);
3045 : ),
3046 : TP_printk("dev %d:%d ino 0x%llx parent_ino 0x%llx parent_gen 0x%x name '%.*s'",
3047 : MAJOR(__entry->dev), MINOR(__entry->dev),
3048 : __entry->ino,
3049 : __entry->parent_ino,
3050 : __entry->parent_gen,
3051 : __entry->namelen,
3052 : __get_str(name))
3053 : )
3054 : #define DEFINE_XREP_PPTR_SALVAGE_EVENT(name) \
3055 : DEFINE_EVENT(xrep_pptr_salvage_class, name, \
3056 : TP_PROTO(struct xfs_inode *ip, unsigned int flags, const void *name, \
3057 : unsigned int namelen, const void *value, unsigned int valuelen), \
3058 : TP_ARGS(ip, flags, name, namelen, value, valuelen))
3059 228819 : DEFINE_XREP_PPTR_SALVAGE_EVENT(xrep_xattr_salvage_pptr);
3060 228819 : DEFINE_XREP_PPTR_SALVAGE_EVENT(xrep_xattr_insert_pptr);
3061 :
3062 0 : TRACE_EVENT(xrep_xattr_class,
3063 : TP_PROTO(struct xfs_inode *ip, struct xfs_inode *arg_ip),
3064 : TP_ARGS(ip, arg_ip),
3065 : TP_STRUCT__entry(
3066 : __field(dev_t, dev)
3067 : __field(xfs_ino_t, ino)
3068 : __field(xfs_ino_t, src_ino)
3069 : ),
3070 : TP_fast_assign(
3071 : __entry->dev = ip->i_mount->m_super->s_dev;
3072 : __entry->ino = ip->i_ino;
3073 : __entry->src_ino = arg_ip->i_ino;
3074 : ),
3075 : TP_printk("dev %d:%d ino 0x%llx src 0x%llx",
3076 : MAJOR(__entry->dev), MINOR(__entry->dev),
3077 : __entry->ino,
3078 : __entry->src_ino)
3079 : )
3080 : #define DEFINE_XREP_XATTR_EVENT(name) \
3081 : DEFINE_EVENT(xrep_xattr_class, name, \
3082 : TP_PROTO(struct xfs_inode *ip, struct xfs_inode *arg_ip), \
3083 : TP_ARGS(ip, arg_ip))
3084 178485 : DEFINE_XREP_XATTR_EVENT(xrep_xattr_rebuild_tree);
3085 317235 : DEFINE_XREP_XATTR_EVENT(xrep_xattr_reset_fork);
3086 0 : DEFINE_XREP_XATTR_EVENT(xrep_xattr_full_reset);
3087 :
3088 0 : DECLARE_EVENT_CLASS(xrep_xattr_pptr_scan_class,
3089 : TP_PROTO(struct xfs_inode *ip, const struct xfs_inode *dp,
3090 : const struct xfs_name *name),
3091 : TP_ARGS(ip, dp, name),
3092 : TP_STRUCT__entry(
3093 : __field(dev_t, dev)
3094 : __field(xfs_ino_t, ino)
3095 : __field(xfs_ino_t, parent_ino)
3096 : __field(unsigned int, parent_gen)
3097 : __field(unsigned int, namelen)
3098 : __dynamic_array(char, name, name->len)
3099 : ),
3100 : TP_fast_assign(
3101 : __entry->dev = ip->i_mount->m_super->s_dev;
3102 : __entry->ino = ip->i_ino;
3103 : __entry->parent_ino = dp->i_ino;
3104 : __entry->parent_gen = VFS_IC(dp)->i_generation;
3105 : __entry->namelen = name->len;
3106 : memcpy(__get_str(name), name->name, name->len);
3107 : ),
3108 : TP_printk("dev %d:%d ino 0x%llx parent_ino 0x%llx parent_gen 0x%x name '%.*s'",
3109 : MAJOR(__entry->dev), MINOR(__entry->dev),
3110 : __entry->ino,
3111 : __entry->parent_ino,
3112 : __entry->parent_gen,
3113 : __entry->namelen,
3114 : __get_str(name))
3115 : )
3116 : #define DEFINE_XREP_XATTR_PPTR_SCAN_EVENT(name) \
3117 : DEFINE_EVENT(xrep_xattr_pptr_scan_class, name, \
3118 : TP_PROTO(struct xfs_inode *ip, const struct xfs_inode *dp, \
3119 : const struct xfs_name *name), \
3120 : TP_ARGS(ip, dp, name))
3121 0 : DEFINE_XREP_XATTR_PPTR_SCAN_EVENT(xrep_xattr_stash_parentadd);
3122 0 : DEFINE_XREP_XATTR_PPTR_SCAN_EVENT(xrep_xattr_stash_parentremove);
3123 :
3124 0 : TRACE_EVENT(xrep_dir_recover_dirblock,
3125 : TP_PROTO(struct xfs_inode *dp, xfs_dablk_t dabno, uint32_t magic,
3126 : uint32_t magic_guess),
3127 : TP_ARGS(dp, dabno, magic, magic_guess),
3128 : TP_STRUCT__entry(
3129 : __field(dev_t, dev)
3130 : __field(xfs_ino_t, dir_ino)
3131 : __field(xfs_dablk_t, dabno)
3132 : __field(uint32_t, magic)
3133 : __field(uint32_t, magic_guess)
3134 : ),
3135 : TP_fast_assign(
3136 : __entry->dev = dp->i_mount->m_super->s_dev;
3137 : __entry->dir_ino = dp->i_ino;
3138 : __entry->dabno = dabno;
3139 : __entry->magic = magic;
3140 : __entry->magic_guess = magic_guess;
3141 : ),
3142 : TP_printk("dev %d:%d dir 0x%llx dablk 0x%x magic 0x%x magic_guess 0x%x",
3143 : MAJOR(__entry->dev), MINOR(__entry->dev),
3144 : __entry->dir_ino,
3145 : __entry->dabno,
3146 : __entry->magic,
3147 : __entry->magic_guess)
3148 : );
3149 :
3150 0 : DECLARE_EVENT_CLASS(xrep_dir_class,
3151 : TP_PROTO(struct xfs_inode *dp, xfs_ino_t parent_ino),
3152 : TP_ARGS(dp, parent_ino),
3153 : TP_STRUCT__entry(
3154 : __field(dev_t, dev)
3155 : __field(xfs_ino_t, dir_ino)
3156 : __field(xfs_ino_t, parent_ino)
3157 : ),
3158 : TP_fast_assign(
3159 : __entry->dev = dp->i_mount->m_super->s_dev;
3160 : __entry->dir_ino = dp->i_ino;
3161 : __entry->parent_ino = parent_ino;
3162 : ),
3163 : TP_printk("dev %d:%d dir 0x%llx parent 0x%llx",
3164 : MAJOR(__entry->dev), MINOR(__entry->dev),
3165 : __entry->dir_ino,
3166 : __entry->parent_ino)
3167 : )
3168 : #define DEFINE_XREP_DIR_EVENT(name) \
3169 : DEFINE_EVENT(xrep_dir_class, name, \
3170 : TP_PROTO(struct xfs_inode *dp, xfs_ino_t parent_ino), \
3171 : TP_ARGS(dp, parent_ino))
3172 24745 : DEFINE_XREP_DIR_EVENT(xrep_dir_rebuild_tree);
3173 24745 : DEFINE_XREP_DIR_EVENT(xrep_dir_reset_fork);
3174 0 : DEFINE_XREP_DIR_EVENT(xrep_parent_reset_dotdot);
3175 :
3176 0 : DECLARE_EVENT_CLASS(xrep_dirent_class,
3177 : TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name,
3178 : xfs_ino_t ino),
3179 : TP_ARGS(dp, name, ino),
3180 : TP_STRUCT__entry(
3181 : __field(dev_t, dev)
3182 : __field(xfs_ino_t, dir_ino)
3183 : __field(unsigned int, namelen)
3184 : __dynamic_array(char, name, name->len)
3185 : __field(xfs_ino_t, ino)
3186 : __field(uint8_t, ftype)
3187 : ),
3188 : TP_fast_assign(
3189 : __entry->dev = dp->i_mount->m_super->s_dev;
3190 : __entry->dir_ino = dp->i_ino;
3191 : __entry->namelen = name->len;
3192 : memcpy(__get_str(name), name->name, name->len);
3193 : __entry->ino = ino;
3194 : __entry->ftype = name->type;
3195 : ),
3196 : TP_printk("dev %d:%d dir 0x%llx ftype %s name '%.*s' ino 0x%llx",
3197 : MAJOR(__entry->dev), MINOR(__entry->dev),
3198 : __entry->dir_ino,
3199 : __print_symbolic(__entry->ftype, XFS_DIR3_FTYPE_STR),
3200 : __entry->namelen,
3201 : __get_str(name),
3202 : __entry->ino)
3203 : )
3204 : #define DEFINE_XREP_DIRENT_EVENT(name) \
3205 : DEFINE_EVENT(xrep_dirent_class, name, \
3206 : TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name, \
3207 : xfs_ino_t ino), \
3208 : TP_ARGS(dp, name, ino))
3209 0 : DEFINE_XREP_DIRENT_EVENT(xrep_dir_salvage_entry);
3210 259756 : DEFINE_XREP_DIRENT_EVENT(xrep_dir_stash_createname);
3211 236441 : DEFINE_XREP_DIRENT_EVENT(xrep_dir_replay_createname);
3212 0 : DEFINE_XREP_DIRENT_EVENT(xrep_adoption_commit);
3213 0 : DEFINE_XREP_DIRENT_EVENT(xrep_dir_stash_removename);
3214 0 : DEFINE_XREP_DIRENT_EVENT(xrep_dir_replay_removename);
3215 :
3216 88496719 : TRACE_EVENT(xrep_adoption_cancel,
3217 : TP_PROTO(struct xfs_inode *dp, struct xfs_inode *ip, int error),
3218 : TP_ARGS(dp, ip, error),
3219 : TP_STRUCT__entry(
3220 : __field(dev_t, dev)
3221 : __field(xfs_ino_t, dir_ino)
3222 : __field(xfs_ino_t, child_ino)
3223 : __field(int, error)
3224 : ),
3225 : TP_fast_assign(
3226 : __entry->dev = dp->i_mount->m_super->s_dev;
3227 : __entry->dir_ino = dp->i_ino;
3228 : __entry->child_ino = ip->i_ino;
3229 : __entry->error = error;
3230 : ),
3231 : TP_printk("dev %d:%d dir 0x%llx child 0x%llx error %d",
3232 : MAJOR(__entry->dev), MINOR(__entry->dev),
3233 : __entry->dir_ino,
3234 : __entry->child_ino,
3235 : __entry->error)
3236 : );
3237 :
3238 0 : DECLARE_EVENT_CLASS(xrep_parent_salvage_class,
3239 : TP_PROTO(struct xfs_inode *dp, xfs_ino_t ino),
3240 : TP_ARGS(dp, ino),
3241 : TP_STRUCT__entry(
3242 : __field(dev_t, dev)
3243 : __field(xfs_ino_t, dir_ino)
3244 : __field(xfs_ino_t, ino)
3245 : ),
3246 : TP_fast_assign(
3247 : __entry->dev = dp->i_mount->m_super->s_dev;
3248 : __entry->dir_ino = dp->i_ino;
3249 : __entry->ino = ino;
3250 : ),
3251 : TP_printk("dev %d:%d dir 0x%llx parent 0x%llx",
3252 : MAJOR(__entry->dev), MINOR(__entry->dev),
3253 : __entry->dir_ino,
3254 : __entry->ino)
3255 : )
3256 : #define DEFINE_XREP_PARENT_SALVAGE_EVENT(name) \
3257 : DEFINE_EVENT(xrep_parent_salvage_class, name, \
3258 : TP_PROTO(struct xfs_inode *dp, xfs_ino_t ino), \
3259 : TP_ARGS(dp, ino))
3260 0 : DEFINE_XREP_PARENT_SALVAGE_EVENT(xrep_dir_salvaged_parent);
3261 0 : DEFINE_XREP_PARENT_SALVAGE_EVENT(xrep_findparent_dirent);
3262 0 : DEFINE_XREP_PARENT_SALVAGE_EVENT(xrep_findparent_from_dcache);
3263 :
3264 0 : DECLARE_EVENT_CLASS(xrep_pptr_class,
3265 : TP_PROTO(struct xfs_inode *ip, const struct xfs_parent_name_irec *pptr),
3266 : TP_ARGS(ip, pptr),
3267 : TP_STRUCT__entry(
3268 : __field(dev_t, dev)
3269 : __field(xfs_ino_t, ino)
3270 : __field(xfs_ino_t, parent_ino)
3271 : __field(unsigned int, parent_gen)
3272 : __field(unsigned int, namelen)
3273 : __dynamic_array(char, name, pptr->p_namelen)
3274 : ),
3275 : TP_fast_assign(
3276 : __entry->dev = ip->i_mount->m_super->s_dev;
3277 : __entry->ino = ip->i_ino;
3278 : __entry->parent_ino = pptr->p_ino;
3279 : __entry->parent_gen = pptr->p_gen;
3280 : __entry->namelen = pptr->p_namelen;
3281 : memcpy(__get_str(name), pptr->p_name, pptr->p_namelen);
3282 : ),
3283 : TP_printk("dev %d:%d ino 0x%llx parent_ino 0x%llx parent_gen 0x%x name '%.*s'",
3284 : MAJOR(__entry->dev), MINOR(__entry->dev),
3285 : __entry->ino,
3286 : __entry->parent_ino,
3287 : __entry->parent_gen,
3288 : __entry->namelen,
3289 : __get_str(name))
3290 : )
3291 : #define DEFINE_XREP_PPTR_EVENT(name) \
3292 : DEFINE_EVENT(xrep_pptr_class, name, \
3293 : TP_PROTO(struct xfs_inode *ip, const struct xfs_parent_name_irec *pptr), \
3294 : TP_ARGS(ip, pptr))
3295 0 : DEFINE_XREP_PPTR_EVENT(xrep_xattr_replay_parentadd);
3296 0 : DEFINE_XREP_PPTR_EVENT(xrep_xattr_replay_parentremove);
3297 160855 : DEFINE_XREP_PPTR_EVENT(xrep_parent_replay_parentadd);
3298 0 : DEFINE_XREP_PPTR_EVENT(xrep_parent_replay_parentremove);
3299 :
3300 0 : DECLARE_EVENT_CLASS(xrep_pptr_scan_class,
3301 : TP_PROTO(struct xfs_inode *ip, const struct xfs_inode *dp,
3302 : const struct xfs_name *name),
3303 : TP_ARGS(ip, dp, name),
3304 : TP_STRUCT__entry(
3305 : __field(dev_t, dev)
3306 : __field(xfs_ino_t, ino)
3307 : __field(xfs_ino_t, parent_ino)
3308 : __field(unsigned int, parent_gen)
3309 : __field(unsigned int, namelen)
3310 : __dynamic_array(char, name, name->len)
3311 : ),
3312 : TP_fast_assign(
3313 : __entry->dev = ip->i_mount->m_super->s_dev;
3314 : __entry->ino = ip->i_ino;
3315 : __entry->parent_ino = dp->i_ino;
3316 : __entry->parent_gen = VFS_IC(dp)->i_generation;
3317 : __entry->namelen = name->len;
3318 : memcpy(__get_str(name), name->name, name->len);
3319 : ),
3320 : TP_printk("dev %d:%d ino 0x%llx parent_ino 0x%llx parent_gen 0x%x name '%.*s'",
3321 : MAJOR(__entry->dev), MINOR(__entry->dev),
3322 : __entry->ino,
3323 : __entry->parent_ino,
3324 : __entry->parent_gen,
3325 : __entry->namelen,
3326 : __get_str(name))
3327 : )
3328 : #define DEFINE_XREP_PPTR_SCAN_EVENT(name) \
3329 : DEFINE_EVENT(xrep_pptr_scan_class, name, \
3330 : TP_PROTO(struct xfs_inode *ip, const struct xfs_inode *dp, \
3331 : const struct xfs_name *name), \
3332 : TP_ARGS(ip, dp, name))
3333 160881 : DEFINE_XREP_PPTR_SCAN_EVENT(xrep_parent_stash_parentadd);
3334 0 : DEFINE_XREP_PPTR_SCAN_EVENT(xrep_parent_stash_parentremove);
3335 :
3336 0 : TRACE_EVENT(xrep_nlinks_set_record,
3337 : TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino,
3338 : const struct xchk_nlink *obs),
3339 : TP_ARGS(mp, ino, obs),
3340 : TP_STRUCT__entry(
3341 : __field(dev_t, dev)
3342 : __field(xfs_ino_t, ino)
3343 : __field(xfs_nlink_t, parents)
3344 : __field(xfs_nlink_t, backrefs)
3345 : __field(xfs_nlink_t, children)
3346 : ),
3347 : TP_fast_assign(
3348 : __entry->dev = mp->m_super->s_dev;
3349 : __entry->ino = ino;
3350 : __entry->parents = obs->parents;
3351 : __entry->backrefs = obs->backrefs;
3352 : __entry->children = obs->children;
3353 : ),
3354 : TP_printk("dev %d:%d ino 0x%llx parents %u backrefs %u children %u",
3355 : MAJOR(__entry->dev), MINOR(__entry->dev),
3356 : __entry->ino,
3357 : __entry->parents,
3358 : __entry->backrefs,
3359 : __entry->children)
3360 : );
3361 :
3362 0 : DECLARE_EVENT_CLASS(xrep_dentry_class,
3363 : TP_PROTO(struct xfs_mount *mp, const struct dentry *dentry),
3364 : TP_ARGS(mp, dentry),
3365 : TP_STRUCT__entry(
3366 : __field(dev_t, dev)
3367 : __field(unsigned int, flags)
3368 : __field(unsigned long, ino)
3369 : __field(bool, positive)
3370 : __field(unsigned long, parent_ino)
3371 : __field(unsigned int, namelen)
3372 : __dynamic_array(char, name, dentry->d_name.len)
3373 : ),
3374 : TP_fast_assign(
3375 : __entry->dev = mp->m_super->s_dev;
3376 : __entry->flags = dentry->d_flags;
3377 : __entry->positive = d_is_positive(dentry);
3378 : if (dentry->d_parent && d_inode(dentry->d_parent))
3379 : __entry->parent_ino = d_inode(dentry->d_parent)->i_ino;
3380 : else
3381 : __entry->parent_ino = -1UL;
3382 : __entry->ino = d_inode(dentry) ? d_inode(dentry)->i_ino : 0;
3383 : __entry->namelen = dentry->d_name.len;
3384 : memcpy(__get_str(name), dentry->d_name.name, dentry->d_name.len);
3385 : ),
3386 : TP_printk("dev %d:%d flags 0x%x positive? %d parent_ino 0x%lx ino 0x%lx name '%.*s'",
3387 : MAJOR(__entry->dev), MINOR(__entry->dev),
3388 : __entry->flags,
3389 : __entry->positive,
3390 : __entry->parent_ino,
3391 : __entry->ino,
3392 : __entry->namelen,
3393 : __get_str(name))
3394 : );
3395 : #define DEFINE_REPAIR_DENTRY_EVENT(name) \
3396 : DEFINE_EVENT(xrep_dentry_class, name, \
3397 : TP_PROTO(struct xfs_mount *mp, const struct dentry *dentry), \
3398 : TP_ARGS(mp, dentry))
3399 0 : DEFINE_REPAIR_DENTRY_EVENT(xrep_orphanage_check_child);
3400 0 : DEFINE_REPAIR_DENTRY_EVENT(xrep_orphanage_check_alias);
3401 0 : DEFINE_REPAIR_DENTRY_EVENT(xrep_orphanage_check_dentry);
3402 0 : DEFINE_REPAIR_DENTRY_EVENT(xrep_orphanage_invalidate_child);
3403 0 : DEFINE_REPAIR_DENTRY_EVENT(xrep_dirtree_delete_child);
3404 :
3405 7369 : TRACE_EVENT(xrep_symlink_salvage_target,
3406 : TP_PROTO(struct xfs_inode *ip, char *target, unsigned int targetlen),
3407 : TP_ARGS(ip, target, targetlen),
3408 : TP_STRUCT__entry(
3409 : __field(dev_t, dev)
3410 : __field(xfs_ino_t, ino)
3411 : __field(unsigned int, targetlen)
3412 : __dynamic_array(char, target, targetlen + 1)
3413 : ),
3414 : TP_fast_assign(
3415 : __entry->dev = ip->i_mount->m_super->s_dev;
3416 : __entry->ino = ip->i_ino;
3417 : __entry->targetlen = targetlen;
3418 : memcpy(__get_str(target), target, targetlen);
3419 : __get_str(target)[targetlen] = 0;
3420 : ),
3421 : TP_printk("dev %d:%d ip 0x%llx target '%.*s'",
3422 : MAJOR(__entry->dev), MINOR(__entry->dev),
3423 : __entry->ino,
3424 : __entry->targetlen,
3425 : __get_str(target))
3426 : );
3427 :
3428 0 : DECLARE_EVENT_CLASS(xrep_symlink_class,
3429 : TP_PROTO(struct xfs_inode *ip),
3430 : TP_ARGS(ip),
3431 : TP_STRUCT__entry(
3432 : __field(dev_t, dev)
3433 : __field(xfs_ino_t, ino)
3434 : ),
3435 : TP_fast_assign(
3436 : __entry->dev = ip->i_mount->m_super->s_dev;
3437 : __entry->ino = ip->i_ino;
3438 : ),
3439 : TP_printk("dev %d:%d ip 0x%llx",
3440 : MAJOR(__entry->dev), MINOR(__entry->dev),
3441 : __entry->ino)
3442 : );
3443 :
3444 : #define DEFINE_XREP_SYMLINK_EVENT(name) \
3445 : DEFINE_EVENT(xrep_symlink_class, name, \
3446 : TP_PROTO(struct xfs_inode *ip), \
3447 : TP_ARGS(ip))
3448 7369 : DEFINE_XREP_SYMLINK_EVENT(xrep_symlink_rebuild);
3449 7369 : DEFINE_XREP_SYMLINK_EVENT(xrep_symlink_reset_fork);
3450 :
3451 1839 : TRACE_EVENT(xrep_iunlink_visit,
3452 : TP_PROTO(struct xfs_perag *pag, xfs_agino_t bucket_agino,
3453 : struct xfs_inode *ip),
3454 : TP_ARGS(pag, bucket_agino, ip),
3455 : TP_STRUCT__entry(
3456 : __field(dev_t, dev)
3457 : __field(xfs_agnumber_t, agno)
3458 : __field(xfs_agino_t, agino)
3459 : __field(xfs_agino_t, bucket_agino)
3460 : __field(xfs_agino_t, prev_agino)
3461 : __field(xfs_agino_t, next_agino)
3462 : ),
3463 : TP_fast_assign(
3464 : __entry->dev = pag->pag_mount->m_super->s_dev;
3465 : __entry->agno = pag->pag_agno;
3466 : __entry->agino = XFS_INO_TO_AGINO(pag->pag_mount, ip->i_ino);
3467 : __entry->bucket_agino = bucket_agino;
3468 : __entry->prev_agino = ip->i_prev_unlinked;
3469 : __entry->next_agino = ip->i_next_unlinked;
3470 : ),
3471 : TP_printk("dev %d:%d agno 0x%x agino 0x%x bucket_agino %u prev_agino 0x%x next_agino 0x%x",
3472 : MAJOR(__entry->dev), MINOR(__entry->dev),
3473 : __entry->agno,
3474 : __entry->agino,
3475 : __entry->bucket_agino,
3476 : __entry->prev_agino,
3477 : __entry->next_agino)
3478 : );
3479 :
3480 0 : TRACE_EVENT(xrep_iunlink_reload,
3481 : TP_PROTO(struct xfs_inode *ip, xfs_agino_t prev_agino),
3482 : TP_ARGS(ip, prev_agino),
3483 : TP_STRUCT__entry(
3484 : __field(dev_t, dev)
3485 : __field(xfs_agnumber_t, agno)
3486 : __field(xfs_agino_t, agino)
3487 : __field(xfs_agino_t, old_prev_agino)
3488 : __field(xfs_agino_t, prev_agino)
3489 : __field(xfs_agino_t, next_agino)
3490 : __field(unsigned int, nlink)
3491 : ),
3492 : TP_fast_assign(
3493 : __entry->dev = ip->i_mount->m_super->s_dev;
3494 : __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3495 : __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3496 : __entry->old_prev_agino = ip->i_prev_unlinked;
3497 : __entry->prev_agino = prev_agino;
3498 : __entry->next_agino = ip->i_next_unlinked;
3499 : __entry->nlink = VFS_I(ip)->i_nlink;
3500 : ),
3501 : TP_printk("dev %d:%d agno 0x%x agino 0x%x nlink %u old_prev_agino %u prev_agino 0x%x next_agino 0x%x",
3502 : MAJOR(__entry->dev), MINOR(__entry->dev),
3503 : __entry->agno,
3504 : __entry->agino,
3505 : __entry->nlink,
3506 : __entry->old_prev_agino,
3507 : __entry->prev_agino,
3508 : __entry->next_agino)
3509 : );
3510 :
3511 1839 : TRACE_EVENT(xrep_iunlink_walk_ondisk_bucket,
3512 : TP_PROTO(struct xfs_perag *pag, unsigned int bucket,
3513 : xfs_agino_t prev_agino, xfs_agino_t next_agino),
3514 : TP_ARGS(pag, bucket, prev_agino, next_agino),
3515 : TP_STRUCT__entry(
3516 : __field(dev_t, dev)
3517 : __field(xfs_agnumber_t, agno)
3518 : __field(unsigned int, bucket)
3519 : __field(xfs_agino_t, prev_agino)
3520 : __field(xfs_agino_t, next_agino)
3521 : ),
3522 : TP_fast_assign(
3523 : __entry->dev = pag->pag_mount->m_super->s_dev;
3524 : __entry->agno = pag->pag_agno;
3525 : __entry->bucket = bucket;
3526 : __entry->prev_agino = prev_agino;
3527 : __entry->next_agino = next_agino;
3528 : ),
3529 : TP_printk("dev %d:%d agno 0x%x bucket %u prev_agino 0x%x next_agino 0x%x",
3530 : MAJOR(__entry->dev), MINOR(__entry->dev),
3531 : __entry->agno,
3532 : __entry->bucket,
3533 : __entry->prev_agino,
3534 : __entry->next_agino)
3535 : );
3536 :
3537 1839 : TRACE_EVENT(xrep_iunlink_clear_bucket_chain,
3538 : TP_PROTO(struct xfs_perag *pag, unsigned int bucket,
3539 : xfs_agino_t prev_agino, xfs_agino_t next_agino),
3540 : TP_ARGS(pag, bucket, prev_agino, next_agino),
3541 : TP_STRUCT__entry(
3542 : __field(dev_t, dev)
3543 : __field(xfs_agnumber_t, agno)
3544 : __field(unsigned int, bucket)
3545 : __field(xfs_agino_t, prev_agino)
3546 : __field(xfs_agino_t, next_agino)
3547 : ),
3548 : TP_fast_assign(
3549 : __entry->dev = pag->pag_mount->m_super->s_dev;
3550 : __entry->agno = pag->pag_agno;
3551 : __entry->bucket = bucket;
3552 : __entry->prev_agino = prev_agino;
3553 : __entry->next_agino = next_agino;
3554 : ),
3555 : TP_printk("dev %d:%d agno 0x%x bucket %u prev_agino 0x%x next_agino 0x%x",
3556 : MAJOR(__entry->dev), MINOR(__entry->dev),
3557 : __entry->agno,
3558 : __entry->bucket,
3559 : __entry->prev_agino,
3560 : __entry->next_agino)
3561 : );
3562 :
3563 0 : TRACE_EVENT(xrep_iunlink_relink_next,
3564 : TP_PROTO(struct xfs_inode *ip, xfs_agino_t next_agino),
3565 : TP_ARGS(ip, next_agino),
3566 : TP_STRUCT__entry(
3567 : __field(dev_t, dev)
3568 : __field(xfs_agnumber_t, agno)
3569 : __field(xfs_agino_t, agino)
3570 : __field(xfs_agino_t, next_agino)
3571 : __field(xfs_agino_t, new_next_agino)
3572 : ),
3573 : TP_fast_assign(
3574 : __entry->dev = ip->i_mount->m_super->s_dev;
3575 : __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3576 : __entry->agino = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3577 : __entry->next_agino = ip->i_next_unlinked;
3578 : __entry->new_next_agino = next_agino;
3579 : ),
3580 : TP_printk("dev %d:%d agno 0x%x agino 0x%x next_agino 0x%x -> 0x%x",
3581 : MAJOR(__entry->dev), MINOR(__entry->dev),
3582 : __entry->agno,
3583 : __entry->agino,
3584 : __entry->next_agino,
3585 : __entry->new_next_agino)
3586 : );
3587 :
3588 0 : TRACE_EVENT(xrep_iunlink_relink_prev,
3589 : TP_PROTO(struct xfs_inode *ip, xfs_agino_t prev_agino),
3590 : TP_ARGS(ip, prev_agino),
3591 : TP_STRUCT__entry(
3592 : __field(dev_t, dev)
3593 : __field(xfs_agnumber_t, agno)
3594 : __field(xfs_agino_t, agino)
3595 : __field(xfs_agino_t, prev_agino)
3596 : __field(xfs_agino_t, new_prev_agino)
3597 : ),
3598 : TP_fast_assign(
3599 : __entry->dev = ip->i_mount->m_super->s_dev;
3600 : __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3601 : __entry->agino = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3602 : __entry->prev_agino = ip->i_prev_unlinked;
3603 : __entry->new_prev_agino = prev_agino;
3604 : ),
3605 : TP_printk("dev %d:%d agno 0x%x agino 0x%x prev_agino 0x%x -> 0x%x",
3606 : MAJOR(__entry->dev), MINOR(__entry->dev),
3607 : __entry->agno,
3608 : __entry->agino,
3609 : __entry->prev_agino,
3610 : __entry->new_prev_agino)
3611 : );
3612 :
3613 7819264 : TRACE_EVENT(xrep_iunlink_commit_bucket,
3614 : TP_PROTO(struct xfs_perag *pag, unsigned int bucket,
3615 : xfs_agino_t agino),
3616 : TP_ARGS(pag, bucket, agino),
3617 : TP_STRUCT__entry(
3618 : __field(dev_t, dev)
3619 : __field(xfs_agnumber_t, agno)
3620 : __field(unsigned int, bucket)
3621 : __field(xfs_agino_t, agino)
3622 : ),
3623 : TP_fast_assign(
3624 : __entry->dev = pag->pag_mount->m_super->s_dev;
3625 : __entry->agno = pag->pag_agno;
3626 : __entry->bucket = bucket;
3627 : __entry->agino = agino;
3628 : ),
3629 : TP_printk("dev %d:%d agno 0x%x bucket %u agino 0x%x",
3630 : MAJOR(__entry->dev), MINOR(__entry->dev),
3631 : __entry->agno,
3632 : __entry->bucket,
3633 : __entry->agino)
3634 : );
3635 :
3636 0 : DEFINE_XCHK_DIRPATH_OUTCOME_EVENT(xrep_dirpath_set_outcome);
3637 0 : DEFINE_XCHK_DIRTREE_EVENT(xrep_dirtree_delete_path);
3638 0 : DEFINE_XCHK_DIRTREE_EVENT(xrep_dirtree_create_adoption);
3639 55876 : DEFINE_XCHK_DIRTREE_EVALUATE_EVENT(xrep_dirtree_decided_fate);
3640 :
3641 : #ifdef CONFIG_XFS_RT
3642 0 : DECLARE_EVENT_CLASS(xrep_rgbitmap_class,
3643 : TP_PROTO(struct xfs_mount *mp, xfs_rtxnum_t start, xfs_rtxnum_t end),
3644 : TP_ARGS(mp, start, end),
3645 : TP_STRUCT__entry(
3646 : __field(dev_t, dev)
3647 : __field(dev_t, rtdev)
3648 : __field(xfs_rtxnum_t, start)
3649 : __field(xfs_rtxnum_t, end)
3650 : ),
3651 : TP_fast_assign(
3652 : __entry->dev = mp->m_super->s_dev;
3653 : __entry->rtdev = mp->m_rtdev_targp->bt_dev;
3654 : __entry->start = start;
3655 : __entry->end = end;
3656 : ),
3657 : TP_printk("dev %d:%d rtdev %d:%d startrtx 0x%llx endrtx 0x%llx",
3658 : MAJOR(__entry->dev), MINOR(__entry->dev),
3659 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
3660 : __entry->start,
3661 : __entry->end)
3662 : );
3663 : #define DEFINE_REPAIR_RGBITMAP_EVENT(name) \
3664 : DEFINE_EVENT(xrep_rgbitmap_class, name, \
3665 : TP_PROTO(struct xfs_mount *mp, xfs_rtxnum_t start, \
3666 : xfs_rtxnum_t end), \
3667 : TP_ARGS(mp, start, end))
3668 734749 : DEFINE_REPAIR_RGBITMAP_EVENT(xrep_rgbitmap_record_free);
3669 40606 : DEFINE_REPAIR_RGBITMAP_EVENT(xrep_rgbitmap_record_free_bulk);
3670 :
3671 839620 : TRACE_EVENT(xrep_rgbitmap_or,
3672 : TP_PROTO(struct xfs_mount *mp, unsigned long long wordoff,
3673 : xfs_rtword_t mask, xfs_rtword_t word),
3674 : TP_ARGS(mp, wordoff, mask, word),
3675 : TP_STRUCT__entry(
3676 : __field(dev_t, dev)
3677 : __field(dev_t, rtdev)
3678 : __field(unsigned long long, wordoff)
3679 : __field(unsigned int, mask)
3680 : __field(unsigned int, word)
3681 : ),
3682 : TP_fast_assign(
3683 : __entry->dev = mp->m_super->s_dev;
3684 : __entry->rtdev = mp->m_rtdev_targp->bt_dev;
3685 : __entry->wordoff = wordoff;
3686 : __entry->mask = mask;
3687 : __entry->word = word;
3688 : ),
3689 : TP_printk("dev %d:%d rtdev %d:%d wordoff 0x%llx mask 0x%x word 0x%x",
3690 : MAJOR(__entry->dev), MINOR(__entry->dev),
3691 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
3692 : __entry->wordoff,
3693 : __entry->mask,
3694 : __entry->word)
3695 : );
3696 :
3697 65682 : TRACE_EVENT(xrep_rgbitmap_load,
3698 : TP_PROTO(struct xfs_rtgroup *rtg, xfs_fileoff_t rbmoff,
3699 : xfs_rtxnum_t rtx, xfs_rtxnum_t len),
3700 : TP_ARGS(rtg, rbmoff, rtx, len),
3701 : TP_STRUCT__entry(
3702 : __field(dev_t, dev)
3703 : __field(dev_t, rtdev)
3704 : __field(xfs_rgnumber_t, rgno)
3705 : __field(xfs_fileoff_t, rbmoff)
3706 : __field(xfs_rtxnum_t, rtx)
3707 : __field(xfs_rtxnum_t, len)
3708 : ),
3709 : TP_fast_assign(
3710 : __entry->dev = rtg->rtg_mount->m_super->s_dev;
3711 : __entry->rtdev = rtg->rtg_mount->m_rtdev_targp->bt_dev;
3712 : __entry->rgno = rtg->rtg_rgno;
3713 : __entry->rbmoff = rbmoff;
3714 : __entry->rtx = rtx;
3715 : __entry->len = len;
3716 : ),
3717 : TP_printk("dev %d:%d rtdev %d:%d rgno 0x%x rbmoff 0x%llx rtx 0x%llx rtxcount 0x%llx",
3718 : MAJOR(__entry->dev), MINOR(__entry->dev),
3719 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
3720 : __entry->rgno,
3721 : __entry->rbmoff,
3722 : __entry->rtx,
3723 : __entry->len)
3724 : );
3725 :
3726 52545 : TRACE_EVENT(xrep_rgbitmap_load_words,
3727 : TP_PROTO(struct xfs_mount *mp, xfs_fileoff_t rbmoff,
3728 : unsigned long long wordoff, unsigned int wordcnt),
3729 : TP_ARGS(mp, rbmoff, wordoff, wordcnt),
3730 : TP_STRUCT__entry(
3731 : __field(dev_t, dev)
3732 : __field(dev_t, rtdev)
3733 : __field(xfs_fileoff_t, rbmoff)
3734 : __field(unsigned long long, wordoff)
3735 : __field(unsigned int, wordcnt)
3736 : ),
3737 : TP_fast_assign(
3738 : __entry->dev = mp->m_super->s_dev;
3739 : __entry->rtdev = mp->m_rtdev_targp->bt_dev;
3740 : __entry->rbmoff = rbmoff;
3741 : __entry->wordoff = wordoff;
3742 : __entry->wordcnt = wordcnt;
3743 : ),
3744 : TP_printk("dev %d:%d rtdev %d:%d rbmoff 0x%llx wordoff 0x%llx wordcnt 0x%x",
3745 : MAJOR(__entry->dev), MINOR(__entry->dev),
3746 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
3747 : __entry->rbmoff,
3748 : __entry->wordoff,
3749 : __entry->wordcnt)
3750 : );
3751 :
3752 0 : TRACE_EVENT(xrep_rgbitmap_load_word,
3753 : TP_PROTO(struct xfs_mount *mp, unsigned long long wordoff,
3754 : unsigned int bit, xfs_rtword_t ondisk_word,
3755 : xfs_rtword_t xfile_word, xfs_rtword_t word_mask),
3756 : TP_ARGS(mp, wordoff, bit, ondisk_word, xfile_word, word_mask),
3757 : TP_STRUCT__entry(
3758 : __field(dev_t, dev)
3759 : __field(dev_t, rtdev)
3760 : __field(unsigned long long, wordoff)
3761 : __field(unsigned int, bit)
3762 : __field(xfs_rtword_t, ondisk_word)
3763 : __field(xfs_rtword_t, xfile_word)
3764 : __field(xfs_rtword_t, word_mask)
3765 : ),
3766 : TP_fast_assign(
3767 : __entry->dev = mp->m_super->s_dev;
3768 : __entry->rtdev = mp->m_rtdev_targp->bt_dev;
3769 : __entry->wordoff = wordoff;
3770 : __entry->bit = bit;
3771 : __entry->ondisk_word = ondisk_word;
3772 : __entry->xfile_word = xfile_word;
3773 : __entry->word_mask = word_mask;
3774 : ),
3775 : TP_printk("dev %d:%d rtdev %d:%d wordoff 0x%llx bit %u ondisk 0x%x(0x%x) inmem 0x%x(0x%x) result 0x%x mask 0x%x",
3776 : MAJOR(__entry->dev), MINOR(__entry->dev),
3777 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
3778 : __entry->wordoff,
3779 : __entry->bit,
3780 : __entry->ondisk_word,
3781 : __entry->ondisk_word & __entry->word_mask,
3782 : __entry->xfile_word,
3783 : __entry->xfile_word & ~__entry->word_mask,
3784 : (__entry->xfile_word & ~__entry->word_mask) |
3785 : (__entry->ondisk_word & __entry->word_mask),
3786 : __entry->word_mask)
3787 : );
3788 :
3789 6427538 : TRACE_EVENT(xrep_rtrmap_found,
3790 : TP_PROTO(struct xfs_mount *mp, const struct xfs_rmap_irec *rec),
3791 : TP_ARGS(mp, rec),
3792 : TP_STRUCT__entry(
3793 : __field(dev_t, dev)
3794 : __field(dev_t, rtdev)
3795 : __field(xfs_rgblock_t, rgbno)
3796 : __field(xfs_extlen_t, len)
3797 : __field(uint64_t, owner)
3798 : __field(uint64_t, offset)
3799 : __field(unsigned int, flags)
3800 : ),
3801 : TP_fast_assign(
3802 : __entry->dev = mp->m_super->s_dev;
3803 : __entry->rtdev = mp->m_rtdev_targp->bt_dev;
3804 : __entry->rgbno = rec->rm_startblock;
3805 : __entry->len = rec->rm_blockcount;
3806 : __entry->owner = rec->rm_owner;
3807 : __entry->offset = rec->rm_offset;
3808 : __entry->flags = rec->rm_flags;
3809 : ),
3810 : TP_printk("dev %d:%d rtdev %d:%d rgbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
3811 : MAJOR(__entry->dev), MINOR(__entry->dev),
3812 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
3813 : __entry->rgbno,
3814 : __entry->len,
3815 : __entry->owner,
3816 : __entry->offset,
3817 : __entry->flags)
3818 : );
3819 :
3820 428842 : TRACE_EVENT(xrep_rtrmap_live_update,
3821 : TP_PROTO(struct xfs_mount *mp, xfs_rgnumber_t rgno, unsigned int op,
3822 : const struct xfs_rmap_update_params *p),
3823 : TP_ARGS(mp, rgno, op, p),
3824 : TP_STRUCT__entry(
3825 : __field(dev_t, dev)
3826 : __field(xfs_rgnumber_t, rgno)
3827 : __field(unsigned int, op)
3828 : __field(xfs_rgblock_t, rgbno)
3829 : __field(xfs_extlen_t, len)
3830 : __field(uint64_t, owner)
3831 : __field(uint64_t, offset)
3832 : __field(unsigned int, flags)
3833 : ),
3834 : TP_fast_assign(
3835 : __entry->dev = mp->m_super->s_dev;
3836 : __entry->rgno = rgno;
3837 : __entry->op = op;
3838 : __entry->rgbno = p->startblock;
3839 : __entry->len = p->blockcount;
3840 : xfs_owner_info_unpack(&p->oinfo, &__entry->owner,
3841 : &__entry->offset, &__entry->flags);
3842 : if (p->unwritten)
3843 : __entry->flags |= XFS_RMAP_UNWRITTEN;
3844 : ),
3845 : TP_printk("dev %d:%d rgno 0x%x op %s rgbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
3846 : MAJOR(__entry->dev), MINOR(__entry->dev),
3847 : __entry->rgno,
3848 : __print_symbolic(__entry->op, XFS_RMAP_INTENT_STRINGS),
3849 : __entry->rgbno,
3850 : __entry->len,
3851 : __entry->owner,
3852 : __entry->offset,
3853 : __entry->flags)
3854 : );
3855 :
3856 5125421 : TRACE_EVENT(xrep_rtrefc_found,
3857 : TP_PROTO(struct xfs_rtgroup *rtg, const struct xfs_refcount_irec *rec),
3858 : TP_ARGS(rtg, rec),
3859 : TP_STRUCT__entry(
3860 : __field(dev_t, dev)
3861 : __field(dev_t, rtdev)
3862 : __field(xfs_rgnumber_t, rgno)
3863 : __field(enum xfs_refc_domain, domain)
3864 : __field(xfs_rgblock_t, startblock)
3865 : __field(xfs_extlen_t, blockcount)
3866 : __field(xfs_nlink_t, refcount)
3867 : ),
3868 : TP_fast_assign(
3869 : __entry->dev = rtg->rtg_mount->m_super->s_dev;
3870 : __entry->rtdev = rtg->rtg_mount->m_rtdev_targp->bt_dev;
3871 : __entry->rgno = rtg->rtg_rgno;
3872 : __entry->domain = rec->rc_domain;
3873 : __entry->startblock = rec->rc_startblock;
3874 : __entry->blockcount = rec->rc_blockcount;
3875 : __entry->refcount = rec->rc_refcount;
3876 : ),
3877 : TP_printk("dev %d:%d rtdev %d:%d rgno 0x%x dom %s rgbno 0x%x fsbcount 0x%x refcount %u",
3878 : MAJOR(__entry->dev), MINOR(__entry->dev),
3879 : MAJOR(__entry->rtdev), MINOR(__entry->rtdev),
3880 : __entry->rgno,
3881 : __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
3882 : __entry->startblock,
3883 : __entry->blockcount,
3884 : __entry->refcount)
3885 : );
3886 : #endif /* CONFIG_XFS_RT */
3887 :
3888 : #endif /* IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR) */
3889 :
3890 :
3891 : #endif /* _TRACE_XFS_SCRUB_TRACE_H */
3892 :
3893 : #undef TRACE_INCLUDE_PATH
3894 : #define TRACE_INCLUDE_PATH .
3895 : #define TRACE_INCLUDE_FILE scrub/trace
3896 : #include <trace/define_trace.h>
|