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