1*0b61f8a4SDave 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 15a5637186SDarrick J. Wong DECLARE_EVENT_CLASS(xfs_scrub_class, 16a5637186SDarrick J. Wong TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, 17a5637186SDarrick J. Wong int error), 18a5637186SDarrick J. Wong TP_ARGS(ip, sm, error), 19a5637186SDarrick J. Wong TP_STRUCT__entry( 20a5637186SDarrick J. Wong __field(dev_t, dev) 21a5637186SDarrick J. Wong __field(xfs_ino_t, ino) 22a5637186SDarrick J. Wong __field(unsigned int, type) 23a5637186SDarrick J. Wong __field(xfs_agnumber_t, agno) 24a5637186SDarrick J. Wong __field(xfs_ino_t, inum) 25a5637186SDarrick J. Wong __field(unsigned int, gen) 26a5637186SDarrick J. Wong __field(unsigned int, flags) 27a5637186SDarrick J. Wong __field(int, error) 28a5637186SDarrick J. Wong ), 29a5637186SDarrick J. Wong TP_fast_assign( 30a5637186SDarrick J. Wong __entry->dev = ip->i_mount->m_super->s_dev; 31a5637186SDarrick J. Wong __entry->ino = ip->i_ino; 32a5637186SDarrick J. Wong __entry->type = sm->sm_type; 33a5637186SDarrick J. Wong __entry->agno = sm->sm_agno; 34a5637186SDarrick J. Wong __entry->inum = sm->sm_ino; 35a5637186SDarrick J. Wong __entry->gen = sm->sm_gen; 36a5637186SDarrick J. Wong __entry->flags = sm->sm_flags; 37a5637186SDarrick J. Wong __entry->error = error; 38a5637186SDarrick J. Wong ), 3967a3f6d0SDarrick J. Wong TP_printk("dev %d:%d ino 0x%llx type %u agno %u inum %llu gen %u flags 0x%x error %d", 40a5637186SDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 41a5637186SDarrick J. Wong __entry->ino, 42a5637186SDarrick J. Wong __entry->type, 43a5637186SDarrick J. Wong __entry->agno, 44a5637186SDarrick J. Wong __entry->inum, 45a5637186SDarrick J. Wong __entry->gen, 46a5637186SDarrick J. Wong __entry->flags, 47a5637186SDarrick J. Wong __entry->error) 48a5637186SDarrick J. Wong ) 49a5637186SDarrick J. Wong #define DEFINE_SCRUB_EVENT(name) \ 50a5637186SDarrick J. Wong DEFINE_EVENT(xfs_scrub_class, name, \ 51a5637186SDarrick J. Wong TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, \ 52a5637186SDarrick J. Wong int error), \ 53a5637186SDarrick J. Wong TP_ARGS(ip, sm, error)) 54a5637186SDarrick J. Wong 55a5637186SDarrick J. Wong DEFINE_SCRUB_EVENT(xfs_scrub_start); 56a5637186SDarrick J. Wong DEFINE_SCRUB_EVENT(xfs_scrub_done); 574700d229SDarrick J. Wong DEFINE_SCRUB_EVENT(xfs_scrub_deadlock_retry); 58718fa74bSDarrick J. Wong DEFINE_SCRUB_EVENT(xfs_repair_attempt); 59718fa74bSDarrick J. Wong DEFINE_SCRUB_EVENT(xfs_repair_done); 604700d229SDarrick J. Wong 614700d229SDarrick J. Wong TRACE_EVENT(xfs_scrub_op_error, 624700d229SDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, xfs_agnumber_t agno, 634700d229SDarrick J. Wong xfs_agblock_t bno, int error, void *ret_ip), 644700d229SDarrick J. Wong TP_ARGS(sc, agno, bno, error, ret_ip), 654700d229SDarrick J. Wong TP_STRUCT__entry( 664700d229SDarrick J. Wong __field(dev_t, dev) 674700d229SDarrick J. Wong __field(unsigned int, type) 684700d229SDarrick J. Wong __field(xfs_agnumber_t, agno) 694700d229SDarrick J. Wong __field(xfs_agblock_t, bno) 704700d229SDarrick J. Wong __field(int, error) 714700d229SDarrick J. Wong __field(void *, ret_ip) 724700d229SDarrick J. Wong ), 734700d229SDarrick J. Wong TP_fast_assign( 744700d229SDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 754700d229SDarrick J. Wong __entry->type = sc->sm->sm_type; 764700d229SDarrick J. Wong __entry->agno = agno; 774700d229SDarrick J. Wong __entry->bno = bno; 784700d229SDarrick J. Wong __entry->error = error; 794700d229SDarrick J. Wong __entry->ret_ip = ret_ip; 804700d229SDarrick J. Wong ), 81aff68a55SDarrick J. Wong TP_printk("dev %d:%d type %u agno %u agbno %u error %d ret_ip %pS", 824700d229SDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 834700d229SDarrick J. Wong __entry->type, 844700d229SDarrick J. Wong __entry->agno, 854700d229SDarrick J. Wong __entry->bno, 864700d229SDarrick J. Wong __entry->error, 874700d229SDarrick J. Wong __entry->ret_ip) 884700d229SDarrick J. Wong ); 894700d229SDarrick J. Wong 904700d229SDarrick J. Wong TRACE_EVENT(xfs_scrub_file_op_error, 914700d229SDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, int whichfork, 924700d229SDarrick J. Wong xfs_fileoff_t offset, int error, void *ret_ip), 934700d229SDarrick J. Wong TP_ARGS(sc, whichfork, offset, error, ret_ip), 944700d229SDarrick J. Wong TP_STRUCT__entry( 954700d229SDarrick J. Wong __field(dev_t, dev) 964700d229SDarrick J. Wong __field(xfs_ino_t, ino) 974700d229SDarrick J. Wong __field(int, whichfork) 984700d229SDarrick J. Wong __field(unsigned int, type) 994700d229SDarrick J. Wong __field(xfs_fileoff_t, offset) 1004700d229SDarrick J. Wong __field(int, error) 1014700d229SDarrick J. Wong __field(void *, ret_ip) 1024700d229SDarrick J. Wong ), 1034700d229SDarrick J. Wong TP_fast_assign( 1044700d229SDarrick J. Wong __entry->dev = sc->ip->i_mount->m_super->s_dev; 1054700d229SDarrick J. Wong __entry->ino = sc->ip->i_ino; 1064700d229SDarrick J. Wong __entry->whichfork = whichfork; 1074700d229SDarrick J. Wong __entry->type = sc->sm->sm_type; 1084700d229SDarrick J. Wong __entry->offset = offset; 1094700d229SDarrick J. Wong __entry->error = error; 1104700d229SDarrick J. Wong __entry->ret_ip = ret_ip; 1114700d229SDarrick J. Wong ), 11267a3f6d0SDarrick J. Wong TP_printk("dev %d:%d ino 0x%llx fork %d type %u offset %llu error %d ret_ip %pS", 1134700d229SDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 1144700d229SDarrick J. Wong __entry->ino, 1154700d229SDarrick J. Wong __entry->whichfork, 1164700d229SDarrick J. Wong __entry->type, 1174700d229SDarrick J. Wong __entry->offset, 1184700d229SDarrick J. Wong __entry->error, 1194700d229SDarrick J. Wong __entry->ret_ip) 1204700d229SDarrick J. Wong ); 1214700d229SDarrick J. Wong 1224700d229SDarrick J. Wong DECLARE_EVENT_CLASS(xfs_scrub_block_error_class, 1234700d229SDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, void *ret_ip), 1244700d229SDarrick J. Wong TP_ARGS(sc, daddr, ret_ip), 1254700d229SDarrick J. Wong TP_STRUCT__entry( 1264700d229SDarrick J. Wong __field(dev_t, dev) 1274700d229SDarrick J. Wong __field(unsigned int, type) 1284700d229SDarrick J. Wong __field(xfs_agnumber_t, agno) 1294700d229SDarrick J. Wong __field(xfs_agblock_t, bno) 1304700d229SDarrick J. Wong __field(void *, ret_ip) 1314700d229SDarrick J. Wong ), 1324700d229SDarrick J. Wong TP_fast_assign( 1334700d229SDarrick J. Wong xfs_fsblock_t fsbno; 1344700d229SDarrick J. Wong xfs_agnumber_t agno; 1354700d229SDarrick J. Wong xfs_agblock_t bno; 1364700d229SDarrick J. Wong 1374700d229SDarrick J. Wong fsbno = XFS_DADDR_TO_FSB(sc->mp, daddr); 1384700d229SDarrick J. Wong agno = XFS_FSB_TO_AGNO(sc->mp, fsbno); 1394700d229SDarrick J. Wong bno = XFS_FSB_TO_AGBNO(sc->mp, fsbno); 1404700d229SDarrick J. Wong 1414700d229SDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 1424700d229SDarrick J. Wong __entry->type = sc->sm->sm_type; 1434700d229SDarrick J. Wong __entry->agno = agno; 1444700d229SDarrick J. Wong __entry->bno = bno; 1454700d229SDarrick J. Wong __entry->ret_ip = ret_ip; 1464700d229SDarrick J. Wong ), 147aff68a55SDarrick J. Wong TP_printk("dev %d:%d type %u agno %u agbno %u ret_ip %pS", 1484700d229SDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 1494700d229SDarrick J. Wong __entry->type, 1504700d229SDarrick J. Wong __entry->agno, 1514700d229SDarrick J. Wong __entry->bno, 1524700d229SDarrick J. Wong __entry->ret_ip) 1534700d229SDarrick J. Wong ) 1544700d229SDarrick J. Wong 1554700d229SDarrick J. Wong #define DEFINE_SCRUB_BLOCK_ERROR_EVENT(name) \ 1564700d229SDarrick J. Wong DEFINE_EVENT(xfs_scrub_block_error_class, name, \ 1574700d229SDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, xfs_daddr_t daddr, \ 1584700d229SDarrick J. Wong void *ret_ip), \ 1594700d229SDarrick J. Wong TP_ARGS(sc, daddr, ret_ip)) 1604700d229SDarrick J. Wong 1614700d229SDarrick J. Wong DEFINE_SCRUB_BLOCK_ERROR_EVENT(xfs_scrub_block_error); 1624700d229SDarrick J. Wong DEFINE_SCRUB_BLOCK_ERROR_EVENT(xfs_scrub_block_preen); 1634700d229SDarrick J. Wong 1644700d229SDarrick J. Wong DECLARE_EVENT_CLASS(xfs_scrub_ino_error_class, 1657e56d9eaSDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, void *ret_ip), 1667e56d9eaSDarrick J. Wong TP_ARGS(sc, ino, ret_ip), 1674700d229SDarrick J. Wong TP_STRUCT__entry( 1684700d229SDarrick J. Wong __field(dev_t, dev) 1694700d229SDarrick J. Wong __field(xfs_ino_t, ino) 1704700d229SDarrick J. Wong __field(unsigned int, type) 1714700d229SDarrick J. Wong __field(void *, ret_ip) 1724700d229SDarrick J. Wong ), 1734700d229SDarrick J. Wong TP_fast_assign( 1744700d229SDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 1754700d229SDarrick J. Wong __entry->ino = ino; 1764700d229SDarrick J. Wong __entry->type = sc->sm->sm_type; 1774700d229SDarrick J. Wong __entry->ret_ip = ret_ip; 1784700d229SDarrick J. Wong ), 1797e56d9eaSDarrick J. Wong TP_printk("dev %d:%d ino 0x%llx type %u ret_ip %pS", 1804700d229SDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 1814700d229SDarrick J. Wong __entry->ino, 1824700d229SDarrick J. Wong __entry->type, 1834700d229SDarrick J. Wong __entry->ret_ip) 1844700d229SDarrick J. Wong ) 1854700d229SDarrick J. Wong 1864700d229SDarrick J. Wong #define DEFINE_SCRUB_INO_ERROR_EVENT(name) \ 1874700d229SDarrick J. Wong DEFINE_EVENT(xfs_scrub_ino_error_class, name, \ 1884700d229SDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, xfs_ino_t ino, \ 1897e56d9eaSDarrick J. Wong void *ret_ip), \ 1907e56d9eaSDarrick J. Wong TP_ARGS(sc, ino, ret_ip)) 1914700d229SDarrick J. Wong 1924700d229SDarrick J. Wong DEFINE_SCRUB_INO_ERROR_EVENT(xfs_scrub_ino_error); 1934700d229SDarrick J. Wong DEFINE_SCRUB_INO_ERROR_EVENT(xfs_scrub_ino_preen); 1944700d229SDarrick J. Wong DEFINE_SCRUB_INO_ERROR_EVENT(xfs_scrub_ino_warning); 1954700d229SDarrick J. Wong 1964700d229SDarrick J. Wong DECLARE_EVENT_CLASS(xfs_scrub_fblock_error_class, 1974700d229SDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, int whichfork, 1984700d229SDarrick J. Wong xfs_fileoff_t offset, void *ret_ip), 1994700d229SDarrick J. Wong TP_ARGS(sc, whichfork, offset, ret_ip), 2004700d229SDarrick J. Wong TP_STRUCT__entry( 2014700d229SDarrick J. Wong __field(dev_t, dev) 2024700d229SDarrick J. Wong __field(xfs_ino_t, ino) 2034700d229SDarrick J. Wong __field(int, whichfork) 2044700d229SDarrick J. Wong __field(unsigned int, type) 2054700d229SDarrick J. Wong __field(xfs_fileoff_t, offset) 2064700d229SDarrick J. Wong __field(void *, ret_ip) 2074700d229SDarrick J. Wong ), 2084700d229SDarrick J. Wong TP_fast_assign( 2094700d229SDarrick J. Wong __entry->dev = sc->ip->i_mount->m_super->s_dev; 2104700d229SDarrick J. Wong __entry->ino = sc->ip->i_ino; 2114700d229SDarrick J. Wong __entry->whichfork = whichfork; 2124700d229SDarrick J. Wong __entry->type = sc->sm->sm_type; 2134700d229SDarrick J. Wong __entry->offset = offset; 2144700d229SDarrick J. Wong __entry->ret_ip = ret_ip; 2154700d229SDarrick J. Wong ), 21667a3f6d0SDarrick J. Wong TP_printk("dev %d:%d ino 0x%llx fork %d type %u offset %llu ret_ip %pS", 2174700d229SDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 2184700d229SDarrick J. Wong __entry->ino, 2194700d229SDarrick J. Wong __entry->whichfork, 2204700d229SDarrick J. Wong __entry->type, 2214700d229SDarrick J. Wong __entry->offset, 2224700d229SDarrick J. Wong __entry->ret_ip) 2234700d229SDarrick J. Wong ); 2244700d229SDarrick J. Wong 2254700d229SDarrick J. Wong #define DEFINE_SCRUB_FBLOCK_ERROR_EVENT(name) \ 2264700d229SDarrick J. Wong DEFINE_EVENT(xfs_scrub_fblock_error_class, name, \ 2274700d229SDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, int whichfork, \ 2284700d229SDarrick J. Wong xfs_fileoff_t offset, void *ret_ip), \ 2294700d229SDarrick J. Wong TP_ARGS(sc, whichfork, offset, ret_ip)) 2304700d229SDarrick J. Wong 2314700d229SDarrick J. Wong DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xfs_scrub_fblock_error); 2324700d229SDarrick J. Wong DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xfs_scrub_fblock_warning); 2334700d229SDarrick J. Wong 2344700d229SDarrick J. Wong TRACE_EVENT(xfs_scrub_incomplete, 2354700d229SDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, void *ret_ip), 2364700d229SDarrick J. Wong TP_ARGS(sc, ret_ip), 2374700d229SDarrick J. Wong TP_STRUCT__entry( 2384700d229SDarrick J. Wong __field(dev_t, dev) 2394700d229SDarrick J. Wong __field(unsigned int, type) 2404700d229SDarrick J. Wong __field(void *, ret_ip) 2414700d229SDarrick J. Wong ), 2424700d229SDarrick J. Wong TP_fast_assign( 2434700d229SDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 2444700d229SDarrick J. Wong __entry->type = sc->sm->sm_type; 2454700d229SDarrick J. Wong __entry->ret_ip = ret_ip; 2464700d229SDarrick J. Wong ), 247aff68a55SDarrick J. Wong TP_printk("dev %d:%d type %u ret_ip %pS", 2484700d229SDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 2494700d229SDarrick J. Wong __entry->type, 2504700d229SDarrick J. Wong __entry->ret_ip) 2514700d229SDarrick J. Wong ); 252a5637186SDarrick J. Wong 253537964bcSDarrick J. Wong TRACE_EVENT(xfs_scrub_btree_op_error, 254537964bcSDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, 255537964bcSDarrick J. Wong int level, int error, void *ret_ip), 256537964bcSDarrick J. Wong TP_ARGS(sc, cur, level, error, ret_ip), 257537964bcSDarrick J. Wong TP_STRUCT__entry( 258537964bcSDarrick J. Wong __field(dev_t, dev) 259537964bcSDarrick J. Wong __field(unsigned int, type) 260537964bcSDarrick J. Wong __field(xfs_btnum_t, btnum) 261537964bcSDarrick J. Wong __field(int, level) 262537964bcSDarrick J. Wong __field(xfs_agnumber_t, agno) 263537964bcSDarrick J. Wong __field(xfs_agblock_t, bno) 264537964bcSDarrick J. Wong __field(int, ptr); 265537964bcSDarrick J. Wong __field(int, error) 266537964bcSDarrick J. Wong __field(void *, ret_ip) 267537964bcSDarrick J. Wong ), 268537964bcSDarrick J. Wong TP_fast_assign( 269537964bcSDarrick J. Wong xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level); 270537964bcSDarrick J. Wong 271537964bcSDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 272537964bcSDarrick J. Wong __entry->type = sc->sm->sm_type; 273537964bcSDarrick J. Wong __entry->btnum = cur->bc_btnum; 274537964bcSDarrick J. Wong __entry->level = level; 275537964bcSDarrick J. Wong __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno); 276537964bcSDarrick J. Wong __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno); 277537964bcSDarrick J. Wong __entry->ptr = cur->bc_ptrs[level]; 278537964bcSDarrick J. Wong __entry->error = error; 279537964bcSDarrick J. Wong __entry->ret_ip = ret_ip; 280537964bcSDarrick J. Wong ), 281aff68a55SDarrick J. Wong TP_printk("dev %d:%d type %u btnum %d level %d ptr %d agno %u agbno %u error %d ret_ip %pS", 282537964bcSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 283537964bcSDarrick J. Wong __entry->type, 284537964bcSDarrick J. Wong __entry->btnum, 285537964bcSDarrick J. Wong __entry->level, 286537964bcSDarrick J. Wong __entry->ptr, 287537964bcSDarrick J. Wong __entry->agno, 288537964bcSDarrick J. Wong __entry->bno, 289537964bcSDarrick J. Wong __entry->error, 290537964bcSDarrick J. Wong __entry->ret_ip) 291537964bcSDarrick J. Wong ); 292537964bcSDarrick J. Wong 293537964bcSDarrick J. Wong TRACE_EVENT(xfs_scrub_ifork_btree_op_error, 294537964bcSDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, 295537964bcSDarrick J. Wong int level, int error, void *ret_ip), 296537964bcSDarrick J. Wong TP_ARGS(sc, cur, level, error, ret_ip), 297537964bcSDarrick J. Wong TP_STRUCT__entry( 298537964bcSDarrick J. Wong __field(dev_t, dev) 299537964bcSDarrick J. Wong __field(xfs_ino_t, ino) 300537964bcSDarrick J. Wong __field(int, whichfork) 301537964bcSDarrick J. Wong __field(unsigned int, type) 302537964bcSDarrick J. Wong __field(xfs_btnum_t, btnum) 303537964bcSDarrick J. Wong __field(int, level) 304537964bcSDarrick J. Wong __field(int, ptr) 305537964bcSDarrick J. Wong __field(xfs_agnumber_t, agno) 306537964bcSDarrick J. Wong __field(xfs_agblock_t, bno) 307537964bcSDarrick J. Wong __field(int, error) 308537964bcSDarrick J. Wong __field(void *, ret_ip) 309537964bcSDarrick J. Wong ), 310537964bcSDarrick J. Wong TP_fast_assign( 311537964bcSDarrick J. Wong xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level); 312537964bcSDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 313537964bcSDarrick J. Wong __entry->ino = sc->ip->i_ino; 314537964bcSDarrick J. Wong __entry->whichfork = cur->bc_private.b.whichfork; 315537964bcSDarrick J. Wong __entry->type = sc->sm->sm_type; 316537964bcSDarrick J. Wong __entry->btnum = cur->bc_btnum; 317537964bcSDarrick J. Wong __entry->level = level; 318537964bcSDarrick J. Wong __entry->ptr = cur->bc_ptrs[level]; 319537964bcSDarrick J. Wong __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno); 320537964bcSDarrick J. Wong __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno); 321537964bcSDarrick J. Wong __entry->error = error; 322537964bcSDarrick J. Wong __entry->ret_ip = ret_ip; 323537964bcSDarrick J. Wong ), 32467a3f6d0SDarrick J. Wong TP_printk("dev %d:%d ino 0x%llx fork %d type %u btnum %d level %d ptr %d agno %u agbno %u error %d ret_ip %pS", 325537964bcSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 326537964bcSDarrick J. Wong __entry->ino, 327537964bcSDarrick J. Wong __entry->whichfork, 328537964bcSDarrick J. Wong __entry->type, 329537964bcSDarrick J. Wong __entry->btnum, 330537964bcSDarrick J. Wong __entry->level, 331537964bcSDarrick J. Wong __entry->ptr, 332537964bcSDarrick J. Wong __entry->agno, 333537964bcSDarrick J. Wong __entry->bno, 334537964bcSDarrick J. Wong __entry->error, 335537964bcSDarrick J. Wong __entry->ret_ip) 336537964bcSDarrick J. Wong ); 337537964bcSDarrick J. Wong 338537964bcSDarrick J. Wong TRACE_EVENT(xfs_scrub_btree_error, 339537964bcSDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, 340537964bcSDarrick J. Wong int level, void *ret_ip), 341537964bcSDarrick J. Wong TP_ARGS(sc, cur, level, ret_ip), 342537964bcSDarrick J. Wong TP_STRUCT__entry( 343537964bcSDarrick J. Wong __field(dev_t, dev) 344537964bcSDarrick J. Wong __field(unsigned int, type) 345537964bcSDarrick J. Wong __field(xfs_btnum_t, btnum) 346537964bcSDarrick J. Wong __field(int, level) 347537964bcSDarrick J. Wong __field(xfs_agnumber_t, agno) 348537964bcSDarrick J. Wong __field(xfs_agblock_t, bno) 349537964bcSDarrick J. Wong __field(int, ptr); 350537964bcSDarrick J. Wong __field(void *, ret_ip) 351537964bcSDarrick J. Wong ), 352537964bcSDarrick J. Wong TP_fast_assign( 353537964bcSDarrick J. Wong xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level); 354537964bcSDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 355537964bcSDarrick J. Wong __entry->type = sc->sm->sm_type; 356537964bcSDarrick J. Wong __entry->btnum = cur->bc_btnum; 357537964bcSDarrick J. Wong __entry->level = level; 358537964bcSDarrick J. Wong __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno); 359537964bcSDarrick J. Wong __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno); 360537964bcSDarrick J. Wong __entry->ptr = cur->bc_ptrs[level]; 361537964bcSDarrick J. Wong __entry->ret_ip = ret_ip; 362537964bcSDarrick J. Wong ), 363aff68a55SDarrick J. Wong TP_printk("dev %d:%d type %u btnum %d level %d ptr %d agno %u agbno %u ret_ip %pS", 364537964bcSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 365537964bcSDarrick J. Wong __entry->type, 366537964bcSDarrick J. Wong __entry->btnum, 367537964bcSDarrick J. Wong __entry->level, 368537964bcSDarrick J. Wong __entry->ptr, 369537964bcSDarrick J. Wong __entry->agno, 370537964bcSDarrick J. Wong __entry->bno, 371537964bcSDarrick J. Wong __entry->ret_ip) 372537964bcSDarrick J. Wong ); 373537964bcSDarrick J. Wong 374537964bcSDarrick J. Wong TRACE_EVENT(xfs_scrub_ifork_btree_error, 375537964bcSDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, 376537964bcSDarrick J. Wong int level, void *ret_ip), 377537964bcSDarrick J. Wong TP_ARGS(sc, cur, level, ret_ip), 378537964bcSDarrick J. Wong TP_STRUCT__entry( 379537964bcSDarrick J. Wong __field(dev_t, dev) 380537964bcSDarrick J. Wong __field(xfs_ino_t, ino) 381537964bcSDarrick J. Wong __field(int, whichfork) 382537964bcSDarrick J. Wong __field(unsigned int, type) 383537964bcSDarrick J. Wong __field(xfs_btnum_t, btnum) 384537964bcSDarrick J. Wong __field(int, level) 385537964bcSDarrick J. Wong __field(xfs_agnumber_t, agno) 386537964bcSDarrick J. Wong __field(xfs_agblock_t, bno) 387537964bcSDarrick J. Wong __field(int, ptr); 388537964bcSDarrick J. Wong __field(void *, ret_ip) 389537964bcSDarrick J. Wong ), 390537964bcSDarrick J. Wong TP_fast_assign( 391537964bcSDarrick J. Wong xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level); 392537964bcSDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 393537964bcSDarrick J. Wong __entry->ino = sc->ip->i_ino; 394537964bcSDarrick J. Wong __entry->whichfork = cur->bc_private.b.whichfork; 395537964bcSDarrick J. Wong __entry->type = sc->sm->sm_type; 396537964bcSDarrick J. Wong __entry->btnum = cur->bc_btnum; 397537964bcSDarrick J. Wong __entry->level = level; 398537964bcSDarrick J. Wong __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno); 399537964bcSDarrick J. Wong __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno); 400537964bcSDarrick J. Wong __entry->ptr = cur->bc_ptrs[level]; 401537964bcSDarrick J. Wong __entry->ret_ip = ret_ip; 402537964bcSDarrick J. Wong ), 40367a3f6d0SDarrick J. Wong TP_printk("dev %d:%d ino 0x%llx fork %d type %u btnum %d level %d ptr %d agno %u agbno %u ret_ip %pS", 404537964bcSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 405537964bcSDarrick J. Wong __entry->ino, 406537964bcSDarrick J. Wong __entry->whichfork, 407537964bcSDarrick J. Wong __entry->type, 408537964bcSDarrick J. Wong __entry->btnum, 409537964bcSDarrick J. Wong __entry->level, 410537964bcSDarrick J. Wong __entry->ptr, 411537964bcSDarrick J. Wong __entry->agno, 412537964bcSDarrick J. Wong __entry->bno, 413537964bcSDarrick J. Wong __entry->ret_ip) 414537964bcSDarrick J. Wong ); 415537964bcSDarrick J. Wong 41637f3fa7fSDarrick J. Wong DECLARE_EVENT_CLASS(xfs_scrub_sbtree_class, 41737f3fa7fSDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, 41837f3fa7fSDarrick J. Wong int level), 41937f3fa7fSDarrick J. Wong TP_ARGS(sc, cur, level), 42037f3fa7fSDarrick J. Wong TP_STRUCT__entry( 42137f3fa7fSDarrick J. Wong __field(dev_t, dev) 42237f3fa7fSDarrick J. Wong __field(int, type) 42337f3fa7fSDarrick J. Wong __field(xfs_btnum_t, btnum) 42437f3fa7fSDarrick J. Wong __field(xfs_agnumber_t, agno) 42537f3fa7fSDarrick J. Wong __field(xfs_agblock_t, bno) 42637f3fa7fSDarrick J. Wong __field(int, level) 42737f3fa7fSDarrick J. Wong __field(int, nlevels) 42837f3fa7fSDarrick J. Wong __field(int, ptr) 42937f3fa7fSDarrick J. Wong ), 43037f3fa7fSDarrick J. Wong TP_fast_assign( 43137f3fa7fSDarrick J. Wong xfs_fsblock_t fsbno = xfs_scrub_btree_cur_fsbno(cur, level); 43237f3fa7fSDarrick J. Wong 43337f3fa7fSDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 43437f3fa7fSDarrick J. Wong __entry->type = sc->sm->sm_type; 43537f3fa7fSDarrick J. Wong __entry->btnum = cur->bc_btnum; 43637f3fa7fSDarrick J. Wong __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsbno); 43737f3fa7fSDarrick J. Wong __entry->bno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsbno); 43837f3fa7fSDarrick J. Wong __entry->level = level; 43937f3fa7fSDarrick J. Wong __entry->nlevels = cur->bc_nlevels; 44037f3fa7fSDarrick J. Wong __entry->ptr = cur->bc_ptrs[level]; 44137f3fa7fSDarrick J. Wong ), 44237f3fa7fSDarrick J. Wong TP_printk("dev %d:%d type %u btnum %d agno %u agbno %u level %d nlevels %d ptr %d", 44337f3fa7fSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 44437f3fa7fSDarrick J. Wong __entry->type, 44537f3fa7fSDarrick J. Wong __entry->btnum, 44637f3fa7fSDarrick J. Wong __entry->agno, 44737f3fa7fSDarrick J. Wong __entry->bno, 44837f3fa7fSDarrick J. Wong __entry->level, 44937f3fa7fSDarrick J. Wong __entry->nlevels, 45037f3fa7fSDarrick J. Wong __entry->ptr) 45137f3fa7fSDarrick J. Wong ) 45237f3fa7fSDarrick J. Wong #define DEFINE_SCRUB_SBTREE_EVENT(name) \ 45337f3fa7fSDarrick J. Wong DEFINE_EVENT(xfs_scrub_sbtree_class, name, \ 45437f3fa7fSDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, struct xfs_btree_cur *cur, \ 45537f3fa7fSDarrick J. Wong int level), \ 45637f3fa7fSDarrick J. Wong TP_ARGS(sc, cur, level)) 45737f3fa7fSDarrick J. Wong 45837f3fa7fSDarrick J. Wong DEFINE_SCRUB_SBTREE_EVENT(xfs_scrub_btree_rec); 45937f3fa7fSDarrick J. Wong DEFINE_SCRUB_SBTREE_EVENT(xfs_scrub_btree_key); 46037f3fa7fSDarrick J. Wong 46164b12563SDarrick J. Wong TRACE_EVENT(xfs_scrub_xref_error, 46264b12563SDarrick J. Wong TP_PROTO(struct xfs_scrub_context *sc, int error, void *ret_ip), 46364b12563SDarrick J. Wong TP_ARGS(sc, error, ret_ip), 46464b12563SDarrick J. Wong TP_STRUCT__entry( 46564b12563SDarrick J. Wong __field(dev_t, dev) 46664b12563SDarrick J. Wong __field(int, type) 46764b12563SDarrick J. Wong __field(int, error) 46864b12563SDarrick J. Wong __field(void *, ret_ip) 46964b12563SDarrick J. Wong ), 47064b12563SDarrick J. Wong TP_fast_assign( 47164b12563SDarrick J. Wong __entry->dev = sc->mp->m_super->s_dev; 47264b12563SDarrick J. Wong __entry->type = sc->sm->sm_type; 47364b12563SDarrick J. Wong __entry->error = error; 47464b12563SDarrick J. Wong __entry->ret_ip = ret_ip; 47564b12563SDarrick J. Wong ), 47664b12563SDarrick J. Wong TP_printk("dev %d:%d type %u xref error %d ret_ip %pF", 47764b12563SDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 47864b12563SDarrick J. Wong __entry->type, 47964b12563SDarrick J. Wong __entry->error, 48064b12563SDarrick J. Wong __entry->ret_ip) 48164b12563SDarrick J. Wong ); 48264b12563SDarrick J. Wong 483718fa74bSDarrick J. Wong /* repair tracepoints */ 484718fa74bSDarrick J. Wong #if IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR) 485718fa74bSDarrick J. Wong 486718fa74bSDarrick J. Wong DECLARE_EVENT_CLASS(xfs_repair_extent_class, 487718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 488718fa74bSDarrick J. Wong xfs_agblock_t agbno, xfs_extlen_t len), 489718fa74bSDarrick J. Wong TP_ARGS(mp, agno, agbno, len), 490718fa74bSDarrick J. Wong TP_STRUCT__entry( 491718fa74bSDarrick J. Wong __field(dev_t, dev) 492718fa74bSDarrick J. Wong __field(xfs_agnumber_t, agno) 493718fa74bSDarrick J. Wong __field(xfs_agblock_t, agbno) 494718fa74bSDarrick J. Wong __field(xfs_extlen_t, len) 495718fa74bSDarrick J. Wong ), 496718fa74bSDarrick J. Wong TP_fast_assign( 497718fa74bSDarrick J. Wong __entry->dev = mp->m_super->s_dev; 498718fa74bSDarrick J. Wong __entry->agno = agno; 499718fa74bSDarrick J. Wong __entry->agbno = agbno; 500718fa74bSDarrick J. Wong __entry->len = len; 501718fa74bSDarrick J. Wong ), 502718fa74bSDarrick J. Wong TP_printk("dev %d:%d agno %u agbno %u len %u", 503718fa74bSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 504718fa74bSDarrick J. Wong __entry->agno, 505718fa74bSDarrick J. Wong __entry->agbno, 506718fa74bSDarrick J. Wong __entry->len) 507718fa74bSDarrick J. Wong ); 508718fa74bSDarrick J. Wong #define DEFINE_REPAIR_EXTENT_EVENT(name) \ 509718fa74bSDarrick J. Wong DEFINE_EVENT(xfs_repair_extent_class, name, \ 510718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 511718fa74bSDarrick J. Wong xfs_agblock_t agbno, xfs_extlen_t len), \ 512718fa74bSDarrick J. Wong TP_ARGS(mp, agno, agbno, len)) 513718fa74bSDarrick J. Wong DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_dispose_btree_extent); 514718fa74bSDarrick J. Wong DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_collect_btree_extent); 515718fa74bSDarrick J. Wong DEFINE_REPAIR_EXTENT_EVENT(xfs_repair_agfl_insert); 516718fa74bSDarrick J. Wong 517718fa74bSDarrick J. Wong DECLARE_EVENT_CLASS(xfs_repair_rmap_class, 518718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 519718fa74bSDarrick J. Wong xfs_agblock_t agbno, xfs_extlen_t len, 520718fa74bSDarrick J. Wong uint64_t owner, uint64_t offset, unsigned int flags), 521718fa74bSDarrick J. Wong TP_ARGS(mp, agno, agbno, len, owner, offset, flags), 522718fa74bSDarrick J. Wong TP_STRUCT__entry( 523718fa74bSDarrick J. Wong __field(dev_t, dev) 524718fa74bSDarrick J. Wong __field(xfs_agnumber_t, agno) 525718fa74bSDarrick J. Wong __field(xfs_agblock_t, agbno) 526718fa74bSDarrick J. Wong __field(xfs_extlen_t, len) 527718fa74bSDarrick J. Wong __field(uint64_t, owner) 528718fa74bSDarrick J. Wong __field(uint64_t, offset) 529718fa74bSDarrick J. Wong __field(unsigned int, flags) 530718fa74bSDarrick J. Wong ), 531718fa74bSDarrick J. Wong TP_fast_assign( 532718fa74bSDarrick J. Wong __entry->dev = mp->m_super->s_dev; 533718fa74bSDarrick J. Wong __entry->agno = agno; 534718fa74bSDarrick J. Wong __entry->agbno = agbno; 535718fa74bSDarrick J. Wong __entry->len = len; 536718fa74bSDarrick J. Wong __entry->owner = owner; 537718fa74bSDarrick J. Wong __entry->offset = offset; 538718fa74bSDarrick J. Wong __entry->flags = flags; 539718fa74bSDarrick J. Wong ), 540718fa74bSDarrick J. Wong TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x", 541718fa74bSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 542718fa74bSDarrick J. Wong __entry->agno, 543718fa74bSDarrick J. Wong __entry->agbno, 544718fa74bSDarrick J. Wong __entry->len, 545718fa74bSDarrick J. Wong __entry->owner, 546718fa74bSDarrick J. Wong __entry->offset, 547718fa74bSDarrick J. Wong __entry->flags) 548718fa74bSDarrick J. Wong ); 549718fa74bSDarrick J. Wong #define DEFINE_REPAIR_RMAP_EVENT(name) \ 550718fa74bSDarrick J. Wong DEFINE_EVENT(xfs_repair_rmap_class, name, \ 551718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ 552718fa74bSDarrick J. Wong xfs_agblock_t agbno, xfs_extlen_t len, \ 553718fa74bSDarrick J. Wong uint64_t owner, uint64_t offset, unsigned int flags), \ 554718fa74bSDarrick J. Wong TP_ARGS(mp, agno, agbno, len, owner, offset, flags)) 555718fa74bSDarrick J. Wong DEFINE_REPAIR_RMAP_EVENT(xfs_repair_alloc_extent_fn); 556718fa74bSDarrick J. Wong DEFINE_REPAIR_RMAP_EVENT(xfs_repair_ialloc_extent_fn); 557718fa74bSDarrick J. Wong DEFINE_REPAIR_RMAP_EVENT(xfs_repair_rmap_extent_fn); 558718fa74bSDarrick J. Wong DEFINE_REPAIR_RMAP_EVENT(xfs_repair_bmap_extent_fn); 559718fa74bSDarrick J. Wong 560718fa74bSDarrick J. Wong TRACE_EVENT(xfs_repair_refcount_extent_fn, 561718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 562718fa74bSDarrick J. Wong struct xfs_refcount_irec *irec), 563718fa74bSDarrick J. Wong TP_ARGS(mp, agno, irec), 564718fa74bSDarrick J. Wong TP_STRUCT__entry( 565718fa74bSDarrick J. Wong __field(dev_t, dev) 566718fa74bSDarrick J. Wong __field(xfs_agnumber_t, agno) 567718fa74bSDarrick J. Wong __field(xfs_agblock_t, startblock) 568718fa74bSDarrick J. Wong __field(xfs_extlen_t, blockcount) 569718fa74bSDarrick J. Wong __field(xfs_nlink_t, refcount) 570718fa74bSDarrick J. Wong ), 571718fa74bSDarrick J. Wong TP_fast_assign( 572718fa74bSDarrick J. Wong __entry->dev = mp->m_super->s_dev; 573718fa74bSDarrick J. Wong __entry->agno = agno; 574718fa74bSDarrick J. Wong __entry->startblock = irec->rc_startblock; 575718fa74bSDarrick J. Wong __entry->blockcount = irec->rc_blockcount; 576718fa74bSDarrick J. Wong __entry->refcount = irec->rc_refcount; 577718fa74bSDarrick J. Wong ), 578718fa74bSDarrick J. Wong TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u", 579718fa74bSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 580718fa74bSDarrick J. Wong __entry->agno, 581718fa74bSDarrick J. Wong __entry->startblock, 582718fa74bSDarrick J. Wong __entry->blockcount, 583718fa74bSDarrick J. Wong __entry->refcount) 584718fa74bSDarrick J. Wong ) 585718fa74bSDarrick J. Wong 586718fa74bSDarrick J. Wong TRACE_EVENT(xfs_repair_init_btblock, 587718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, 588718fa74bSDarrick J. Wong xfs_btnum_t btnum), 589718fa74bSDarrick J. Wong TP_ARGS(mp, agno, agbno, btnum), 590718fa74bSDarrick J. Wong TP_STRUCT__entry( 591718fa74bSDarrick J. Wong __field(dev_t, dev) 592718fa74bSDarrick J. Wong __field(xfs_agnumber_t, agno) 593718fa74bSDarrick J. Wong __field(xfs_agblock_t, agbno) 594718fa74bSDarrick J. Wong __field(uint32_t, btnum) 595718fa74bSDarrick J. Wong ), 596718fa74bSDarrick J. Wong TP_fast_assign( 597718fa74bSDarrick J. Wong __entry->dev = mp->m_super->s_dev; 598718fa74bSDarrick J. Wong __entry->agno = agno; 599718fa74bSDarrick J. Wong __entry->agbno = agbno; 600718fa74bSDarrick J. Wong __entry->btnum = btnum; 601718fa74bSDarrick J. Wong ), 602718fa74bSDarrick J. Wong TP_printk("dev %d:%d agno %u agbno %u btnum %d", 603718fa74bSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 604718fa74bSDarrick J. Wong __entry->agno, 605718fa74bSDarrick J. Wong __entry->agbno, 606718fa74bSDarrick J. Wong __entry->btnum) 607718fa74bSDarrick J. Wong ) 608718fa74bSDarrick J. Wong TRACE_EVENT(xfs_repair_findroot_block, 609718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, 610718fa74bSDarrick J. Wong uint32_t magic, uint16_t level), 611718fa74bSDarrick J. Wong TP_ARGS(mp, agno, agbno, magic, level), 612718fa74bSDarrick J. Wong TP_STRUCT__entry( 613718fa74bSDarrick J. Wong __field(dev_t, dev) 614718fa74bSDarrick J. Wong __field(xfs_agnumber_t, agno) 615718fa74bSDarrick J. Wong __field(xfs_agblock_t, agbno) 616718fa74bSDarrick J. Wong __field(uint32_t, magic) 617718fa74bSDarrick J. Wong __field(uint16_t, level) 618718fa74bSDarrick J. Wong ), 619718fa74bSDarrick J. Wong TP_fast_assign( 620718fa74bSDarrick J. Wong __entry->dev = mp->m_super->s_dev; 621718fa74bSDarrick J. Wong __entry->agno = agno; 622718fa74bSDarrick J. Wong __entry->agbno = agbno; 623718fa74bSDarrick J. Wong __entry->magic = magic; 624718fa74bSDarrick J. Wong __entry->level = level; 625718fa74bSDarrick J. Wong ), 626718fa74bSDarrick J. Wong TP_printk("dev %d:%d agno %u agbno %u magic 0x%x level %u", 627718fa74bSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 628718fa74bSDarrick J. Wong __entry->agno, 629718fa74bSDarrick J. Wong __entry->agbno, 630718fa74bSDarrick J. Wong __entry->magic, 631718fa74bSDarrick J. Wong __entry->level) 632718fa74bSDarrick J. Wong ) 633718fa74bSDarrick J. Wong TRACE_EVENT(xfs_repair_calc_ag_resblks, 634718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 635718fa74bSDarrick J. Wong xfs_agino_t icount, xfs_agblock_t aglen, xfs_agblock_t freelen, 636718fa74bSDarrick J. Wong xfs_agblock_t usedlen), 637718fa74bSDarrick J. Wong TP_ARGS(mp, agno, icount, aglen, freelen, usedlen), 638718fa74bSDarrick J. Wong TP_STRUCT__entry( 639718fa74bSDarrick J. Wong __field(dev_t, dev) 640718fa74bSDarrick J. Wong __field(xfs_agnumber_t, agno) 641718fa74bSDarrick J. Wong __field(xfs_agino_t, icount) 642718fa74bSDarrick J. Wong __field(xfs_agblock_t, aglen) 643718fa74bSDarrick J. Wong __field(xfs_agblock_t, freelen) 644718fa74bSDarrick J. Wong __field(xfs_agblock_t, usedlen) 645718fa74bSDarrick J. Wong ), 646718fa74bSDarrick J. Wong TP_fast_assign( 647718fa74bSDarrick J. Wong __entry->dev = mp->m_super->s_dev; 648718fa74bSDarrick J. Wong __entry->agno = agno; 649718fa74bSDarrick J. Wong __entry->icount = icount; 650718fa74bSDarrick J. Wong __entry->aglen = aglen; 651718fa74bSDarrick J. Wong __entry->freelen = freelen; 652718fa74bSDarrick J. Wong __entry->usedlen = usedlen; 653718fa74bSDarrick J. Wong ), 654718fa74bSDarrick J. Wong TP_printk("dev %d:%d agno %d icount %u aglen %u freelen %u usedlen %u", 655718fa74bSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 656718fa74bSDarrick J. Wong __entry->agno, 657718fa74bSDarrick J. Wong __entry->icount, 658718fa74bSDarrick J. Wong __entry->aglen, 659718fa74bSDarrick J. Wong __entry->freelen, 660718fa74bSDarrick J. Wong __entry->usedlen) 661718fa74bSDarrick J. Wong ) 662718fa74bSDarrick J. Wong TRACE_EVENT(xfs_repair_calc_ag_resblks_btsize, 663718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 664718fa74bSDarrick J. Wong xfs_agblock_t bnobt_sz, xfs_agblock_t inobt_sz, 665718fa74bSDarrick J. Wong xfs_agblock_t rmapbt_sz, xfs_agblock_t refcbt_sz), 666718fa74bSDarrick J. Wong TP_ARGS(mp, agno, bnobt_sz, inobt_sz, rmapbt_sz, refcbt_sz), 667718fa74bSDarrick J. Wong TP_STRUCT__entry( 668718fa74bSDarrick J. Wong __field(dev_t, dev) 669718fa74bSDarrick J. Wong __field(xfs_agnumber_t, agno) 670718fa74bSDarrick J. Wong __field(xfs_agblock_t, bnobt_sz) 671718fa74bSDarrick J. Wong __field(xfs_agblock_t, inobt_sz) 672718fa74bSDarrick J. Wong __field(xfs_agblock_t, rmapbt_sz) 673718fa74bSDarrick J. Wong __field(xfs_agblock_t, refcbt_sz) 674718fa74bSDarrick J. Wong ), 675718fa74bSDarrick J. Wong TP_fast_assign( 676718fa74bSDarrick J. Wong __entry->dev = mp->m_super->s_dev; 677718fa74bSDarrick J. Wong __entry->agno = agno; 678718fa74bSDarrick J. Wong __entry->bnobt_sz = bnobt_sz; 679718fa74bSDarrick J. Wong __entry->inobt_sz = inobt_sz; 680718fa74bSDarrick J. Wong __entry->rmapbt_sz = rmapbt_sz; 681718fa74bSDarrick J. Wong __entry->refcbt_sz = refcbt_sz; 682718fa74bSDarrick J. Wong ), 683718fa74bSDarrick J. Wong TP_printk("dev %d:%d agno %d bno %u ino %u rmap %u refcount %u", 684718fa74bSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 685718fa74bSDarrick J. Wong __entry->agno, 686718fa74bSDarrick J. Wong __entry->bnobt_sz, 687718fa74bSDarrick J. Wong __entry->inobt_sz, 688718fa74bSDarrick J. Wong __entry->rmapbt_sz, 689718fa74bSDarrick J. Wong __entry->refcbt_sz) 690718fa74bSDarrick J. Wong ) 691718fa74bSDarrick J. Wong TRACE_EVENT(xfs_repair_reset_counters, 692718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp), 693718fa74bSDarrick J. Wong TP_ARGS(mp), 694718fa74bSDarrick J. Wong TP_STRUCT__entry( 695718fa74bSDarrick J. Wong __field(dev_t, dev) 696718fa74bSDarrick J. Wong ), 697718fa74bSDarrick J. Wong TP_fast_assign( 698718fa74bSDarrick J. Wong __entry->dev = mp->m_super->s_dev; 699718fa74bSDarrick J. Wong ), 700718fa74bSDarrick J. Wong TP_printk("dev %d:%d", 701718fa74bSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev)) 702718fa74bSDarrick J. Wong ) 703718fa74bSDarrick J. Wong 704718fa74bSDarrick J. Wong TRACE_EVENT(xfs_repair_ialloc_insert, 705718fa74bSDarrick J. Wong TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, 706718fa74bSDarrick J. Wong xfs_agino_t startino, uint16_t holemask, uint8_t count, 707718fa74bSDarrick J. Wong uint8_t freecount, uint64_t freemask), 708718fa74bSDarrick J. Wong TP_ARGS(mp, agno, startino, holemask, count, freecount, freemask), 709718fa74bSDarrick J. Wong TP_STRUCT__entry( 710718fa74bSDarrick J. Wong __field(dev_t, dev) 711718fa74bSDarrick J. Wong __field(xfs_agnumber_t, agno) 712718fa74bSDarrick J. Wong __field(xfs_agino_t, startino) 713718fa74bSDarrick J. Wong __field(uint16_t, holemask) 714718fa74bSDarrick J. Wong __field(uint8_t, count) 715718fa74bSDarrick J. Wong __field(uint8_t, freecount) 716718fa74bSDarrick J. Wong __field(uint64_t, freemask) 717718fa74bSDarrick J. Wong ), 718718fa74bSDarrick J. Wong TP_fast_assign( 719718fa74bSDarrick J. Wong __entry->dev = mp->m_super->s_dev; 720718fa74bSDarrick J. Wong __entry->agno = agno; 721718fa74bSDarrick J. Wong __entry->startino = startino; 722718fa74bSDarrick J. Wong __entry->holemask = holemask; 723718fa74bSDarrick J. Wong __entry->count = count; 724718fa74bSDarrick J. Wong __entry->freecount = freecount; 725718fa74bSDarrick J. Wong __entry->freemask = freemask; 726718fa74bSDarrick J. Wong ), 727718fa74bSDarrick J. Wong TP_printk("dev %d:%d agno %d startino %u holemask 0x%x count %u freecount %u freemask 0x%llx", 728718fa74bSDarrick J. Wong MAJOR(__entry->dev), MINOR(__entry->dev), 729718fa74bSDarrick J. Wong __entry->agno, 730718fa74bSDarrick J. Wong __entry->startino, 731718fa74bSDarrick J. Wong __entry->holemask, 732718fa74bSDarrick J. Wong __entry->count, 733718fa74bSDarrick J. Wong __entry->freecount, 734718fa74bSDarrick J. Wong __entry->freemask) 735718fa74bSDarrick J. Wong ) 736718fa74bSDarrick J. Wong 737718fa74bSDarrick J. Wong #endif /* IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR) */ 738718fa74bSDarrick J. Wong 73936fd6e86SDarrick J. Wong #endif /* _TRACE_XFS_SCRUB_TRACE_H */ 74036fd6e86SDarrick J. Wong 74136fd6e86SDarrick J. Wong #undef TRACE_INCLUDE_PATH 74236fd6e86SDarrick J. Wong #define TRACE_INCLUDE_PATH . 74336fd6e86SDarrick J. Wong #define TRACE_INCLUDE_FILE scrub/trace 74436fd6e86SDarrick J. Wong #include <trace/define_trace.h> 745