xref: /openbmc/linux/fs/xfs/scrub/trace.h (revision c03e4b9e6b645a5020f128aeb739a5424c6abe8c)
10b61f8a4SDave Chinner // SPDX-License-Identifier: GPL-2.0+
236fd6e86SDarrick J. Wong /*
336fd6e86SDarrick J. Wong  * Copyright (C) 2017 Oracle.  All Rights Reserved.
436fd6e86SDarrick J. Wong  * Author: Darrick J. Wong <darrick.wong@oracle.com>
536fd6e86SDarrick J. Wong  */
636fd6e86SDarrick J. Wong #undef TRACE_SYSTEM
736fd6e86SDarrick J. Wong #define TRACE_SYSTEM xfs_scrub
836fd6e86SDarrick J. Wong 
936fd6e86SDarrick J. Wong #if !defined(_TRACE_XFS_SCRUB_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
1036fd6e86SDarrick J. Wong #define _TRACE_XFS_SCRUB_TRACE_H
1136fd6e86SDarrick J. Wong 
1236fd6e86SDarrick J. Wong #include <linux/tracepoint.h>
134700d229SDarrick J. Wong #include "xfs_bit.h"
1436fd6e86SDarrick J. Wong 
15c494213fSDarrick J. Wong /*
16c494213fSDarrick J. Wong  * ftrace's __print_symbolic requires that all enum values be wrapped in the
17c494213fSDarrick J. Wong  * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
18c494213fSDarrick J. Wong  * ring buffer.  Somehow this was only worth mentioning in the ftrace sample
19c494213fSDarrick J. Wong  * code.
20c494213fSDarrick J. Wong  */
21c494213fSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
22c494213fSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
23c494213fSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
24c494213fSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
25c494213fSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
26c494213fSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
27c494213fSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
28c494213fSDarrick J. Wong 
2986d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PROBE);
3086d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SB);
3186d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGF);
3286d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGFL);
3386d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_AGI);
3486d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BNOBT);
3586d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_CNTBT);
3686d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INOBT);
3786d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FINOBT);
3886d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RMAPBT);
3986d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_REFCNTBT);
4086d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_INODE);
4186d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTD);
4286d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTA);
4386d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_BMBTC);
4486d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_DIR);
4586d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_XATTR);
4686d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_SYMLINK);
4786d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PARENT);
4886d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTBITMAP);
4986d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_RTSUM);
5086d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_UQUOTA);
5186d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_GQUOTA);
5286d163dbSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_PQUOTA);
5375efa57dSDarrick J. Wong TRACE_DEFINE_ENUM(XFS_SCRUB_TYPE_FSCOUNTERS);
5486d163dbSDarrick J. Wong 
5586d163dbSDarrick J. Wong #define XFS_SCRUB_TYPE_STRINGS \
5686d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_PROBE,		"probe" }, \
5786d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_SB,		"sb" }, \
5886d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_AGF,		"agf" }, \
5986d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_AGFL,		"agfl" }, \
6086d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_AGI,		"agi" }, \
6186d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_BNOBT,		"bnobt" }, \
6286d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_CNTBT,		"cntbt" }, \
6386d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_INOBT,		"inobt" }, \
6486d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_FINOBT,	"finobt" }, \
6586d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_RMAPBT,	"rmapbt" }, \
6686d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_REFCNTBT,	"refcountbt" }, \
6786d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_INODE,		"inode" }, \
6886d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_BMBTD,		"bmapbtd" }, \
6986d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_BMBTA,		"bmapbta" }, \
7086d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_BMBTC,		"bmapbtc" }, \
7186d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_DIR,		"directory" }, \
7286d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_XATTR,		"xattr" }, \
7386d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_SYMLINK,	"symlink" }, \
7486d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_PARENT,	"parent" }, \
7586d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_RTBITMAP,	"rtbitmap" }, \
7686d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_RTSUM,		"rtsummary" }, \
7786d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_UQUOTA,	"usrquota" }, \
7886d163dbSDarrick J. Wong 	{ XFS_SCRUB_TYPE_GQUOTA,	"grpquota" }, \
7975efa57dSDarrick J. Wong 	{ XFS_SCRUB_TYPE_PQUOTA,	"prjquota" }, \
8075efa57dSDarrick J. Wong 	{ XFS_SCRUB_TYPE_FSCOUNTERS,	"fscounters" }
8186d163dbSDarrick J. Wong 
82*c03e4b9eSDarrick J. Wong #define XFS_SCRUB_FLAG_STRINGS \
83*c03e4b9eSDarrick J. Wong 	{ XFS_SCRUB_IFLAG_REPAIR,		"repair" }, \
84*c03e4b9eSDarrick J. Wong 	{ XFS_SCRUB_OFLAG_CORRUPT,		"corrupt" }, \
85*c03e4b9eSDarrick J. Wong 	{ XFS_SCRUB_OFLAG_PREEN,		"preen" }, \
86*c03e4b9eSDarrick J. Wong 	{ XFS_SCRUB_OFLAG_XFAIL,		"xfail" }, \
87*c03e4b9eSDarrick J. Wong 	{ XFS_SCRUB_OFLAG_XCORRUPT,		"xcorrupt" }, \
88*c03e4b9eSDarrick J. Wong 	{ XFS_SCRUB_OFLAG_INCOMPLETE,		"incomplete" }, \
89*c03e4b9eSDarrick J. Wong 	{ XFS_SCRUB_OFLAG_WARNING,		"warning" }, \
90*c03e4b9eSDarrick J. Wong 	{ XFS_SCRUB_OFLAG_NO_REPAIR_NEEDED,	"norepair" }
91*c03e4b9eSDarrick J. Wong 
92c517b3aaSDarrick J. Wong DECLARE_EVENT_CLASS(xchk_class,
93a5637186SDarrick J. Wong 	TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
94a5637186SDarrick J. Wong 		 int error),
95a5637186SDarrick J. Wong 	TP_ARGS(ip, sm, error),
96a5637186SDarrick J. Wong 	TP_STRUCT__entry(
97a5637186SDarrick J. Wong 		__field(dev_t, dev)
98a5637186SDarrick J. Wong 		__field(xfs_ino_t, ino)
99a5637186SDarrick J. Wong 		__field(unsigned int, type)
100a5637186SDarrick J. Wong 		__field(xfs_agnumber_t, agno)
101a5637186SDarrick J. Wong 		__field(xfs_ino_t, inum)
102a5637186SDarrick J. Wong 		__field(unsigned int, gen)
103a5637186SDarrick J. Wong 		__field(unsigned int, flags)
104a5637186SDarrick J. Wong 		__field(int, error)
105a5637186SDarrick J. Wong 	),
106a5637186SDarrick J. Wong 	TP_fast_assign(
107a5637186SDarrick J. Wong 		__entry->dev = ip->i_mount->m_super->s_dev;
108a5637186SDarrick J. Wong 		__entry->ino = ip->i_ino;
109a5637186SDarrick J. Wong 		__entry->type = sm->sm_type;
110a5637186SDarrick J. Wong 		__entry->agno = sm->sm_agno;
111a5637186SDarrick J. Wong 		__entry->inum = sm->sm_ino;
112a5637186SDarrick J. Wong 		__entry->gen = sm->sm_gen;
113a5637186SDarrick J. Wong 		__entry->flags = sm->sm_flags;
114a5637186SDarrick J. Wong 		__entry->error = error;
115a5637186SDarrick J. Wong 	),
116*c03e4b9eSDarrick J. Wong 	TP_printk("dev %d:%d ino 0x%llx type %s agno 0x%x inum 0x%llx gen 0x%x flags (%s) error %d",
117a5637186SDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
118a5637186SDarrick J. Wong 		  __entry->ino,
11986d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
120a5637186SDarrick J. Wong 		  __entry->agno,
121a5637186SDarrick J. Wong 		  __entry->inum,
122a5637186SDarrick J. Wong 		  __entry->gen,
123*c03e4b9eSDarrick J. Wong 		  __print_flags(__entry->flags, "|", XFS_SCRUB_FLAG_STRINGS),
124a5637186SDarrick J. Wong 		  __entry->error)
125a5637186SDarrick J. Wong )
126a5637186SDarrick J. Wong #define DEFINE_SCRUB_EVENT(name) \
127c517b3aaSDarrick J. Wong DEFINE_EVENT(xchk_class, name, \
128a5637186SDarrick J. Wong 	TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, \
129a5637186SDarrick J. Wong 		 int error), \
130a5637186SDarrick J. Wong 	TP_ARGS(ip, sm, error))
131a5637186SDarrick J. Wong 
132c517b3aaSDarrick J. Wong DEFINE_SCRUB_EVENT(xchk_start);
133c517b3aaSDarrick J. Wong DEFINE_SCRUB_EVENT(xchk_done);
134c517b3aaSDarrick J. Wong DEFINE_SCRUB_EVENT(xchk_deadlock_retry);
135b5e2196eSDarrick J. Wong DEFINE_SCRUB_EVENT(xrep_attempt);
136b5e2196eSDarrick J. Wong DEFINE_SCRUB_EVENT(xrep_done);
1374700d229SDarrick J. Wong 
138c517b3aaSDarrick J. Wong TRACE_EVENT(xchk_op_error,
1391d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, xfs_agnumber_t agno,
1404700d229SDarrick J. Wong 		 xfs_agblock_t bno, int error, void *ret_ip),
1414700d229SDarrick J. Wong 	TP_ARGS(sc, agno, bno, error, ret_ip),
1424700d229SDarrick J. Wong 	TP_STRUCT__entry(
1434700d229SDarrick J. Wong 		__field(dev_t, dev)
1444700d229SDarrick J. Wong 		__field(unsigned int, type)
1454700d229SDarrick J. Wong 		__field(xfs_agnumber_t, agno)
1464700d229SDarrick J. Wong 		__field(xfs_agblock_t, bno)
1474700d229SDarrick J. Wong 		__field(int, error)
1484700d229SDarrick J. Wong 		__field(void *, ret_ip)
1494700d229SDarrick J. Wong 	),
1504700d229SDarrick J. Wong 	TP_fast_assign(
1514700d229SDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
1524700d229SDarrick J. Wong 		__entry->type = sc->sm->sm_type;
1534700d229SDarrick J. Wong 		__entry->agno = agno;
1544700d229SDarrick J. Wong 		__entry->bno = bno;
1554700d229SDarrick J. Wong 		__entry->error = error;
1564700d229SDarrick J. Wong 		__entry->ret_ip = ret_ip;
1574700d229SDarrick J. Wong 	),
158f7b08163SDarrick J. Wong 	TP_printk("dev %d:%d type %s agno 0x%x agbno 0x%x error %d ret_ip %pS",
1594700d229SDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
16086d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
1614700d229SDarrick J. Wong 		  __entry->agno,
1624700d229SDarrick J. Wong 		  __entry->bno,
1634700d229SDarrick J. Wong 		  __entry->error,
1644700d229SDarrick J. Wong 		  __entry->ret_ip)
1654700d229SDarrick J. Wong );
1664700d229SDarrick J. Wong 
167c517b3aaSDarrick J. Wong TRACE_EVENT(xchk_file_op_error,
1681d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, int whichfork,
1694700d229SDarrick J. Wong 		 xfs_fileoff_t offset, int error, void *ret_ip),
1704700d229SDarrick J. Wong 	TP_ARGS(sc, whichfork, offset, error, ret_ip),
1714700d229SDarrick J. Wong 	TP_STRUCT__entry(
1724700d229SDarrick J. Wong 		__field(dev_t, dev)
1734700d229SDarrick J. Wong 		__field(xfs_ino_t, ino)
1744700d229SDarrick J. Wong 		__field(int, whichfork)
1754700d229SDarrick J. Wong 		__field(unsigned int, type)
1764700d229SDarrick J. Wong 		__field(xfs_fileoff_t, offset)
1774700d229SDarrick J. Wong 		__field(int, error)
1784700d229SDarrick J. Wong 		__field(void *, ret_ip)
1794700d229SDarrick J. Wong 	),
1804700d229SDarrick J. Wong 	TP_fast_assign(
1814700d229SDarrick J. Wong 		__entry->dev = sc->ip->i_mount->m_super->s_dev;
1824700d229SDarrick J. Wong 		__entry->ino = sc->ip->i_ino;
1834700d229SDarrick J. Wong 		__entry->whichfork = whichfork;
1844700d229SDarrick J. Wong 		__entry->type = sc->sm->sm_type;
1854700d229SDarrick J. Wong 		__entry->offset = offset;
1864700d229SDarrick J. Wong 		__entry->error = error;
1874700d229SDarrick J. Wong 		__entry->ret_ip = ret_ip;
1884700d229SDarrick J. Wong 	),
189f93f85f7SDarrick J. Wong 	TP_printk("dev %d:%d ino 0x%llx fork %s type %s fileoff 0x%llx error %d ret_ip %pS",
1904700d229SDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
1914700d229SDarrick J. Wong 		  __entry->ino,
192f93f85f7SDarrick J. Wong 		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
19386d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
1944700d229SDarrick J. Wong 		  __entry->offset,
1954700d229SDarrick J. Wong 		  __entry->error,
1964700d229SDarrick J. Wong 		  __entry->ret_ip)
1974700d229SDarrick J. Wong );
1984700d229SDarrick J. Wong 
199c517b3aaSDarrick J. Wong DECLARE_EVENT_CLASS(xchk_block_error_class,
2001d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, void *ret_ip),
2014700d229SDarrick J. Wong 	TP_ARGS(sc, daddr, ret_ip),
2024700d229SDarrick J. Wong 	TP_STRUCT__entry(
2034700d229SDarrick J. Wong 		__field(dev_t, dev)
2044700d229SDarrick J. Wong 		__field(unsigned int, type)
2054700d229SDarrick J. Wong 		__field(xfs_agnumber_t, agno)
2063fd7cb84SDarrick J. Wong 		__field(xfs_agblock_t, agbno)
2074700d229SDarrick J. Wong 		__field(void *, ret_ip)
2084700d229SDarrick J. Wong 	),
2094700d229SDarrick J. Wong 	TP_fast_assign(
2104700d229SDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
2114700d229SDarrick J. Wong 		__entry->type = sc->sm->sm_type;
2123fd7cb84SDarrick J. Wong 		__entry->agno = xfs_daddr_to_agno(sc->mp, daddr);
2133fd7cb84SDarrick J. Wong 		__entry->agbno = xfs_daddr_to_agbno(sc->mp, daddr);
2144700d229SDarrick J. Wong 		__entry->ret_ip = ret_ip;
2154700d229SDarrick J. Wong 	),
216f7b08163SDarrick J. Wong 	TP_printk("dev %d:%d type %s agno 0x%x agbno 0x%x ret_ip %pS",
2174700d229SDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
21886d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
2194700d229SDarrick J. Wong 		  __entry->agno,
2203fd7cb84SDarrick J. Wong 		  __entry->agbno,
2214700d229SDarrick J. Wong 		  __entry->ret_ip)
2224700d229SDarrick J. Wong )
2234700d229SDarrick J. Wong 
2244700d229SDarrick J. Wong #define DEFINE_SCRUB_BLOCK_ERROR_EVENT(name) \
225c517b3aaSDarrick J. Wong DEFINE_EVENT(xchk_block_error_class, name, \
2261d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, xfs_daddr_t daddr, \
2274700d229SDarrick J. Wong 		 void *ret_ip), \
2284700d229SDarrick J. Wong 	TP_ARGS(sc, daddr, ret_ip))
2294700d229SDarrick J. Wong 
23075efa57dSDarrick J. Wong DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_fs_error);
231c517b3aaSDarrick J. Wong DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_error);
232c517b3aaSDarrick J. Wong DEFINE_SCRUB_BLOCK_ERROR_EVENT(xchk_block_preen);
2334700d229SDarrick J. Wong 
234c517b3aaSDarrick J. Wong DECLARE_EVENT_CLASS(xchk_ino_error_class,
2351d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, void *ret_ip),
2367e56d9eaSDarrick J. Wong 	TP_ARGS(sc, ino, ret_ip),
2374700d229SDarrick J. Wong 	TP_STRUCT__entry(
2384700d229SDarrick J. Wong 		__field(dev_t, dev)
2394700d229SDarrick J. Wong 		__field(xfs_ino_t, ino)
2404700d229SDarrick J. Wong 		__field(unsigned int, type)
2414700d229SDarrick J. Wong 		__field(void *, ret_ip)
2424700d229SDarrick J. Wong 	),
2434700d229SDarrick J. Wong 	TP_fast_assign(
2444700d229SDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
2454700d229SDarrick J. Wong 		__entry->ino = ino;
2464700d229SDarrick J. Wong 		__entry->type = sc->sm->sm_type;
2474700d229SDarrick J. Wong 		__entry->ret_ip = ret_ip;
2484700d229SDarrick J. Wong 	),
24986d163dbSDarrick J. Wong 	TP_printk("dev %d:%d ino 0x%llx type %s ret_ip %pS",
2504700d229SDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
2514700d229SDarrick J. Wong 		  __entry->ino,
25286d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
2534700d229SDarrick J. Wong 		  __entry->ret_ip)
2544700d229SDarrick J. Wong )
2554700d229SDarrick J. Wong 
2564700d229SDarrick J. Wong #define DEFINE_SCRUB_INO_ERROR_EVENT(name) \
257c517b3aaSDarrick J. Wong DEFINE_EVENT(xchk_ino_error_class, name, \
2581d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, xfs_ino_t ino, \
2597e56d9eaSDarrick J. Wong 		 void *ret_ip), \
2607e56d9eaSDarrick J. Wong 	TP_ARGS(sc, ino, ret_ip))
2614700d229SDarrick J. Wong 
262c517b3aaSDarrick J. Wong DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_error);
263c517b3aaSDarrick J. Wong DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_preen);
264c517b3aaSDarrick J. Wong DEFINE_SCRUB_INO_ERROR_EVENT(xchk_ino_warning);
2654700d229SDarrick J. Wong 
266c517b3aaSDarrick J. Wong DECLARE_EVENT_CLASS(xchk_fblock_error_class,
2671d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, int whichfork,
2684700d229SDarrick J. Wong 		 xfs_fileoff_t offset, void *ret_ip),
2694700d229SDarrick J. Wong 	TP_ARGS(sc, whichfork, offset, ret_ip),
2704700d229SDarrick J. Wong 	TP_STRUCT__entry(
2714700d229SDarrick J. Wong 		__field(dev_t, dev)
2724700d229SDarrick J. Wong 		__field(xfs_ino_t, ino)
2734700d229SDarrick J. Wong 		__field(int, whichfork)
2744700d229SDarrick J. Wong 		__field(unsigned int, type)
2754700d229SDarrick J. Wong 		__field(xfs_fileoff_t, offset)
2764700d229SDarrick J. Wong 		__field(void *, ret_ip)
2774700d229SDarrick J. Wong 	),
2784700d229SDarrick J. Wong 	TP_fast_assign(
2794700d229SDarrick J. Wong 		__entry->dev = sc->ip->i_mount->m_super->s_dev;
2804700d229SDarrick J. Wong 		__entry->ino = sc->ip->i_ino;
2814700d229SDarrick J. Wong 		__entry->whichfork = whichfork;
2824700d229SDarrick J. Wong 		__entry->type = sc->sm->sm_type;
2834700d229SDarrick J. Wong 		__entry->offset = offset;
2844700d229SDarrick J. Wong 		__entry->ret_ip = ret_ip;
2854700d229SDarrick J. Wong 	),
286f93f85f7SDarrick J. Wong 	TP_printk("dev %d:%d ino 0x%llx fork %s type %s fileoff 0x%llx ret_ip %pS",
2874700d229SDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
2884700d229SDarrick J. Wong 		  __entry->ino,
289f93f85f7SDarrick J. Wong 		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
29086d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
2914700d229SDarrick J. Wong 		  __entry->offset,
2924700d229SDarrick J. Wong 		  __entry->ret_ip)
2934700d229SDarrick J. Wong );
2944700d229SDarrick J. Wong 
2954700d229SDarrick J. Wong #define DEFINE_SCRUB_FBLOCK_ERROR_EVENT(name) \
296c517b3aaSDarrick J. Wong DEFINE_EVENT(xchk_fblock_error_class, name, \
2971d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, int whichfork, \
2984700d229SDarrick J. Wong 		 xfs_fileoff_t offset, void *ret_ip), \
2994700d229SDarrick J. Wong 	TP_ARGS(sc, whichfork, offset, ret_ip))
3004700d229SDarrick J. Wong 
301c517b3aaSDarrick J. Wong DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_error);
302c517b3aaSDarrick J. Wong DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_warning);
3034700d229SDarrick J. Wong 
304c517b3aaSDarrick J. Wong TRACE_EVENT(xchk_incomplete,
3051d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, void *ret_ip),
3064700d229SDarrick J. Wong 	TP_ARGS(sc, ret_ip),
3074700d229SDarrick J. Wong 	TP_STRUCT__entry(
3084700d229SDarrick J. Wong 		__field(dev_t, dev)
3094700d229SDarrick J. Wong 		__field(unsigned int, type)
3104700d229SDarrick J. Wong 		__field(void *, ret_ip)
3114700d229SDarrick J. Wong 	),
3124700d229SDarrick J. Wong 	TP_fast_assign(
3134700d229SDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
3144700d229SDarrick J. Wong 		__entry->type = sc->sm->sm_type;
3154700d229SDarrick J. Wong 		__entry->ret_ip = ret_ip;
3164700d229SDarrick J. Wong 	),
31786d163dbSDarrick J. Wong 	TP_printk("dev %d:%d type %s ret_ip %pS",
3184700d229SDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
31986d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
3204700d229SDarrick J. Wong 		  __entry->ret_ip)
3214700d229SDarrick J. Wong );
322a5637186SDarrick J. Wong 
323c517b3aaSDarrick J. Wong TRACE_EVENT(xchk_btree_op_error,
3241d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
325537964bcSDarrick J. Wong 		 int level, int error, void *ret_ip),
326537964bcSDarrick J. Wong 	TP_ARGS(sc, cur, level, error, ret_ip),
327537964bcSDarrick J. Wong 	TP_STRUCT__entry(
328537964bcSDarrick J. Wong 		__field(dev_t, dev)
329537964bcSDarrick J. Wong 		__field(unsigned int, type)
330537964bcSDarrick J. Wong 		__field(xfs_btnum_t, btnum)
331537964bcSDarrick J. Wong 		__field(int, level)
332537964bcSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
333537964bcSDarrick J. Wong 		__field(xfs_agblock_t, bno)
33404ae87a5SPeter Zijlstra 		__field(int, ptr)
335537964bcSDarrick J. Wong 		__field(int, error)
336537964bcSDarrick J. Wong 		__field(void *, ret_ip)
337537964bcSDarrick J. Wong 	),
338537964bcSDarrick J. Wong 	TP_fast_assign(
339c517b3aaSDarrick J. Wong 		xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
340537964bcSDarrick J. Wong 
341537964bcSDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
342537964bcSDarrick J. Wong 		__entry->type = sc->sm->sm_type;
343537964bcSDarrick J. Wong 		__entry->btnum = cur->bc_btnum;
344537964bcSDarrick J. Wong 		__entry->level = level;
345537964bcSDarrick J. Wong 		__entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
346537964bcSDarrick J. Wong 		__entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
347537964bcSDarrick J. Wong 		__entry->ptr = cur->bc_ptrs[level];
348537964bcSDarrick J. Wong 		__entry->error = error;
349537964bcSDarrick J. Wong 		__entry->ret_ip = ret_ip;
350537964bcSDarrick J. Wong 	),
351f7b08163SDarrick J. Wong 	TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x error %d ret_ip %pS",
352537964bcSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
35386d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
354c494213fSDarrick J. Wong 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
355537964bcSDarrick J. Wong 		  __entry->level,
356537964bcSDarrick J. Wong 		  __entry->ptr,
357537964bcSDarrick J. Wong 		  __entry->agno,
358537964bcSDarrick J. Wong 		  __entry->bno,
359537964bcSDarrick J. Wong 		  __entry->error,
360537964bcSDarrick J. Wong 		  __entry->ret_ip)
361537964bcSDarrick J. Wong );
362537964bcSDarrick J. Wong 
363c517b3aaSDarrick J. Wong TRACE_EVENT(xchk_ifork_btree_op_error,
3641d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
365537964bcSDarrick J. Wong 		 int level, int error, void *ret_ip),
366537964bcSDarrick J. Wong 	TP_ARGS(sc, cur, level, error, ret_ip),
367537964bcSDarrick J. Wong 	TP_STRUCT__entry(
368537964bcSDarrick J. Wong 		__field(dev_t, dev)
369537964bcSDarrick J. Wong 		__field(xfs_ino_t, ino)
370537964bcSDarrick J. Wong 		__field(int, whichfork)
371537964bcSDarrick J. Wong 		__field(unsigned int, type)
372537964bcSDarrick J. Wong 		__field(xfs_btnum_t, btnum)
373537964bcSDarrick J. Wong 		__field(int, level)
374537964bcSDarrick J. Wong 		__field(int, ptr)
375537964bcSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
376537964bcSDarrick J. Wong 		__field(xfs_agblock_t, bno)
377537964bcSDarrick J. Wong 		__field(int, error)
378537964bcSDarrick J. Wong 		__field(void *, ret_ip)
379537964bcSDarrick J. Wong 	),
380537964bcSDarrick J. Wong 	TP_fast_assign(
381c517b3aaSDarrick J. Wong 		xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
382537964bcSDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
383537964bcSDarrick J. Wong 		__entry->ino = sc->ip->i_ino;
38492219c29SDave Chinner 		__entry->whichfork = cur->bc_ino.whichfork;
385537964bcSDarrick J. Wong 		__entry->type = sc->sm->sm_type;
386537964bcSDarrick J. Wong 		__entry->btnum = cur->bc_btnum;
387537964bcSDarrick J. Wong 		__entry->level = level;
388537964bcSDarrick J. Wong 		__entry->ptr = cur->bc_ptrs[level];
389537964bcSDarrick J. Wong 		__entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
390537964bcSDarrick J. Wong 		__entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
391537964bcSDarrick J. Wong 		__entry->error = error;
392537964bcSDarrick J. Wong 		__entry->ret_ip = ret_ip;
393537964bcSDarrick J. Wong 	),
394f93f85f7SDarrick J. Wong 	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",
395537964bcSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
396537964bcSDarrick J. Wong 		  __entry->ino,
397f93f85f7SDarrick J. Wong 		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
39886d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
399c494213fSDarrick J. Wong 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
400537964bcSDarrick J. Wong 		  __entry->level,
401537964bcSDarrick J. Wong 		  __entry->ptr,
402537964bcSDarrick J. Wong 		  __entry->agno,
403537964bcSDarrick J. Wong 		  __entry->bno,
404537964bcSDarrick J. Wong 		  __entry->error,
405537964bcSDarrick J. Wong 		  __entry->ret_ip)
406537964bcSDarrick J. Wong );
407537964bcSDarrick J. Wong 
408c517b3aaSDarrick J. Wong TRACE_EVENT(xchk_btree_error,
4091d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
410537964bcSDarrick J. Wong 		 int level, void *ret_ip),
411537964bcSDarrick J. Wong 	TP_ARGS(sc, cur, level, ret_ip),
412537964bcSDarrick J. Wong 	TP_STRUCT__entry(
413537964bcSDarrick J. Wong 		__field(dev_t, dev)
414537964bcSDarrick J. Wong 		__field(unsigned int, type)
415537964bcSDarrick J. Wong 		__field(xfs_btnum_t, btnum)
416537964bcSDarrick J. Wong 		__field(int, level)
417537964bcSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
418537964bcSDarrick J. Wong 		__field(xfs_agblock_t, bno)
41904ae87a5SPeter Zijlstra 		__field(int, ptr)
420537964bcSDarrick J. Wong 		__field(void *, ret_ip)
421537964bcSDarrick J. Wong 	),
422537964bcSDarrick J. Wong 	TP_fast_assign(
423c517b3aaSDarrick J. Wong 		xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
424537964bcSDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
425537964bcSDarrick J. Wong 		__entry->type = sc->sm->sm_type;
426537964bcSDarrick J. Wong 		__entry->btnum = cur->bc_btnum;
427537964bcSDarrick J. Wong 		__entry->level = level;
428537964bcSDarrick J. Wong 		__entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
429537964bcSDarrick J. Wong 		__entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
430537964bcSDarrick J. Wong 		__entry->ptr = cur->bc_ptrs[level];
431537964bcSDarrick J. Wong 		__entry->ret_ip = ret_ip;
432537964bcSDarrick J. Wong 	),
433f7b08163SDarrick J. Wong 	TP_printk("dev %d:%d type %s btree %s level %d ptr %d agno 0x%x agbno 0x%x ret_ip %pS",
434537964bcSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
43586d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
436c494213fSDarrick J. Wong 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
437537964bcSDarrick J. Wong 		  __entry->level,
438537964bcSDarrick J. Wong 		  __entry->ptr,
439537964bcSDarrick J. Wong 		  __entry->agno,
440537964bcSDarrick J. Wong 		  __entry->bno,
441537964bcSDarrick J. Wong 		  __entry->ret_ip)
442537964bcSDarrick J. Wong );
443537964bcSDarrick J. Wong 
444c517b3aaSDarrick J. Wong TRACE_EVENT(xchk_ifork_btree_error,
4451d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
446537964bcSDarrick J. Wong 		 int level, void *ret_ip),
447537964bcSDarrick J. Wong 	TP_ARGS(sc, cur, level, ret_ip),
448537964bcSDarrick J. Wong 	TP_STRUCT__entry(
449537964bcSDarrick J. Wong 		__field(dev_t, dev)
450537964bcSDarrick J. Wong 		__field(xfs_ino_t, ino)
451537964bcSDarrick J. Wong 		__field(int, whichfork)
452537964bcSDarrick J. Wong 		__field(unsigned int, type)
453537964bcSDarrick J. Wong 		__field(xfs_btnum_t, btnum)
454537964bcSDarrick J. Wong 		__field(int, level)
455537964bcSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
456537964bcSDarrick J. Wong 		__field(xfs_agblock_t, bno)
45704ae87a5SPeter Zijlstra 		__field(int, ptr)
458537964bcSDarrick J. Wong 		__field(void *, ret_ip)
459537964bcSDarrick J. Wong 	),
460537964bcSDarrick J. Wong 	TP_fast_assign(
461c517b3aaSDarrick J. Wong 		xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
462537964bcSDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
463537964bcSDarrick J. Wong 		__entry->ino = sc->ip->i_ino;
46492219c29SDave Chinner 		__entry->whichfork = cur->bc_ino.whichfork;
465537964bcSDarrick J. Wong 		__entry->type = sc->sm->sm_type;
466537964bcSDarrick J. Wong 		__entry->btnum = cur->bc_btnum;
467537964bcSDarrick J. Wong 		__entry->level = level;
468537964bcSDarrick J. Wong 		__entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
469537964bcSDarrick J. Wong 		__entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
470537964bcSDarrick J. Wong 		__entry->ptr = cur->bc_ptrs[level];
471537964bcSDarrick J. Wong 		__entry->ret_ip = ret_ip;
472537964bcSDarrick J. Wong 	),
473f93f85f7SDarrick J. Wong 	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",
474537964bcSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
475537964bcSDarrick J. Wong 		  __entry->ino,
476f93f85f7SDarrick J. Wong 		  __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
47786d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
478c494213fSDarrick J. Wong 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
479537964bcSDarrick J. Wong 		  __entry->level,
480537964bcSDarrick J. Wong 		  __entry->ptr,
481537964bcSDarrick J. Wong 		  __entry->agno,
482537964bcSDarrick J. Wong 		  __entry->bno,
483537964bcSDarrick J. Wong 		  __entry->ret_ip)
484537964bcSDarrick J. Wong );
485537964bcSDarrick J. Wong 
486c517b3aaSDarrick J. Wong DECLARE_EVENT_CLASS(xchk_sbtree_class,
4871d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur,
48837f3fa7fSDarrick J. Wong 		 int level),
48937f3fa7fSDarrick J. Wong 	TP_ARGS(sc, cur, level),
49037f3fa7fSDarrick J. Wong 	TP_STRUCT__entry(
49137f3fa7fSDarrick J. Wong 		__field(dev_t, dev)
49237f3fa7fSDarrick J. Wong 		__field(int, type)
49337f3fa7fSDarrick J. Wong 		__field(xfs_btnum_t, btnum)
49437f3fa7fSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
49537f3fa7fSDarrick J. Wong 		__field(xfs_agblock_t, bno)
49637f3fa7fSDarrick J. Wong 		__field(int, level)
49737f3fa7fSDarrick J. Wong 		__field(int, nlevels)
49837f3fa7fSDarrick J. Wong 		__field(int, ptr)
49937f3fa7fSDarrick J. Wong 	),
50037f3fa7fSDarrick J. Wong 	TP_fast_assign(
501c517b3aaSDarrick J. Wong 		xfs_fsblock_t fsbno = xchk_btree_cur_fsbno(cur, level);
50237f3fa7fSDarrick J. Wong 
50337f3fa7fSDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
50437f3fa7fSDarrick J. Wong 		__entry->type = sc->sm->sm_type;
50537f3fa7fSDarrick J. Wong 		__entry->btnum = cur->bc_btnum;
50637f3fa7fSDarrick J. Wong 		__entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno);
50737f3fa7fSDarrick J. Wong 		__entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno);
50837f3fa7fSDarrick J. Wong 		__entry->level = level;
50937f3fa7fSDarrick J. Wong 		__entry->nlevels = cur->bc_nlevels;
51037f3fa7fSDarrick J. Wong 		__entry->ptr = cur->bc_ptrs[level];
51137f3fa7fSDarrick J. Wong 	),
512f7b08163SDarrick J. Wong 	TP_printk("dev %d:%d type %s btree %s agno 0x%x agbno 0x%x level %d nlevels %d ptr %d",
51337f3fa7fSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
51486d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
515c494213fSDarrick J. Wong 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
51637f3fa7fSDarrick J. Wong 		  __entry->agno,
51737f3fa7fSDarrick J. Wong 		  __entry->bno,
51837f3fa7fSDarrick J. Wong 		  __entry->level,
51937f3fa7fSDarrick J. Wong 		  __entry->nlevels,
52037f3fa7fSDarrick J. Wong 		  __entry->ptr)
52137f3fa7fSDarrick J. Wong )
52237f3fa7fSDarrick J. Wong #define DEFINE_SCRUB_SBTREE_EVENT(name) \
523c517b3aaSDarrick J. Wong DEFINE_EVENT(xchk_sbtree_class, name, \
5241d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, struct xfs_btree_cur *cur, \
52537f3fa7fSDarrick J. Wong 		 int level), \
52637f3fa7fSDarrick J. Wong 	TP_ARGS(sc, cur, level))
52737f3fa7fSDarrick J. Wong 
528c517b3aaSDarrick J. Wong DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_rec);
529c517b3aaSDarrick J. Wong DEFINE_SCRUB_SBTREE_EVENT(xchk_btree_key);
53037f3fa7fSDarrick J. Wong 
531c517b3aaSDarrick J. Wong TRACE_EVENT(xchk_xref_error,
5321d8a748aSDarrick J. Wong 	TP_PROTO(struct xfs_scrub *sc, int error, void *ret_ip),
53364b12563SDarrick J. Wong 	TP_ARGS(sc, error, ret_ip),
53464b12563SDarrick J. Wong 	TP_STRUCT__entry(
53564b12563SDarrick J. Wong 		__field(dev_t, dev)
53664b12563SDarrick J. Wong 		__field(int, type)
53764b12563SDarrick J. Wong 		__field(int, error)
53864b12563SDarrick J. Wong 		__field(void *, ret_ip)
53964b12563SDarrick J. Wong 	),
54064b12563SDarrick J. Wong 	TP_fast_assign(
54164b12563SDarrick J. Wong 		__entry->dev = sc->mp->m_super->s_dev;
54264b12563SDarrick J. Wong 		__entry->type = sc->sm->sm_type;
54364b12563SDarrick J. Wong 		__entry->error = error;
54464b12563SDarrick J. Wong 		__entry->ret_ip = ret_ip;
54564b12563SDarrick J. Wong 	),
54686d163dbSDarrick J. Wong 	TP_printk("dev %d:%d type %s xref error %d ret_ip %pS",
54764b12563SDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
54886d163dbSDarrick J. Wong 		  __print_symbolic(__entry->type, XFS_SCRUB_TYPE_STRINGS),
54964b12563SDarrick J. Wong 		  __entry->error,
55064b12563SDarrick J. Wong 		  __entry->ret_ip)
55164b12563SDarrick J. Wong );
55264b12563SDarrick J. Wong 
553b9454fe0SDarrick J. Wong TRACE_EVENT(xchk_iallocbt_check_cluster,
554b9454fe0SDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
555b9454fe0SDarrick J. Wong 		 xfs_agino_t startino, xfs_daddr_t map_daddr,
556b9454fe0SDarrick J. Wong 		 unsigned short map_len, unsigned int chunk_ino,
557b9454fe0SDarrick J. Wong 		 unsigned int nr_inodes, uint16_t cluster_mask,
558b9454fe0SDarrick J. Wong 		 uint16_t holemask, unsigned int cluster_ino),
559b9454fe0SDarrick J. Wong 	TP_ARGS(mp, agno, startino, map_daddr, map_len, chunk_ino, nr_inodes,
560b9454fe0SDarrick J. Wong 		cluster_mask, holemask, cluster_ino),
561b9454fe0SDarrick J. Wong 	TP_STRUCT__entry(
562b9454fe0SDarrick J. Wong 		__field(dev_t, dev)
563b9454fe0SDarrick J. Wong 		__field(xfs_agnumber_t, agno)
564b9454fe0SDarrick J. Wong 		__field(xfs_agino_t, startino)
565b9454fe0SDarrick J. Wong 		__field(xfs_daddr_t, map_daddr)
566b9454fe0SDarrick J. Wong 		__field(unsigned short, map_len)
567b9454fe0SDarrick J. Wong 		__field(unsigned int, chunk_ino)
568b9454fe0SDarrick J. Wong 		__field(unsigned int, nr_inodes)
569b9454fe0SDarrick J. Wong 		__field(unsigned int, cluster_ino)
570b9454fe0SDarrick J. Wong 		__field(uint16_t, cluster_mask)
571b9454fe0SDarrick J. Wong 		__field(uint16_t, holemask)
572b9454fe0SDarrick J. Wong 	),
573b9454fe0SDarrick J. Wong 	TP_fast_assign(
574b9454fe0SDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
575b9454fe0SDarrick J. Wong 		__entry->agno = agno;
576b9454fe0SDarrick J. Wong 		__entry->startino = startino;
577b9454fe0SDarrick J. Wong 		__entry->map_daddr = map_daddr;
578b9454fe0SDarrick J. Wong 		__entry->map_len = map_len;
579b9454fe0SDarrick J. Wong 		__entry->chunk_ino = chunk_ino;
580b9454fe0SDarrick J. Wong 		__entry->nr_inodes = nr_inodes;
581b9454fe0SDarrick J. Wong 		__entry->cluster_mask = cluster_mask;
582b9454fe0SDarrick J. Wong 		__entry->holemask = holemask;
583b9454fe0SDarrick J. Wong 		__entry->cluster_ino = cluster_ino;
584b9454fe0SDarrick J. Wong 	),
5857989acccSDarrick J. Wong 	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",
586b9454fe0SDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
587b9454fe0SDarrick J. Wong 		  __entry->agno,
588b9454fe0SDarrick J. Wong 		  __entry->startino,
589b9454fe0SDarrick J. Wong 		  __entry->map_daddr,
590b9454fe0SDarrick J. Wong 		  __entry->map_len,
591b9454fe0SDarrick J. Wong 		  __entry->chunk_ino,
592b9454fe0SDarrick J. Wong 		  __entry->nr_inodes,
593b9454fe0SDarrick J. Wong 		  __entry->cluster_mask,
594b9454fe0SDarrick J. Wong 		  __entry->holemask,
595b9454fe0SDarrick J. Wong 		  __entry->cluster_ino)
596b9454fe0SDarrick J. Wong )
597b9454fe0SDarrick J. Wong 
59875efa57dSDarrick J. Wong TRACE_EVENT(xchk_fscounters_calc,
59975efa57dSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, uint64_t icount, uint64_t ifree,
60075efa57dSDarrick J. Wong 		 uint64_t fdblocks, uint64_t delalloc),
60175efa57dSDarrick J. Wong 	TP_ARGS(mp, icount, ifree, fdblocks, delalloc),
60275efa57dSDarrick J. Wong 	TP_STRUCT__entry(
60375efa57dSDarrick J. Wong 		__field(dev_t, dev)
60475efa57dSDarrick J. Wong 		__field(int64_t, icount_sb)
60575efa57dSDarrick J. Wong 		__field(uint64_t, icount_calculated)
60675efa57dSDarrick J. Wong 		__field(int64_t, ifree_sb)
60775efa57dSDarrick J. Wong 		__field(uint64_t, ifree_calculated)
60875efa57dSDarrick J. Wong 		__field(int64_t, fdblocks_sb)
60975efa57dSDarrick J. Wong 		__field(uint64_t, fdblocks_calculated)
61075efa57dSDarrick J. Wong 		__field(uint64_t, delalloc)
61175efa57dSDarrick J. Wong 	),
61275efa57dSDarrick J. Wong 	TP_fast_assign(
61375efa57dSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
61475efa57dSDarrick J. Wong 		__entry->icount_sb = mp->m_sb.sb_icount;
61575efa57dSDarrick J. Wong 		__entry->icount_calculated = icount;
61675efa57dSDarrick J. Wong 		__entry->ifree_sb = mp->m_sb.sb_ifree;
61775efa57dSDarrick J. Wong 		__entry->ifree_calculated = ifree;
61875efa57dSDarrick J. Wong 		__entry->fdblocks_sb = mp->m_sb.sb_fdblocks;
61975efa57dSDarrick J. Wong 		__entry->fdblocks_calculated = fdblocks;
62075efa57dSDarrick J. Wong 		__entry->delalloc = delalloc;
62175efa57dSDarrick J. Wong 	),
62275efa57dSDarrick J. Wong 	TP_printk("dev %d:%d icount %lld:%llu ifree %lld::%llu fdblocks %lld::%llu delalloc %llu",
62375efa57dSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
62475efa57dSDarrick J. Wong 		  __entry->icount_sb,
62575efa57dSDarrick J. Wong 		  __entry->icount_calculated,
62675efa57dSDarrick J. Wong 		  __entry->ifree_sb,
62775efa57dSDarrick J. Wong 		  __entry->ifree_calculated,
62875efa57dSDarrick J. Wong 		  __entry->fdblocks_sb,
62975efa57dSDarrick J. Wong 		  __entry->fdblocks_calculated,
63075efa57dSDarrick J. Wong 		  __entry->delalloc)
63175efa57dSDarrick J. Wong )
63275efa57dSDarrick J. Wong 
63375efa57dSDarrick J. Wong TRACE_EVENT(xchk_fscounters_within_range,
63475efa57dSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, uint64_t expected, int64_t curr_value,
63575efa57dSDarrick J. Wong 		 int64_t old_value),
63675efa57dSDarrick J. Wong 	TP_ARGS(mp, expected, curr_value, old_value),
63775efa57dSDarrick J. Wong 	TP_STRUCT__entry(
63875efa57dSDarrick J. Wong 		__field(dev_t, dev)
63975efa57dSDarrick J. Wong 		__field(uint64_t, expected)
64075efa57dSDarrick J. Wong 		__field(int64_t, curr_value)
64175efa57dSDarrick J. Wong 		__field(int64_t, old_value)
64275efa57dSDarrick J. Wong 	),
64375efa57dSDarrick J. Wong 	TP_fast_assign(
64475efa57dSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
64575efa57dSDarrick J. Wong 		__entry->expected = expected;
64675efa57dSDarrick J. Wong 		__entry->curr_value = curr_value;
64775efa57dSDarrick J. Wong 		__entry->old_value = old_value;
64875efa57dSDarrick J. Wong 	),
64975efa57dSDarrick J. Wong 	TP_printk("dev %d:%d expected %llu curr_value %lld old_value %lld",
65075efa57dSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
65175efa57dSDarrick J. Wong 		  __entry->expected,
65275efa57dSDarrick J. Wong 		  __entry->curr_value,
65375efa57dSDarrick J. Wong 		  __entry->old_value)
65475efa57dSDarrick J. Wong )
65575efa57dSDarrick J. Wong 
656718fa74bSDarrick J. Wong /* repair tracepoints */
657718fa74bSDarrick J. Wong #if IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR)
658718fa74bSDarrick J. Wong 
659b5e2196eSDarrick J. Wong DECLARE_EVENT_CLASS(xrep_extent_class,
660718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
661718fa74bSDarrick J. Wong 		 xfs_agblock_t agbno, xfs_extlen_t len),
662718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, agbno, len),
663718fa74bSDarrick J. Wong 	TP_STRUCT__entry(
664718fa74bSDarrick J. Wong 		__field(dev_t, dev)
665718fa74bSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
666718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, agbno)
667718fa74bSDarrick J. Wong 		__field(xfs_extlen_t, len)
668718fa74bSDarrick J. Wong 	),
669718fa74bSDarrick J. Wong 	TP_fast_assign(
670718fa74bSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
671718fa74bSDarrick J. Wong 		__entry->agno = agno;
672718fa74bSDarrick J. Wong 		__entry->agbno = agbno;
673718fa74bSDarrick J. Wong 		__entry->len = len;
674718fa74bSDarrick J. Wong 	),
6757989acccSDarrick J. Wong 	TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
676718fa74bSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
677718fa74bSDarrick J. Wong 		  __entry->agno,
678718fa74bSDarrick J. Wong 		  __entry->agbno,
679718fa74bSDarrick J. Wong 		  __entry->len)
680718fa74bSDarrick J. Wong );
681718fa74bSDarrick J. Wong #define DEFINE_REPAIR_EXTENT_EVENT(name) \
682b5e2196eSDarrick J. Wong DEFINE_EVENT(xrep_extent_class, name, \
683718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
684718fa74bSDarrick J. Wong 		 xfs_agblock_t agbno, xfs_extlen_t len), \
685718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, agbno, len))
686b5e2196eSDarrick J. Wong DEFINE_REPAIR_EXTENT_EVENT(xrep_dispose_btree_extent);
687b5e2196eSDarrick J. Wong DEFINE_REPAIR_EXTENT_EVENT(xrep_agfl_insert);
688718fa74bSDarrick J. Wong 
689b5e2196eSDarrick J. Wong DECLARE_EVENT_CLASS(xrep_rmap_class,
690718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
691718fa74bSDarrick J. Wong 		 xfs_agblock_t agbno, xfs_extlen_t len,
692718fa74bSDarrick J. Wong 		 uint64_t owner, uint64_t offset, unsigned int flags),
693718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
694718fa74bSDarrick J. Wong 	TP_STRUCT__entry(
695718fa74bSDarrick J. Wong 		__field(dev_t, dev)
696718fa74bSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
697718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, agbno)
698718fa74bSDarrick J. Wong 		__field(xfs_extlen_t, len)
699718fa74bSDarrick J. Wong 		__field(uint64_t, owner)
700718fa74bSDarrick J. Wong 		__field(uint64_t, offset)
701718fa74bSDarrick J. Wong 		__field(unsigned int, flags)
702718fa74bSDarrick J. Wong 	),
703718fa74bSDarrick J. Wong 	TP_fast_assign(
704718fa74bSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
705718fa74bSDarrick J. Wong 		__entry->agno = agno;
706718fa74bSDarrick J. Wong 		__entry->agbno = agbno;
707718fa74bSDarrick J. Wong 		__entry->len = len;
708718fa74bSDarrick J. Wong 		__entry->owner = owner;
709718fa74bSDarrick J. Wong 		__entry->offset = offset;
710718fa74bSDarrick J. Wong 		__entry->flags = flags;
711718fa74bSDarrick J. Wong 	),
7127989acccSDarrick J. Wong 	TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
713718fa74bSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
714718fa74bSDarrick J. Wong 		  __entry->agno,
715718fa74bSDarrick J. Wong 		  __entry->agbno,
716718fa74bSDarrick J. Wong 		  __entry->len,
717718fa74bSDarrick J. Wong 		  __entry->owner,
718718fa74bSDarrick J. Wong 		  __entry->offset,
719718fa74bSDarrick J. Wong 		  __entry->flags)
720718fa74bSDarrick J. Wong );
721718fa74bSDarrick J. Wong #define DEFINE_REPAIR_RMAP_EVENT(name) \
722b5e2196eSDarrick J. Wong DEFINE_EVENT(xrep_rmap_class, name, \
723718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
724718fa74bSDarrick J. Wong 		 xfs_agblock_t agbno, xfs_extlen_t len, \
725718fa74bSDarrick J. Wong 		 uint64_t owner, uint64_t offset, unsigned int flags), \
726718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
727b5e2196eSDarrick J. Wong DEFINE_REPAIR_RMAP_EVENT(xrep_alloc_extent_fn);
728b5e2196eSDarrick J. Wong DEFINE_REPAIR_RMAP_EVENT(xrep_ialloc_extent_fn);
729b5e2196eSDarrick J. Wong DEFINE_REPAIR_RMAP_EVENT(xrep_rmap_extent_fn);
730b5e2196eSDarrick J. Wong DEFINE_REPAIR_RMAP_EVENT(xrep_bmap_extent_fn);
731718fa74bSDarrick J. Wong 
732b5e2196eSDarrick J. Wong TRACE_EVENT(xrep_refcount_extent_fn,
733718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
734718fa74bSDarrick J. Wong 		 struct xfs_refcount_irec *irec),
735718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, irec),
736718fa74bSDarrick J. Wong 	TP_STRUCT__entry(
737718fa74bSDarrick J. Wong 		__field(dev_t, dev)
738718fa74bSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
739718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, startblock)
740718fa74bSDarrick J. Wong 		__field(xfs_extlen_t, blockcount)
741718fa74bSDarrick J. Wong 		__field(xfs_nlink_t, refcount)
742718fa74bSDarrick J. Wong 	),
743718fa74bSDarrick J. Wong 	TP_fast_assign(
744718fa74bSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
745718fa74bSDarrick J. Wong 		__entry->agno = agno;
746718fa74bSDarrick J. Wong 		__entry->startblock = irec->rc_startblock;
747718fa74bSDarrick J. Wong 		__entry->blockcount = irec->rc_blockcount;
748718fa74bSDarrick J. Wong 		__entry->refcount = irec->rc_refcount;
749718fa74bSDarrick J. Wong 	),
7507989acccSDarrick J. Wong 	TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u",
751718fa74bSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
752718fa74bSDarrick J. Wong 		  __entry->agno,
753718fa74bSDarrick J. Wong 		  __entry->startblock,
754718fa74bSDarrick J. Wong 		  __entry->blockcount,
755718fa74bSDarrick J. Wong 		  __entry->refcount)
756718fa74bSDarrick J. Wong )
757718fa74bSDarrick J. Wong 
758b5e2196eSDarrick J. Wong TRACE_EVENT(xrep_init_btblock,
759718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
760718fa74bSDarrick J. Wong 		 xfs_btnum_t btnum),
761718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, agbno, btnum),
762718fa74bSDarrick J. Wong 	TP_STRUCT__entry(
763718fa74bSDarrick J. Wong 		__field(dev_t, dev)
764718fa74bSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
765718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, agbno)
766718fa74bSDarrick J. Wong 		__field(uint32_t, btnum)
767718fa74bSDarrick J. Wong 	),
768718fa74bSDarrick J. Wong 	TP_fast_assign(
769718fa74bSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
770718fa74bSDarrick J. Wong 		__entry->agno = agno;
771718fa74bSDarrick J. Wong 		__entry->agbno = agbno;
772718fa74bSDarrick J. Wong 		__entry->btnum = btnum;
773718fa74bSDarrick J. Wong 	),
774f7b08163SDarrick J. Wong 	TP_printk("dev %d:%d agno 0x%x agbno 0x%x btree %s",
775718fa74bSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
776718fa74bSDarrick J. Wong 		  __entry->agno,
777718fa74bSDarrick J. Wong 		  __entry->agbno,
778c494213fSDarrick J. Wong 		  __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS))
779718fa74bSDarrick J. Wong )
780b5e2196eSDarrick J. Wong TRACE_EVENT(xrep_findroot_block,
781718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
782718fa74bSDarrick J. Wong 		 uint32_t magic, uint16_t level),
783718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, agbno, magic, level),
784718fa74bSDarrick J. Wong 	TP_STRUCT__entry(
785718fa74bSDarrick J. Wong 		__field(dev_t, dev)
786718fa74bSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
787718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, agbno)
788718fa74bSDarrick J. Wong 		__field(uint32_t, magic)
789718fa74bSDarrick J. Wong 		__field(uint16_t, level)
790718fa74bSDarrick J. Wong 	),
791718fa74bSDarrick J. Wong 	TP_fast_assign(
792718fa74bSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
793718fa74bSDarrick J. Wong 		__entry->agno = agno;
794718fa74bSDarrick J. Wong 		__entry->agbno = agbno;
795718fa74bSDarrick J. Wong 		__entry->magic = magic;
796718fa74bSDarrick J. Wong 		__entry->level = level;
797718fa74bSDarrick J. Wong 	),
798f7b08163SDarrick J. Wong 	TP_printk("dev %d:%d agno 0x%x agbno 0x%x magic 0x%x level %u",
799718fa74bSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
800718fa74bSDarrick J. Wong 		  __entry->agno,
801718fa74bSDarrick J. Wong 		  __entry->agbno,
802718fa74bSDarrick J. Wong 		  __entry->magic,
803718fa74bSDarrick J. Wong 		  __entry->level)
804718fa74bSDarrick J. Wong )
805b5e2196eSDarrick J. Wong TRACE_EVENT(xrep_calc_ag_resblks,
806718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
807718fa74bSDarrick J. Wong 		 xfs_agino_t icount, xfs_agblock_t aglen, xfs_agblock_t freelen,
808718fa74bSDarrick J. Wong 		 xfs_agblock_t usedlen),
809718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, icount, aglen, freelen, usedlen),
810718fa74bSDarrick J. Wong 	TP_STRUCT__entry(
811718fa74bSDarrick J. Wong 		__field(dev_t, dev)
812718fa74bSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
813718fa74bSDarrick J. Wong 		__field(xfs_agino_t, icount)
814718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, aglen)
815718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, freelen)
816718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, usedlen)
817718fa74bSDarrick J. Wong 	),
818718fa74bSDarrick J. Wong 	TP_fast_assign(
819718fa74bSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
820718fa74bSDarrick J. Wong 		__entry->agno = agno;
821718fa74bSDarrick J. Wong 		__entry->icount = icount;
822718fa74bSDarrick J. Wong 		__entry->aglen = aglen;
823718fa74bSDarrick J. Wong 		__entry->freelen = freelen;
824718fa74bSDarrick J. Wong 		__entry->usedlen = usedlen;
825718fa74bSDarrick J. Wong 	),
8269febf39dSDarrick J. Wong 	TP_printk("dev %d:%d agno 0x%x icount %u aglen %u freelen %u usedlen %u",
827718fa74bSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
828718fa74bSDarrick J. Wong 		  __entry->agno,
829718fa74bSDarrick J. Wong 		  __entry->icount,
830718fa74bSDarrick J. Wong 		  __entry->aglen,
831718fa74bSDarrick J. Wong 		  __entry->freelen,
832718fa74bSDarrick J. Wong 		  __entry->usedlen)
833718fa74bSDarrick J. Wong )
834b5e2196eSDarrick J. Wong TRACE_EVENT(xrep_calc_ag_resblks_btsize,
835718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
836718fa74bSDarrick J. Wong 		 xfs_agblock_t bnobt_sz, xfs_agblock_t inobt_sz,
837718fa74bSDarrick J. Wong 		 xfs_agblock_t rmapbt_sz, xfs_agblock_t refcbt_sz),
838718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, bnobt_sz, inobt_sz, rmapbt_sz, refcbt_sz),
839718fa74bSDarrick J. Wong 	TP_STRUCT__entry(
840718fa74bSDarrick J. Wong 		__field(dev_t, dev)
841718fa74bSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
842718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, bnobt_sz)
843718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, inobt_sz)
844718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, rmapbt_sz)
845718fa74bSDarrick J. Wong 		__field(xfs_agblock_t, refcbt_sz)
846718fa74bSDarrick J. Wong 	),
847718fa74bSDarrick J. Wong 	TP_fast_assign(
848718fa74bSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
849718fa74bSDarrick J. Wong 		__entry->agno = agno;
850718fa74bSDarrick J. Wong 		__entry->bnobt_sz = bnobt_sz;
851718fa74bSDarrick J. Wong 		__entry->inobt_sz = inobt_sz;
852718fa74bSDarrick J. Wong 		__entry->rmapbt_sz = rmapbt_sz;
853718fa74bSDarrick J. Wong 		__entry->refcbt_sz = refcbt_sz;
854718fa74bSDarrick J. Wong 	),
8559febf39dSDarrick J. Wong 	TP_printk("dev %d:%d agno 0x%x bnobt %u inobt %u rmapbt %u refcountbt %u",
856718fa74bSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
857718fa74bSDarrick J. Wong 		  __entry->agno,
858718fa74bSDarrick J. Wong 		  __entry->bnobt_sz,
859718fa74bSDarrick J. Wong 		  __entry->inobt_sz,
860718fa74bSDarrick J. Wong 		  __entry->rmapbt_sz,
861718fa74bSDarrick J. Wong 		  __entry->refcbt_sz)
862718fa74bSDarrick J. Wong )
863b5e2196eSDarrick J. Wong TRACE_EVENT(xrep_reset_counters,
864718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp),
865718fa74bSDarrick J. Wong 	TP_ARGS(mp),
866718fa74bSDarrick J. Wong 	TP_STRUCT__entry(
867718fa74bSDarrick J. Wong 		__field(dev_t, dev)
868718fa74bSDarrick J. Wong 	),
869718fa74bSDarrick J. Wong 	TP_fast_assign(
870718fa74bSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
871718fa74bSDarrick J. Wong 	),
872718fa74bSDarrick J. Wong 	TP_printk("dev %d:%d",
873718fa74bSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev))
874718fa74bSDarrick J. Wong )
875718fa74bSDarrick J. Wong 
876b5e2196eSDarrick J. Wong TRACE_EVENT(xrep_ialloc_insert,
877718fa74bSDarrick J. Wong 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
878718fa74bSDarrick J. Wong 		 xfs_agino_t startino, uint16_t holemask, uint8_t count,
879718fa74bSDarrick J. Wong 		 uint8_t freecount, uint64_t freemask),
880718fa74bSDarrick J. Wong 	TP_ARGS(mp, agno, startino, holemask, count, freecount, freemask),
881718fa74bSDarrick J. Wong 	TP_STRUCT__entry(
882718fa74bSDarrick J. Wong 		__field(dev_t, dev)
883718fa74bSDarrick J. Wong 		__field(xfs_agnumber_t, agno)
884718fa74bSDarrick J. Wong 		__field(xfs_agino_t, startino)
885718fa74bSDarrick J. Wong 		__field(uint16_t, holemask)
886718fa74bSDarrick J. Wong 		__field(uint8_t, count)
887718fa74bSDarrick J. Wong 		__field(uint8_t, freecount)
888718fa74bSDarrick J. Wong 		__field(uint64_t, freemask)
889718fa74bSDarrick J. Wong 	),
890718fa74bSDarrick J. Wong 	TP_fast_assign(
891718fa74bSDarrick J. Wong 		__entry->dev = mp->m_super->s_dev;
892718fa74bSDarrick J. Wong 		__entry->agno = agno;
893718fa74bSDarrick J. Wong 		__entry->startino = startino;
894718fa74bSDarrick J. Wong 		__entry->holemask = holemask;
895718fa74bSDarrick J. Wong 		__entry->count = count;
896718fa74bSDarrick J. Wong 		__entry->freecount = freecount;
897718fa74bSDarrick J. Wong 		__entry->freemask = freemask;
898718fa74bSDarrick J. Wong 	),
8999febf39dSDarrick J. Wong 	TP_printk("dev %d:%d agno 0x%x startino 0x%x holemask 0x%x count %u freecount %u freemask 0x%llx",
900718fa74bSDarrick J. Wong 		  MAJOR(__entry->dev), MINOR(__entry->dev),
901718fa74bSDarrick J. Wong 		  __entry->agno,
902718fa74bSDarrick J. Wong 		  __entry->startino,
903718fa74bSDarrick J. Wong 		  __entry->holemask,
904718fa74bSDarrick J. Wong 		  __entry->count,
905718fa74bSDarrick J. Wong 		  __entry->freecount,
906718fa74bSDarrick J. Wong 		  __entry->freemask)
907718fa74bSDarrick J. Wong )
908718fa74bSDarrick J. Wong 
909718fa74bSDarrick J. Wong #endif /* IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR) */
910718fa74bSDarrick J. Wong 
91136fd6e86SDarrick J. Wong #endif /* _TRACE_XFS_SCRUB_TRACE_H */
91236fd6e86SDarrick J. Wong 
91336fd6e86SDarrick J. Wong #undef TRACE_INCLUDE_PATH
91436fd6e86SDarrick J. Wong #define TRACE_INCLUDE_PATH .
91536fd6e86SDarrick J. Wong #define TRACE_INCLUDE_FILE scrub/trace
91636fd6e86SDarrick J. Wong #include <trace/define_trace.h>
917