LCOV - code coverage report
Current view: top level - fs/xfs - xfs_trace.h (source / functions) Hit Total Coverage
Test: fstests of 6.5.0-rc3-achx @ Mon Jul 31 20:08:12 PDT 2023 Lines: 560 692 80.9 %
Date: 2023-07-31 20:08:12 Functions: 562 2318 24.2 %

          Line data    Source code
       1             : // SPDX-License-Identifier: GPL-2.0
       2             : /*
       3             :  * Copyright (c) 2009, Christoph Hellwig
       4             :  * All Rights Reserved.
       5             :  *
       6             :  * NOTE: none of these tracepoints shall be considered a stable kernel ABI
       7             :  * as they can change at any time.
       8             :  *
       9             :  * Current conventions for printing numbers measuring specific units:
      10             :  *
      11             :  * agno: allocation group number
      12             :  *
      13             :  * agino: per-AG inode number
      14             :  * ino: filesystem inode number
      15             :  *
      16             :  * agbno: per-AG block number in fs blocks
      17             :  * startblock: physical block number for file mappings.  This is either a
      18             :  *             segmented fsblock for data device mappings, or a rfsblock
      19             :  *             for realtime device mappings
      20             :  * fsbcount: number of blocks in an extent, in fs blocks
      21             :  *
      22             :  * daddr: physical block number in 512b blocks
      23             :  * bbcount: number of blocks in a physical extent, in 512b blocks
      24             :  *
      25             :  * rtx: physical rt extent number for extent mappings
      26             :  * rtxcount: number of rt extents in an extent mapping
      27             :  *
      28             :  * owner: reverse-mapping owner, usually inodes
      29             :  *
      30             :  * fileoff: file offset, in fs blocks
      31             :  * pos: file offset, in bytes
      32             :  * bytecount: number of bytes
      33             :  *
      34             :  * dablk: directory or xattr block offset, in filesystem blocks
      35             :  *
      36             :  * disize: ondisk file size, in bytes
      37             :  * isize: incore file size, in bytes
      38             :  *
      39             :  * forkoff: inode fork offset, in bytes
      40             :  *
      41             :  * ireccount: number of inode records
      42             :  *
      43             :  * Numbers describing space allocations (blocks, extents, inodes) should be
      44             :  * formatted in hexadecimal.
      45             :  */
      46             : #undef TRACE_SYSTEM
      47             : #define TRACE_SYSTEM xfs
      48             : 
      49             : #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
      50             : #define _TRACE_XFS_H
      51             : 
      52             : #include <linux/tracepoint.h>
      53             : 
      54             : struct xfs_agf;
      55             : struct xfs_alloc_arg;
      56             : struct xfs_attr_list_context;
      57             : struct xfs_buf_log_item;
      58             : struct xfs_da_args;
      59             : struct xfs_da_node_entry;
      60             : struct xfs_dquot;
      61             : struct xfs_log_item;
      62             : struct xlog;
      63             : struct xlog_ticket;
      64             : struct xlog_recover;
      65             : struct xlog_recover_item;
      66             : struct xlog_rec_header;
      67             : struct xlog_in_core;
      68             : struct xfs_buf_log_format;
      69             : struct xfs_inode_log_format;
      70             : struct xfs_bmbt_irec;
      71             : struct xfs_btree_cur;
      72             : struct xfs_refcount_irec;
      73             : struct xfs_fsmap;
      74             : struct xfs_rmap_irec;
      75             : struct xfs_icreate_log;
      76             : struct xfs_owner_info;
      77             : struct xfs_trans_res;
      78             : struct xfs_inobt_rec_incore;
      79             : union xfs_btree_ptr;
      80             : struct xfs_dqtrx;
      81             : struct xfs_icwalk;
      82             : struct xfs_perag;
      83             : struct xfs_bmap_intent;
      84             : struct xfs_swapext_intent;
      85             : struct xfs_swapext_req;
      86             : struct xfs_getparents;
      87             : struct xfs_parent_name_irec;
      88             : struct xfs_attrlist_cursor_kern;
      89             : 
      90             : #define XFS_ATTR_FILTER_FLAGS \
      91             :         { XFS_ATTR_ROOT,        "ROOT" }, \
      92             :         { XFS_ATTR_SECURE,      "SECURE" }, \
      93             :         { XFS_ATTR_INCOMPLETE,  "INCOMPLETE" }, \
      94             :         { XFS_ATTR_PARENT,      "PARENT" }
      95             : 
      96           0 : DECLARE_EVENT_CLASS(xfs_attr_list_class,
      97             :         TP_PROTO(struct xfs_attr_list_context *ctx),
      98             :         TP_ARGS(ctx),
      99             :         TP_STRUCT__entry(
     100             :                 __field(dev_t, dev)
     101             :                 __field(xfs_ino_t, ino)
     102             :                 __field(u32, hashval)
     103             :                 __field(u32, blkno)
     104             :                 __field(u32, offset)
     105             :                 __field(void *, buffer)
     106             :                 __field(int, bufsize)
     107             :                 __field(int, count)
     108             :                 __field(int, firstu)
     109             :                 __field(int, dupcnt)
     110             :                 __field(unsigned int, attr_filter)
     111             :         ),
     112             :         TP_fast_assign(
     113             :                 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
     114             :                 __entry->ino = ctx->dp->i_ino;
     115             :                 __entry->hashval = ctx->cursor.hashval;
     116             :                 __entry->blkno = ctx->cursor.blkno;
     117             :                 __entry->offset = ctx->cursor.offset;
     118             :                 __entry->buffer = ctx->buffer;
     119             :                 __entry->bufsize = ctx->bufsize;
     120             :                 __entry->count = ctx->count;
     121             :                 __entry->firstu = ctx->firstu;
     122             :                 __entry->attr_filter = ctx->attr_filter;
     123             :         ),
     124             :         TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
     125             :                   "buffer %p size %u count %u firstu %u filter %s",
     126             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     127             :                    __entry->ino,
     128             :                    __entry->hashval,
     129             :                    __entry->blkno,
     130             :                    __entry->offset,
     131             :                    __entry->dupcnt,
     132             :                    __entry->buffer,
     133             :                    __entry->bufsize,
     134             :                    __entry->count,
     135             :                    __entry->firstu,
     136             :                    __print_flags(__entry->attr_filter, "|",
     137             :                                  XFS_ATTR_FILTER_FLAGS)
     138             :         )
     139             : )
     140             : 
     141             : #define DEFINE_ATTR_LIST_EVENT(name) \
     142             : DEFINE_EVENT(xfs_attr_list_class, name, \
     143             :         TP_PROTO(struct xfs_attr_list_context *ctx), \
     144             :         TP_ARGS(ctx))
     145   741771697 : DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
     146   733806290 : DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
     147   529802829 : DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
     148   528810726 : DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
     149        1088 : DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
     150    25821523 : DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
     151         977 : DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
     152     1013309 : DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
     153    50868128 : DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
     154     1195211 : DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
     155             : 
     156           6 : TRACE_EVENT(xlog_intent_recovery_failed,
     157             :         TP_PROTO(struct xfs_mount *mp, int error, void *function),
     158             :         TP_ARGS(mp, error, function),
     159             :         TP_STRUCT__entry(
     160             :                 __field(dev_t, dev)
     161             :                 __field(int, error)
     162             :                 __field(void *, function)
     163             :         ),
     164             :         TP_fast_assign(
     165             :                 __entry->dev = mp->m_super->s_dev;
     166             :                 __entry->error = error;
     167             :                 __entry->function = function;
     168             :         ),
     169             :         TP_printk("dev %d:%d error %d function %pS",
     170             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     171             :                   __entry->error, __entry->function)
     172             : );
     173             : 
     174           0 : DECLARE_EVENT_CLASS(xfs_perag_class,
     175             :         TP_PROTO(struct xfs_perag *pag, unsigned long caller_ip),
     176             :         TP_ARGS(pag, caller_ip),
     177             :         TP_STRUCT__entry(
     178             :                 __field(dev_t, dev)
     179             :                 __field(xfs_agnumber_t, agno)
     180             :                 __field(int, refcount)
     181             :                 __field(int, active_refcount)
     182             :                 __field(unsigned long, caller_ip)
     183             :         ),
     184             :         TP_fast_assign(
     185             :                 __entry->dev = pag->pag_mount->m_super->s_dev;
     186             :                 __entry->agno = pag->pag_agno;
     187             :                 __entry->refcount = atomic_read(&pag->pag_ref);
     188             :                 __entry->active_refcount = atomic_read(&pag->pag_active_ref);
     189             :                 __entry->caller_ip = caller_ip;
     190             :         ),
     191             :         TP_printk("dev %d:%d agno 0x%x passive refs %d active refs %d caller %pS",
     192             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     193             :                   __entry->agno,
     194             :                   __entry->refcount,
     195             :                   __entry->active_refcount,
     196             :                   (char *)__entry->caller_ip)
     197             : );
     198             : 
     199             : #define DEFINE_PERAG_REF_EVENT(name)    \
     200             : DEFINE_EVENT(xfs_perag_class, name,     \
     201             :         TP_PROTO(struct xfs_perag *pag, unsigned long caller_ip), \
     202             :         TP_ARGS(pag, caller_ip))
     203 >14565*10^7 : DEFINE_PERAG_REF_EVENT(xfs_perag_get);
     204      471535 : DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
     205  6553019568 : DEFINE_PERAG_REF_EVENT(xfs_perag_hold);
     206 >15333*10^7 : DEFINE_PERAG_REF_EVENT(xfs_perag_put);
     207  2208875534 : DEFINE_PERAG_REF_EVENT(xfs_perag_grab);
     208     7027465 : DEFINE_PERAG_REF_EVENT(xfs_perag_grab_tag);
     209  1112036819 : DEFINE_PERAG_REF_EVENT(xfs_perag_rele);
     210    15165269 : DEFINE_PERAG_REF_EVENT(xfs_perag_set_inode_tag);
     211    27675806 : DEFINE_PERAG_REF_EVENT(xfs_perag_clear_inode_tag);
     212             : 
     213    11095735 : TRACE_EVENT(xfs_inodegc_worker,
     214             :         TP_PROTO(struct xfs_mount *mp, unsigned int shrinker_hits),
     215             :         TP_ARGS(mp, shrinker_hits),
     216             :         TP_STRUCT__entry(
     217             :                 __field(dev_t, dev)
     218             :                 __field(unsigned int, shrinker_hits)
     219             :         ),
     220             :         TP_fast_assign(
     221             :                 __entry->dev = mp->m_super->s_dev;
     222             :                 __entry->shrinker_hits = shrinker_hits;
     223             :         ),
     224             :         TP_printk("dev %d:%d shrinker_hits %u",
     225             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     226             :                   __entry->shrinker_hits)
     227             : );
     228             : 
     229           0 : DECLARE_EVENT_CLASS(xfs_fs_class,
     230             :         TP_PROTO(struct xfs_mount *mp, void *caller_ip),
     231             :         TP_ARGS(mp, caller_ip),
     232             :         TP_STRUCT__entry(
     233             :                 __field(dev_t, dev)
     234             :                 __field(unsigned long long, mflags)
     235             :                 __field(unsigned long, opstate)
     236             :                 __field(unsigned long, sbflags)
     237             :                 __field(void *, caller_ip)
     238             :         ),
     239             :         TP_fast_assign(
     240             :                 if (mp) {
     241             :                         __entry->dev = mp->m_super->s_dev;
     242             :                         __entry->mflags = mp->m_features;
     243             :                         __entry->opstate = mp->m_opstate;
     244             :                         __entry->sbflags = mp->m_super->s_flags;
     245             :                 }
     246             :                 __entry->caller_ip = caller_ip;
     247             :         ),
     248             :         TP_printk("dev %d:%d m_features 0x%llx opstate (%s) s_flags 0x%lx caller %pS",
     249             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     250             :                   __entry->mflags,
     251             :                   __print_flags(__entry->opstate, "|", XFS_OPSTATE_STRINGS),
     252             :                   __entry->sbflags,
     253             :                   __entry->caller_ip)
     254             : );
     255             : 
     256             : #define DEFINE_FS_EVENT(name)   \
     257             : DEFINE_EVENT(xfs_fs_class, name,                                        \
     258             :         TP_PROTO(struct xfs_mount *mp, void *caller_ip), \
     259             :         TP_ARGS(mp, caller_ip))
     260    11432154 : DEFINE_FS_EVENT(xfs_inodegc_flush);
     261    34440997 : DEFINE_FS_EVENT(xfs_inodegc_push);
     262      117713 : DEFINE_FS_EVENT(xfs_inodegc_start);
     263      117703 : DEFINE_FS_EVENT(xfs_inodegc_stop);
     264    86094917 : DEFINE_FS_EVENT(xfs_inodegc_queue);
     265     5346439 : DEFINE_FS_EVENT(xfs_inodegc_throttle);
     266     6740702 : DEFINE_FS_EVENT(xfs_fs_sync_fs);
     267      117713 : DEFINE_FS_EVENT(xfs_blockgc_start);
     268      117574 : DEFINE_FS_EVENT(xfs_blockgc_stop);
     269     3247242 : DEFINE_FS_EVENT(xfs_blockgc_worker);
     270     7555590 : DEFINE_FS_EVENT(xfs_blockgc_flush_all);
     271             : 
     272          35 : TRACE_EVENT(xfs_inodegc_shrinker_scan,
     273             :         TP_PROTO(struct xfs_mount *mp, struct shrink_control *sc,
     274             :                  void *caller_ip),
     275             :         TP_ARGS(mp, sc, caller_ip),
     276             :         TP_STRUCT__entry(
     277             :                 __field(dev_t, dev)
     278             :                 __field(unsigned long, nr_to_scan)
     279             :                 __field(void *, caller_ip)
     280             :         ),
     281             :         TP_fast_assign(
     282             :                 __entry->dev = mp->m_super->s_dev;
     283             :                 __entry->nr_to_scan = sc->nr_to_scan;
     284             :                 __entry->caller_ip = caller_ip;
     285             :         ),
     286             :         TP_printk("dev %d:%d nr_to_scan %lu caller %pS",
     287             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     288             :                   __entry->nr_to_scan,
     289             :                   __entry->caller_ip)
     290             : );
     291             : 
     292           0 : DECLARE_EVENT_CLASS(xfs_ag_class,
     293             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
     294             :         TP_ARGS(mp, agno),
     295             :         TP_STRUCT__entry(
     296             :                 __field(dev_t, dev)
     297             :                 __field(xfs_agnumber_t, agno)
     298             :         ),
     299             :         TP_fast_assign(
     300             :                 __entry->dev = mp->m_super->s_dev;
     301             :                 __entry->agno = agno;
     302             :         ),
     303             :         TP_printk("dev %d:%d agno 0x%x",
     304             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     305             :                   __entry->agno)
     306             : );
     307             : #define DEFINE_AG_EVENT(name)   \
     308             : DEFINE_EVENT(xfs_ag_class, name,        \
     309             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),    \
     310             :         TP_ARGS(mp, agno))
     311             : 
     312  1513127312 : DEFINE_AG_EVENT(xfs_read_agf);
     313  1513262547 : DEFINE_AG_EVENT(xfs_alloc_read_agf);
     314  2633741081 : DEFINE_AG_EVENT(xfs_read_agi);
     315  2453584986 : DEFINE_AG_EVENT(xfs_ialloc_read_agi);
     316             : 
     317     1424634 : TRACE_EVENT(xfs_attr_list_node_descend,
     318             :         TP_PROTO(struct xfs_attr_list_context *ctx,
     319             :                  struct xfs_da_node_entry *btree),
     320             :         TP_ARGS(ctx, btree),
     321             :         TP_STRUCT__entry(
     322             :                 __field(dev_t, dev)
     323             :                 __field(xfs_ino_t, ino)
     324             :                 __field(u32, hashval)
     325             :                 __field(u32, blkno)
     326             :                 __field(u32, offset)
     327             :                 __field(void *, buffer)
     328             :                 __field(int, bufsize)
     329             :                 __field(int, count)
     330             :                 __field(int, firstu)
     331             :                 __field(int, dupcnt)
     332             :                 __field(unsigned int, attr_filter)
     333             :                 __field(u32, bt_hashval)
     334             :                 __field(u32, bt_before)
     335             :         ),
     336             :         TP_fast_assign(
     337             :                 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
     338             :                 __entry->ino = ctx->dp->i_ino;
     339             :                 __entry->hashval = ctx->cursor.hashval;
     340             :                 __entry->blkno = ctx->cursor.blkno;
     341             :                 __entry->offset = ctx->cursor.offset;
     342             :                 __entry->buffer = ctx->buffer;
     343             :                 __entry->bufsize = ctx->bufsize;
     344             :                 __entry->count = ctx->count;
     345             :                 __entry->firstu = ctx->firstu;
     346             :                 __entry->attr_filter = ctx->attr_filter;
     347             :                 __entry->bt_hashval = be32_to_cpu(btree->hashval);
     348             :                 __entry->bt_before = be32_to_cpu(btree->before);
     349             :         ),
     350             :         TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
     351             :                   "buffer %p size %u count %u firstu %u filter %s "
     352             :                   "node hashval %u, node before %u",
     353             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     354             :                    __entry->ino,
     355             :                    __entry->hashval,
     356             :                    __entry->blkno,
     357             :                    __entry->offset,
     358             :                    __entry->dupcnt,
     359             :                    __entry->buffer,
     360             :                    __entry->bufsize,
     361             :                    __entry->count,
     362             :                    __entry->firstu,
     363             :                    __print_flags(__entry->attr_filter, "|",
     364             :                                  XFS_ATTR_FILTER_FLAGS),
     365             :                    __entry->bt_hashval,
     366             :                    __entry->bt_before)
     367             : );
     368             : 
     369           0 : DECLARE_EVENT_CLASS(xfs_bmap_class,
     370             :         TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
     371             :                  unsigned long caller_ip),
     372             :         TP_ARGS(ip, cur, state, caller_ip),
     373             :         TP_STRUCT__entry(
     374             :                 __field(dev_t, dev)
     375             :                 __field(xfs_ino_t, ino)
     376             :                 __field(void *, leaf)
     377             :                 __field(int, pos)
     378             :                 __field(xfs_fileoff_t, startoff)
     379             :                 __field(xfs_fsblock_t, startblock)
     380             :                 __field(xfs_filblks_t, blockcount)
     381             :                 __field(xfs_exntst_t, state)
     382             :                 __field(int, bmap_state)
     383             :                 __field(unsigned long, caller_ip)
     384             :         ),
     385             :         TP_fast_assign(
     386             :                 struct xfs_ifork        *ifp;
     387             :                 struct xfs_bmbt_irec    r;
     388             : 
     389             :                 ifp = xfs_iext_state_to_fork(ip, state);
     390             :                 xfs_iext_get_extent(ifp, cur, &r);
     391             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
     392             :                 __entry->ino = ip->i_ino;
     393             :                 __entry->leaf = cur->leaf;
     394             :                 __entry->pos = cur->pos;
     395             :                 __entry->startoff = r.br_startoff;
     396             :                 __entry->startblock = r.br_startblock;
     397             :                 __entry->blockcount = r.br_blockcount;
     398             :                 __entry->state = r.br_state;
     399             :                 __entry->bmap_state = state;
     400             :                 __entry->caller_ip = caller_ip;
     401             :         ),
     402             :         TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
     403             :                   "fileoff 0x%llx startblock 0x%llx fsbcount 0x%llx flag %d caller %pS",
     404             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     405             :                   __entry->ino,
     406             :                   __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
     407             :                   __entry->leaf,
     408             :                   __entry->pos,
     409             :                   __entry->startoff,
     410             :                   (int64_t)__entry->startblock,
     411             :                   __entry->blockcount,
     412             :                   __entry->state,
     413             :                   (char *)__entry->caller_ip)
     414             : )
     415             : 
     416             : #define DEFINE_BMAP_EVENT(name) \
     417             : DEFINE_EVENT(xfs_bmap_class, name, \
     418             :         TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
     419             :                  unsigned long caller_ip), \
     420             :         TP_ARGS(ip, cur, state, caller_ip))
     421  1754974747 : DEFINE_BMAP_EVENT(xfs_iext_insert);
     422   150061892 : DEFINE_BMAP_EVENT(xfs_iext_remove);
     423   339485821 : DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
     424   339485443 : DEFINE_BMAP_EVENT(xfs_bmap_post_update);
     425  1493034549 : DEFINE_BMAP_EVENT(xfs_read_extent);
     426  2291995513 : DEFINE_BMAP_EVENT(xfs_write_extent);
     427             : 
     428           0 : DECLARE_EVENT_CLASS(xfs_buf_class,
     429             :         TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
     430             :         TP_ARGS(bp, caller_ip),
     431             :         TP_STRUCT__entry(
     432             :                 __field(dev_t, dev)
     433             :                 __field(xfs_daddr_t, bno)
     434             :                 __field(int, nblks)
     435             :                 __field(int, hold)
     436             :                 __field(int, pincount)
     437             :                 __field(unsigned, lockval)
     438             :                 __field(unsigned, flags)
     439             :                 __field(unsigned long, caller_ip)
     440             :                 __field(const void *, buf_ops)
     441             :         ),
     442             :         TP_fast_assign(
     443             :                 __entry->dev = bp->b_target->bt_dev;
     444             :                 __entry->bno = xfs_buf_daddr(bp);
     445             :                 __entry->nblks = bp->b_length;
     446             :                 __entry->hold = atomic_read(&bp->b_hold);
     447             :                 __entry->pincount = atomic_read(&bp->b_pin_count);
     448             :                 __entry->lockval = bp->b_sema.count;
     449             :                 __entry->flags = bp->b_flags;
     450             :                 __entry->caller_ip = caller_ip;
     451             :                 __entry->buf_ops = bp->b_ops;
     452             :         ),
     453             :         TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
     454             :                   "lock %d flags %s bufops %pS caller %pS",
     455             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     456             :                   (unsigned long long)__entry->bno,
     457             :                   __entry->nblks,
     458             :                   __entry->hold,
     459             :                   __entry->pincount,
     460             :                   __entry->lockval,
     461             :                   __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
     462             :                   __entry->buf_ops,
     463             :                   (void *)__entry->caller_ip)
     464             : )
     465             : 
     466             : #define DEFINE_BUF_EVENT(name) \
     467             : DEFINE_EVENT(xfs_buf_class, name, \
     468             :         TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
     469             :         TP_ARGS(bp, caller_ip))
     470    72920393 : DEFINE_BUF_EVENT(xfs_buf_init);
     471    72948837 : DEFINE_BUF_EVENT(xfs_buf_free);
     472  9580999851 : DEFINE_BUF_EVENT(xfs_buf_hold);
     473 40348851642 : DEFINE_BUF_EVENT(xfs_buf_rele);
     474   162591535 : DEFINE_BUF_EVENT(xfs_buf_iodone);
     475   161426320 : DEFINE_BUF_EVENT(xfs_buf_submit);
     476 24235727558 : DEFINE_BUF_EVENT(xfs_buf_lock);
     477 24233302047 : DEFINE_BUF_EVENT(xfs_buf_lock_done);
     478   132521169 : DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
     479  6491590575 : DEFINE_BUF_EVENT(xfs_buf_trylock);
     480 30799477782 : DEFINE_BUF_EVENT(xfs_buf_unlock);
     481    38847001 : DEFINE_BUF_EVENT(xfs_buf_iowait);
     482    38845921 : DEFINE_BUF_EVENT(xfs_buf_iowait_done);
     483   129752927 : DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
     484    13719173 : DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
     485   129712583 : DEFINE_BUF_EVENT(xfs_buf_delwri_split);
     486           0 : DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
     487      493955 : DEFINE_BUF_EVENT(xfs_buf_get_uncached);
     488  8696365451 : DEFINE_BUF_EVENT(xfs_buf_item_relse);
     489       12121 : DEFINE_BUF_EVENT(xfs_buf_iodone_async);
     490     2981599 : DEFINE_BUF_EVENT(xfs_buf_error_relse);
     491           0 : DEFINE_BUF_EVENT(xfs_buf_drain_buftarg);
     492     1663368 : DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
     493             : 
     494             : /* not really buffer traces, but the buf provides useful information */
     495        1359 : DEFINE_BUF_EVENT(xfs_btree_corrupt);
     496        1959 : DEFINE_BUF_EVENT(xfs_reset_dqcounts);
     497             : 
     498             : /* pass flags explicitly */
     499           0 : DECLARE_EVENT_CLASS(xfs_buf_flags_class,
     500             :         TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
     501             :         TP_ARGS(bp, flags, caller_ip),
     502             :         TP_STRUCT__entry(
     503             :                 __field(dev_t, dev)
     504             :                 __field(xfs_daddr_t, bno)
     505             :                 __field(unsigned int, length)
     506             :                 __field(int, hold)
     507             :                 __field(int, pincount)
     508             :                 __field(unsigned, lockval)
     509             :                 __field(unsigned, flags)
     510             :                 __field(unsigned long, caller_ip)
     511             :         ),
     512             :         TP_fast_assign(
     513             :                 __entry->dev = bp->b_target->bt_dev;
     514             :                 __entry->bno = xfs_buf_daddr(bp);
     515             :                 __entry->length = bp->b_length;
     516             :                 __entry->flags = flags;
     517             :                 __entry->hold = atomic_read(&bp->b_hold);
     518             :                 __entry->pincount = atomic_read(&bp->b_pin_count);
     519             :                 __entry->lockval = bp->b_sema.count;
     520             :                 __entry->caller_ip = caller_ip;
     521             :         ),
     522             :         TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
     523             :                   "lock %d flags %s caller %pS",
     524             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     525             :                   (unsigned long long)__entry->bno,
     526             :                   __entry->length,
     527             :                   __entry->hold,
     528             :                   __entry->pincount,
     529             :                   __entry->lockval,
     530             :                   __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
     531             :                   (void *)__entry->caller_ip)
     532             : )
     533             : 
     534             : #define DEFINE_BUF_FLAGS_EVENT(name) \
     535             : DEFINE_EVENT(xfs_buf_flags_class, name, \
     536             :         TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
     537             :         TP_ARGS(bp, flags, caller_ip))
     538 30403741290 : DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
     539 30489277009 : DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
     540 30417808795 : DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
     541             : 
     542    70077558 : TRACE_EVENT(xfs_buf_ioerror,
     543             :         TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
     544             :         TP_ARGS(bp, error, caller_ip),
     545             :         TP_STRUCT__entry(
     546             :                 __field(dev_t, dev)
     547             :                 __field(xfs_daddr_t, bno)
     548             :                 __field(unsigned int, length)
     549             :                 __field(unsigned, flags)
     550             :                 __field(int, hold)
     551             :                 __field(int, pincount)
     552             :                 __field(unsigned, lockval)
     553             :                 __field(int, error)
     554             :                 __field(xfs_failaddr_t, caller_ip)
     555             :         ),
     556             :         TP_fast_assign(
     557             :                 __entry->dev = bp->b_target->bt_dev;
     558             :                 __entry->bno = xfs_buf_daddr(bp);
     559             :                 __entry->length = bp->b_length;
     560             :                 __entry->hold = atomic_read(&bp->b_hold);
     561             :                 __entry->pincount = atomic_read(&bp->b_pin_count);
     562             :                 __entry->lockval = bp->b_sema.count;
     563             :                 __entry->error = error;
     564             :                 __entry->flags = bp->b_flags;
     565             :                 __entry->caller_ip = caller_ip;
     566             :         ),
     567             :         TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
     568             :                   "lock %d error %d flags %s caller %pS",
     569             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     570             :                   (unsigned long long)__entry->bno,
     571             :                   __entry->length,
     572             :                   __entry->hold,
     573             :                   __entry->pincount,
     574             :                   __entry->lockval,
     575             :                   __entry->error,
     576             :                   __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
     577             :                   (void *)__entry->caller_ip)
     578             : );
     579             : 
     580           0 : DECLARE_EVENT_CLASS(xfs_buf_item_class,
     581             :         TP_PROTO(struct xfs_buf_log_item *bip),
     582             :         TP_ARGS(bip),
     583             :         TP_STRUCT__entry(
     584             :                 __field(dev_t, dev)
     585             :                 __field(xfs_daddr_t, buf_bno)
     586             :                 __field(unsigned int, buf_len)
     587             :                 __field(int, buf_hold)
     588             :                 __field(int, buf_pincount)
     589             :                 __field(int, buf_lockval)
     590             :                 __field(unsigned, buf_flags)
     591             :                 __field(unsigned, bli_recur)
     592             :                 __field(int, bli_refcount)
     593             :                 __field(unsigned, bli_flags)
     594             :                 __field(unsigned long, li_flags)
     595             :         ),
     596             :         TP_fast_assign(
     597             :                 __entry->dev = bip->bli_buf->b_target->bt_dev;
     598             :                 __entry->bli_flags = bip->bli_flags;
     599             :                 __entry->bli_recur = bip->bli_recur;
     600             :                 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
     601             :                 __entry->buf_bno = xfs_buf_daddr(bip->bli_buf);
     602             :                 __entry->buf_len = bip->bli_buf->b_length;
     603             :                 __entry->buf_flags = bip->bli_buf->b_flags;
     604             :                 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
     605             :                 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
     606             :                 __entry->buf_lockval = bip->bli_buf->b_sema.count;
     607             :                 __entry->li_flags = bip->bli_item.li_flags;
     608             :         ),
     609             :         TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
     610             :                   "lock %d flags %s recur %d refcount %d bliflags %s "
     611             :                   "liflags %s",
     612             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     613             :                   (unsigned long long)__entry->buf_bno,
     614             :                   __entry->buf_len,
     615             :                   __entry->buf_hold,
     616             :                   __entry->buf_pincount,
     617             :                   __entry->buf_lockval,
     618             :                   __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
     619             :                   __entry->bli_recur,
     620             :                   __entry->bli_refcount,
     621             :                   __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
     622             :                   __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
     623             : )
     624             : 
     625             : #define DEFINE_BUF_ITEM_EVENT(name) \
     626             : DEFINE_EVENT(xfs_buf_item_class, name, \
     627             :         TP_PROTO(struct xfs_buf_log_item *bip), \
     628             :         TP_ARGS(bip))
     629  3328105408 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
     630     2159518 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
     631    31556093 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
     632  3360046144 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
     633    31553543 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
     634     2159191 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
     635   337826741 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
     636   337870128 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
     637    31570973 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
     638  4082820461 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release);
     639   337870129 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
     640    56190486 : DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
     641    64812226 : DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
     642      308256 : DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
     643    86583157 : DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
     644        1049 : DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
     645 22486874875 : DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
     646  1162737016 : DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
     647  7393940494 : DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
     648 21381017476 : DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
     649   451239302 : DEFINE_BUF_ITEM_EVENT(xfs_trans_bdetach);
     650     7160580 : DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
     651     9760039 : DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
     652      754999 : DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
     653    31521174 : DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
     654             : 
     655           0 : DECLARE_EVENT_CLASS(xfs_filestream_class,
     656             :         TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino),
     657             :         TP_ARGS(pag, ino),
     658             :         TP_STRUCT__entry(
     659             :                 __field(dev_t, dev)
     660             :                 __field(xfs_ino_t, ino)
     661             :                 __field(xfs_agnumber_t, agno)
     662             :                 __field(int, streams)
     663             :         ),
     664             :         TP_fast_assign(
     665             :                 __entry->dev = pag->pag_mount->m_super->s_dev;
     666             :                 __entry->ino = ino;
     667             :                 __entry->agno = pag->pag_agno;
     668             :                 __entry->streams = atomic_read(&pag->pagf_fstrms);
     669             :         ),
     670             :         TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d",
     671             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     672             :                   __entry->ino,
     673             :                   __entry->agno,
     674             :                   __entry->streams)
     675             : )
     676             : #define DEFINE_FILESTREAM_EVENT(name) \
     677             : DEFINE_EVENT(xfs_filestream_class, name, \
     678             :         TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino), \
     679             :         TP_ARGS(pag, ino))
     680        8986 : DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
     681       57238 : DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
     682      391247 : DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
     683             : 
     684        8985 : TRACE_EVENT(xfs_filestream_pick,
     685             :         TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino, xfs_extlen_t free),
     686             :         TP_ARGS(pag, ino, free),
     687             :         TP_STRUCT__entry(
     688             :                 __field(dev_t, dev)
     689             :                 __field(xfs_ino_t, ino)
     690             :                 __field(xfs_agnumber_t, agno)
     691             :                 __field(int, streams)
     692             :                 __field(xfs_extlen_t, free)
     693             :         ),
     694             :         TP_fast_assign(
     695             :                 __entry->dev = pag->pag_mount->m_super->s_dev;
     696             :                 __entry->ino = ino;
     697             :                 if (pag) {
     698             :                         __entry->agno = pag->pag_agno;
     699             :                         __entry->streams = atomic_read(&pag->pagf_fstrms);
     700             :                 } else {
     701             :                         __entry->agno = NULLAGNUMBER;
     702             :                         __entry->streams = 0;
     703             :                 }
     704             :                 __entry->free = free;
     705             :         ),
     706             :         TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d",
     707             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     708             :                   __entry->ino,
     709             :                   __entry->agno,
     710             :                   __entry->streams,
     711             :                   __entry->free)
     712             : );
     713             : 
     714           0 : DECLARE_EVENT_CLASS(xfs_lock_class,
     715             :         TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
     716             :                  unsigned long caller_ip),
     717             :         TP_ARGS(ip,  lock_flags, caller_ip),
     718             :         TP_STRUCT__entry(
     719             :                 __field(dev_t, dev)
     720             :                 __field(xfs_ino_t, ino)
     721             :                 __field(int, lock_flags)
     722             :                 __field(unsigned long, caller_ip)
     723             :         ),
     724             :         TP_fast_assign(
     725             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
     726             :                 __entry->ino = ip->i_ino;
     727             :                 __entry->lock_flags = lock_flags;
     728             :                 __entry->caller_ip = caller_ip;
     729             :         ),
     730             :         TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
     731             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     732             :                   __entry->ino,
     733             :                   __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
     734             :                   (void *)__entry->caller_ip)
     735             : )
     736             : 
     737             : #define DEFINE_LOCK_EVENT(name) \
     738             : DEFINE_EVENT(xfs_lock_class, name, \
     739             :         TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
     740             :                  unsigned long caller_ip), \
     741             :         TP_ARGS(ip,  lock_flags, caller_ip))
     742 >12232*10^7 : DEFINE_LOCK_EVENT(xfs_ilock);
     743  3397248627 : DEFINE_LOCK_EVENT(xfs_ilock_nowait);
     744      869487 : DEFINE_LOCK_EVENT(xfs_ilock_demote);
     745 >12345*10^7 : DEFINE_LOCK_EVENT(xfs_iunlock);
     746             : 
     747           0 : DECLARE_EVENT_CLASS(xfs_inode_class,
     748             :         TP_PROTO(struct xfs_inode *ip),
     749             :         TP_ARGS(ip),
     750             :         TP_STRUCT__entry(
     751             :                 __field(dev_t, dev)
     752             :                 __field(xfs_ino_t, ino)
     753             :                 __field(unsigned long, iflags)
     754             :         ),
     755             :         TP_fast_assign(
     756             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
     757             :                 __entry->ino = ip->i_ino;
     758             :                 __entry->iflags = ip->i_flags;
     759             :         ),
     760             :         TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx",
     761             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     762             :                   __entry->ino,
     763             :                   __entry->iflags)
     764             : )
     765             : 
     766             : #define DEFINE_INODE_EVENT(name) \
     767             : DEFINE_EVENT(xfs_inode_class, name, \
     768             :         TP_PROTO(struct xfs_inode *ip), \
     769             :         TP_ARGS(ip))
     770      789607 : DEFINE_INODE_EVENT(xfs_iget_skip);
     771   635878512 : DEFINE_INODE_EVENT(xfs_iget_recycle);
     772           0 : DEFINE_INODE_EVENT(xfs_iget_recycle_fail);
     773 >11308*10^7 : DEFINE_INODE_EVENT(xfs_iget_hit);
     774   479770301 : DEFINE_INODE_EVENT(xfs_iget_miss);
     775             : 
     776  1926642382 : DEFINE_INODE_EVENT(xfs_getattr);
     777    45840021 : DEFINE_INODE_EVENT(xfs_setattr);
     778   280016490 : DEFINE_INODE_EVENT(xfs_readlink);
     779    29859455 : DEFINE_INODE_EVENT(xfs_inactive_symlink);
     780    12340224 : DEFINE_INODE_EVENT(xfs_alloc_file_space);
     781    45180130 : DEFINE_INODE_EVENT(xfs_free_file_space);
     782     3873125 : DEFINE_INODE_EVENT(xfs_zero_file_space);
     783     2406027 : DEFINE_INODE_EVENT(xfs_collapse_file_space);
     784     1795515 : DEFINE_INODE_EVENT(xfs_insert_file_space);
     785    96771578 : DEFINE_INODE_EVENT(xfs_readdir);
     786             : #ifdef CONFIG_XFS_POSIX_ACL
     787    11655936 : DEFINE_INODE_EVENT(xfs_get_acl);
     788             : #endif
     789       28182 : DEFINE_INODE_EVENT(xfs_vm_bmap);
     790  2507965110 : DEFINE_INODE_EVENT(xfs_file_ioctl);
     791           0 : DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
     792     1032493 : DEFINE_INODE_EVENT(xfs_ioctl_setattr);
     793      864164 : DEFINE_INODE_EVENT(xfs_dir_fsync);
     794    20329477 : DEFINE_INODE_EVENT(xfs_file_fsync);
     795  1115445755 : DEFINE_INODE_EVENT(xfs_destroy_inode);
     796   111587537 : DEFINE_INODE_EVENT(xfs_update_time);
     797             : 
     798    81641613 : DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
     799    81592489 : DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
     800             : 
     801     6140726 : DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
     802    20773105 : DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
     803      821088 : DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
     804     5898317 : DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
     805     7752192 : DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
     806      281037 : DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
     807  1115872456 : DEFINE_INODE_EVENT(xfs_inode_set_reclaimable);
     808   479505559 : DEFINE_INODE_EVENT(xfs_inode_reclaiming);
     809    86059525 : DEFINE_INODE_EVENT(xfs_inode_set_need_inactive);
     810    86006441 : DEFINE_INODE_EVENT(xfs_inode_inactivating);
     811             : 
     812             : /*
     813             :  * ftrace's __print_symbolic requires that all enum values be wrapped in the
     814             :  * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
     815             :  * ring buffer.  Somehow this was only worth mentioning in the ftrace sample
     816             :  * code.
     817             :  */
     818             : TRACE_DEFINE_ENUM(PE_SIZE_PTE);
     819             : TRACE_DEFINE_ENUM(PE_SIZE_PMD);
     820             : TRACE_DEFINE_ENUM(PE_SIZE_PUD);
     821             : 
     822             : TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_SHARED);
     823             : TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_COW);
     824             : 
     825   196748681 : TRACE_EVENT(xfs_filemap_fault,
     826             :         TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
     827             :                  bool write_fault),
     828             :         TP_ARGS(ip, pe_size, write_fault),
     829             :         TP_STRUCT__entry(
     830             :                 __field(dev_t, dev)
     831             :                 __field(xfs_ino_t, ino)
     832             :                 __field(enum page_entry_size, pe_size)
     833             :                 __field(bool, write_fault)
     834             :         ),
     835             :         TP_fast_assign(
     836             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
     837             :                 __entry->ino = ip->i_ino;
     838             :                 __entry->pe_size = pe_size;
     839             :                 __entry->write_fault = write_fault;
     840             :         ),
     841             :         TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
     842             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     843             :                   __entry->ino,
     844             :                   __print_symbolic(__entry->pe_size,
     845             :                         { PE_SIZE_PTE,  "PTE" },
     846             :                         { PE_SIZE_PMD,  "PMD" },
     847             :                         { PE_SIZE_PUD,  "PUD" }),
     848             :                   __entry->write_fault)
     849             : )
     850             : 
     851           0 : DECLARE_EVENT_CLASS(xfs_iref_class,
     852             :         TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
     853             :         TP_ARGS(ip, caller_ip),
     854             :         TP_STRUCT__entry(
     855             :                 __field(dev_t, dev)
     856             :                 __field(xfs_ino_t, ino)
     857             :                 __field(int, count)
     858             :                 __field(int, pincount)
     859             :                 __field(unsigned long, caller_ip)
     860             :         ),
     861             :         TP_fast_assign(
     862             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
     863             :                 __entry->ino = ip->i_ino;
     864             :                 __entry->count = atomic_read(&VFS_I(ip)->i_count);
     865             :                 __entry->pincount = atomic_read(&ip->i_pincount);
     866             :                 __entry->caller_ip = caller_ip;
     867             :         ),
     868             :         TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
     869             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     870             :                   __entry->ino,
     871             :                   __entry->count,
     872             :                   __entry->pincount,
     873             :                   (char *)__entry->caller_ip)
     874             : )
     875             : 
     876     1393599 : TRACE_EVENT(xfs_iomap_prealloc_size,
     877             :         TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
     878             :                  unsigned int writeio_blocks),
     879             :         TP_ARGS(ip, blocks, shift, writeio_blocks),
     880             :         TP_STRUCT__entry(
     881             :                 __field(dev_t, dev)
     882             :                 __field(xfs_ino_t, ino)
     883             :                 __field(xfs_fsblock_t, blocks)
     884             :                 __field(int, shift)
     885             :                 __field(unsigned int, writeio_blocks)
     886             :         ),
     887             :         TP_fast_assign(
     888             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
     889             :                 __entry->ino = ip->i_ino;
     890             :                 __entry->blocks = blocks;
     891             :                 __entry->shift = shift;
     892             :                 __entry->writeio_blocks = writeio_blocks;
     893             :         ),
     894             :         TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
     895             :                   "m_allocsize_blocks %u",
     896             :                   MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
     897             :                   __entry->blocks, __entry->shift, __entry->writeio_blocks)
     898             : )
     899             : 
     900      133190 : TRACE_EVENT(xfs_irec_merge_pre,
     901             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
     902             :                  uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
     903             :         TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
     904             :         TP_STRUCT__entry(
     905             :                 __field(dev_t, dev)
     906             :                 __field(xfs_agnumber_t, agno)
     907             :                 __field(xfs_agino_t, agino)
     908             :                 __field(uint16_t, holemask)
     909             :                 __field(xfs_agino_t, nagino)
     910             :                 __field(uint16_t, nholemask)
     911             :         ),
     912             :         TP_fast_assign(
     913             :                 __entry->dev = mp->m_super->s_dev;
     914             :                 __entry->agno = agno;
     915             :                 __entry->agino = agino;
     916             :                 __entry->holemask = holemask;
     917             :                 __entry->nagino = nagino;
     918             :                 __entry->nholemask = holemask;
     919             :         ),
     920             :         TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x",
     921             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     922             :                   __entry->agno,
     923             :                   __entry->agino,
     924             :                   __entry->holemask,
     925             :                   __entry->nagino,
     926             :                   __entry->nholemask)
     927             : )
     928             : 
     929      133189 : TRACE_EVENT(xfs_irec_merge_post,
     930             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
     931             :                  uint16_t holemask),
     932             :         TP_ARGS(mp, agno, agino, holemask),
     933             :         TP_STRUCT__entry(
     934             :                 __field(dev_t, dev)
     935             :                 __field(xfs_agnumber_t, agno)
     936             :                 __field(xfs_agino_t, agino)
     937             :                 __field(uint16_t, holemask)
     938             :         ),
     939             :         TP_fast_assign(
     940             :                 __entry->dev = mp->m_super->s_dev;
     941             :                 __entry->agno = agno;
     942             :                 __entry->agino = agino;
     943             :                 __entry->holemask = holemask;
     944             :         ),
     945             :         TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x",
     946             :                   MAJOR(__entry->dev),
     947             :                   MINOR(__entry->dev),
     948             :                   __entry->agno,
     949             :                   __entry->agino,
     950             :                   __entry->holemask)
     951             : )
     952             : 
     953             : #define DEFINE_IREF_EVENT(name) \
     954             : DEFINE_EVENT(xfs_iref_class, name, \
     955             :         TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
     956             :         TP_ARGS(ip, caller_ip))
     957 >11240*10^7 : DEFINE_IREF_EVENT(xfs_irele);
     958   527889414 : DEFINE_IREF_EVENT(xfs_inode_pin);
     959   528509813 : DEFINE_IREF_EVENT(xfs_inode_unpin);
     960           4 : DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
     961             : 
     962           0 : DECLARE_EVENT_CLASS(xfs_namespace_class,
     963             :         TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name),
     964             :         TP_ARGS(dp, name),
     965             :         TP_STRUCT__entry(
     966             :                 __field(dev_t, dev)
     967             :                 __field(xfs_ino_t, dp_ino)
     968             :                 __field(int, namelen)
     969             :                 __dynamic_array(char, name, name->len)
     970             :         ),
     971             :         TP_fast_assign(
     972             :                 __entry->dev = VFS_I(dp)->i_sb->s_dev;
     973             :                 __entry->dp_ino = dp->i_ino;
     974             :                 __entry->namelen = name->len;
     975             :                 memcpy(__get_str(name), name->name, name->len);
     976             :         ),
     977             :         TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
     978             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
     979             :                   __entry->dp_ino,
     980             :                   __entry->namelen,
     981             :                   __get_str(name))
     982             : )
     983             : 
     984             : #define DEFINE_NAMESPACE_EVENT(name) \
     985             : DEFINE_EVENT(xfs_namespace_class, name, \
     986             :         TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name), \
     987             :         TP_ARGS(dp, name))
     988    66892629 : DEFINE_NAMESPACE_EVENT(xfs_remove);
     989    13027225 : DEFINE_NAMESPACE_EVENT(xfs_link);
     990   206239498 : DEFINE_NAMESPACE_EVENT(xfs_lookup);
     991    65700533 : DEFINE_NAMESPACE_EVENT(xfs_create);
     992   597410567 : DEFINE_NAMESPACE_EVENT(xfs_symlink);
     993             : 
     994    47773856 : TRACE_EVENT(xfs_rename,
     995             :         TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
     996             :                  struct xfs_name *src_name, struct xfs_name *target_name),
     997             :         TP_ARGS(src_dp, target_dp, src_name, target_name),
     998             :         TP_STRUCT__entry(
     999             :                 __field(dev_t, dev)
    1000             :                 __field(xfs_ino_t, src_dp_ino)
    1001             :                 __field(xfs_ino_t, target_dp_ino)
    1002             :                 __field(int, src_namelen)
    1003             :                 __field(int, target_namelen)
    1004             :                 __dynamic_array(char, src_name, src_name->len)
    1005             :                 __dynamic_array(char, target_name, target_name->len)
    1006             :         ),
    1007             :         TP_fast_assign(
    1008             :                 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
    1009             :                 __entry->src_dp_ino = src_dp->i_ino;
    1010             :                 __entry->target_dp_ino = target_dp->i_ino;
    1011             :                 __entry->src_namelen = src_name->len;
    1012             :                 __entry->target_namelen = target_name->len;
    1013             :                 memcpy(__get_str(src_name), src_name->name, src_name->len);
    1014             :                 memcpy(__get_str(target_name), target_name->name,
    1015             :                         target_name->len);
    1016             :         ),
    1017             :         TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
    1018             :                   " src name %.*s target name %.*s",
    1019             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1020             :                   __entry->src_dp_ino,
    1021             :                   __entry->target_dp_ino,
    1022             :                   __entry->src_namelen,
    1023             :                   __get_str(src_name),
    1024             :                   __entry->target_namelen,
    1025             :                   __get_str(target_name))
    1026             : )
    1027             : 
    1028           0 : DECLARE_EVENT_CLASS(xfs_dquot_class,
    1029             :         TP_PROTO(struct xfs_dquot *dqp),
    1030             :         TP_ARGS(dqp),
    1031             :         TP_STRUCT__entry(
    1032             :                 __field(dev_t, dev)
    1033             :                 __field(u32, id)
    1034             :                 __field(xfs_dqtype_t, type)
    1035             :                 __field(unsigned, flags)
    1036             :                 __field(unsigned, nrefs)
    1037             :                 __field(unsigned long long, res_bcount)
    1038             :                 __field(unsigned long long, res_rtbcount)
    1039             :                 __field(unsigned long long, res_icount)
    1040             : 
    1041             :                 __field(unsigned long long, bcount)
    1042             :                 __field(unsigned long long, rtbcount)
    1043             :                 __field(unsigned long long, icount)
    1044             : 
    1045             :                 __field(unsigned long long, blk_hardlimit)
    1046             :                 __field(unsigned long long, blk_softlimit)
    1047             :                 __field(unsigned long long, rtb_hardlimit)
    1048             :                 __field(unsigned long long, rtb_softlimit)
    1049             :                 __field(unsigned long long, ino_hardlimit)
    1050             :                 __field(unsigned long long, ino_softlimit)
    1051             :         ),
    1052             :         TP_fast_assign(
    1053             :                 __entry->dev = dqp->q_mount->m_super->s_dev;
    1054             :                 __entry->id = dqp->q_id;
    1055             :                 __entry->type = dqp->q_type;
    1056             :                 __entry->flags = dqp->q_flags;
    1057             :                 __entry->nrefs = dqp->q_nrefs;
    1058             : 
    1059             :                 __entry->res_bcount = dqp->q_blk.reserved;
    1060             :                 __entry->res_rtbcount = dqp->q_rtb.reserved;
    1061             :                 __entry->res_icount = dqp->q_ino.reserved;
    1062             : 
    1063             :                 __entry->bcount = dqp->q_blk.count;
    1064             :                 __entry->rtbcount = dqp->q_rtb.count;
    1065             :                 __entry->icount = dqp->q_ino.count;
    1066             : 
    1067             :                 __entry->blk_hardlimit = dqp->q_blk.hardlimit;
    1068             :                 __entry->blk_softlimit = dqp->q_blk.softlimit;
    1069             :                 __entry->rtb_hardlimit = dqp->q_rtb.hardlimit;
    1070             :                 __entry->rtb_softlimit = dqp->q_rtb.softlimit;
    1071             :                 __entry->ino_hardlimit = dqp->q_ino.hardlimit;
    1072             :                 __entry->ino_softlimit = dqp->q_ino.softlimit;
    1073             :         ),
    1074             :         TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u "
    1075             :                   "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx "
    1076             :                   "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
    1077             :                   "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx "
    1078             :                   "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
    1079             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1080             :                   __entry->id,
    1081             :                   __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
    1082             :                   __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
    1083             :                   __entry->nrefs,
    1084             :                   __entry->res_bcount,
    1085             :                   __entry->res_rtbcount,
    1086             :                   __entry->res_icount,
    1087             :                   __entry->bcount,
    1088             :                   __entry->blk_hardlimit,
    1089             :                   __entry->blk_softlimit,
    1090             :                   __entry->rtbcount,
    1091             :                   __entry->rtb_hardlimit,
    1092             :                   __entry->rtb_softlimit,
    1093             :                   __entry->icount,
    1094             :                   __entry->ino_hardlimit,
    1095             :                   __entry->ino_softlimit)
    1096             : )
    1097             : 
    1098             : #define DEFINE_DQUOT_EVENT(name) \
    1099             : DEFINE_EVENT(xfs_dquot_class, name, \
    1100             :         TP_PROTO(struct xfs_dquot *dqp), \
    1101             :         TP_ARGS(dqp))
    1102      356442 : DEFINE_DQUOT_EVENT(xfs_dqadjust);
    1103       47644 : DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
    1104         862 : DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
    1105      126375 : DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
    1106      796665 : DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
    1107           0 : DEFINE_DQUOT_EVENT(xfs_dqattach_found);
    1108    52765953 : DEFINE_DQUOT_EVENT(xfs_dqattach_get);
    1109     2955025 : DEFINE_DQUOT_EVENT(xfs_dqalloc);
    1110    12989729 : DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
    1111    16171391 : DEFINE_DQUOT_EVENT(xfs_dqread);
    1112      260210 : DEFINE_DQUOT_EVENT(xfs_dqread_fail);
    1113   139360628 : DEFINE_DQUOT_EVENT(xfs_dqget_hit);
    1114    15739568 : DEFINE_DQUOT_EVENT(xfs_dqget_miss);
    1115           4 : DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
    1116         385 : DEFINE_DQUOT_EVENT(xfs_dqget_dup);
    1117   576226819 : DEFINE_DQUOT_EVENT(xfs_dqput);
    1118    29397478 : DEFINE_DQUOT_EVENT(xfs_dqput_free);
    1119   494553682 : DEFINE_DQUOT_EVENT(xfs_dqrele);
    1120    18251818 : DEFINE_DQUOT_EVENT(xfs_dqflush);
    1121       22631 : DEFINE_DQUOT_EVENT(xfs_dqflush_force);
    1122    16581762 : DEFINE_DQUOT_EVENT(xfs_dqflush_done);
    1123   930829765 : DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
    1124   930825642 : DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
    1125             : 
    1126  3246405303 : TRACE_EVENT(xfs_trans_mod_dquot,
    1127             :         TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
    1128             :                  unsigned int field, int64_t delta),
    1129             :         TP_ARGS(tp, dqp, field, delta),
    1130             :         TP_STRUCT__entry(
    1131             :                 __field(dev_t, dev)
    1132             :                 __field(xfs_dqtype_t, type)
    1133             :                 __field(unsigned int, flags)
    1134             :                 __field(unsigned int, dqid)
    1135             :                 __field(unsigned int, field)
    1136             :                 __field(int64_t, delta)
    1137             :         ),
    1138             :         TP_fast_assign(
    1139             :                 __entry->dev = tp->t_mountp->m_super->s_dev;
    1140             :                 __entry->type = dqp->q_type;
    1141             :                 __entry->flags = dqp->q_flags;
    1142             :                 __entry->dqid = dqp->q_id;
    1143             :                 __entry->field = field;
    1144             :                 __entry->delta = delta;
    1145             :         ),
    1146             :         TP_printk("dev %d:%d dquot id 0x%x type %s flags %s field %s delta %lld",
    1147             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1148             :                   __entry->dqid,
    1149             :                   __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
    1150             :                   __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
    1151             :                   __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS),
    1152             :                   __entry->delta)
    1153             : );
    1154             : 
    1155           0 : DECLARE_EVENT_CLASS(xfs_dqtrx_class,
    1156             :         TP_PROTO(struct xfs_dqtrx *qtrx),
    1157             :         TP_ARGS(qtrx),
    1158             :         TP_STRUCT__entry(
    1159             :                 __field(dev_t, dev)
    1160             :                 __field(xfs_dqtype_t, type)
    1161             :                 __field(unsigned int, flags)
    1162             :                 __field(u32, dqid)
    1163             : 
    1164             :                 __field(uint64_t, blk_res)
    1165             :                 __field(int64_t,  bcount_delta)
    1166             :                 __field(int64_t,  delbcnt_delta)
    1167             : 
    1168             :                 __field(uint64_t, rtblk_res)
    1169             :                 __field(uint64_t, rtblk_res_used)
    1170             :                 __field(int64_t,  rtbcount_delta)
    1171             :                 __field(int64_t,  delrtb_delta)
    1172             : 
    1173             :                 __field(uint64_t, ino_res)
    1174             :                 __field(uint64_t, ino_res_used)
    1175             :                 __field(int64_t,  icount_delta)
    1176             :         ),
    1177             :         TP_fast_assign(
    1178             :                 __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev;
    1179             :                 __entry->type = qtrx->qt_dquot->q_type;
    1180             :                 __entry->flags = qtrx->qt_dquot->q_flags;
    1181             :                 __entry->dqid = qtrx->qt_dquot->q_id;
    1182             : 
    1183             :                 __entry->blk_res = qtrx->qt_blk_res;
    1184             :                 __entry->bcount_delta = qtrx->qt_bcount_delta;
    1185             :                 __entry->delbcnt_delta = qtrx->qt_delbcnt_delta;
    1186             : 
    1187             :                 __entry->rtblk_res = qtrx->qt_rtblk_res;
    1188             :                 __entry->rtblk_res_used = qtrx->qt_rtblk_res_used;
    1189             :                 __entry->rtbcount_delta = qtrx->qt_rtbcount_delta;
    1190             :                 __entry->delrtb_delta = qtrx->qt_delrtb_delta;
    1191             : 
    1192             :                 __entry->ino_res = qtrx->qt_ino_res;
    1193             :                 __entry->ino_res_used = qtrx->qt_ino_res_used;
    1194             :                 __entry->icount_delta = qtrx->qt_icount_delta;
    1195             :         ),
    1196             :         TP_printk("dev %d:%d dquot id 0x%x type %s flags %s "
    1197             :                   "blk_res %llu bcount_delta %lld delbcnt_delta %lld "
    1198             :                   "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld "
    1199             :                   "ino_res %llu ino_res_used %llu icount_delta %lld",
    1200             :                 MAJOR(__entry->dev), MINOR(__entry->dev),
    1201             :                 __entry->dqid,
    1202             :                   __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
    1203             :                   __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
    1204             : 
    1205             :                 __entry->blk_res,
    1206             :                 __entry->bcount_delta,
    1207             :                 __entry->delbcnt_delta,
    1208             : 
    1209             :                 __entry->rtblk_res,
    1210             :                 __entry->rtblk_res_used,
    1211             :                 __entry->rtbcount_delta,
    1212             :                 __entry->delrtb_delta,
    1213             : 
    1214             :                 __entry->ino_res,
    1215             :                 __entry->ino_res_used,
    1216             :                 __entry->icount_delta)
    1217             : )
    1218             : 
    1219             : #define DEFINE_DQTRX_EVENT(name) \
    1220             : DEFINE_EVENT(xfs_dqtrx_class, name, \
    1221             :         TP_PROTO(struct xfs_dqtrx *qtrx), \
    1222             :         TP_ARGS(qtrx))
    1223   930829074 : DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas);
    1224  3246421426 : DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before);
    1225  3246358508 : DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after);
    1226             : 
    1227           0 : DECLARE_EVENT_CLASS(xfs_loggrant_class,
    1228             :         TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
    1229             :         TP_ARGS(log, tic),
    1230             :         TP_STRUCT__entry(
    1231             :                 __field(dev_t, dev)
    1232             :                 __field(char, ocnt)
    1233             :                 __field(char, cnt)
    1234             :                 __field(int, curr_res)
    1235             :                 __field(int, unit_res)
    1236             :                 __field(unsigned int, flags)
    1237             :                 __field(int, reserveq)
    1238             :                 __field(int, writeq)
    1239             :                 __field(int, grant_reserve_cycle)
    1240             :                 __field(int, grant_reserve_bytes)
    1241             :                 __field(int, grant_write_cycle)
    1242             :                 __field(int, grant_write_bytes)
    1243             :                 __field(int, curr_cycle)
    1244             :                 __field(int, curr_block)
    1245             :                 __field(xfs_lsn_t, tail_lsn)
    1246             :         ),
    1247             :         TP_fast_assign(
    1248             :                 __entry->dev = log->l_mp->m_super->s_dev;
    1249             :                 __entry->ocnt = tic->t_ocnt;
    1250             :                 __entry->cnt = tic->t_cnt;
    1251             :                 __entry->curr_res = tic->t_curr_res;
    1252             :                 __entry->unit_res = tic->t_unit_res;
    1253             :                 __entry->flags = tic->t_flags;
    1254             :                 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
    1255             :                 __entry->writeq = list_empty(&log->l_write_head.waiters);
    1256             :                 xlog_crack_grant_head(&log->l_reserve_head.grant,
    1257             :                                 &__entry->grant_reserve_cycle,
    1258             :                                 &__entry->grant_reserve_bytes);
    1259             :                 xlog_crack_grant_head(&log->l_write_head.grant,
    1260             :                                 &__entry->grant_write_cycle,
    1261             :                                 &__entry->grant_write_bytes);
    1262             :                 __entry->curr_cycle = log->l_curr_cycle;
    1263             :                 __entry->curr_block = log->l_curr_block;
    1264             :                 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
    1265             :         ),
    1266             :         TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
    1267             :                   "t_unit_res %u t_flags %s reserveq %s "
    1268             :                   "writeq %s grant_reserve_cycle %d "
    1269             :                   "grant_reserve_bytes %d grant_write_cycle %d "
    1270             :                   "grant_write_bytes %d curr_cycle %d curr_block %d "
    1271             :                   "tail_cycle %d tail_block %d",
    1272             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1273             :                   __entry->ocnt,
    1274             :                   __entry->cnt,
    1275             :                   __entry->curr_res,
    1276             :                   __entry->unit_res,
    1277             :                   __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
    1278             :                   __entry->reserveq ? "empty" : "active",
    1279             :                   __entry->writeq ? "empty" : "active",
    1280             :                   __entry->grant_reserve_cycle,
    1281             :                   __entry->grant_reserve_bytes,
    1282             :                   __entry->grant_write_cycle,
    1283             :                   __entry->grant_write_bytes,
    1284             :                   __entry->curr_cycle,
    1285             :                   __entry->curr_block,
    1286             :                   CYCLE_LSN(__entry->tail_lsn),
    1287             :                   BLOCK_LSN(__entry->tail_lsn)
    1288             :         )
    1289             : )
    1290             : 
    1291             : #define DEFINE_LOGGRANT_EVENT(name) \
    1292             : DEFINE_EVENT(xfs_loggrant_class, name, \
    1293             :         TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
    1294             :         TP_ARGS(log, tic))
    1295       50095 : DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
    1296     8692473 : DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
    1297     8570147 : DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
    1298   538835107 : DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
    1299  1536120235 : DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
    1300  1538800452 : DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
    1301   407193971 : DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
    1302   407209778 : DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
    1303  1330883144 : DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant);
    1304   407212495 : DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit);
    1305  1331112452 : DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub);
    1306  1544452153 : DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant);
    1307  1544358102 : DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub);
    1308  1545178057 : DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit);
    1309          16 : DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait);
    1310             : 
    1311           0 : DECLARE_EVENT_CLASS(xfs_log_item_class,
    1312             :         TP_PROTO(struct xfs_log_item *lip),
    1313             :         TP_ARGS(lip),
    1314             :         TP_STRUCT__entry(
    1315             :                 __field(dev_t, dev)
    1316             :                 __field(void *, lip)
    1317             :                 __field(uint, type)
    1318             :                 __field(unsigned long, flags)
    1319             :                 __field(xfs_lsn_t, lsn)
    1320             :         ),
    1321             :         TP_fast_assign(
    1322             :                 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
    1323             :                 __entry->lip = lip;
    1324             :                 __entry->type = lip->li_type;
    1325             :                 __entry->flags = lip->li_flags;
    1326             :                 __entry->lsn = lip->li_lsn;
    1327             :         ),
    1328             :         TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
    1329             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1330             :                   __entry->lip,
    1331             :                   CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
    1332             :                   __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
    1333             :                   __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
    1334             : )
    1335             : 
    1336    17488384 : TRACE_EVENT(xfs_log_force,
    1337             :         TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
    1338             :         TP_ARGS(mp, lsn, caller_ip),
    1339             :         TP_STRUCT__entry(
    1340             :                 __field(dev_t, dev)
    1341             :                 __field(xfs_lsn_t, lsn)
    1342             :                 __field(unsigned long, caller_ip)
    1343             :         ),
    1344             :         TP_fast_assign(
    1345             :                 __entry->dev = mp->m_super->s_dev;
    1346             :                 __entry->lsn = lsn;
    1347             :                 __entry->caller_ip = caller_ip;
    1348             :         ),
    1349             :         TP_printk("dev %d:%d lsn 0x%llx caller %pS",
    1350             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1351             :                   __entry->lsn, (void *)__entry->caller_ip)
    1352             : )
    1353             : 
    1354             : #define DEFINE_LOG_ITEM_EVENT(name) \
    1355             : DEFINE_EVENT(xfs_log_item_class, name, \
    1356             :         TP_PROTO(struct xfs_log_item *lip), \
    1357             :         TP_ARGS(lip))
    1358   103588213 : DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
    1359     6916703 : DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
    1360     1660307 : DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
    1361   125386497 : DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
    1362  1100698863 : DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_mark);
    1363  1100756562 : DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_skip);
    1364  1100700455 : DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_unpin);
    1365             : 
    1366           0 : DECLARE_EVENT_CLASS(xfs_ail_class,
    1367             :         TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
    1368             :         TP_ARGS(lip, old_lsn, new_lsn),
    1369             :         TP_STRUCT__entry(
    1370             :                 __field(dev_t, dev)
    1371             :                 __field(void *, lip)
    1372             :                 __field(uint, type)
    1373             :                 __field(unsigned long, flags)
    1374             :                 __field(xfs_lsn_t, old_lsn)
    1375             :                 __field(xfs_lsn_t, new_lsn)
    1376             :         ),
    1377             :         TP_fast_assign(
    1378             :                 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
    1379             :                 __entry->lip = lip;
    1380             :                 __entry->type = lip->li_type;
    1381             :                 __entry->flags = lip->li_flags;
    1382             :                 __entry->old_lsn = old_lsn;
    1383             :                 __entry->new_lsn = new_lsn;
    1384             :         ),
    1385             :         TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s",
    1386             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1387             :                   __entry->lip,
    1388             :                   CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
    1389             :                   CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
    1390             :                   __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
    1391             :                   __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
    1392             : )
    1393             : 
    1394             : #define DEFINE_AIL_EVENT(name) \
    1395             : DEFINE_EVENT(xfs_ail_class, name, \
    1396             :         TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
    1397             :         TP_ARGS(lip, old_lsn, new_lsn))
    1398   375373563 : DEFINE_AIL_EVENT(xfs_ail_insert);
    1399   525488523 : DEFINE_AIL_EVENT(xfs_ail_move);
    1400   375373563 : DEFINE_AIL_EVENT(xfs_ail_delete);
    1401             : 
    1402    29820259 : TRACE_EVENT(xfs_log_assign_tail_lsn,
    1403             :         TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
    1404             :         TP_ARGS(log, new_lsn),
    1405             :         TP_STRUCT__entry(
    1406             :                 __field(dev_t, dev)
    1407             :                 __field(xfs_lsn_t, new_lsn)
    1408             :                 __field(xfs_lsn_t, old_lsn)
    1409             :                 __field(xfs_lsn_t, last_sync_lsn)
    1410             :         ),
    1411             :         TP_fast_assign(
    1412             :                 __entry->dev = log->l_mp->m_super->s_dev;
    1413             :                 __entry->new_lsn = new_lsn;
    1414             :                 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
    1415             :                 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
    1416             :         ),
    1417             :         TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
    1418             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1419             :                   CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
    1420             :                   CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
    1421             :                   CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
    1422             : )
    1423             : 
    1424           0 : DECLARE_EVENT_CLASS(xfs_file_class,
    1425             :         TP_PROTO(struct kiocb *iocb, struct iov_iter *iter),
    1426             :         TP_ARGS(iocb, iter),
    1427             :         TP_STRUCT__entry(
    1428             :                 __field(dev_t, dev)
    1429             :                 __field(xfs_ino_t, ino)
    1430             :                 __field(xfs_fsize_t, size)
    1431             :                 __field(loff_t, offset)
    1432             :                 __field(size_t, count)
    1433             :         ),
    1434             :         TP_fast_assign(
    1435             :                 __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
    1436             :                 __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
    1437             :                 __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size;
    1438             :                 __entry->offset = iocb->ki_pos;
    1439             :                 __entry->count = iov_iter_count(iter);
    1440             :         ),
    1441             :         TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx",
    1442             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1443             :                   __entry->ino,
    1444             :                   __entry->size,
    1445             :                   __entry->offset,
    1446             :                   __entry->count)
    1447             : )
    1448             : 
    1449             : #define DEFINE_RW_EVENT(name)           \
    1450             : DEFINE_EVENT(xfs_file_class, name,      \
    1451             :         TP_PROTO(struct kiocb *iocb, struct iov_iter *iter),            \
    1452             :         TP_ARGS(iocb, iter))
    1453   386879964 : DEFINE_RW_EVENT(xfs_file_buffered_read);
    1454   534592782 : DEFINE_RW_EVENT(xfs_file_direct_read);
    1455           0 : DEFINE_RW_EVENT(xfs_file_dax_read);
    1456   249531250 : DEFINE_RW_EVENT(xfs_file_buffered_write);
    1457    19063505 : DEFINE_RW_EVENT(xfs_file_direct_write);
    1458           0 : DEFINE_RW_EVENT(xfs_file_dax_write);
    1459     6960432 : DEFINE_RW_EVENT(xfs_reflink_bounce_dio_write);
    1460             : 
    1461           0 : DECLARE_EVENT_CLASS(xfs_imap_class,
    1462             :         TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
    1463             :                  int whichfork, struct xfs_bmbt_irec *irec),
    1464             :         TP_ARGS(ip, offset, count, whichfork, irec),
    1465             :         TP_STRUCT__entry(
    1466             :                 __field(dev_t, dev)
    1467             :                 __field(xfs_ino_t, ino)
    1468             :                 __field(loff_t, size)
    1469             :                 __field(loff_t, offset)
    1470             :                 __field(size_t, count)
    1471             :                 __field(int, whichfork)
    1472             :                 __field(xfs_fileoff_t, startoff)
    1473             :                 __field(xfs_fsblock_t, startblock)
    1474             :                 __field(xfs_filblks_t, blockcount)
    1475             :         ),
    1476             :         TP_fast_assign(
    1477             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    1478             :                 __entry->ino = ip->i_ino;
    1479             :                 __entry->size = ip->i_disk_size;
    1480             :                 __entry->offset = offset;
    1481             :                 __entry->count = count;
    1482             :                 __entry->whichfork = whichfork;
    1483             :                 __entry->startoff = irec ? irec->br_startoff : 0;
    1484             :                 __entry->startblock = irec ? irec->br_startblock : 0;
    1485             :                 __entry->blockcount = irec ? irec->br_blockcount : 0;
    1486             :         ),
    1487             :         TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx "
    1488             :                   "fork %s startoff 0x%llx startblock 0x%llx fsbcount 0x%llx",
    1489             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1490             :                   __entry->ino,
    1491             :                   __entry->size,
    1492             :                   __entry->offset,
    1493             :                   __entry->count,
    1494             :                   __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
    1495             :                   __entry->startoff,
    1496             :                   (int64_t)__entry->startblock,
    1497             :                   __entry->blockcount)
    1498             : )
    1499             : 
    1500             : #define DEFINE_IMAP_EVENT(name) \
    1501             : DEFINE_EVENT(xfs_imap_class, name,      \
    1502             :         TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
    1503             :                  int whichfork, struct xfs_bmbt_irec *irec),            \
    1504             :         TP_ARGS(ip, offset, count, whichfork, irec))
    1505    65219542 : DEFINE_IMAP_EVENT(xfs_map_blocks_found);
    1506    28818633 : DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
    1507   116589330 : DEFINE_IMAP_EVENT(xfs_iomap_alloc);
    1508  2051274147 : DEFINE_IMAP_EVENT(xfs_iomap_found);
    1509             : 
    1510           0 : DECLARE_EVENT_CLASS(xfs_simple_io_class,
    1511             :         TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, u64 count),
    1512             :         TP_ARGS(ip, offset, count),
    1513             :         TP_STRUCT__entry(
    1514             :                 __field(dev_t, dev)
    1515             :                 __field(xfs_ino_t, ino)
    1516             :                 __field(loff_t, isize)
    1517             :                 __field(loff_t, disize)
    1518             :                 __field(loff_t, offset)
    1519             :                 __field(u64, count)
    1520             :         ),
    1521             :         TP_fast_assign(
    1522             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    1523             :                 __entry->ino = ip->i_ino;
    1524             :                 __entry->isize = VFS_I(ip)->i_size;
    1525             :                 __entry->disize = ip->i_disk_size;
    1526             :                 __entry->offset = offset;
    1527             :                 __entry->count = count;
    1528             :         ),
    1529             :         TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
    1530             :                   "pos 0x%llx bytecount 0x%llx",
    1531             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1532             :                   __entry->ino,
    1533             :                   __entry->isize,
    1534             :                   __entry->disize,
    1535             :                   __entry->offset,
    1536             :                   __entry->count)
    1537             : );
    1538             : 
    1539             : #define DEFINE_SIMPLE_IO_EVENT(name)    \
    1540             : DEFINE_EVENT(xfs_simple_io_class, name, \
    1541             :         TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, u64 count),    \
    1542             :         TP_ARGS(ip, offset, count))
    1543     1660515 : DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
    1544    55499858 : DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
    1545    10774390 : DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
    1546    77403075 : DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
    1547    19064237 : DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
    1548           0 : DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
    1549           0 : DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
    1550    11929956 : DEFINE_SIMPLE_IO_EVENT(xfs_file_splice_read);
    1551             : 
    1552           0 : DECLARE_EVENT_CLASS(xfs_itrunc_class,
    1553             :         TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
    1554             :         TP_ARGS(ip, new_size),
    1555             :         TP_STRUCT__entry(
    1556             :                 __field(dev_t, dev)
    1557             :                 __field(xfs_ino_t, ino)
    1558             :                 __field(xfs_fsize_t, size)
    1559             :                 __field(xfs_fsize_t, new_size)
    1560             :         ),
    1561             :         TP_fast_assign(
    1562             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    1563             :                 __entry->ino = ip->i_ino;
    1564             :                 __entry->size = ip->i_disk_size;
    1565             :                 __entry->new_size = new_size;
    1566             :         ),
    1567             :         TP_printk("dev %d:%d ino 0x%llx disize 0x%llx new_size 0x%llx",
    1568             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1569             :                   __entry->ino,
    1570             :                   __entry->size,
    1571             :                   __entry->new_size)
    1572             : )
    1573             : 
    1574             : #define DEFINE_ITRUNC_EVENT(name) \
    1575             : DEFINE_EVENT(xfs_itrunc_class, name, \
    1576             :         TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
    1577             :         TP_ARGS(ip, new_size))
    1578    32939399 : DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
    1579    33171088 : DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
    1580             : 
    1581           0 : TRACE_EVENT(xfs_pagecache_inval,
    1582             :         TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
    1583             :         TP_ARGS(ip, start, finish),
    1584             :         TP_STRUCT__entry(
    1585             :                 __field(dev_t, dev)
    1586             :                 __field(xfs_ino_t, ino)
    1587             :                 __field(xfs_fsize_t, size)
    1588             :                 __field(xfs_off_t, start)
    1589             :                 __field(xfs_off_t, finish)
    1590             :         ),
    1591             :         TP_fast_assign(
    1592             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    1593             :                 __entry->ino = ip->i_ino;
    1594             :                 __entry->size = ip->i_disk_size;
    1595             :                 __entry->start = start;
    1596             :                 __entry->finish = finish;
    1597             :         ),
    1598             :         TP_printk("dev %d:%d ino 0x%llx disize 0x%llx start 0x%llx finish 0x%llx",
    1599             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1600             :                   __entry->ino,
    1601             :                   __entry->size,
    1602             :                   __entry->start,
    1603             :                   __entry->finish)
    1604             : );
    1605             : 
    1606   171685691 : TRACE_EVENT(xfs_bunmap,
    1607             :         TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t fileoff, xfs_filblks_t len,
    1608             :                  int flags, unsigned long caller_ip),
    1609             :         TP_ARGS(ip, fileoff, len, flags, caller_ip),
    1610             :         TP_STRUCT__entry(
    1611             :                 __field(dev_t, dev)
    1612             :                 __field(xfs_ino_t, ino)
    1613             :                 __field(xfs_fsize_t, size)
    1614             :                 __field(xfs_fileoff_t, fileoff)
    1615             :                 __field(xfs_filblks_t, len)
    1616             :                 __field(unsigned long, caller_ip)
    1617             :                 __field(int, flags)
    1618             :         ),
    1619             :         TP_fast_assign(
    1620             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    1621             :                 __entry->ino = ip->i_ino;
    1622             :                 __entry->size = ip->i_disk_size;
    1623             :                 __entry->fileoff = fileoff;
    1624             :                 __entry->len = len;
    1625             :                 __entry->caller_ip = caller_ip;
    1626             :                 __entry->flags = flags;
    1627             :         ),
    1628             :         TP_printk("dev %d:%d ino 0x%llx disize 0x%llx fileoff 0x%llx fsbcount 0x%llx "
    1629             :                   "flags %s caller %pS",
    1630             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1631             :                   __entry->ino,
    1632             :                   __entry->size,
    1633             :                   __entry->fileoff,
    1634             :                   __entry->len,
    1635             :                   __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
    1636             :                   (void *)__entry->caller_ip)
    1637             : 
    1638             : );
    1639             : 
    1640           0 : DECLARE_EVENT_CLASS(xfs_extent_busy_class,
    1641             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    1642             :                  xfs_agblock_t agbno, xfs_extlen_t len),
    1643             :         TP_ARGS(mp, agno, agbno, len),
    1644             :         TP_STRUCT__entry(
    1645             :                 __field(dev_t, dev)
    1646             :                 __field(xfs_agnumber_t, agno)
    1647             :                 __field(xfs_agblock_t, agbno)
    1648             :                 __field(xfs_extlen_t, len)
    1649             :         ),
    1650             :         TP_fast_assign(
    1651             :                 __entry->dev = mp->m_super->s_dev;
    1652             :                 __entry->agno = agno;
    1653             :                 __entry->agbno = agbno;
    1654             :                 __entry->len = len;
    1655             :         ),
    1656             :         TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
    1657             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1658             :                   __entry->agno,
    1659             :                   __entry->agbno,
    1660             :                   __entry->len)
    1661             : );
    1662             : #define DEFINE_BUSY_EVENT(name) \
    1663             : DEFINE_EVENT(xfs_extent_busy_class, name, \
    1664             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    1665             :                  xfs_agblock_t agbno, xfs_extlen_t len), \
    1666             :         TP_ARGS(mp, agno, agbno, len))
    1667    98777618 : DEFINE_BUSY_EVENT(xfs_extent_busy);
    1668           0 : DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
    1669           0 : DEFINE_BUSY_EVENT(xfs_extent_busy_force);
    1670           0 : DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
    1671    98798949 : DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
    1672             : 
    1673  3477210104 : TRACE_EVENT(xfs_extent_busy_trim,
    1674             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    1675             :                  xfs_agblock_t agbno, xfs_extlen_t len,
    1676             :                  xfs_agblock_t tbno, xfs_extlen_t tlen),
    1677             :         TP_ARGS(mp, agno, agbno, len, tbno, tlen),
    1678             :         TP_STRUCT__entry(
    1679             :                 __field(dev_t, dev)
    1680             :                 __field(xfs_agnumber_t, agno)
    1681             :                 __field(xfs_agblock_t, agbno)
    1682             :                 __field(xfs_extlen_t, len)
    1683             :                 __field(xfs_agblock_t, tbno)
    1684             :                 __field(xfs_extlen_t, tlen)
    1685             :         ),
    1686             :         TP_fast_assign(
    1687             :                 __entry->dev = mp->m_super->s_dev;
    1688             :                 __entry->agno = agno;
    1689             :                 __entry->agbno = agbno;
    1690             :                 __entry->len = len;
    1691             :                 __entry->tbno = tbno;
    1692             :                 __entry->tlen = tlen;
    1693             :         ),
    1694             :         TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
    1695             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1696             :                   __entry->agno,
    1697             :                   __entry->agbno,
    1698             :                   __entry->len,
    1699             :                   __entry->tbno,
    1700             :                   __entry->tlen)
    1701             : );
    1702             : 
    1703           0 : DECLARE_EVENT_CLASS(xfs_agf_class,
    1704             :         TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
    1705             :                  unsigned long caller_ip),
    1706             :         TP_ARGS(mp, agf, flags, caller_ip),
    1707             :         TP_STRUCT__entry(
    1708             :                 __field(dev_t, dev)
    1709             :                 __field(xfs_agnumber_t, agno)
    1710             :                 __field(int, flags)
    1711             :                 __field(__u32, length)
    1712             :                 __field(__u32, bno_root)
    1713             :                 __field(__u32, cnt_root)
    1714             :                 __field(__u32, bno_level)
    1715             :                 __field(__u32, cnt_level)
    1716             :                 __field(__u32, flfirst)
    1717             :                 __field(__u32, fllast)
    1718             :                 __field(__u32, flcount)
    1719             :                 __field(__u32, freeblks)
    1720             :                 __field(__u32, longest)
    1721             :                 __field(unsigned long, caller_ip)
    1722             :         ),
    1723             :         TP_fast_assign(
    1724             :                 __entry->dev = mp->m_super->s_dev;
    1725             :                 __entry->agno = be32_to_cpu(agf->agf_seqno),
    1726             :                 __entry->flags = flags;
    1727             :                 __entry->length = be32_to_cpu(agf->agf_length),
    1728             :                 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
    1729             :                 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
    1730             :                 __entry->bno_level =
    1731             :                                 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
    1732             :                 __entry->cnt_level =
    1733             :                                 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
    1734             :                 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
    1735             :                 __entry->fllast = be32_to_cpu(agf->agf_fllast),
    1736             :                 __entry->flcount = be32_to_cpu(agf->agf_flcount),
    1737             :                 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
    1738             :                 __entry->longest = be32_to_cpu(agf->agf_longest);
    1739             :                 __entry->caller_ip = caller_ip;
    1740             :         ),
    1741             :         TP_printk("dev %d:%d agno 0x%x flags %s length %u roots b %u c %u "
    1742             :                   "levels b %u c %u flfirst %u fllast %u flcount %u "
    1743             :                   "freeblks %u longest %u caller %pS",
    1744             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1745             :                   __entry->agno,
    1746             :                   __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
    1747             :                   __entry->length,
    1748             :                   __entry->bno_root,
    1749             :                   __entry->cnt_root,
    1750             :                   __entry->bno_level,
    1751             :                   __entry->cnt_level,
    1752             :                   __entry->flfirst,
    1753             :                   __entry->fllast,
    1754             :                   __entry->flcount,
    1755             :                   __entry->freeblks,
    1756             :                   __entry->longest,
    1757             :                   (void *)__entry->caller_ip)
    1758             : );
    1759             : #define DEFINE_AGF_EVENT(name) \
    1760             : DEFINE_EVENT(xfs_agf_class, name, \
    1761             :         TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
    1762             :                  unsigned long caller_ip), \
    1763             :         TP_ARGS(mp, agf, flags, caller_ip))
    1764   239831067 : DEFINE_AGF_EVENT(xfs_agf);
    1765          20 : DEFINE_AGF_EVENT(xfs_agfl_reset);
    1766             : 
    1767    98804640 : TRACE_EVENT(xfs_free_extent,
    1768             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
    1769             :                  xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
    1770             :                  int haveright),
    1771             :         TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
    1772             :         TP_STRUCT__entry(
    1773             :                 __field(dev_t, dev)
    1774             :                 __field(xfs_agnumber_t, agno)
    1775             :                 __field(xfs_agblock_t, agbno)
    1776             :                 __field(xfs_extlen_t, len)
    1777             :                 __field(int, resv)
    1778             :                 __field(int, haveleft)
    1779             :                 __field(int, haveright)
    1780             :         ),
    1781             :         TP_fast_assign(
    1782             :                 __entry->dev = mp->m_super->s_dev;
    1783             :                 __entry->agno = agno;
    1784             :                 __entry->agbno = agbno;
    1785             :                 __entry->len = len;
    1786             :                 __entry->resv = resv;
    1787             :                 __entry->haveleft = haveleft;
    1788             :                 __entry->haveright = haveright;
    1789             :         ),
    1790             :         TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x resv %d %s",
    1791             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1792             :                   __entry->agno,
    1793             :                   __entry->agbno,
    1794             :                   __entry->len,
    1795             :                   __entry->resv,
    1796             :                   __entry->haveleft ?
    1797             :                         (__entry->haveright ? "both" : "left") :
    1798             :                         (__entry->haveright ? "right" : "none"))
    1799             : 
    1800             : );
    1801             : 
    1802           0 : DECLARE_EVENT_CLASS(xfs_alloc_class,
    1803             :         TP_PROTO(struct xfs_alloc_arg *args),
    1804             :         TP_ARGS(args),
    1805             :         TP_STRUCT__entry(
    1806             :                 __field(dev_t, dev)
    1807             :                 __field(xfs_agnumber_t, agno)
    1808             :                 __field(xfs_agblock_t, agbno)
    1809             :                 __field(xfs_extlen_t, minlen)
    1810             :                 __field(xfs_extlen_t, maxlen)
    1811             :                 __field(xfs_extlen_t, mod)
    1812             :                 __field(xfs_extlen_t, prod)
    1813             :                 __field(xfs_extlen_t, minleft)
    1814             :                 __field(xfs_extlen_t, total)
    1815             :                 __field(xfs_extlen_t, alignment)
    1816             :                 __field(xfs_extlen_t, minalignslop)
    1817             :                 __field(xfs_extlen_t, len)
    1818             :                 __field(char, wasdel)
    1819             :                 __field(char, wasfromfl)
    1820             :                 __field(int, resv)
    1821             :                 __field(int, datatype)
    1822             :                 __field(xfs_agnumber_t, highest_agno)
    1823             :         ),
    1824             :         TP_fast_assign(
    1825             :                 __entry->dev = args->mp->m_super->s_dev;
    1826             :                 __entry->agno = args->agno;
    1827             :                 __entry->agbno = args->agbno;
    1828             :                 __entry->minlen = args->minlen;
    1829             :                 __entry->maxlen = args->maxlen;
    1830             :                 __entry->mod = args->mod;
    1831             :                 __entry->prod = args->prod;
    1832             :                 __entry->minleft = args->minleft;
    1833             :                 __entry->total = args->total;
    1834             :                 __entry->alignment = args->alignment;
    1835             :                 __entry->minalignslop = args->minalignslop;
    1836             :                 __entry->len = args->len;
    1837             :                 __entry->wasdel = args->wasdel;
    1838             :                 __entry->wasfromfl = args->wasfromfl;
    1839             :                 __entry->resv = args->resv;
    1840             :                 __entry->datatype = args->datatype;
    1841             :                 __entry->highest_agno = args->tp->t_highest_agno;
    1842             :         ),
    1843             :         TP_printk("dev %d:%d agno 0x%x agbno 0x%x minlen %u maxlen %u mod %u "
    1844             :                   "prod %u minleft %u total %u alignment %u minalignslop %u "
    1845             :                   "len %u wasdel %d wasfromfl %d resv %d "
    1846             :                   "datatype 0x%x highest_agno 0x%x",
    1847             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1848             :                   __entry->agno,
    1849             :                   __entry->agbno,
    1850             :                   __entry->minlen,
    1851             :                   __entry->maxlen,
    1852             :                   __entry->mod,
    1853             :                   __entry->prod,
    1854             :                   __entry->minleft,
    1855             :                   __entry->total,
    1856             :                   __entry->alignment,
    1857             :                   __entry->minalignslop,
    1858             :                   __entry->len,
    1859             :                   __entry->wasdel,
    1860             :                   __entry->wasfromfl,
    1861             :                   __entry->resv,
    1862             :                   __entry->datatype,
    1863             :                   __entry->highest_agno)
    1864             : )
    1865             : 
    1866             : #define DEFINE_ALLOC_EVENT(name) \
    1867             : DEFINE_EVENT(xfs_alloc_class, name, \
    1868             :         TP_PROTO(struct xfs_alloc_arg *args), \
    1869             :         TP_ARGS(args))
    1870      428027 : DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
    1871      624837 : DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
    1872           0 : DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
    1873           0 : DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
    1874    31527033 : DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
    1875    78933623 : DEFINE_ALLOC_EVENT(xfs_alloc_cur);
    1876    10558784 : DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
    1877    21105217 : DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
    1878   224476555 : DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
    1879    15871571 : DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
    1880           0 : DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
    1881           0 : DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
    1882      112123 : DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
    1883        4627 : DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
    1884           0 : DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
    1885      155797 : DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
    1886     6599198 : DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
    1887         195 : DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
    1888       38516 : DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
    1889           0 : DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
    1890           0 : DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
    1891     1181868 : DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
    1892           0 : DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
    1893           0 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
    1894        3330 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_skip_deadlock);
    1895        1779 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
    1896   190300107 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
    1897   187125720 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
    1898      433350 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
    1899             : 
    1900           0 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_this_ag);
    1901    81089331 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_start_ag);
    1902     2730698 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_first_ag);
    1903     1834202 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_exact_bno);
    1904     3856126 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_near_bno);
    1905    85175658 : DEFINE_ALLOC_EVENT(xfs_alloc_vextent_finish);
    1906             : 
    1907  5290351239 : TRACE_EVENT(xfs_alloc_cur_check,
    1908             :         TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
    1909             :                  xfs_extlen_t len, xfs_extlen_t diff, bool new),
    1910             :         TP_ARGS(mp, btnum, bno, len, diff, new),
    1911             :         TP_STRUCT__entry(
    1912             :                 __field(dev_t, dev)
    1913             :                 __field(xfs_btnum_t, btnum)
    1914             :                 __field(xfs_agblock_t, bno)
    1915             :                 __field(xfs_extlen_t, len)
    1916             :                 __field(xfs_extlen_t, diff)
    1917             :                 __field(bool, new)
    1918             :         ),
    1919             :         TP_fast_assign(
    1920             :                 __entry->dev = mp->m_super->s_dev;
    1921             :                 __entry->btnum = btnum;
    1922             :                 __entry->bno = bno;
    1923             :                 __entry->len = len;
    1924             :                 __entry->diff = diff;
    1925             :                 __entry->new = new;
    1926             :         ),
    1927             :         TP_printk("dev %d:%d btree %s agbno 0x%x fsbcount 0x%x diff 0x%x new %d",
    1928             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1929             :                   __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
    1930             :                   __entry->bno, __entry->len, __entry->diff, __entry->new)
    1931             : )
    1932             : 
    1933           0 : DECLARE_EVENT_CLASS(xfs_da_class,
    1934             :         TP_PROTO(struct xfs_da_args *args),
    1935             :         TP_ARGS(args),
    1936             :         TP_STRUCT__entry(
    1937             :                 __field(dev_t, dev)
    1938             :                 __field(xfs_ino_t, ino)
    1939             :                 __dynamic_array(char, name, args->namelen)
    1940             :                 __field(int, namelen)
    1941             :                 __field(xfs_dahash_t, hashval)
    1942             :                 __field(xfs_ino_t, inumber)
    1943             :                 __field(uint32_t, op_flags)
    1944             :                 __field(xfs_ino_t, owner)
    1945             :         ),
    1946             :         TP_fast_assign(
    1947             :                 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
    1948             :                 __entry->ino = args->dp->i_ino;
    1949             :                 if (args->namelen)
    1950             :                         memcpy(__get_str(name), args->name, args->namelen);
    1951             :                 __entry->namelen = args->namelen;
    1952             :                 __entry->hashval = args->hashval;
    1953             :                 __entry->inumber = args->inumber;
    1954             :                 __entry->op_flags = args->op_flags;
    1955             :                 __entry->owner = args->owner;
    1956             :         ),
    1957             :         TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
    1958             :                   "inumber 0x%llx op_flags %s owner 0x%llx",
    1959             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    1960             :                   __entry->ino,
    1961             :                   __entry->namelen,
    1962             :                   __entry->namelen ? __get_str(name) : NULL,
    1963             :                   __entry->namelen,
    1964             :                   __entry->hashval,
    1965             :                   __entry->inumber,
    1966             :                   __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
    1967             :                   __entry->owner)
    1968             : )
    1969             : 
    1970             : #define DEFINE_DIR2_EVENT(name) \
    1971             : DEFINE_EVENT(xfs_da_class, name, \
    1972             :         TP_PROTO(struct xfs_da_args *args), \
    1973             :         TP_ARGS(args))
    1974    80612916 : DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
    1975    12384108 : DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
    1976   460267635 : DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
    1977    46842565 : DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
    1978    40020463 : DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
    1979           0 : DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
    1980           0 : DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
    1981      524230 : DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
    1982     7553044 : DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
    1983    32021534 : DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
    1984     1403219 : DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
    1985     4094558 : DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
    1986      369558 : DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
    1987       26983 : DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
    1988    12587894 : DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
    1989    31629466 : DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
    1990      612003 : DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
    1991    11075404 : DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
    1992    11091086 : DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
    1993        9942 : DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
    1994    44518250 : DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
    1995   146460398 : DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
    1996      732345 : DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
    1997    39905589 : DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
    1998       52184 : DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
    1999             : 
    2000           0 : DECLARE_EVENT_CLASS(xfs_attr_class,
    2001             :         TP_PROTO(struct xfs_da_args *args),
    2002             :         TP_ARGS(args),
    2003             :         TP_STRUCT__entry(
    2004             :                 __field(dev_t, dev)
    2005             :                 __field(xfs_ino_t, ino)
    2006             :                 __dynamic_array(char, name, args->namelen)
    2007             :                 __field(int, namelen)
    2008             :                 __field(int, valuelen)
    2009             :                 __field(xfs_dahash_t, hashval)
    2010             :                 __field(unsigned int, attr_filter)
    2011             :                 __field(unsigned int, attr_flags)
    2012             :                 __field(uint32_t, op_flags)
    2013             :         ),
    2014             :         TP_fast_assign(
    2015             :                 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
    2016             :                 __entry->ino = args->dp->i_ino;
    2017             :                 if (args->namelen)
    2018             :                         memcpy(__get_str(name), args->name, args->namelen);
    2019             :                 __entry->namelen = args->namelen;
    2020             :                 __entry->valuelen = args->valuelen;
    2021             :                 __entry->hashval = args->hashval;
    2022             :                 __entry->attr_filter = args->attr_filter;
    2023             :                 __entry->attr_flags = args->attr_flags;
    2024             :                 __entry->op_flags = args->op_flags;
    2025             :         ),
    2026             :         TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
    2027             :                   "hashval 0x%x filter %s flags %s op_flags %s",
    2028             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2029             :                   __entry->ino,
    2030             :                   __entry->namelen,
    2031             :                   __entry->namelen ? __get_str(name) : NULL,
    2032             :                   __entry->namelen,
    2033             :                   __entry->valuelen,
    2034             :                   __entry->hashval,
    2035             :                   __print_flags(__entry->attr_filter, "|",
    2036             :                                 XFS_ATTR_FILTER_FLAGS),
    2037             :                    __print_flags(__entry->attr_flags, "|",
    2038             :                                 { XATTR_CREATE,         "CREATE" },
    2039             :                                 { XATTR_REPLACE,        "REPLACE" }),
    2040             :                   __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
    2041             : )
    2042             : 
    2043             : #define DEFINE_ATTR_EVENT(name) \
    2044             : DEFINE_EVENT(xfs_attr_class, name, \
    2045             :         TP_PROTO(struct xfs_da_args *args), \
    2046             :         TP_ARGS(args))
    2047   208531906 : DEFINE_ATTR_EVENT(xfs_attr_sf_add);
    2048   199831386 : DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
    2049   101056748 : DEFINE_ATTR_EVENT(xfs_attr_sf_create);
    2050   199742170 : DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
    2051   130378925 : DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
    2052     4682633 : DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
    2053             : 
    2054   103605384 : DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
    2055       22935 : DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
    2056      120383 : DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
    2057   103408150 : DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
    2058     4821417 : DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
    2059      323802 : DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
    2060    17109569 : DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
    2061   751852007 : DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
    2062    17561346 : DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
    2063    48952554 : DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
    2064    30337383 : DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
    2065      143317 : DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
    2066           0 : DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
    2067           0 : DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
    2068        2953 : DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
    2069      688939 : DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
    2070    17910441 : DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
    2071     2470349 : DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
    2072       41036 : DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
    2073      143319 : DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
    2074        1701 : DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
    2075     1044633 : DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
    2076             : 
    2077     2160727 : DEFINE_ATTR_EVENT(xfs_attr_node_addname);
    2078      683471 : DEFINE_ATTR_EVENT(xfs_attr_node_get);
    2079      358110 : DEFINE_ATTR_EVENT(xfs_attr_node_replace);
    2080           0 : DEFINE_ATTR_EVENT(xfs_attr_node_removename);
    2081             : 
    2082           0 : DEFINE_ATTR_EVENT(xfs_attr_fillstate);
    2083           0 : DEFINE_ATTR_EVENT(xfs_attr_refillstate);
    2084             : 
    2085        1282 : DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
    2086           0 : DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
    2087             : 
    2088             : #define DEFINE_DA_EVENT(name) \
    2089             : DEFINE_EVENT(xfs_da_class, name, \
    2090             :         TP_PROTO(struct xfs_da_args *args), \
    2091             :         TP_ARGS(args))
    2092      222170 : DEFINE_DA_EVENT(xfs_da_split);
    2093     3853855 : DEFINE_DA_EVENT(xfs_da_join);
    2094           0 : DEFINE_DA_EVENT(xfs_da_link_before);
    2095      222660 : DEFINE_DA_EVENT(xfs_da_link_after);
    2096       18984 : DEFINE_DA_EVENT(xfs_da_unlink_back);
    2097       41341 : DEFINE_DA_EVENT(xfs_da_unlink_forward);
    2098        9767 : DEFINE_DA_EVENT(xfs_da_root_split);
    2099       48705 : DEFINE_DA_EVENT(xfs_da_root_join);
    2100      212895 : DEFINE_DA_EVENT(xfs_da_node_add);
    2101       51293 : DEFINE_DA_EVENT(xfs_da_node_create);
    2102      212895 : DEFINE_DA_EVENT(xfs_da_node_split);
    2103       60325 : DEFINE_DA_EVENT(xfs_da_node_remove);
    2104         500 : DEFINE_DA_EVENT(xfs_da_node_rebalance);
    2105          40 : DEFINE_DA_EVENT(xfs_da_node_unbalance);
    2106       11620 : DEFINE_DA_EVENT(xfs_da_node_toosmall);
    2107           0 : DEFINE_DA_EVENT(xfs_da_swap_lastblock);
    2108     4983110 : DEFINE_DA_EVENT(xfs_da_grow_inode);
    2109     2558903 : DEFINE_DA_EVENT(xfs_da_shrink_inode);
    2110    87950331 : DEFINE_DA_EVENT(xfs_da_fixhashpath);
    2111   482919624 : DEFINE_DA_EVENT(xfs_da_path_shift);
    2112             : 
    2113           0 : DECLARE_EVENT_CLASS(xfs_dir2_space_class,
    2114             :         TP_PROTO(struct xfs_da_args *args, int idx),
    2115             :         TP_ARGS(args, idx),
    2116             :         TP_STRUCT__entry(
    2117             :                 __field(dev_t, dev)
    2118             :                 __field(xfs_ino_t, ino)
    2119             :                 __field(uint32_t, op_flags)
    2120             :                 __field(int, idx)
    2121             :         ),
    2122             :         TP_fast_assign(
    2123             :                 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
    2124             :                 __entry->ino = args->dp->i_ino;
    2125             :                 __entry->op_flags = args->op_flags;
    2126             :                 __entry->idx = idx;
    2127             :         ),
    2128             :         TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
    2129             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2130             :                   __entry->ino,
    2131             :                   __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
    2132             :                   __entry->idx)
    2133             : )
    2134             : 
    2135             : #define DEFINE_DIR2_SPACE_EVENT(name) \
    2136             : DEFINE_EVENT(xfs_dir2_space_class, name, \
    2137             :         TP_PROTO(struct xfs_da_args *args, int idx), \
    2138             :         TP_ARGS(args, idx))
    2139    44648824 : DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
    2140    39919579 : DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
    2141      724865 : DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
    2142      494697 : DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
    2143             : 
    2144      137425 : TRACE_EVENT(xfs_dir2_leafn_moveents,
    2145             :         TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
    2146             :         TP_ARGS(args, src_idx, dst_idx, count),
    2147             :         TP_STRUCT__entry(
    2148             :                 __field(dev_t, dev)
    2149             :                 __field(xfs_ino_t, ino)
    2150             :                 __field(uint32_t, op_flags)
    2151             :                 __field(int, src_idx)
    2152             :                 __field(int, dst_idx)
    2153             :                 __field(int, count)
    2154             :         ),
    2155             :         TP_fast_assign(
    2156             :                 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
    2157             :                 __entry->ino = args->dp->i_ino;
    2158             :                 __entry->op_flags = args->op_flags;
    2159             :                 __entry->src_idx = src_idx;
    2160             :                 __entry->dst_idx = dst_idx;
    2161             :                 __entry->count = count;
    2162             :         ),
    2163             :         TP_printk("dev %d:%d ino 0x%llx op_flags %s "
    2164             :                   "src_idx %d dst_idx %d count %d",
    2165             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2166             :                   __entry->ino,
    2167             :                   __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
    2168             :                   __entry->src_idx,
    2169             :                   __entry->dst_idx,
    2170             :                   __entry->count)
    2171             : );
    2172             : 
    2173             : #define XFS_SWAP_EXT_INODES \
    2174             :         { 0,    "target" }, \
    2175             :         { 1,    "temp" }
    2176             : 
    2177             : TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
    2178             : TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
    2179             : TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
    2180             : TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
    2181             : TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
    2182             : 
    2183           0 : DECLARE_EVENT_CLASS(xfs_swap_extent_class,
    2184             :         TP_PROTO(struct xfs_inode *ip, int which),
    2185             :         TP_ARGS(ip, which),
    2186             :         TP_STRUCT__entry(
    2187             :                 __field(dev_t, dev)
    2188             :                 __field(int, which)
    2189             :                 __field(xfs_ino_t, ino)
    2190             :                 __field(int, format)
    2191             :                 __field(xfs_extnum_t, nex)
    2192             :                 __field(int, broot_size)
    2193             :                 __field(int, fork_off)
    2194             :         ),
    2195             :         TP_fast_assign(
    2196             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    2197             :                 __entry->which = which;
    2198             :                 __entry->ino = ip->i_ino;
    2199             :                 __entry->format = ip->i_df.if_format;
    2200             :                 __entry->nex = ip->i_df.if_nextents;
    2201             :                 __entry->broot_size = ip->i_df.if_broot_bytes;
    2202             :                 __entry->fork_off = xfs_inode_fork_boff(ip);
    2203             :         ),
    2204             :         TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %llu, "
    2205             :                   "broot size %d, forkoff 0x%x",
    2206             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2207             :                   __entry->ino,
    2208             :                   __print_symbolic(__entry->which, XFS_SWAP_EXT_INODES),
    2209             :                   __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
    2210             :                   __entry->nex,
    2211             :                   __entry->broot_size,
    2212             :                   __entry->fork_off)
    2213             : )
    2214             : 
    2215             : #define DEFINE_SWAPEXT_EVENT(name) \
    2216             : DEFINE_EVENT(xfs_swap_extent_class, name, \
    2217             :         TP_PROTO(struct xfs_inode *ip, int which), \
    2218             :         TP_ARGS(ip, which))
    2219             : 
    2220     2484919 : DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
    2221     2483792 : DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
    2222             : 
    2223       13813 : TRACE_EVENT(xfs_log_recover,
    2224             :         TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
    2225             :         TP_ARGS(log, headblk, tailblk),
    2226             :         TP_STRUCT__entry(
    2227             :                 __field(dev_t, dev)
    2228             :                 __field(xfs_daddr_t, headblk)
    2229             :                 __field(xfs_daddr_t, tailblk)
    2230             :         ),
    2231             :         TP_fast_assign(
    2232             :                 __entry->dev = log->l_mp->m_super->s_dev;
    2233             :                 __entry->headblk = headblk;
    2234             :                 __entry->tailblk = tailblk;
    2235             :         ),
    2236             :         TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
    2237             :                   MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
    2238             :                   __entry->tailblk)
    2239             : )
    2240             : 
    2241     3217774 : TRACE_EVENT(xfs_log_recover_record,
    2242             :         TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
    2243             :         TP_ARGS(log, rhead, pass),
    2244             :         TP_STRUCT__entry(
    2245             :                 __field(dev_t, dev)
    2246             :                 __field(xfs_lsn_t, lsn)
    2247             :                 __field(int, len)
    2248             :                 __field(int, num_logops)
    2249             :                 __field(int, pass)
    2250             :         ),
    2251             :         TP_fast_assign(
    2252             :                 __entry->dev = log->l_mp->m_super->s_dev;
    2253             :                 __entry->lsn = be64_to_cpu(rhead->h_lsn);
    2254             :                 __entry->len = be32_to_cpu(rhead->h_len);
    2255             :                 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
    2256             :                 __entry->pass = pass;
    2257             :         ),
    2258             :         TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
    2259             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2260             :                   __entry->lsn, __entry->len, __entry->num_logops,
    2261             :                    __entry->pass)
    2262             : )
    2263             : 
    2264           0 : DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
    2265             :         TP_PROTO(struct xlog *log, struct xlog_recover *trans,
    2266             :                 struct xlog_recover_item *item, int pass),
    2267             :         TP_ARGS(log, trans, item, pass),
    2268             :         TP_STRUCT__entry(
    2269             :                 __field(dev_t, dev)
    2270             :                 __field(unsigned long, item)
    2271             :                 __field(xlog_tid_t, tid)
    2272             :                 __field(xfs_lsn_t, lsn)
    2273             :                 __field(int, type)
    2274             :                 __field(int, pass)
    2275             :                 __field(int, count)
    2276             :                 __field(int, total)
    2277             :         ),
    2278             :         TP_fast_assign(
    2279             :                 __entry->dev = log->l_mp->m_super->s_dev;
    2280             :                 __entry->item = (unsigned long)item;
    2281             :                 __entry->tid = trans->r_log_tid;
    2282             :                 __entry->lsn = trans->r_lsn;
    2283             :                 __entry->type = ITEM_TYPE(item);
    2284             :                 __entry->pass = pass;
    2285             :                 __entry->count = item->ri_cnt;
    2286             :                 __entry->total = item->ri_total;
    2287             :         ),
    2288             :         TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
    2289             :                   "item type %s item region count/total %d/%d",
    2290             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2291             :                   __entry->tid,
    2292             :                   __entry->lsn,
    2293             :                   __entry->pass,
    2294             :                   (void *)__entry->item,
    2295             :                   __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
    2296             :                   __entry->count,
    2297             :                   __entry->total)
    2298             : )
    2299             : 
    2300             : #define DEFINE_LOG_RECOVER_ITEM(name) \
    2301             : DEFINE_EVENT(xfs_log_recover_item_class, name, \
    2302             :         TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
    2303             :                 struct xlog_recover_item *item, int pass), \
    2304             :         TP_ARGS(log, trans, item, pass))
    2305             : 
    2306   172265974 : DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
    2307     2225692 : DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
    2308      750888 : DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
    2309    33552342 : DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
    2310   100867359 : DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
    2311             : 
    2312           0 : DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
    2313             :         TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
    2314             :         TP_ARGS(log, buf_f),
    2315             :         TP_STRUCT__entry(
    2316             :                 __field(dev_t, dev)
    2317             :                 __field(int64_t, blkno)
    2318             :                 __field(unsigned short, len)
    2319             :                 __field(unsigned short, flags)
    2320             :                 __field(unsigned short, size)
    2321             :                 __field(unsigned int, map_size)
    2322             :         ),
    2323             :         TP_fast_assign(
    2324             :                 __entry->dev = log->l_mp->m_super->s_dev;
    2325             :                 __entry->blkno = buf_f->blf_blkno;
    2326             :                 __entry->len = buf_f->blf_len;
    2327             :                 __entry->flags = buf_f->blf_flags;
    2328             :                 __entry->size = buf_f->blf_size;
    2329             :                 __entry->map_size = buf_f->blf_map_size;
    2330             :         ),
    2331             :         TP_printk("dev %d:%d daddr 0x%llx, bbcount 0x%x, flags 0x%x, size %d, "
    2332             :                         "map_size %d",
    2333             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2334             :                   __entry->blkno,
    2335             :                   __entry->len,
    2336             :                   __entry->flags,
    2337             :                   __entry->size,
    2338             :                   __entry->map_size)
    2339             : )
    2340             : 
    2341             : #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
    2342             : DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
    2343             :         TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
    2344             :         TP_ARGS(log, buf_f))
    2345             : 
    2346    16441998 : DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
    2347      780564 : DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
    2348      316135 : DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
    2349       59309 : DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
    2350    16036878 : DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
    2351       24254 : DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
    2352       33689 : DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
    2353    15978935 : DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
    2354      342537 : DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
    2355             : 
    2356           0 : DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
    2357             :         TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
    2358             :         TP_ARGS(log, in_f),
    2359             :         TP_STRUCT__entry(
    2360             :                 __field(dev_t, dev)
    2361             :                 __field(xfs_ino_t, ino)
    2362             :                 __field(unsigned short, size)
    2363             :                 __field(int, fields)
    2364             :                 __field(unsigned short, asize)
    2365             :                 __field(unsigned short, dsize)
    2366             :                 __field(int64_t, blkno)
    2367             :                 __field(int, len)
    2368             :                 __field(int, boffset)
    2369             :         ),
    2370             :         TP_fast_assign(
    2371             :                 __entry->dev = log->l_mp->m_super->s_dev;
    2372             :                 __entry->ino = in_f->ilf_ino;
    2373             :                 __entry->size = in_f->ilf_size;
    2374             :                 __entry->fields = in_f->ilf_fields;
    2375             :                 __entry->asize = in_f->ilf_asize;
    2376             :                 __entry->dsize = in_f->ilf_dsize;
    2377             :                 __entry->blkno = in_f->ilf_blkno;
    2378             :                 __entry->len = in_f->ilf_len;
    2379             :                 __entry->boffset = in_f->ilf_boffset;
    2380             :         ),
    2381             :         TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
    2382             :                         "dsize %d, daddr 0x%llx, bbcount 0x%x, boffset %d",
    2383             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2384             :                   __entry->ino,
    2385             :                   __entry->size,
    2386             :                   __entry->fields,
    2387             :                   __entry->asize,
    2388             :                   __entry->dsize,
    2389             :                   __entry->blkno,
    2390             :                   __entry->len,
    2391             :                   __entry->boffset)
    2392             : )
    2393             : #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
    2394             : DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
    2395             :         TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
    2396             :         TP_ARGS(log, in_f))
    2397             : 
    2398     8761693 : DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
    2399      232179 : DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
    2400       31560 : DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
    2401             : 
    2402           0 : DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
    2403             :         TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
    2404             :         TP_ARGS(log, in_f),
    2405             :         TP_STRUCT__entry(
    2406             :                 __field(dev_t, dev)
    2407             :                 __field(xfs_agnumber_t, agno)
    2408             :                 __field(xfs_agblock_t, agbno)
    2409             :                 __field(unsigned int, count)
    2410             :                 __field(unsigned int, isize)
    2411             :                 __field(xfs_agblock_t, length)
    2412             :                 __field(unsigned int, gen)
    2413             :         ),
    2414             :         TP_fast_assign(
    2415             :                 __entry->dev = log->l_mp->m_super->s_dev;
    2416             :                 __entry->agno = be32_to_cpu(in_f->icl_ag);
    2417             :                 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
    2418             :                 __entry->count = be32_to_cpu(in_f->icl_count);
    2419             :                 __entry->isize = be32_to_cpu(in_f->icl_isize);
    2420             :                 __entry->length = be32_to_cpu(in_f->icl_length);
    2421             :                 __entry->gen = be32_to_cpu(in_f->icl_gen);
    2422             :         ),
    2423             :         TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x ireccount %u isize %u gen 0x%x",
    2424             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2425             :                   __entry->agno,
    2426             :                   __entry->agbno,
    2427             :                   __entry->length,
    2428             :                   __entry->count,
    2429             :                   __entry->isize,
    2430             :                   __entry->gen)
    2431             : )
    2432             : #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
    2433             : DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
    2434             :         TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
    2435             :         TP_ARGS(log, in_f))
    2436             : 
    2437          70 : DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
    2438       28770 : DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
    2439             : 
    2440           0 : DECLARE_EVENT_CLASS(xfs_discard_class,
    2441             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    2442             :                  xfs_agblock_t agbno, xfs_extlen_t len),
    2443             :         TP_ARGS(mp, agno, agbno, len),
    2444             :         TP_STRUCT__entry(
    2445             :                 __field(dev_t, dev)
    2446             :                 __field(xfs_agnumber_t, agno)
    2447             :                 __field(xfs_agblock_t, agbno)
    2448             :                 __field(xfs_extlen_t, len)
    2449             :         ),
    2450             :         TP_fast_assign(
    2451             :                 __entry->dev = mp->m_super->s_dev;
    2452             :                 __entry->agno = agno;
    2453             :                 __entry->agbno = agbno;
    2454             :                 __entry->len = len;
    2455             :         ),
    2456             :         TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
    2457             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2458             :                   __entry->agno,
    2459             :                   __entry->agbno,
    2460             :                   __entry->len)
    2461             : )
    2462             : 
    2463             : #define DEFINE_DISCARD_EVENT(name) \
    2464             : DEFINE_EVENT(xfs_discard_class, name, \
    2465             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    2466             :                  xfs_agblock_t agbno, xfs_extlen_t len), \
    2467             :         TP_ARGS(mp, agno, agbno, len))
    2468     1182745 : DEFINE_DISCARD_EVENT(xfs_discard_extent);
    2469    28307559 : DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
    2470           0 : DEFINE_DISCARD_EVENT(xfs_discard_exclude);
    2471         551 : DEFINE_DISCARD_EVENT(xfs_discard_busy);
    2472        1565 : DEFINE_DISCARD_EVENT(xfs_discard_relax);
    2473             : 
    2474             : /* btree cursor events */
    2475             : TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
    2476             : TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
    2477             : TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
    2478             : TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
    2479             : TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
    2480             : TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
    2481             : TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
    2482             : TRACE_DEFINE_ENUM(XFS_BTNUM_RCBAGi);
    2483             : 
    2484           0 : DECLARE_EVENT_CLASS(xfs_btree_cur_class,
    2485             :         TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
    2486             :         TP_ARGS(cur, level, bp),
    2487             :         TP_STRUCT__entry(
    2488             :                 __field(dev_t, dev)
    2489             :                 __field(xfs_btnum_t, btnum)
    2490             :                 __field(int, level)
    2491             :                 __field(int, nlevels)
    2492             :                 __field(int, ptr)
    2493             :                 __field(xfs_daddr_t, daddr)
    2494             :         ),
    2495             :         TP_fast_assign(
    2496             :                 __entry->dev = cur->bc_mp->m_super->s_dev;
    2497             :                 __entry->btnum = cur->bc_btnum;
    2498             :                 __entry->level = level;
    2499             :                 __entry->nlevels = cur->bc_nlevels;
    2500             :                 __entry->ptr = cur->bc_levels[level].ptr;
    2501             :                 __entry->daddr = bp ? xfs_buf_daddr(bp) : -1;
    2502             :         ),
    2503             :         TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
    2504             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2505             :                   __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
    2506             :                   __entry->level,
    2507             :                   __entry->nlevels,
    2508             :                   __entry->ptr,
    2509             :                   (unsigned long long)__entry->daddr)
    2510             : )
    2511             : 
    2512             : #define DEFINE_BTREE_CUR_EVENT(name) \
    2513             : DEFINE_EVENT(xfs_btree_cur_class, name, \
    2514             :         TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
    2515             :         TP_ARGS(cur, level, bp))
    2516  1542127572 : DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
    2517  2973883524 : DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
    2518             : 
    2519     1849735 : TRACE_EVENT(xfs_btree_alloc_block,
    2520             :         TP_PROTO(struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr, int stat,
    2521             :                  int error),
    2522             :         TP_ARGS(cur, ptr, stat, error),
    2523             :         TP_STRUCT__entry(
    2524             :                 __field(dev_t, dev)
    2525             :                 __field(xfs_agnumber_t, agno)
    2526             :                 __field(xfs_ino_t, ino)
    2527             :                 __field(xfs_btnum_t, btnum)
    2528             :                 __field(int, error)
    2529             :                 __field(xfs_agblock_t, agbno)
    2530             :         ),
    2531             :         TP_fast_assign(
    2532             :                 __entry->dev = cur->bc_mp->m_super->s_dev;
    2533             :                 if (cur->bc_flags & XFS_BTREE_IN_XFILE) {
    2534             :                         __entry->agno = 0;
    2535             :                         __entry->ino = 0;
    2536             :                 } else if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) {
    2537             :                         __entry->agno = 0;
    2538             :                         __entry->ino = cur->bc_ino.ip->i_ino;
    2539             :                 } else {
    2540             :                         __entry->agno = cur->bc_ag.pag->pag_agno;
    2541             :                         __entry->ino = 0;
    2542             :                 }
    2543             :                 __entry->btnum = cur->bc_btnum;
    2544             :                 __entry->error = error;
    2545             :                 if (!error && stat) {
    2546             :                         if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
    2547             :                                 xfs_fsblock_t   fsb = be64_to_cpu(ptr->l);
    2548             : 
    2549             :                                 __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp,
    2550             :                                                                 fsb);
    2551             :                                 __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp,
    2552             :                                                                 fsb);
    2553             :                         } else {
    2554             :                                 __entry->agbno = be32_to_cpu(ptr->s);
    2555             :                         }
    2556             :                 } else {
    2557             :                         __entry->agbno = NULLAGBLOCK;
    2558             :                 }
    2559             :         ),
    2560             :         TP_printk("dev %d:%d btree %s agno 0x%x ino 0x%llx agbno 0x%x error %d",
    2561             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2562             :                   __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
    2563             :                   __entry->agno,
    2564             :                   __entry->ino,
    2565             :                   __entry->agbno,
    2566             :                   __entry->error)
    2567             : );
    2568             : 
    2569      539377 : TRACE_EVENT(xfs_btree_free_block,
    2570             :         TP_PROTO(struct xfs_btree_cur *cur, struct xfs_buf *bp),
    2571             :         TP_ARGS(cur, bp),
    2572             :         TP_STRUCT__entry(
    2573             :                 __field(dev_t, dev)
    2574             :                 __field(xfs_agnumber_t, agno)
    2575             :                 __field(xfs_ino_t, ino)
    2576             :                 __field(xfs_btnum_t, btnum)
    2577             :                 __field(xfs_agblock_t, agbno)
    2578             :         ),
    2579             :         TP_fast_assign(
    2580             :                 __entry->dev = cur->bc_mp->m_super->s_dev;
    2581             :                 __entry->agno = xfs_daddr_to_agno(cur->bc_mp,
    2582             :                                                         xfs_buf_daddr(bp));
    2583             :                 if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE)
    2584             :                         __entry->ino = cur->bc_ino.ip->i_ino;
    2585             :                 else
    2586             :                         __entry->ino = 0;
    2587             :                 __entry->btnum = cur->bc_btnum;
    2588             :                 __entry->agbno = xfs_daddr_to_agbno(cur->bc_mp,
    2589             :                                                         xfs_buf_daddr(bp));
    2590             :         ),
    2591             :         TP_printk("dev %d:%d btree %s agno 0x%x ino 0x%llx agbno 0x%x",
    2592             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2593             :                   __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
    2594             :                   __entry->agno,
    2595             :                   __entry->ino,
    2596             :                   __entry->agbno)
    2597             : );
    2598             : 
    2599             : /* deferred ops */
    2600             : struct xfs_defer_pending;
    2601             : 
    2602   598753169 : TRACE_EVENT(xfs_defer_stats,
    2603             :         TP_PROTO(struct xfs_trans *tp),
    2604             :         TP_ARGS(tp),
    2605             :         TP_STRUCT__entry(
    2606             :                 __field(dev_t, dev)
    2607             :                 __field(unsigned int, max)
    2608             :                 __field(unsigned int, finished)
    2609             :         ),
    2610             :         TP_fast_assign(
    2611             :                 __entry->dev = tp->t_mountp->m_super->s_dev;
    2612             :                 __entry->max = tp->t_dfops_nr_max;
    2613             :                 __entry->finished = tp->t_dfops_finished;
    2614             :         ),
    2615             :         TP_printk("dev %d:%d max %u finished %u",
    2616             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2617             :                   __entry->max,
    2618             :                   __entry->finished)
    2619             : )
    2620             : 
    2621           0 : DECLARE_EVENT_CLASS(xfs_defer_class,
    2622             :         TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
    2623             :         TP_ARGS(tp, caller_ip),
    2624             :         TP_STRUCT__entry(
    2625             :                 __field(dev_t, dev)
    2626             :                 __field(struct xfs_trans *, tp)
    2627             :                 __field(char, committed)
    2628             :                 __field(unsigned long, caller_ip)
    2629             :         ),
    2630             :         TP_fast_assign(
    2631             :                 __entry->dev = tp->t_mountp->m_super->s_dev;
    2632             :                 __entry->tp = tp;
    2633             :                 __entry->caller_ip = caller_ip;
    2634             :         ),
    2635             :         TP_printk("dev %d:%d tp %p caller %pS",
    2636             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2637             :                   __entry->tp,
    2638             :                   (char *)__entry->caller_ip)
    2639             : )
    2640             : #define DEFINE_DEFER_EVENT(name) \
    2641             : DEFINE_EVENT(xfs_defer_class, name, \
    2642             :         TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
    2643             :         TP_ARGS(tp, caller_ip))
    2644             : 
    2645           0 : DECLARE_EVENT_CLASS(xfs_defer_error_class,
    2646             :         TP_PROTO(struct xfs_trans *tp, int error),
    2647             :         TP_ARGS(tp, error),
    2648             :         TP_STRUCT__entry(
    2649             :                 __field(dev_t, dev)
    2650             :                 __field(struct xfs_trans *, tp)
    2651             :                 __field(char, committed)
    2652             :                 __field(int, error)
    2653             :         ),
    2654             :         TP_fast_assign(
    2655             :                 __entry->dev = tp->t_mountp->m_super->s_dev;
    2656             :                 __entry->tp = tp;
    2657             :                 __entry->error = error;
    2658             :         ),
    2659             :         TP_printk("dev %d:%d tp %p err %d",
    2660             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2661             :                   __entry->tp,
    2662             :                   __entry->error)
    2663             : )
    2664             : #define DEFINE_DEFER_ERROR_EVENT(name) \
    2665             : DEFINE_EVENT(xfs_defer_error_class, name, \
    2666             :         TP_PROTO(struct xfs_trans *tp, int error), \
    2667             :         TP_ARGS(tp, error))
    2668             : 
    2669           0 : DECLARE_EVENT_CLASS(xfs_defer_pending_class,
    2670             :         TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
    2671             :         TP_ARGS(mp, dfp),
    2672             :         TP_STRUCT__entry(
    2673             :                 __field(dev_t, dev)
    2674             :                 __field(int, type)
    2675             :                 __field(void *, intent)
    2676             :                 __field(char, committed)
    2677             :                 __field(int, nr)
    2678             :         ),
    2679             :         TP_fast_assign(
    2680             :                 __entry->dev = mp ? mp->m_super->s_dev : 0;
    2681             :                 __entry->type = dfp->dfp_type;
    2682             :                 __entry->intent = dfp->dfp_intent;
    2683             :                 __entry->committed = dfp->dfp_done != NULL;
    2684             :                 __entry->nr = dfp->dfp_count;
    2685             :         ),
    2686             :         TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
    2687             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2688             :                   __entry->type,
    2689             :                   __entry->intent,
    2690             :                   __entry->committed,
    2691             :                   __entry->nr)
    2692             : )
    2693             : #define DEFINE_DEFER_PENDING_EVENT(name) \
    2694             : DEFINE_EVENT(xfs_defer_pending_class, name, \
    2695             :         TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
    2696             :         TP_ARGS(mp, dfp))
    2697             : 
    2698        5120 : DEFINE_DEFER_EVENT(xfs_defer_cancel);
    2699  1318638830 : DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
    2700        4775 : DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
    2701  1191937311 : DEFINE_DEFER_EVENT(xfs_defer_finish);
    2702  1192275456 : DEFINE_DEFER_EVENT(xfs_defer_finish_done);
    2703             : 
    2704         234 : DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
    2705        4776 : DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
    2706             : 
    2707  1187599558 : DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
    2708        8152 : DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
    2709  1290850919 : DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
    2710        7799 : DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
    2711       72869 : DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent);
    2712             : 
    2713           0 : DECLARE_EVENT_CLASS(xfs_free_extent_deferred_class,
    2714             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    2715             :                  int type, xfs_agblock_t agbno, xfs_extlen_t len),
    2716             :         TP_ARGS(mp, agno, type, agbno, len),
    2717             :         TP_STRUCT__entry(
    2718             :                 __field(dev_t, dev)
    2719             :                 __field(xfs_agnumber_t, agno)
    2720             :                 __field(int, type)
    2721             :                 __field(xfs_agblock_t, agbno)
    2722             :                 __field(xfs_extlen_t, len)
    2723             :         ),
    2724             :         TP_fast_assign(
    2725             :                 __entry->dev = mp->m_super->s_dev;
    2726             :                 __entry->agno = agno;
    2727             :                 __entry->type = type;
    2728             :                 __entry->agbno = agbno;
    2729             :                 __entry->len = len;
    2730             :         ),
    2731             :         TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x fsbcount 0x%x",
    2732             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2733             :                   __entry->type,
    2734             :                   __entry->agno,
    2735             :                   __entry->agbno,
    2736             :                   __entry->len)
    2737             : );
    2738             : #define DEFINE_FREE_EXTENT_DEFERRED_EVENT(name) \
    2739             : DEFINE_EVENT(xfs_free_extent_deferred_class, name, \
    2740             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    2741             :                  int type, \
    2742             :                  xfs_agblock_t bno, \
    2743             :                  xfs_extlen_t len), \
    2744             :         TP_ARGS(mp, agno, type, bno, len))
    2745    98473676 : DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_bmap_free_defer);
    2746    98534724 : DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_bmap_free_deferred);
    2747      266519 : DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_agfl_free_defer);
    2748      266512 : DEFINE_FREE_EXTENT_DEFERRED_EVENT(xfs_agfl_free_deferred);
    2749             : 
    2750           0 : DECLARE_EVENT_CLASS(xfs_defer_pending_item_class,
    2751             :         TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp,
    2752             :                  void *item),
    2753             :         TP_ARGS(mp, dfp, item),
    2754             :         TP_STRUCT__entry(
    2755             :                 __field(dev_t, dev)
    2756             :                 __field(int, type)
    2757             :                 __field(void *, intent)
    2758             :                 __field(void *, item)
    2759             :                 __field(char, committed)
    2760             :                 __field(int, nr)
    2761             :         ),
    2762             :         TP_fast_assign(
    2763             :                 __entry->dev = mp ? mp->m_super->s_dev : 0;
    2764             :                 __entry->type = dfp->dfp_type;
    2765             :                 __entry->intent = dfp->dfp_intent;
    2766             :                 __entry->item = item;
    2767             :                 __entry->committed = dfp->dfp_done != NULL;
    2768             :                 __entry->nr = dfp->dfp_count;
    2769             :         ),
    2770             :         TP_printk("dev %d:%d optype %d intent %p item %p committed %d nr %d",
    2771             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2772             :                   __entry->type,
    2773             :                   __entry->intent,
    2774             :                   __entry->item,
    2775             :                   __entry->committed,
    2776             :                   __entry->nr)
    2777             : )
    2778             : #define DEFINE_DEFER_PENDING_ITEM_EVENT(name) \
    2779             : DEFINE_EVENT(xfs_defer_pending_item_class, name, \
    2780             :         TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp, \
    2781             :                  void *item), \
    2782             :         TP_ARGS(mp, dfp, item))
    2783             : 
    2784  1260699452 : DEFINE_DEFER_PENDING_ITEM_EVENT(xfs_defer_add_item);
    2785        3628 : DEFINE_DEFER_PENDING_ITEM_EVENT(xfs_defer_cancel_item);
    2786  1363522290 : DEFINE_DEFER_PENDING_ITEM_EVENT(xfs_defer_finish_item);
    2787             : 
    2788             : /* rmap tracepoints */
    2789           0 : DECLARE_EVENT_CLASS(xfs_rmap_class,
    2790             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    2791             :                  xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
    2792             :                  const struct xfs_owner_info *oinfo),
    2793             :         TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
    2794             :         TP_STRUCT__entry(
    2795             :                 __field(dev_t, dev)
    2796             :                 __field(xfs_agnumber_t, agno)
    2797             :                 __field(xfs_agblock_t, agbno)
    2798             :                 __field(xfs_extlen_t, len)
    2799             :                 __field(uint64_t, owner)
    2800             :                 __field(uint64_t, offset)
    2801             :                 __field(unsigned long, flags)
    2802             :         ),
    2803             :         TP_fast_assign(
    2804             :                 __entry->dev = mp->m_super->s_dev;
    2805             :                 __entry->agno = agno;
    2806             :                 __entry->agbno = agbno;
    2807             :                 __entry->len = len;
    2808             :                 __entry->owner = oinfo->oi_owner;
    2809             :                 __entry->offset = oinfo->oi_offset;
    2810             :                 __entry->flags = oinfo->oi_flags;
    2811             :                 if (unwritten)
    2812             :                         __entry->flags |= XFS_RMAP_UNWRITTEN;
    2813             :         ),
    2814             :         TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%lx",
    2815             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2816             :                   __entry->agno,
    2817             :                   __entry->agbno,
    2818             :                   __entry->len,
    2819             :                   __entry->owner,
    2820             :                   __entry->offset,
    2821             :                   __entry->flags)
    2822             : );
    2823             : #define DEFINE_RMAP_EVENT(name) \
    2824             : DEFINE_EVENT(xfs_rmap_class, name, \
    2825             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    2826             :                  xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
    2827             :                  const struct xfs_owner_info *oinfo), \
    2828             :         TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
    2829             : 
    2830             : /* simple AG-based error/%ip tracepoint class */
    2831           0 : DECLARE_EVENT_CLASS(xfs_ag_error_class,
    2832             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
    2833             :                  unsigned long caller_ip),
    2834             :         TP_ARGS(mp, agno, error, caller_ip),
    2835             :         TP_STRUCT__entry(
    2836             :                 __field(dev_t, dev)
    2837             :                 __field(xfs_agnumber_t, agno)
    2838             :                 __field(int, error)
    2839             :                 __field(unsigned long, caller_ip)
    2840             :         ),
    2841             :         TP_fast_assign(
    2842             :                 __entry->dev = mp->m_super->s_dev;
    2843             :                 __entry->agno = agno;
    2844             :                 __entry->error = error;
    2845             :                 __entry->caller_ip = caller_ip;
    2846             :         ),
    2847             :         TP_printk("dev %d:%d agno 0x%x error %d caller %pS",
    2848             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2849             :                   __entry->agno,
    2850             :                   __entry->error,
    2851             :                   (char *)__entry->caller_ip)
    2852             : );
    2853             : 
    2854             : #define DEFINE_AG_ERROR_EVENT(name) \
    2855             : DEFINE_EVENT(xfs_ag_error_class, name, \
    2856             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
    2857             :                  unsigned long caller_ip), \
    2858             :         TP_ARGS(mp, agno, error, caller_ip))
    2859             : 
    2860   214932248 : DEFINE_RMAP_EVENT(xfs_rmap_unmap);
    2861   214928704 : DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
    2862         379 : DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
    2863   283239006 : DEFINE_RMAP_EVENT(xfs_rmap_map);
    2864   283240994 : DEFINE_RMAP_EVENT(xfs_rmap_map_done);
    2865        1384 : DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
    2866    31837860 : DEFINE_RMAP_EVENT(xfs_rmap_convert);
    2867    31837921 : DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
    2868           2 : DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
    2869    31837916 : DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
    2870             : 
    2871           0 : DECLARE_EVENT_CLASS(xfs_rmapbt_class,
    2872             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    2873             :                  xfs_agblock_t agbno, xfs_extlen_t len,
    2874             :                  uint64_t owner, uint64_t offset, unsigned int flags),
    2875             :         TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
    2876             :         TP_STRUCT__entry(
    2877             :                 __field(dev_t, dev)
    2878             :                 __field(xfs_agnumber_t, agno)
    2879             :                 __field(xfs_agblock_t, agbno)
    2880             :                 __field(xfs_extlen_t, len)
    2881             :                 __field(uint64_t, owner)
    2882             :                 __field(uint64_t, offset)
    2883             :                 __field(unsigned int, flags)
    2884             :         ),
    2885             :         TP_fast_assign(
    2886             :                 __entry->dev = mp->m_super->s_dev;
    2887             :                 __entry->agno = agno;
    2888             :                 __entry->agbno = agbno;
    2889             :                 __entry->len = len;
    2890             :                 __entry->owner = owner;
    2891             :                 __entry->offset = offset;
    2892             :                 __entry->flags = flags;
    2893             :         ),
    2894             :         TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
    2895             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2896             :                   __entry->agno,
    2897             :                   __entry->agbno,
    2898             :                   __entry->len,
    2899             :                   __entry->owner,
    2900             :                   __entry->offset,
    2901             :                   __entry->flags)
    2902             : );
    2903             : #define DEFINE_RMAPBT_EVENT(name) \
    2904             : DEFINE_EVENT(xfs_rmapbt_class, name, \
    2905             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    2906             :                  xfs_agblock_t agbno, xfs_extlen_t len, \
    2907             :                  uint64_t owner, uint64_t offset, unsigned int flags), \
    2908             :         TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
    2909             : 
    2910           0 : DECLARE_EVENT_CLASS(xfs_rmap_deferred_class,
    2911             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    2912             :                  int op,
    2913             :                  xfs_agblock_t agbno,
    2914             :                  xfs_ino_t ino,
    2915             :                  int whichfork,
    2916             :                  xfs_fileoff_t offset,
    2917             :                  xfs_filblks_t len,
    2918             :                  xfs_exntst_t state),
    2919             :         TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
    2920             :         TP_STRUCT__entry(
    2921             :                 __field(dev_t, dev)
    2922             :                 __field(xfs_agnumber_t, agno)
    2923             :                 __field(xfs_ino_t, ino)
    2924             :                 __field(xfs_agblock_t, agbno)
    2925             :                 __field(int, whichfork)
    2926             :                 __field(xfs_fileoff_t, l_loff)
    2927             :                 __field(xfs_filblks_t, l_len)
    2928             :                 __field(xfs_exntst_t, l_state)
    2929             :                 __field(int, op)
    2930             :         ),
    2931             :         TP_fast_assign(
    2932             :                 __entry->dev = mp->m_super->s_dev;
    2933             :                 __entry->agno = agno;
    2934             :                 __entry->ino = ino;
    2935             :                 __entry->agbno = agbno;
    2936             :                 __entry->whichfork = whichfork;
    2937             :                 __entry->l_loff = offset;
    2938             :                 __entry->l_len = len;
    2939             :                 __entry->l_state = state;
    2940             :                 __entry->op = op;
    2941             :         ),
    2942             :         TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x owner 0x%llx %s fileoff 0x%llx fsbcount 0x%llx state %d",
    2943             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    2944             :                   __entry->op,
    2945             :                   __entry->agno,
    2946             :                   __entry->agbno,
    2947             :                   __entry->ino,
    2948             :                   __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
    2949             :                   __entry->l_loff,
    2950             :                   __entry->l_len,
    2951             :                   __entry->l_state)
    2952             : );
    2953             : #define DEFINE_RMAP_DEFERRED_EVENT(name) \
    2954             : DEFINE_EVENT(xfs_rmap_deferred_class, name, \
    2955             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    2956             :                  int op, \
    2957             :                  xfs_agblock_t agbno, \
    2958             :                  xfs_ino_t ino, \
    2959             :                  int whichfork, \
    2960             :                  xfs_fileoff_t offset, \
    2961             :                  xfs_filblks_t len, \
    2962             :                  xfs_exntst_t state), \
    2963             :         TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
    2964   470478394 : DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
    2965   470618369 : DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
    2966             : 
    2967    86203721 : DEFINE_RMAPBT_EVENT(xfs_rmap_update);
    2968   313702437 : DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
    2969   183515039 : DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
    2970         175 : DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
    2971           5 : DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
    2972           0 : DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
    2973             : 
    2974   319235739 : DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
    2975   181183401 : DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
    2976   262989068 : DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
    2977   237374329 : DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
    2978   472799986 : DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
    2979   120213332 : DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
    2980    46089659 : DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
    2981             : 
    2982             : /* deferred bmbt updates */
    2983             : TRACE_DEFINE_ENUM(XFS_BMAP_MAP);
    2984             : TRACE_DEFINE_ENUM(XFS_BMAP_UNMAP);
    2985             : 
    2986           0 : DECLARE_EVENT_CLASS(xfs_bmap_deferred_class,
    2987             :         TP_PROTO(struct xfs_bmap_intent *bi),
    2988             :         TP_ARGS(bi),
    2989             :         TP_STRUCT__entry(
    2990             :                 __field(dev_t, dev)
    2991             :                 __field(dev_t, opdev)
    2992             :                 __field(xfs_agnumber_t, agno)
    2993             :                 __field(xfs_ino_t, ino)
    2994             :                 __field(xfs_agblock_t, agbno)
    2995             :                 __field(xfs_fsblock_t, rtbno)
    2996             :                 __field(int, whichfork)
    2997             :                 __field(xfs_fileoff_t, l_loff)
    2998             :                 __field(xfs_filblks_t, l_len)
    2999             :                 __field(xfs_exntst_t, l_state)
    3000             :                 __field(int, op)
    3001             :         ),
    3002             :         TP_fast_assign(
    3003             :                 struct xfs_inode        *ip = bi->bi_owner;
    3004             : 
    3005             :                 __entry->dev = ip->i_mount->m_super->s_dev;
    3006             :                 if (xfs_ifork_is_realtime(ip, bi->bi_whichfork)) {
    3007             :                         __entry->agno = 0;
    3008             :                         __entry->agbno = 0;
    3009             :                         __entry->rtbno = bi->bi_bmap.br_startblock;
    3010             :                         __entry->opdev = ip->i_mount->m_rtdev_targp->bt_dev;
    3011             :                 } else {
    3012             :                         __entry->agno = XFS_FSB_TO_AGNO(ip->i_mount,
    3013             :                                                 bi->bi_bmap.br_startblock);
    3014             :                         __entry->agbno = XFS_FSB_TO_AGBNO(ip->i_mount,
    3015             :                                                 bi->bi_bmap.br_startblock);
    3016             :                         __entry->rtbno = 0;
    3017             :                         __entry->opdev = __entry->dev;
    3018             :                 }
    3019             :                 __entry->ino = ip->i_ino;
    3020             :                 __entry->whichfork = bi->bi_whichfork;
    3021             :                 __entry->l_loff = bi->bi_bmap.br_startoff;
    3022             :                 __entry->l_len = bi->bi_bmap.br_blockcount;
    3023             :                 __entry->l_state = bi->bi_bmap.br_state;
    3024             :                 __entry->op = bi->bi_type;
    3025             :         ),
    3026             :         TP_printk("dev %d:%d op %s opdev %d:%d ino 0x%llx agno 0x%x agbno 0x%x rtbno 0x%llx %s fileoff 0x%llx fsbcount 0x%llx state %d",
    3027             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3028             :                   __print_symbolic(__entry->op, XFS_BMAP_INTENT_STRINGS),
    3029             :                   MAJOR(__entry->opdev), MINOR(__entry->opdev),
    3030             :                   __entry->ino,
    3031             :                   __entry->agno,
    3032             :                   __entry->agbno,
    3033             :                   __entry->rtbno,
    3034             :                   __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
    3035             :                   __entry->l_loff,
    3036             :                   __entry->l_len,
    3037             :                   __entry->l_state)
    3038             : );
    3039             : #define DEFINE_BMAP_DEFERRED_EVENT(name) \
    3040             : DEFINE_EVENT(xfs_bmap_deferred_class, name, \
    3041             :         TP_PROTO(struct xfs_bmap_intent *bi), \
    3042             :         TP_ARGS(bi))
    3043   126431664 : DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
    3044   126431789 : DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
    3045             : 
    3046             : /* per-AG reservation */
    3047           0 : DECLARE_EVENT_CLASS(xfs_ag_resv_class,
    3048             :         TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
    3049             :                  xfs_extlen_t len),
    3050             :         TP_ARGS(pag, resv, len),
    3051             :         TP_STRUCT__entry(
    3052             :                 __field(dev_t, dev)
    3053             :                 __field(xfs_agnumber_t, agno)
    3054             :                 __field(int, resv)
    3055             :                 __field(xfs_extlen_t, freeblks)
    3056             :                 __field(xfs_extlen_t, flcount)
    3057             :                 __field(xfs_extlen_t, reserved)
    3058             :                 __field(xfs_extlen_t, asked)
    3059             :                 __field(xfs_extlen_t, len)
    3060             :         ),
    3061             :         TP_fast_assign(
    3062             :                 struct xfs_ag_resv      *r = xfs_perag_resv(pag, resv);
    3063             : 
    3064             :                 __entry->dev = pag->pag_mount->m_super->s_dev;
    3065             :                 __entry->agno = pag->pag_agno;
    3066             :                 __entry->resv = resv;
    3067             :                 __entry->freeblks = pag->pagf_freeblks;
    3068             :                 __entry->flcount = pag->pagf_flcount;
    3069             :                 __entry->reserved = r ? r->ar_reserved : 0;
    3070             :                 __entry->asked = r ? r->ar_asked : 0;
    3071             :                 __entry->len = len;
    3072             :         ),
    3073             :         TP_printk("dev %d:%d agno 0x%x resv %d freeblks %u flcount %u "
    3074             :                   "resv %u ask %u len %u",
    3075             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3076             :                   __entry->agno,
    3077             :                   __entry->resv,
    3078             :                   __entry->freeblks,
    3079             :                   __entry->flcount,
    3080             :                   __entry->reserved,
    3081             :                   __entry->asked,
    3082             :                   __entry->len)
    3083             : )
    3084             : #define DEFINE_AG_RESV_EVENT(name) \
    3085             : DEFINE_EVENT(xfs_ag_resv_class, name, \
    3086             :         TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
    3087             :                  xfs_extlen_t len), \
    3088             :         TP_ARGS(pag, type, len))
    3089             : 
    3090             : /* per-AG reservation tracepoints */
    3091     1971243 : DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
    3092     1990006 : DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
    3093    85874672 : DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
    3094    98997074 : DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
    3095   156088795 : DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
    3096   443242667 : DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
    3097             : 
    3098           0 : DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
    3099           0 : DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
    3100             : 
    3101             : /* refcount tracepoint classes */
    3102             : 
    3103             : /* reuse the discard trace class for agbno/aglen-based traces */
    3104             : #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
    3105             : 
    3106             : /* ag btree lookup tracepoint class */
    3107             : TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
    3108             : TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
    3109             : TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
    3110           0 : DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
    3111             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    3112             :                  xfs_agblock_t agbno, xfs_lookup_t dir),
    3113             :         TP_ARGS(mp, agno, agbno, dir),
    3114             :         TP_STRUCT__entry(
    3115             :                 __field(dev_t, dev)
    3116             :                 __field(xfs_agnumber_t, agno)
    3117             :                 __field(xfs_agblock_t, agbno)
    3118             :                 __field(xfs_lookup_t, dir)
    3119             :         ),
    3120             :         TP_fast_assign(
    3121             :                 __entry->dev = mp->m_super->s_dev;
    3122             :                 __entry->agno = agno;
    3123             :                 __entry->agbno = agbno;
    3124             :                 __entry->dir = dir;
    3125             :         ),
    3126             :         TP_printk("dev %d:%d agno 0x%x agbno 0x%x cmp %s(%d)",
    3127             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3128             :                   __entry->agno,
    3129             :                   __entry->agbno,
    3130             :                   __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
    3131             :                   __entry->dir)
    3132             : )
    3133             : 
    3134             : #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
    3135             : DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
    3136             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    3137             :                  xfs_agblock_t agbno, xfs_lookup_t dir), \
    3138             :         TP_ARGS(mp, agno, agbno, dir))
    3139             : 
    3140             : /* single-rcext tracepoint class */
    3141           0 : DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
    3142             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    3143             :                  struct xfs_refcount_irec *irec),
    3144             :         TP_ARGS(mp, agno, irec),
    3145             :         TP_STRUCT__entry(
    3146             :                 __field(dev_t, dev)
    3147             :                 __field(xfs_agnumber_t, agno)
    3148             :                 __field(enum xfs_refc_domain, domain)
    3149             :                 __field(xfs_agblock_t, startblock)
    3150             :                 __field(xfs_extlen_t, blockcount)
    3151             :                 __field(xfs_nlink_t, refcount)
    3152             :         ),
    3153             :         TP_fast_assign(
    3154             :                 __entry->dev = mp->m_super->s_dev;
    3155             :                 __entry->agno = agno;
    3156             :                 __entry->domain = irec->rc_domain;
    3157             :                 __entry->startblock = irec->rc_startblock;
    3158             :                 __entry->blockcount = irec->rc_blockcount;
    3159             :                 __entry->refcount = irec->rc_refcount;
    3160             :         ),
    3161             :         TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u",
    3162             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3163             :                   __entry->agno,
    3164             :                   __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
    3165             :                   __entry->startblock,
    3166             :                   __entry->blockcount,
    3167             :                   __entry->refcount)
    3168             : )
    3169             : 
    3170             : #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
    3171             : DEFINE_EVENT(xfs_refcount_extent_class, name, \
    3172             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    3173             :                  struct xfs_refcount_irec *irec), \
    3174             :         TP_ARGS(mp, agno, irec))
    3175             : 
    3176             : /* single-rcext and an agbno tracepoint class */
    3177           0 : DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
    3178             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    3179             :                  struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
    3180             :         TP_ARGS(mp, agno, irec, agbno),
    3181             :         TP_STRUCT__entry(
    3182             :                 __field(dev_t, dev)
    3183             :                 __field(xfs_agnumber_t, agno)
    3184             :                 __field(enum xfs_refc_domain, domain)
    3185             :                 __field(xfs_agblock_t, startblock)
    3186             :                 __field(xfs_extlen_t, blockcount)
    3187             :                 __field(xfs_nlink_t, refcount)
    3188             :                 __field(xfs_agblock_t, agbno)
    3189             :         ),
    3190             :         TP_fast_assign(
    3191             :                 __entry->dev = mp->m_super->s_dev;
    3192             :                 __entry->agno = agno;
    3193             :                 __entry->domain = irec->rc_domain;
    3194             :                 __entry->startblock = irec->rc_startblock;
    3195             :                 __entry->blockcount = irec->rc_blockcount;
    3196             :                 __entry->refcount = irec->rc_refcount;
    3197             :                 __entry->agbno = agbno;
    3198             :         ),
    3199             :         TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
    3200             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3201             :                   __entry->agno,
    3202             :                   __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
    3203             :                   __entry->startblock,
    3204             :                   __entry->blockcount,
    3205             :                   __entry->refcount,
    3206             :                   __entry->agbno)
    3207             : )
    3208             : 
    3209             : #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
    3210             : DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
    3211             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    3212             :                  struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
    3213             :         TP_ARGS(mp, agno, irec, agbno))
    3214             : 
    3215             : /* double-rcext tracepoint class */
    3216           0 : DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
    3217             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    3218             :                  struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
    3219             :         TP_ARGS(mp, agno, i1, i2),
    3220             :         TP_STRUCT__entry(
    3221             :                 __field(dev_t, dev)
    3222             :                 __field(xfs_agnumber_t, agno)
    3223             :                 __field(enum xfs_refc_domain, i1_domain)
    3224             :                 __field(xfs_agblock_t, i1_startblock)
    3225             :                 __field(xfs_extlen_t, i1_blockcount)
    3226             :                 __field(xfs_nlink_t, i1_refcount)
    3227             :                 __field(enum xfs_refc_domain, i2_domain)
    3228             :                 __field(xfs_agblock_t, i2_startblock)
    3229             :                 __field(xfs_extlen_t, i2_blockcount)
    3230             :                 __field(xfs_nlink_t, i2_refcount)
    3231             :         ),
    3232             :         TP_fast_assign(
    3233             :                 __entry->dev = mp->m_super->s_dev;
    3234             :                 __entry->agno = agno;
    3235             :                 __entry->i1_domain = i1->rc_domain;
    3236             :                 __entry->i1_startblock = i1->rc_startblock;
    3237             :                 __entry->i1_blockcount = i1->rc_blockcount;
    3238             :                 __entry->i1_refcount = i1->rc_refcount;
    3239             :                 __entry->i2_domain = i2->rc_domain;
    3240             :                 __entry->i2_startblock = i2->rc_startblock;
    3241             :                 __entry->i2_blockcount = i2->rc_blockcount;
    3242             :                 __entry->i2_refcount = i2->rc_refcount;
    3243             :         ),
    3244             :         TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
    3245             :                   "dom %s agbno 0x%x fsbcount 0x%x refcount %u",
    3246             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3247             :                   __entry->agno,
    3248             :                   __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
    3249             :                   __entry->i1_startblock,
    3250             :                   __entry->i1_blockcount,
    3251             :                   __entry->i1_refcount,
    3252             :                   __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
    3253             :                   __entry->i2_startblock,
    3254             :                   __entry->i2_blockcount,
    3255             :                   __entry->i2_refcount)
    3256             : )
    3257             : 
    3258             : #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
    3259             : DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
    3260             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    3261             :                  struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
    3262             :         TP_ARGS(mp, agno, i1, i2))
    3263             : 
    3264             : /* double-rcext and an agbno tracepoint class */
    3265           0 : DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
    3266             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    3267             :                  struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
    3268             :                  xfs_agblock_t agbno),
    3269             :         TP_ARGS(mp, agno, i1, i2, agbno),
    3270             :         TP_STRUCT__entry(
    3271             :                 __field(dev_t, dev)
    3272             :                 __field(xfs_agnumber_t, agno)
    3273             :                 __field(enum xfs_refc_domain, i1_domain)
    3274             :                 __field(xfs_agblock_t, i1_startblock)
    3275             :                 __field(xfs_extlen_t, i1_blockcount)
    3276             :                 __field(xfs_nlink_t, i1_refcount)
    3277             :                 __field(enum xfs_refc_domain, i2_domain)
    3278             :                 __field(xfs_agblock_t, i2_startblock)
    3279             :                 __field(xfs_extlen_t, i2_blockcount)
    3280             :                 __field(xfs_nlink_t, i2_refcount)
    3281             :                 __field(xfs_agblock_t, agbno)
    3282             :         ),
    3283             :         TP_fast_assign(
    3284             :                 __entry->dev = mp->m_super->s_dev;
    3285             :                 __entry->agno = agno;
    3286             :                 __entry->i1_domain = i1->rc_domain;
    3287             :                 __entry->i1_startblock = i1->rc_startblock;
    3288             :                 __entry->i1_blockcount = i1->rc_blockcount;
    3289             :                 __entry->i1_refcount = i1->rc_refcount;
    3290             :                 __entry->i2_domain = i2->rc_domain;
    3291             :                 __entry->i2_startblock = i2->rc_startblock;
    3292             :                 __entry->i2_blockcount = i2->rc_blockcount;
    3293             :                 __entry->i2_refcount = i2->rc_refcount;
    3294             :                 __entry->agbno = agbno;
    3295             :         ),
    3296             :         TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
    3297             :                   "dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
    3298             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3299             :                   __entry->agno,
    3300             :                   __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
    3301             :                   __entry->i1_startblock,
    3302             :                   __entry->i1_blockcount,
    3303             :                   __entry->i1_refcount,
    3304             :                   __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
    3305             :                   __entry->i2_startblock,
    3306             :                   __entry->i2_blockcount,
    3307             :                   __entry->i2_refcount,
    3308             :                   __entry->agbno)
    3309             : )
    3310             : 
    3311             : #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
    3312             : DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
    3313             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    3314             :                  struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
    3315             :                  xfs_agblock_t agbno), \
    3316             :         TP_ARGS(mp, agno, i1, i2, agbno))
    3317             : 
    3318             : /* triple-rcext tracepoint class */
    3319           0 : DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
    3320             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    3321             :                  struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
    3322             :                  struct xfs_refcount_irec *i3),
    3323             :         TP_ARGS(mp, agno, i1, i2, i3),
    3324             :         TP_STRUCT__entry(
    3325             :                 __field(dev_t, dev)
    3326             :                 __field(xfs_agnumber_t, agno)
    3327             :                 __field(enum xfs_refc_domain, i1_domain)
    3328             :                 __field(xfs_agblock_t, i1_startblock)
    3329             :                 __field(xfs_extlen_t, i1_blockcount)
    3330             :                 __field(xfs_nlink_t, i1_refcount)
    3331             :                 __field(enum xfs_refc_domain, i2_domain)
    3332             :                 __field(xfs_agblock_t, i2_startblock)
    3333             :                 __field(xfs_extlen_t, i2_blockcount)
    3334             :                 __field(xfs_nlink_t, i2_refcount)
    3335             :                 __field(enum xfs_refc_domain, i3_domain)
    3336             :                 __field(xfs_agblock_t, i3_startblock)
    3337             :                 __field(xfs_extlen_t, i3_blockcount)
    3338             :                 __field(xfs_nlink_t, i3_refcount)
    3339             :         ),
    3340             :         TP_fast_assign(
    3341             :                 __entry->dev = mp->m_super->s_dev;
    3342             :                 __entry->agno = agno;
    3343             :                 __entry->i1_domain = i1->rc_domain;
    3344             :                 __entry->i1_startblock = i1->rc_startblock;
    3345             :                 __entry->i1_blockcount = i1->rc_blockcount;
    3346             :                 __entry->i1_refcount = i1->rc_refcount;
    3347             :                 __entry->i2_domain = i2->rc_domain;
    3348             :                 __entry->i2_startblock = i2->rc_startblock;
    3349             :                 __entry->i2_blockcount = i2->rc_blockcount;
    3350             :                 __entry->i2_refcount = i2->rc_refcount;
    3351             :                 __entry->i3_domain = i3->rc_domain;
    3352             :                 __entry->i3_startblock = i3->rc_startblock;
    3353             :                 __entry->i3_blockcount = i3->rc_blockcount;
    3354             :                 __entry->i3_refcount = i3->rc_refcount;
    3355             :         ),
    3356             :         TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
    3357             :                   "dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
    3358             :                   "dom %s agbno 0x%x fsbcount 0x%x refcount %u",
    3359             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3360             :                   __entry->agno,
    3361             :                   __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
    3362             :                   __entry->i1_startblock,
    3363             :                   __entry->i1_blockcount,
    3364             :                   __entry->i1_refcount,
    3365             :                   __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
    3366             :                   __entry->i2_startblock,
    3367             :                   __entry->i2_blockcount,
    3368             :                   __entry->i2_refcount,
    3369             :                   __print_symbolic(__entry->i3_domain, XFS_REFC_DOMAIN_STRINGS),
    3370             :                   __entry->i3_startblock,
    3371             :                   __entry->i3_blockcount,
    3372             :                   __entry->i3_refcount)
    3373             : );
    3374             : 
    3375             : #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
    3376             : DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
    3377             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    3378             :                  struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
    3379             :                  struct xfs_refcount_irec *i3), \
    3380             :         TP_ARGS(mp, agno, i1, i2, i3))
    3381             : 
    3382             : /* refcount btree tracepoints */
    3383  2092717098 : DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
    3384  2717327338 : DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
    3385   139493803 : DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
    3386    77265444 : DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
    3387    71033693 : DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
    3388          81 : DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
    3389           0 : DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
    3390           0 : DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
    3391             : 
    3392             : /* refcount adjustment tracepoints */
    3393    78043935 : DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
    3394    95720300 : DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
    3395     3784328 : DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
    3396    15589133 : DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
    3397     2475445 : DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
    3398   218659903 : DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
    3399      315192 : DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
    3400    45878996 : DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
    3401     8865305 : DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
    3402     4393683 : DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
    3403    37700348 : DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
    3404    35340894 : DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
    3405         286 : DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
    3406           1 : DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
    3407           0 : DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
    3408          44 : DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
    3409         233 : DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
    3410           0 : DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
    3411           0 : DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
    3412           0 : DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
    3413          10 : DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
    3414             : 
    3415             : /* reflink helpers */
    3416  1034632292 : DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
    3417  1035314903 : DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
    3418          60 : DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
    3419             : 
    3420           0 : DECLARE_EVENT_CLASS(xfs_refcount_deferred_class,
    3421             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    3422             :                  int type, xfs_agblock_t agbno, xfs_extlen_t len),
    3423             :         TP_ARGS(mp, agno, type, agbno, len),
    3424             :         TP_STRUCT__entry(
    3425             :                 __field(dev_t, dev)
    3426             :                 __field(xfs_agnumber_t, agno)
    3427             :                 __field(int, type)
    3428             :                 __field(xfs_agblock_t, agbno)
    3429             :                 __field(xfs_extlen_t, len)
    3430             :         ),
    3431             :         TP_fast_assign(
    3432             :                 __entry->dev = mp->m_super->s_dev;
    3433             :                 __entry->agno = agno;
    3434             :                 __entry->type = type;
    3435             :                 __entry->agbno = agbno;
    3436             :                 __entry->len = len;
    3437             :         ),
    3438             :         TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x fsbcount 0x%x",
    3439             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3440             :                   __entry->type,
    3441             :                   __entry->agno,
    3442             :                   __entry->agbno,
    3443             :                   __entry->len)
    3444             : );
    3445             : #define DEFINE_REFCOUNT_DEFERRED_EVENT(name) \
    3446             : DEFINE_EVENT(xfs_refcount_deferred_class, name, \
    3447             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    3448             :                  int type, \
    3449             :                  xfs_agblock_t bno, \
    3450             :                  xfs_extlen_t len), \
    3451             :         TP_ARGS(mp, agno, type, bno, len))
    3452   193132238 : DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
    3453   193131534 : DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
    3454             : 
    3455        1406 : TRACE_EVENT(xfs_refcount_finish_one_leftover,
    3456             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    3457             :                  int type, xfs_agblock_t agbno, xfs_extlen_t len),
    3458             :         TP_ARGS(mp, agno, type, agbno, len),
    3459             :         TP_STRUCT__entry(
    3460             :                 __field(dev_t, dev)
    3461             :                 __field(xfs_agnumber_t, agno)
    3462             :                 __field(int, type)
    3463             :                 __field(xfs_agblock_t, agbno)
    3464             :                 __field(xfs_extlen_t, len)
    3465             :         ),
    3466             :         TP_fast_assign(
    3467             :                 __entry->dev = mp->m_super->s_dev;
    3468             :                 __entry->agno = agno;
    3469             :                 __entry->type = type;
    3470             :                 __entry->agbno = agbno;
    3471             :                 __entry->len = len;
    3472             :         ),
    3473             :         TP_printk("dev %d:%d type %d agno 0x%x agbno 0x%x fsbcount 0x%x",
    3474             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3475             :                   __entry->type,
    3476             :                   __entry->agno,
    3477             :                   __entry->agbno,
    3478             :                   __entry->len)
    3479             : );
    3480             : 
    3481             : /* simple inode-based error/%ip tracepoint class */
    3482           0 : DECLARE_EVENT_CLASS(xfs_inode_error_class,
    3483             :         TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
    3484             :         TP_ARGS(ip, error, caller_ip),
    3485             :         TP_STRUCT__entry(
    3486             :                 __field(dev_t, dev)
    3487             :                 __field(xfs_ino_t, ino)
    3488             :                 __field(int, error)
    3489             :                 __field(unsigned long, caller_ip)
    3490             :         ),
    3491             :         TP_fast_assign(
    3492             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    3493             :                 __entry->ino = ip->i_ino;
    3494             :                 __entry->error = error;
    3495             :                 __entry->caller_ip = caller_ip;
    3496             :         ),
    3497             :         TP_printk("dev %d:%d ino 0x%llx error %d caller %pS",
    3498             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3499             :                   __entry->ino,
    3500             :                   __entry->error,
    3501             :                   (char *)__entry->caller_ip)
    3502             : );
    3503             : 
    3504             : #define DEFINE_INODE_ERROR_EVENT(name) \
    3505             : DEFINE_EVENT(xfs_inode_error_class, name, \
    3506             :         TP_PROTO(struct xfs_inode *ip, int error, \
    3507             :                  unsigned long caller_ip), \
    3508             :         TP_ARGS(ip, error, caller_ip))
    3509             : 
    3510             : /* reflink tracepoint classes */
    3511             : 
    3512             : /* two-file io tracepoint class */
    3513           0 : DECLARE_EVENT_CLASS(xfs_double_io_class,
    3514             :         TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
    3515             :                  struct xfs_inode *dest, xfs_off_t doffset),
    3516             :         TP_ARGS(src, soffset, len, dest, doffset),
    3517             :         TP_STRUCT__entry(
    3518             :                 __field(dev_t, dev)
    3519             :                 __field(xfs_ino_t, src_ino)
    3520             :                 __field(loff_t, src_isize)
    3521             :                 __field(loff_t, src_disize)
    3522             :                 __field(loff_t, src_offset)
    3523             :                 __field(long long, len)
    3524             :                 __field(xfs_ino_t, dest_ino)
    3525             :                 __field(loff_t, dest_isize)
    3526             :                 __field(loff_t, dest_disize)
    3527             :                 __field(loff_t, dest_offset)
    3528             :         ),
    3529             :         TP_fast_assign(
    3530             :                 __entry->dev = VFS_I(src)->i_sb->s_dev;
    3531             :                 __entry->src_ino = src->i_ino;
    3532             :                 __entry->src_isize = VFS_I(src)->i_size;
    3533             :                 __entry->src_disize = src->i_disk_size;
    3534             :                 __entry->src_offset = soffset;
    3535             :                 __entry->len = len;
    3536             :                 __entry->dest_ino = dest->i_ino;
    3537             :                 __entry->dest_isize = VFS_I(dest)->i_size;
    3538             :                 __entry->dest_disize = dest->i_disk_size;
    3539             :                 __entry->dest_offset = doffset;
    3540             :         ),
    3541             :         TP_printk("dev %d:%d bytecount 0x%llx "
    3542             :                   "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx -> "
    3543             :                   "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx",
    3544             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3545             :                   __entry->len,
    3546             :                   __entry->src_ino,
    3547             :                   __entry->src_isize,
    3548             :                   __entry->src_disize,
    3549             :                   __entry->src_offset,
    3550             :                   __entry->dest_ino,
    3551             :                   __entry->dest_isize,
    3552             :                   __entry->dest_disize,
    3553             :                   __entry->dest_offset)
    3554             : )
    3555             : 
    3556             : #define DEFINE_DOUBLE_IO_EVENT(name)    \
    3557             : DEFINE_EVENT(xfs_double_io_class, name, \
    3558             :         TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
    3559             :                  struct xfs_inode *dest, xfs_off_t doffset), \
    3560             :         TP_ARGS(src, soffset, len, dest, doffset))
    3561             : 
    3562             : /* inode/irec events */
    3563           0 : DECLARE_EVENT_CLASS(xfs_inode_irec_class,
    3564             :         TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
    3565             :         TP_ARGS(ip, irec),
    3566             :         TP_STRUCT__entry(
    3567             :                 __field(dev_t, dev)
    3568             :                 __field(xfs_ino_t, ino)
    3569             :                 __field(xfs_fileoff_t, lblk)
    3570             :                 __field(xfs_extlen_t, len)
    3571             :                 __field(xfs_fsblock_t, pblk)
    3572             :                 __field(int, state)
    3573             :         ),
    3574             :         TP_fast_assign(
    3575             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    3576             :                 __entry->ino = ip->i_ino;
    3577             :                 __entry->lblk = irec->br_startoff;
    3578             :                 __entry->len = irec->br_blockcount;
    3579             :                 __entry->pblk = irec->br_startblock;
    3580             :                 __entry->state = irec->br_state;
    3581             :         ),
    3582             :         TP_printk("dev %d:%d ino 0x%llx fileoff 0x%llx fsbcount 0x%x startblock 0x%llx st %d",
    3583             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3584             :                   __entry->ino,
    3585             :                   __entry->lblk,
    3586             :                   __entry->len,
    3587             :                   __entry->pblk,
    3588             :                   __entry->state)
    3589             : );
    3590             : #define DEFINE_INODE_IREC_EVENT(name) \
    3591             : DEFINE_EVENT(xfs_inode_irec_class, name, \
    3592             :         TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
    3593             :         TP_ARGS(ip, irec))
    3594             : 
    3595             : /* inode iomap invalidation events */
    3596          10 : DECLARE_EVENT_CLASS(xfs_wb_invalid_class,
    3597             :         TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap, unsigned int wpcseq, int whichfork),
    3598             :         TP_ARGS(ip, iomap, wpcseq, whichfork),
    3599             :         TP_STRUCT__entry(
    3600             :                 __field(dev_t, dev)
    3601             :                 __field(xfs_ino_t, ino)
    3602             :                 __field(u64, addr)
    3603             :                 __field(loff_t, pos)
    3604             :                 __field(u64, len)
    3605             :                 __field(u16, type)
    3606             :                 __field(u16, flags)
    3607             :                 __field(u32, wpcseq)
    3608             :                 __field(u32, forkseq)
    3609             :         ),
    3610             :         TP_fast_assign(
    3611             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    3612             :                 __entry->ino = ip->i_ino;
    3613             :                 __entry->addr = iomap->addr;
    3614             :                 __entry->pos = iomap->offset;
    3615             :                 __entry->len = iomap->length;
    3616             :                 __entry->type = iomap->type;
    3617             :                 __entry->flags = iomap->flags;
    3618             :                 __entry->wpcseq = wpcseq;
    3619             :                 __entry->forkseq = READ_ONCE(xfs_ifork_ptr(ip, whichfork)->if_seq);
    3620             :         ),
    3621             :         TP_printk("dev %d:%d ino 0x%llx pos 0x%llx addr 0x%llx bytecount 0x%llx type 0x%x flags 0x%x wpcseq 0x%x forkseq 0x%x",
    3622             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3623             :                   __entry->ino,
    3624             :                   __entry->pos,
    3625             :                   __entry->addr,
    3626             :                   __entry->len,
    3627             :                   __entry->type,
    3628             :                   __entry->flags,
    3629             :                   __entry->wpcseq,
    3630             :                   __entry->forkseq)
    3631             : );
    3632             : #define DEFINE_WB_INVALID_EVENT(name) \
    3633             : DEFINE_EVENT(xfs_wb_invalid_class, name, \
    3634             :         TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap, unsigned int wpcseq, int whichfork), \
    3635             :         TP_ARGS(ip, iomap, wpcseq, whichfork))
    3636    44311792 : DEFINE_WB_INVALID_EVENT(xfs_wb_cow_iomap_invalid);
    3637     1192362 : DEFINE_WB_INVALID_EVENT(xfs_wb_data_iomap_invalid);
    3638             : 
    3639          20 : DECLARE_EVENT_CLASS(xfs_iomap_invalid_class,
    3640             :         TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap),
    3641             :         TP_ARGS(ip, iomap),
    3642             :         TP_STRUCT__entry(
    3643             :                 __field(dev_t, dev)
    3644             :                 __field(xfs_ino_t, ino)
    3645             :                 __field(u64, addr)
    3646             :                 __field(loff_t, pos)
    3647             :                 __field(u64, len)
    3648             :                 __field(u64, validity_cookie)
    3649             :                 __field(u64, inodeseq)
    3650             :                 __field(u16, type)
    3651             :                 __field(u16, flags)
    3652             :         ),
    3653             :         TP_fast_assign(
    3654             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    3655             :                 __entry->ino = ip->i_ino;
    3656             :                 __entry->addr = iomap->addr;
    3657             :                 __entry->pos = iomap->offset;
    3658             :                 __entry->len = iomap->length;
    3659             :                 __entry->validity_cookie = iomap->validity_cookie;
    3660             :                 __entry->type = iomap->type;
    3661             :                 __entry->flags = iomap->flags;
    3662             :                 __entry->inodeseq = xfs_iomap_inode_sequence(ip, iomap->flags);
    3663             :         ),
    3664             :         TP_printk("dev %d:%d ino 0x%llx pos 0x%llx addr 0x%llx bytecount 0x%llx type 0x%x flags 0x%x validity_cookie 0x%llx inodeseq 0x%llx",
    3665             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3666             :                   __entry->ino,
    3667             :                   __entry->pos,
    3668             :                   __entry->addr,
    3669             :                   __entry->len,
    3670             :                   __entry->type,
    3671             :                   __entry->flags,
    3672             :                   __entry->validity_cookie,
    3673             :                   __entry->inodeseq)
    3674             : );
    3675             : #define DEFINE_IOMAP_INVALID_EVENT(name) \
    3676             : DEFINE_EVENT(xfs_iomap_invalid_class, name, \
    3677             :         TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap), \
    3678             :         TP_ARGS(ip, iomap))
    3679      117378 : DEFINE_IOMAP_INVALID_EVENT(xfs_iomap_invalid);
    3680             : 
    3681             : /* refcount/reflink tracepoint definitions */
    3682             : 
    3683             : /* reflink tracepoints */
    3684     3509317 : DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
    3685        6600 : DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
    3686    72857736 : DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
    3687   116709156 : TRACE_EVENT(xfs_reflink_remap_blocks,
    3688             :         TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
    3689             :                  xfs_filblks_t len, struct xfs_inode *dest,
    3690             :                  xfs_fileoff_t doffset),
    3691             :         TP_ARGS(src, soffset, len, dest, doffset),
    3692             :         TP_STRUCT__entry(
    3693             :                 __field(dev_t, dev)
    3694             :                 __field(xfs_ino_t, src_ino)
    3695             :                 __field(xfs_fileoff_t, src_lblk)
    3696             :                 __field(xfs_filblks_t, len)
    3697             :                 __field(xfs_ino_t, dest_ino)
    3698             :                 __field(xfs_fileoff_t, dest_lblk)
    3699             :         ),
    3700             :         TP_fast_assign(
    3701             :                 __entry->dev = VFS_I(src)->i_sb->s_dev;
    3702             :                 __entry->src_ino = src->i_ino;
    3703             :                 __entry->src_lblk = soffset;
    3704             :                 __entry->len = len;
    3705             :                 __entry->dest_ino = dest->i_ino;
    3706             :                 __entry->dest_lblk = doffset;
    3707             :         ),
    3708             :         TP_printk("dev %d:%d fsbcount 0x%llx "
    3709             :                   "ino 0x%llx fileoff 0x%llx -> ino 0x%llx fileoff 0x%llx",
    3710             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3711             :                   __entry->len,
    3712             :                   __entry->src_ino,
    3713             :                   __entry->src_lblk,
    3714             :                   __entry->dest_ino,
    3715             :                   __entry->dest_lblk)
    3716             : );
    3717   116710375 : DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
    3718      837002 : DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
    3719           4 : DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
    3720           0 : DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
    3721      837029 : DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
    3722      836726 : DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
    3723   228924271 : DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
    3724   228087970 : DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
    3725             : 
    3726             : /* dedupe tracepoints */
    3727           0 : DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
    3728           0 : DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
    3729             : 
    3730             : /* ioctl tracepoints */
    3731           0 : TRACE_EVENT(xfs_ioctl_clone,
    3732             :         TP_PROTO(struct inode *src, struct inode *dest),
    3733             :         TP_ARGS(src, dest),
    3734             :         TP_STRUCT__entry(
    3735             :                 __field(dev_t, dev)
    3736             :                 __field(unsigned long, src_ino)
    3737             :                 __field(loff_t, src_isize)
    3738             :                 __field(unsigned long, dest_ino)
    3739             :                 __field(loff_t, dest_isize)
    3740             :         ),
    3741             :         TP_fast_assign(
    3742             :                 __entry->dev = src->i_sb->s_dev;
    3743             :                 __entry->src_ino = src->i_ino;
    3744             :                 __entry->src_isize = i_size_read(src);
    3745             :                 __entry->dest_ino = dest->i_ino;
    3746             :                 __entry->dest_isize = i_size_read(dest);
    3747             :         ),
    3748             :         TP_printk("dev %d:%d ino 0x%lx isize 0x%llx -> ino 0x%lx isize 0x%llx",
    3749             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3750             :                   __entry->src_ino,
    3751             :                   __entry->src_isize,
    3752             :                   __entry->dest_ino,
    3753             :                   __entry->dest_isize)
    3754             : );
    3755             : 
    3756             : /* unshare tracepoints */
    3757         116 : DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
    3758           6 : DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
    3759             : #ifdef CONFIG_XFS_RT
    3760           0 : DEFINE_SIMPLE_IO_EVENT(xfs_rtfile_convert_unwritten);
    3761             : #endif /* CONFIG_XFS_RT */
    3762             : 
    3763             : /* copy on write */
    3764    22194830 : DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
    3765    37187531 : DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
    3766           0 : DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
    3767     4251045 : DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
    3768             : 
    3769     4074275 : DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
    3770     8368165 : DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
    3771    10642925 : DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_from);
    3772    10642925 : DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_to);
    3773             : 
    3774          21 : DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
    3775          51 : DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
    3776             : 
    3777             : 
    3778     7426755 : DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
    3779             : 
    3780             : 
    3781             : /* swapext tracepoints */
    3782         678 : DEFINE_INODE_ERROR_EVENT(xfs_file_xchg_range_error);
    3783           0 : DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_error);
    3784         208 : DEFINE_INODE_IREC_EVENT(xfs_swapext_extent1_skip);
    3785    12126966 : DEFINE_INODE_IREC_EVENT(xfs_swapext_extent1);
    3786    12126956 : DEFINE_INODE_IREC_EVENT(xfs_swapext_extent2);
    3787         176 : DEFINE_ITRUNC_EVENT(xfs_swapext_update_inode_size);
    3788             : 
    3789             : #define XFS_EXCH_RANGE_FLAGS_STRS \
    3790             :         { XFS_EXCH_RANGE_NONATOMIC,     "NONATOMIC" }, \
    3791             :         { XFS_EXCH_RANGE_FILE2_FRESH,   "F2_FRESH" }, \
    3792             :         { XFS_EXCH_RANGE_FULL_FILES,    "FULL" }, \
    3793             :         { XFS_EXCH_RANGE_TO_EOF,        "TO_EOF" }, \
    3794             :         { XFS_EXCH_RANGE_FSYNC  ,       "FSYNC" }, \
    3795             :         { XFS_EXCH_RANGE_DRY_RUN,       "DRY_RUN" }, \
    3796             :         { XFS_EXCH_RANGE_FILE1_WRITTEN, "F1_WRITTEN" }
    3797             : 
    3798             : /* file exchange-range tracepoint class */
    3799           0 : DECLARE_EVENT_CLASS(xfs_xchg_range_class,
    3800             :         TP_PROTO(struct xfs_inode *ip1, const struct xfs_exch_range *fxr,
    3801             :                  struct xfs_inode *ip2, unsigned int xchg_flags),
    3802             :         TP_ARGS(ip1, fxr, ip2, xchg_flags),
    3803             :         TP_STRUCT__entry(
    3804             :                 __field(dev_t, dev)
    3805             :                 __field(xfs_ino_t, ip1_ino)
    3806             :                 __field(loff_t, ip1_isize)
    3807             :                 __field(loff_t, ip1_disize)
    3808             :                 __field(xfs_ino_t, ip2_ino)
    3809             :                 __field(loff_t, ip2_isize)
    3810             :                 __field(loff_t, ip2_disize)
    3811             : 
    3812             :                 __field(loff_t, file1_offset)
    3813             :                 __field(loff_t, file2_offset)
    3814             :                 __field(unsigned long long, length)
    3815             :                 __field(unsigned long long, vflags)
    3816             :                 __field(unsigned int, xflags)
    3817             :         ),
    3818             :         TP_fast_assign(
    3819             :                 __entry->dev = VFS_I(ip1)->i_sb->s_dev;
    3820             :                 __entry->ip1_ino = ip1->i_ino;
    3821             :                 __entry->ip1_isize = VFS_I(ip1)->i_size;
    3822             :                 __entry->ip1_disize = ip1->i_disk_size;
    3823             :                 __entry->ip2_ino = ip2->i_ino;
    3824             :                 __entry->ip2_isize = VFS_I(ip2)->i_size;
    3825             :                 __entry->ip2_disize = ip2->i_disk_size;
    3826             : 
    3827             :                 __entry->file1_offset = fxr->file1_offset;
    3828             :                 __entry->file2_offset = fxr->file2_offset;
    3829             :                 __entry->length = fxr->length;
    3830             :                 __entry->vflags = fxr->flags;
    3831             :                 __entry->xflags = xchg_flags;
    3832             :         ),
    3833             :         TP_printk("dev %d:%d vfs_flags %s xchg_flags %s bytecount 0x%llx "
    3834             :                   "ino1 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx -> "
    3835             :                   "ino2 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx",
    3836             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3837             :                    __print_flags(__entry->vflags, "|", XFS_EXCH_RANGE_FLAGS_STRS),
    3838             :                    __print_flags(__entry->xflags, "|", XCHG_RANGE_FLAGS_STRS),
    3839             :                   __entry->length,
    3840             :                   __entry->ip1_ino,
    3841             :                   __entry->ip1_isize,
    3842             :                   __entry->ip1_disize,
    3843             :                   __entry->file1_offset,
    3844             :                   __entry->ip2_ino,
    3845             :                   __entry->ip2_isize,
    3846             :                   __entry->ip2_disize,
    3847             :                   __entry->file2_offset)
    3848             : )
    3849             : 
    3850             : #define DEFINE_XCHG_RANGE_EVENT(name)   \
    3851             : DEFINE_EVENT(xfs_xchg_range_class, name,        \
    3852             :         TP_PROTO(struct xfs_inode *ip1, const struct xfs_exch_range *fxr, \
    3853             :                  struct xfs_inode *ip2, unsigned int xchg_flags), \
    3854             :         TP_ARGS(ip1, fxr, ip2, xchg_flags))
    3855     1242835 : DEFINE_XCHG_RANGE_EVENT(xfs_xchg_range_prep);
    3856     1242041 : DEFINE_XCHG_RANGE_EVENT(xfs_xchg_range_flush);
    3857     1242465 : DEFINE_XCHG_RANGE_EVENT(xfs_xchg_range);
    3858             : 
    3859       31665 : TRACE_EVENT(xfs_xchg_range_freshness,
    3860             :         TP_PROTO(struct xfs_inode *ip2, const struct xfs_exch_range *fxr),
    3861             :         TP_ARGS(ip2, fxr),
    3862             :         TP_STRUCT__entry(
    3863             :                 __field(dev_t, dev)
    3864             :                 __field(xfs_ino_t, ip2_ino)
    3865             :                 __field(long long, ip2_mtime)
    3866             :                 __field(long long, ip2_ctime)
    3867             :                 __field(int, ip2_mtime_nsec)
    3868             :                 __field(int, ip2_ctime_nsec)
    3869             : 
    3870             :                 __field(xfs_ino_t, file2_ino)
    3871             :                 __field(long long, file2_mtime)
    3872             :                 __field(long long, file2_ctime)
    3873             :                 __field(int, file2_mtime_nsec)
    3874             :                 __field(int, file2_ctime_nsec)
    3875             :         ),
    3876             :         TP_fast_assign(
    3877             :                 __entry->dev = VFS_I(ip2)->i_sb->s_dev;
    3878             :                 __entry->ip2_ino = ip2->i_ino;
    3879             :                 __entry->ip2_mtime = VFS_I(ip2)->i_mtime.tv_sec;
    3880             :                 __entry->ip2_ctime = VFS_I(ip2)->i_ctime.tv_sec;
    3881             :                 __entry->ip2_mtime_nsec = VFS_I(ip2)->i_mtime.tv_nsec;
    3882             :                 __entry->ip2_ctime_nsec = VFS_I(ip2)->i_ctime.tv_nsec;
    3883             : 
    3884             :                 __entry->file2_ino = fxr->file2_ino;
    3885             :                 __entry->file2_mtime = fxr->file2_mtime;
    3886             :                 __entry->file2_ctime = fxr->file2_ctime;
    3887             :                 __entry->file2_mtime_nsec = fxr->file2_mtime_nsec;
    3888             :                 __entry->file2_ctime_nsec = fxr->file2_ctime_nsec;
    3889             :         ),
    3890             :         TP_printk("dev %d:%d "
    3891             :                   "ino 0x%llx mtime %lld:%d ctime %lld:%d -> "
    3892             :                   "file 0x%llx mtime %lld:%d ctime %lld:%d",
    3893             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3894             :                   __entry->ip2_ino,
    3895             :                   __entry->ip2_mtime,
    3896             :                   __entry->ip2_mtime_nsec,
    3897             :                   __entry->ip2_ctime,
    3898             :                   __entry->ip2_ctime_nsec,
    3899             :                   __entry->file2_ino,
    3900             :                   __entry->file2_mtime,
    3901             :                   __entry->file2_mtime_nsec,
    3902             :                   __entry->file2_ctime,
    3903             :                   __entry->file2_ctime_nsec)
    3904             : );
    3905             : 
    3906             : /* fsmap traces */
    3907           0 : DECLARE_EVENT_CLASS(xfs_fsmap_class,
    3908             :         TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
    3909             :                  const struct xfs_rmap_irec *rmap),
    3910             :         TP_ARGS(mp, keydev, agno, rmap),
    3911             :         TP_STRUCT__entry(
    3912             :                 __field(dev_t, dev)
    3913             :                 __field(dev_t, keydev)
    3914             :                 __field(xfs_agnumber_t, agno)
    3915             :                 __field(xfs_fsblock_t, bno)
    3916             :                 __field(xfs_filblks_t, len)
    3917             :                 __field(uint64_t, owner)
    3918             :                 __field(uint64_t, offset)
    3919             :                 __field(unsigned int, flags)
    3920             :         ),
    3921             :         TP_fast_assign(
    3922             :                 __entry->dev = mp->m_super->s_dev;
    3923             :                 __entry->keydev = new_decode_dev(keydev);
    3924             :                 __entry->agno = agno;
    3925             :                 __entry->bno = rmap->rm_startblock;
    3926             :                 __entry->len = rmap->rm_blockcount;
    3927             :                 __entry->owner = rmap->rm_owner;
    3928             :                 __entry->offset = rmap->rm_offset;
    3929             :                 __entry->flags = rmap->rm_flags;
    3930             :         ),
    3931             :         TP_printk("dev %d:%d keydev %d:%d agno 0x%x startblock 0x%llx fsbcount 0x%llx owner 0x%llx fileoff 0x%llx flags 0x%x",
    3932             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3933             :                   MAJOR(__entry->keydev), MINOR(__entry->keydev),
    3934             :                   __entry->agno,
    3935             :                   __entry->bno,
    3936             :                   __entry->len,
    3937             :                   __entry->owner,
    3938             :                   __entry->offset,
    3939             :                   __entry->flags)
    3940             : )
    3941             : #define DEFINE_FSMAP_EVENT(name) \
    3942             : DEFINE_EVENT(xfs_fsmap_class, name, \
    3943             :         TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
    3944             :                  const struct xfs_rmap_irec *rmap), \
    3945             :         TP_ARGS(mp, keydev, agno, rmap))
    3946      319387 : DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
    3947      319172 : DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
    3948   172777103 : DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
    3949             : 
    3950           0 : DECLARE_EVENT_CLASS(xfs_fsmap_linear_class,
    3951             :         TP_PROTO(struct xfs_mount *mp, u32 keydev, uint64_t bno),
    3952             :         TP_ARGS(mp, keydev, bno),
    3953             :         TP_STRUCT__entry(
    3954             :                 __field(dev_t, dev)
    3955             :                 __field(dev_t, keydev)
    3956             :                 __field(xfs_fsblock_t, bno)
    3957             :         ),
    3958             :         TP_fast_assign(
    3959             :                 __entry->dev = mp->m_super->s_dev;
    3960             :                 __entry->keydev = new_decode_dev(keydev);
    3961             :                 __entry->bno = bno;
    3962             :         ),
    3963             :         TP_printk("dev %d:%d keydev %d:%d bno 0x%llx",
    3964             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3965             :                   MAJOR(__entry->keydev), MINOR(__entry->keydev),
    3966             :                   __entry->bno)
    3967             : )
    3968             : #define DEFINE_FSMAP_LINEAR_EVENT(name) \
    3969             : DEFINE_EVENT(xfs_fsmap_linear_class, name, \
    3970             :         TP_PROTO(struct xfs_mount *mp, u32 keydev, uint64_t bno), \
    3971             :         TP_ARGS(mp, keydev, bno))
    3972       25390 : DEFINE_FSMAP_LINEAR_EVENT(xfs_fsmap_low_key_linear);
    3973       25387 : DEFINE_FSMAP_LINEAR_EVENT(xfs_fsmap_high_key_linear);
    3974             : 
    3975           0 : DECLARE_EVENT_CLASS(xfs_getfsmap_class,
    3976             :         TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
    3977             :         TP_ARGS(mp, fsmap),
    3978             :         TP_STRUCT__entry(
    3979             :                 __field(dev_t, dev)
    3980             :                 __field(dev_t, keydev)
    3981             :                 __field(xfs_daddr_t, block)
    3982             :                 __field(xfs_daddr_t, len)
    3983             :                 __field(uint64_t, owner)
    3984             :                 __field(uint64_t, offset)
    3985             :                 __field(uint64_t, flags)
    3986             :         ),
    3987             :         TP_fast_assign(
    3988             :                 __entry->dev = mp->m_super->s_dev;
    3989             :                 __entry->keydev = new_decode_dev(fsmap->fmr_device);
    3990             :                 __entry->block = fsmap->fmr_physical;
    3991             :                 __entry->len = fsmap->fmr_length;
    3992             :                 __entry->owner = fsmap->fmr_owner;
    3993             :                 __entry->offset = fsmap->fmr_offset;
    3994             :                 __entry->flags = fsmap->fmr_flags;
    3995             :         ),
    3996             :         TP_printk("dev %d:%d keydev %d:%d daddr 0x%llx bbcount 0x%llx owner 0x%llx fileoff_daddr 0x%llx flags 0x%llx",
    3997             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    3998             :                   MAJOR(__entry->keydev), MINOR(__entry->keydev),
    3999             :                   __entry->block,
    4000             :                   __entry->len,
    4001             :                   __entry->owner,
    4002             :                   __entry->offset,
    4003             :                   __entry->flags)
    4004             : )
    4005             : #define DEFINE_GETFSMAP_EVENT(name) \
    4006             : DEFINE_EVENT(xfs_getfsmap_class, name, \
    4007             :         TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
    4008             :         TP_ARGS(mp, fsmap))
    4009      526052 : DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
    4010      228039 : DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
    4011   220606455 : DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
    4012             : 
    4013           0 : DECLARE_EVENT_CLASS(xfs_trans_resv_class,
    4014             :         TP_PROTO(struct xfs_mount *mp, unsigned int type,
    4015             :                  struct xfs_trans_res *res),
    4016             :         TP_ARGS(mp, type, res),
    4017             :         TP_STRUCT__entry(
    4018             :                 __field(dev_t, dev)
    4019             :                 __field(int, type)
    4020             :                 __field(uint, logres)
    4021             :                 __field(int, logcount)
    4022             :                 __field(int, logflags)
    4023             :         ),
    4024             :         TP_fast_assign(
    4025             :                 __entry->dev = mp->m_super->s_dev;
    4026             :                 __entry->type = type;
    4027             :                 __entry->logres = res->tr_logres;
    4028             :                 __entry->logcount = res->tr_logcount;
    4029             :                 __entry->logflags = res->tr_logflags;
    4030             :         ),
    4031             :         TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
    4032             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4033             :                   __entry->type,
    4034             :                   __entry->logres,
    4035             :                   __entry->logcount,
    4036             :                   __entry->logflags)
    4037             : )
    4038             : 
    4039             : #define DEFINE_TRANS_RESV_EVENT(name) \
    4040             : DEFINE_EVENT(xfs_trans_resv_class, name, \
    4041             :         TP_PROTO(struct xfs_mount *mp, unsigned int type, \
    4042             :                  struct xfs_trans_res *res), \
    4043             :         TP_ARGS(mp, type, res))
    4044     1579864 : DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc);
    4045     1579864 : DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc_minlogsize);
    4046             : 
    4047       60764 : TRACE_EVENT(xfs_log_get_max_trans_res,
    4048             :         TP_PROTO(struct xfs_mount *mp, const struct xfs_trans_res *res),
    4049             :         TP_ARGS(mp, res),
    4050             :         TP_STRUCT__entry(
    4051             :                 __field(dev_t, dev)
    4052             :                 __field(uint, logres)
    4053             :                 __field(int, logcount)
    4054             :         ),
    4055             :         TP_fast_assign(
    4056             :                 __entry->dev = mp->m_super->s_dev;
    4057             :                 __entry->logres = res->tr_logres;
    4058             :                 __entry->logcount = res->tr_logcount;
    4059             :         ),
    4060             :         TP_printk("dev %d:%d logres %u logcount %d",
    4061             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4062             :                   __entry->logres,
    4063             :                   __entry->logcount)
    4064             : );
    4065             : 
    4066           0 : DECLARE_EVENT_CLASS(xfs_trans_class,
    4067             :         TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
    4068             :         TP_ARGS(tp, caller_ip),
    4069             :         TP_STRUCT__entry(
    4070             :                 __field(dev_t, dev)
    4071             :                 __field(uint32_t, tid)
    4072             :                 __field(uint32_t, flags)
    4073             :                 __field(unsigned long, caller_ip)
    4074             :         ),
    4075             :         TP_fast_assign(
    4076             :                 __entry->dev = tp->t_mountp->m_super->s_dev;
    4077             :                 __entry->tid = 0;
    4078             :                 if (tp->t_ticket)
    4079             :                         __entry->tid = tp->t_ticket->t_tid;
    4080             :                 __entry->flags = tp->t_flags;
    4081             :                 __entry->caller_ip = caller_ip;
    4082             :         ),
    4083             :         TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
    4084             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4085             :                   __entry->tid,
    4086             :                   __entry->flags,
    4087             :                   (char *)__entry->caller_ip)
    4088             : )
    4089             : 
    4090             : #define DEFINE_TRANS_EVENT(name) \
    4091             : DEFINE_EVENT(xfs_trans_class, name, \
    4092             :         TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
    4093             :         TP_ARGS(tp, caller_ip))
    4094  3155640681 : DEFINE_TRANS_EVENT(xfs_trans_alloc);
    4095  1984517906 : DEFINE_TRANS_EVENT(xfs_trans_cancel);
    4096  2518193728 : DEFINE_TRANS_EVENT(xfs_trans_commit);
    4097  1330417727 : DEFINE_TRANS_EVENT(xfs_trans_dup);
    4098  4502643403 : DEFINE_TRANS_EVENT(xfs_trans_free);
    4099  1330428837 : DEFINE_TRANS_EVENT(xfs_trans_roll);
    4100 32732759000 : DEFINE_TRANS_EVENT(xfs_trans_add_item);
    4101  2450715772 : DEFINE_TRANS_EVENT(xfs_trans_commit_items);
    4102  2052965222 : DEFINE_TRANS_EVENT(xfs_trans_free_items);
    4103             : 
    4104   158732585 : TRACE_EVENT(xfs_iunlink_update_bucket,
    4105             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
    4106             :                  xfs_agino_t old_ptr, xfs_agino_t new_ptr),
    4107             :         TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
    4108             :         TP_STRUCT__entry(
    4109             :                 __field(dev_t, dev)
    4110             :                 __field(xfs_agnumber_t, agno)
    4111             :                 __field(unsigned int, bucket)
    4112             :                 __field(xfs_agino_t, old_ptr)
    4113             :                 __field(xfs_agino_t, new_ptr)
    4114             :         ),
    4115             :         TP_fast_assign(
    4116             :                 __entry->dev = mp->m_super->s_dev;
    4117             :                 __entry->agno = agno;
    4118             :                 __entry->bucket = bucket;
    4119             :                 __entry->old_ptr = old_ptr;
    4120             :                 __entry->new_ptr = new_ptr;
    4121             :         ),
    4122             :         TP_printk("dev %d:%d agno 0x%x bucket %u old 0x%x new 0x%x",
    4123             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4124             :                   __entry->agno,
    4125             :                   __entry->bucket,
    4126             :                   __entry->old_ptr,
    4127             :                   __entry->new_ptr)
    4128             : );
    4129             : 
    4130    72917781 : TRACE_EVENT(xfs_iunlink_update_dinode,
    4131             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
    4132             :                  xfs_agino_t old_ptr, xfs_agino_t new_ptr),
    4133             :         TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
    4134             :         TP_STRUCT__entry(
    4135             :                 __field(dev_t, dev)
    4136             :                 __field(xfs_agnumber_t, agno)
    4137             :                 __field(xfs_agino_t, agino)
    4138             :                 __field(xfs_agino_t, old_ptr)
    4139             :                 __field(xfs_agino_t, new_ptr)
    4140             :         ),
    4141             :         TP_fast_assign(
    4142             :                 __entry->dev = mp->m_super->s_dev;
    4143             :                 __entry->agno = agno;
    4144             :                 __entry->agino = agino;
    4145             :                 __entry->old_ptr = old_ptr;
    4146             :                 __entry->new_ptr = new_ptr;
    4147             :         ),
    4148             :         TP_printk("dev %d:%d agno 0x%x agino 0x%x old 0x%x new 0x%x",
    4149             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4150             :                   __entry->agno,
    4151             :                   __entry->agino,
    4152             :                   __entry->old_ptr,
    4153             :                   __entry->new_ptr)
    4154             : );
    4155             : 
    4156           0 : DECLARE_EVENT_CLASS(xfs_ag_inode_class,
    4157             :         TP_PROTO(struct xfs_inode *ip),
    4158             :         TP_ARGS(ip),
    4159             :         TP_STRUCT__entry(
    4160             :                 __field(dev_t, dev)
    4161             :                 __field(xfs_agnumber_t, agno)
    4162             :                 __field(xfs_agino_t, agino)
    4163             :         ),
    4164             :         TP_fast_assign(
    4165             :                 __entry->dev = VFS_I(ip)->i_sb->s_dev;
    4166             :                 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
    4167             :                 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
    4168             :         ),
    4169             :         TP_printk("dev %d:%d agno 0x%x agino 0x%x",
    4170             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4171             :                   __entry->agno, __entry->agino)
    4172             : )
    4173             : 
    4174             : #define DEFINE_AGINODE_EVENT(name) \
    4175             : DEFINE_EVENT(xfs_ag_inode_class, name, \
    4176             :         TP_PROTO(struct xfs_inode *ip), \
    4177             :         TP_ARGS(ip))
    4178    88233686 : DEFINE_AGINODE_EVENT(xfs_iunlink);
    4179   177358792 : DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
    4180             : 
    4181           0 : DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
    4182             :         TP_PROTO(struct xfs_mount *mp, unsigned int flags),
    4183             :         TP_ARGS(mp, flags),
    4184             :         TP_STRUCT__entry(
    4185             :                 __field(dev_t, dev)
    4186             :                 __field(unsigned int, flags)
    4187             :         ),
    4188             :         TP_fast_assign(
    4189             :                 __entry->dev = mp->m_super->s_dev;
    4190             :                 __entry->flags = flags;
    4191             :         ),
    4192             :         TP_printk("dev %d:%d flags 0x%x",
    4193             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4194             :                   __entry->flags)
    4195             : );
    4196             : #define DEFINE_FS_CORRUPT_EVENT(name)   \
    4197             : DEFINE_EVENT(xfs_fs_corrupt_class, name,        \
    4198             :         TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
    4199             :         TP_ARGS(mp, flags))
    4200      353685 : DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
    4201      300164 : DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
    4202           1 : DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
    4203           0 : DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
    4204      103825 : DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
    4205           0 : DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
    4206             : 
    4207           0 : DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
    4208             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
    4209             :         TP_ARGS(mp, agno, flags),
    4210             :         TP_STRUCT__entry(
    4211             :                 __field(dev_t, dev)
    4212             :                 __field(xfs_agnumber_t, agno)
    4213             :                 __field(unsigned int, flags)
    4214             :         ),
    4215             :         TP_fast_assign(
    4216             :                 __entry->dev = mp->m_super->s_dev;
    4217             :                 __entry->agno = agno;
    4218             :                 __entry->flags = flags;
    4219             :         ),
    4220             :         TP_printk("dev %d:%d agno 0x%x flags 0x%x",
    4221             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4222             :                   __entry->agno, __entry->flags)
    4223             : );
    4224             : #define DEFINE_AG_CORRUPT_EVENT(name)   \
    4225             : DEFINE_EVENT(xfs_ag_corrupt_class, name,        \
    4226             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
    4227             :                  unsigned int flags), \
    4228             :         TP_ARGS(mp, agno, flags))
    4229        5723 : DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
    4230     4604238 : DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
    4231         115 : DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
    4232             : 
    4233           0 : DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
    4234             :         TP_PROTO(struct xfs_inode *ip, unsigned int flags),
    4235             :         TP_ARGS(ip, flags),
    4236             :         TP_STRUCT__entry(
    4237             :                 __field(dev_t, dev)
    4238             :                 __field(xfs_ino_t, ino)
    4239             :                 __field(unsigned int, flags)
    4240             :         ),
    4241             :         TP_fast_assign(
    4242             :                 __entry->dev = ip->i_mount->m_super->s_dev;
    4243             :                 __entry->ino = ip->i_ino;
    4244             :                 __entry->flags = flags;
    4245             :         ),
    4246             :         TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
    4247             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4248             :                   __entry->ino, __entry->flags)
    4249             : );
    4250             : #define DEFINE_INODE_CORRUPT_EVENT(name)        \
    4251             : DEFINE_EVENT(xfs_inode_corrupt_class, name,     \
    4252             :         TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
    4253             :         TP_ARGS(ip, flags))
    4254        1428 : DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
    4255   917722848 : DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
    4256           0 : DEFINE_INODE_CORRUPT_EVENT(xfs_inode_unfixed_corruption);
    4257             : 
    4258           0 : TRACE_EVENT(xfs_iwalk_ag,
    4259             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    4260             :                  xfs_agino_t startino),
    4261             :         TP_ARGS(mp, agno, startino),
    4262             :         TP_STRUCT__entry(
    4263             :                 __field(dev_t, dev)
    4264             :                 __field(xfs_agnumber_t, agno)
    4265             :                 __field(xfs_agino_t, startino)
    4266             :         ),
    4267             :         TP_fast_assign(
    4268             :                 __entry->dev = mp->m_super->s_dev;
    4269             :                 __entry->agno = agno;
    4270             :                 __entry->startino = startino;
    4271             :         ),
    4272             :         TP_printk("dev %d:%d agno 0x%x startino 0x%x",
    4273             :                   MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
    4274             :                   __entry->startino)
    4275             : )
    4276             : 
    4277  2001635288 : TRACE_EVENT(xfs_iwalk_ag_rec,
    4278             :         TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
    4279             :                  struct xfs_inobt_rec_incore *irec),
    4280             :         TP_ARGS(mp, agno, irec),
    4281             :         TP_STRUCT__entry(
    4282             :                 __field(dev_t, dev)
    4283             :                 __field(xfs_agnumber_t, agno)
    4284             :                 __field(xfs_agino_t, startino)
    4285             :                 __field(uint64_t, freemask)
    4286             :         ),
    4287             :         TP_fast_assign(
    4288             :                 __entry->dev = mp->m_super->s_dev;
    4289             :                 __entry->agno = agno;
    4290             :                 __entry->startino = irec->ir_startino;
    4291             :                 __entry->freemask = irec->ir_free;
    4292             :         ),
    4293             :         TP_printk("dev %d:%d agno 0x%x startino 0x%x freemask 0x%llx",
    4294             :                   MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
    4295             :                   __entry->startino, __entry->freemask)
    4296             : )
    4297             : 
    4298        7318 : TRACE_EVENT(xfs_pwork_init,
    4299             :         TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
    4300             :         TP_ARGS(mp, nr_threads, pid),
    4301             :         TP_STRUCT__entry(
    4302             :                 __field(dev_t, dev)
    4303             :                 __field(unsigned int, nr_threads)
    4304             :                 __field(pid_t, pid)
    4305             :         ),
    4306             :         TP_fast_assign(
    4307             :                 __entry->dev = mp->m_super->s_dev;
    4308             :                 __entry->nr_threads = nr_threads;
    4309             :                 __entry->pid = pid;
    4310             :         ),
    4311             :         TP_printk("dev %d:%d nr_threads %u pid %u",
    4312             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4313             :                   __entry->nr_threads, __entry->pid)
    4314             : )
    4315             : 
    4316           0 : DECLARE_EVENT_CLASS(xfs_kmem_class,
    4317             :         TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
    4318             :         TP_ARGS(size, flags, caller_ip),
    4319             :         TP_STRUCT__entry(
    4320             :                 __field(ssize_t, size)
    4321             :                 __field(int, flags)
    4322             :                 __field(unsigned long, caller_ip)
    4323             :         ),
    4324             :         TP_fast_assign(
    4325             :                 __entry->size = size;
    4326             :                 __entry->flags = flags;
    4327             :                 __entry->caller_ip = caller_ip;
    4328             :         ),
    4329             :         TP_printk("size %zd flags 0x%x caller %pS",
    4330             :                   __entry->size,
    4331             :                   __entry->flags,
    4332             :                   (char *)__entry->caller_ip)
    4333             : )
    4334             : 
    4335             : #define DEFINE_KMEM_EVENT(name) \
    4336             : DEFINE_EVENT(xfs_kmem_class, name, \
    4337             :         TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
    4338             :         TP_ARGS(size, flags, caller_ip))
    4339  2954940705 : DEFINE_KMEM_EVENT(kmem_alloc);
    4340             : 
    4341          95 : TRACE_EVENT(xfs_check_new_dalign,
    4342             :         TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
    4343             :         TP_ARGS(mp, new_dalign, calc_rootino),
    4344             :         TP_STRUCT__entry(
    4345             :                 __field(dev_t, dev)
    4346             :                 __field(int, new_dalign)
    4347             :                 __field(xfs_ino_t, sb_rootino)
    4348             :                 __field(xfs_ino_t, calc_rootino)
    4349             :         ),
    4350             :         TP_fast_assign(
    4351             :                 __entry->dev = mp->m_super->s_dev;
    4352             :                 __entry->new_dalign = new_dalign;
    4353             :                 __entry->sb_rootino = mp->m_sb.sb_rootino;
    4354             :                 __entry->calc_rootino = calc_rootino;
    4355             :         ),
    4356             :         TP_printk("dev %d:%d new_dalign %d sb_rootino 0x%llx calc_rootino 0x%llx",
    4357             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4358             :                   __entry->new_dalign, __entry->sb_rootino,
    4359             :                   __entry->calc_rootino)
    4360             : )
    4361             : 
    4362      273518 : TRACE_EVENT(xfs_btree_commit_afakeroot,
    4363             :         TP_PROTO(struct xfs_btree_cur *cur),
    4364             :         TP_ARGS(cur),
    4365             :         TP_STRUCT__entry(
    4366             :                 __field(dev_t, dev)
    4367             :                 __field(xfs_btnum_t, btnum)
    4368             :                 __field(xfs_agnumber_t, agno)
    4369             :                 __field(xfs_agblock_t, agbno)
    4370             :                 __field(unsigned int, levels)
    4371             :                 __field(unsigned int, blocks)
    4372             :         ),
    4373             :         TP_fast_assign(
    4374             :                 __entry->dev = cur->bc_mp->m_super->s_dev;
    4375             :                 __entry->btnum = cur->bc_btnum;
    4376             :                 __entry->agno = cur->bc_ag.pag->pag_agno;
    4377             :                 __entry->agbno = cur->bc_ag.afake->af_root;
    4378             :                 __entry->levels = cur->bc_ag.afake->af_levels;
    4379             :                 __entry->blocks = cur->bc_ag.afake->af_blocks;
    4380             :         ),
    4381             :         TP_printk("dev %d:%d btree %s agno 0x%x levels %u blocks %u root %u",
    4382             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4383             :                   __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
    4384             :                   __entry->agno,
    4385             :                   __entry->levels,
    4386             :                   __entry->blocks,
    4387             :                   __entry->agbno)
    4388             : )
    4389             : 
    4390     2568665 : TRACE_EVENT(xfs_btree_commit_ifakeroot,
    4391             :         TP_PROTO(struct xfs_btree_cur *cur),
    4392             :         TP_ARGS(cur),
    4393             :         TP_STRUCT__entry(
    4394             :                 __field(dev_t, dev)
    4395             :                 __field(xfs_btnum_t, btnum)
    4396             :                 __field(xfs_agnumber_t, agno)
    4397             :                 __field(xfs_agino_t, agino)
    4398             :                 __field(unsigned int, levels)
    4399             :                 __field(unsigned int, blocks)
    4400             :                 __field(int, whichfork)
    4401             :         ),
    4402             :         TP_fast_assign(
    4403             :                 __entry->dev = cur->bc_mp->m_super->s_dev;
    4404             :                 __entry->btnum = cur->bc_btnum;
    4405             :                 __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp,
    4406             :                                         cur->bc_ino.ip->i_ino);
    4407             :                 __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp,
    4408             :                                         cur->bc_ino.ip->i_ino);
    4409             :                 __entry->levels = cur->bc_ino.ifake->if_levels;
    4410             :                 __entry->blocks = cur->bc_ino.ifake->if_blocks;
    4411             :                 __entry->whichfork = cur->bc_ino.whichfork;
    4412             :         ),
    4413             :         TP_printk("dev %d:%d btree %s agno 0x%x agino 0x%x whichfork %s levels %u blocks %u",
    4414             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4415             :                   __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
    4416             :                   __entry->agno,
    4417             :                   __entry->agino,
    4418             :                   __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
    4419             :                   __entry->levels,
    4420             :                   __entry->blocks)
    4421             : )
    4422             : 
    4423      769975 : TRACE_EVENT(xfs_btree_bload_level_geometry,
    4424             :         TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
    4425             :                  uint64_t nr_this_level, unsigned int nr_per_block,
    4426             :                  unsigned int desired_npb, uint64_t blocks,
    4427             :                  uint64_t blocks_with_extra),
    4428             :         TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks,
    4429             :                 blocks_with_extra),
    4430             :         TP_STRUCT__entry(
    4431             :                 __field(dev_t, dev)
    4432             :                 __field(xfs_btnum_t, btnum)
    4433             :                 __field(unsigned int, level)
    4434             :                 __field(unsigned int, nlevels)
    4435             :                 __field(uint64_t, nr_this_level)
    4436             :                 __field(unsigned int, nr_per_block)
    4437             :                 __field(unsigned int, desired_npb)
    4438             :                 __field(unsigned long long, blocks)
    4439             :                 __field(unsigned long long, blocks_with_extra)
    4440             :         ),
    4441             :         TP_fast_assign(
    4442             :                 __entry->dev = cur->bc_mp->m_super->s_dev;
    4443             :                 __entry->btnum = cur->bc_btnum;
    4444             :                 __entry->level = level;
    4445             :                 __entry->nlevels = cur->bc_nlevels;
    4446             :                 __entry->nr_this_level = nr_this_level;
    4447             :                 __entry->nr_per_block = nr_per_block;
    4448             :                 __entry->desired_npb = desired_npb;
    4449             :                 __entry->blocks = blocks;
    4450             :                 __entry->blocks_with_extra = blocks_with_extra;
    4451             :         ),
    4452             :         TP_printk("dev %d:%d btree %s level %u/%u nr_this_level %llu nr_per_block %u desired_npb %u blocks %llu blocks_with_extra %llu",
    4453             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4454             :                   __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
    4455             :                   __entry->level,
    4456             :                   __entry->nlevels,
    4457             :                   __entry->nr_this_level,
    4458             :                   __entry->nr_per_block,
    4459             :                   __entry->desired_npb,
    4460             :                   __entry->blocks,
    4461             :                   __entry->blocks_with_extra)
    4462             : )
    4463             : 
    4464     1029221 : TRACE_EVENT(xfs_btree_bload_block,
    4465             :         TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
    4466             :                  uint64_t block_idx, uint64_t nr_blocks,
    4467             :                  union xfs_btree_ptr *ptr, unsigned int nr_records),
    4468             :         TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records),
    4469             :         TP_STRUCT__entry(
    4470             :                 __field(dev_t, dev)
    4471             :                 __field(xfs_btnum_t, btnum)
    4472             :                 __field(unsigned int, level)
    4473             :                 __field(unsigned long long, block_idx)
    4474             :                 __field(unsigned long long, nr_blocks)
    4475             :                 __field(xfs_agnumber_t, agno)
    4476             :                 __field(xfs_agblock_t, agbno)
    4477             :                 __field(unsigned int, nr_records)
    4478             :         ),
    4479             :         TP_fast_assign(
    4480             :                 __entry->dev = cur->bc_mp->m_super->s_dev;
    4481             :                 __entry->btnum = cur->bc_btnum;
    4482             :                 __entry->level = level;
    4483             :                 __entry->block_idx = block_idx;
    4484             :                 __entry->nr_blocks = nr_blocks;
    4485             :                 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
    4486             :                         xfs_fsblock_t   fsb = be64_to_cpu(ptr->l);
    4487             : 
    4488             :                         __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb);
    4489             :                         __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb);
    4490             :                 } else {
    4491             :                         __entry->agno = cur->bc_ag.pag->pag_agno;
    4492             :                         __entry->agbno = be32_to_cpu(ptr->s);
    4493             :                 }
    4494             :                 __entry->nr_records = nr_records;
    4495             :         ),
    4496             :         TP_printk("dev %d:%d btree %s level %u block %llu/%llu agno 0x%x agbno 0x%x recs %u",
    4497             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4498             :                   __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
    4499             :                   __entry->level,
    4500             :                   __entry->block_idx,
    4501             :                   __entry->nr_blocks,
    4502             :                   __entry->agno,
    4503             :                   __entry->agbno,
    4504             :                   __entry->nr_records)
    4505             : )
    4506             : 
    4507           0 : DECLARE_EVENT_CLASS(xfs_timestamp_range_class,
    4508             :         TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max),
    4509             :         TP_ARGS(mp, min, max),
    4510             :         TP_STRUCT__entry(
    4511             :                 __field(dev_t, dev)
    4512             :                 __field(long long, min)
    4513             :                 __field(long long, max)
    4514             :         ),
    4515             :         TP_fast_assign(
    4516             :                 __entry->dev = mp->m_super->s_dev;
    4517             :                 __entry->min = min;
    4518             :                 __entry->max = max;
    4519             :         ),
    4520             :         TP_printk("dev %d:%d min %lld max %lld",
    4521             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4522             :                   __entry->min,
    4523             :                   __entry->max)
    4524             : )
    4525             : 
    4526             : #define DEFINE_TIMESTAMP_RANGE_EVENT(name) \
    4527             : DEFINE_EVENT(xfs_timestamp_range_class, name, \
    4528             :         TP_PROTO(struct xfs_mount *mp, long long min, long long max), \
    4529             :         TP_ARGS(mp, min, max))
    4530       60890 : DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range);
    4531       36142 : DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range);
    4532             : 
    4533           0 : DECLARE_EVENT_CLASS(xfs_icwalk_class,
    4534             :         TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw,
    4535             :                  unsigned long caller_ip),
    4536             :         TP_ARGS(mp, icw, caller_ip),
    4537             :         TP_STRUCT__entry(
    4538             :                 __field(dev_t, dev)
    4539             :                 __field(__u32, flags)
    4540             :                 __field(uint32_t, uid)
    4541             :                 __field(uint32_t, gid)
    4542             :                 __field(prid_t, prid)
    4543             :                 __field(__u64, min_file_size)
    4544             :                 __field(long, scan_limit)
    4545             :                 __field(unsigned long, caller_ip)
    4546             :         ),
    4547             :         TP_fast_assign(
    4548             :                 __entry->dev = mp->m_super->s_dev;
    4549             :                 __entry->flags = icw ? icw->icw_flags : 0;
    4550             :                 __entry->uid = icw ? from_kuid(mp->m_super->s_user_ns,
    4551             :                                                 icw->icw_uid) : 0;
    4552             :                 __entry->gid = icw ? from_kgid(mp->m_super->s_user_ns,
    4553             :                                                 icw->icw_gid) : 0;
    4554             :                 __entry->prid = icw ? icw->icw_prid : 0;
    4555             :                 __entry->min_file_size = icw ? icw->icw_min_file_size : 0;
    4556             :                 __entry->scan_limit = icw ? icw->icw_scan_limit : 0;
    4557             :                 __entry->caller_ip = caller_ip;
    4558             :         ),
    4559             :         TP_printk("dev %d:%d flags 0x%x uid %u gid %u prid %u minsize %llu scan_limit %ld caller %pS",
    4560             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4561             :                   __entry->flags,
    4562             :                   __entry->uid,
    4563             :                   __entry->gid,
    4564             :                   __entry->prid,
    4565             :                   __entry->min_file_size,
    4566             :                   __entry->scan_limit,
    4567             :                   (char *)__entry->caller_ip)
    4568             : );
    4569             : #define DEFINE_ICWALK_EVENT(name)       \
    4570             : DEFINE_EVENT(xfs_icwalk_class, name,    \
    4571             :         TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw, \
    4572             :                  unsigned long caller_ip), \
    4573             :         TP_ARGS(mp, icw, caller_ip))
    4574           0 : DEFINE_ICWALK_EVENT(xfs_ioc_free_eofblocks);
    4575     1141143 : DEFINE_ICWALK_EVENT(xfs_blockgc_free_space);
    4576             : 
    4577             : TRACE_DEFINE_ENUM(XLOG_STATE_ACTIVE);
    4578             : TRACE_DEFINE_ENUM(XLOG_STATE_WANT_SYNC);
    4579             : TRACE_DEFINE_ENUM(XLOG_STATE_SYNCING);
    4580             : TRACE_DEFINE_ENUM(XLOG_STATE_DONE_SYNC);
    4581             : TRACE_DEFINE_ENUM(XLOG_STATE_CALLBACK);
    4582             : TRACE_DEFINE_ENUM(XLOG_STATE_DIRTY);
    4583             : 
    4584           0 : DECLARE_EVENT_CLASS(xlog_iclog_class,
    4585             :         TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip),
    4586             :         TP_ARGS(iclog, caller_ip),
    4587             :         TP_STRUCT__entry(
    4588             :                 __field(dev_t, dev)
    4589             :                 __field(uint32_t, state)
    4590             :                 __field(int32_t, refcount)
    4591             :                 __field(uint32_t, offset)
    4592             :                 __field(uint32_t, flags)
    4593             :                 __field(unsigned long long, lsn)
    4594             :                 __field(unsigned long, caller_ip)
    4595             :         ),
    4596             :         TP_fast_assign(
    4597             :                 __entry->dev = iclog->ic_log->l_mp->m_super->s_dev;
    4598             :                 __entry->state = iclog->ic_state;
    4599             :                 __entry->refcount = atomic_read(&iclog->ic_refcnt);
    4600             :                 __entry->offset = iclog->ic_offset;
    4601             :                 __entry->flags = iclog->ic_flags;
    4602             :                 __entry->lsn = be64_to_cpu(iclog->ic_header.h_lsn);
    4603             :                 __entry->caller_ip = caller_ip;
    4604             :         ),
    4605             :         TP_printk("dev %d:%d state %s refcnt %d offset %u lsn 0x%llx flags %s caller %pS",
    4606             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4607             :                   __print_symbolic(__entry->state, XLOG_STATE_STRINGS),
    4608             :                   __entry->refcount,
    4609             :                   __entry->offset,
    4610             :                   __entry->lsn,
    4611             :                   __print_flags(__entry->flags, "|", XLOG_ICL_STRINGS),
    4612             :                   (char *)__entry->caller_ip)
    4613             : 
    4614             : );
    4615             : 
    4616             : #define DEFINE_ICLOG_EVENT(name)        \
    4617             : DEFINE_EVENT(xlog_iclog_class, name,    \
    4618             :         TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip), \
    4619             :         TP_ARGS(iclog, caller_ip))
    4620             : 
    4621    28793059 : DEFINE_ICLOG_EVENT(xlog_iclog_activate);
    4622    28793059 : DEFINE_ICLOG_EVENT(xlog_iclog_clean);
    4623    28793059 : DEFINE_ICLOG_EVENT(xlog_iclog_callback);
    4624    28793059 : DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_start);
    4625    28793059 : DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_done);
    4626     4275110 : DEFINE_ICLOG_EVENT(xlog_iclog_force);
    4627     3674813 : DEFINE_ICLOG_EVENT(xlog_iclog_force_lsn);
    4628    34735214 : DEFINE_ICLOG_EVENT(xlog_iclog_get_space);
    4629    45694471 : DEFINE_ICLOG_EVENT(xlog_iclog_release);
    4630    28806023 : DEFINE_ICLOG_EVENT(xlog_iclog_switch);
    4631    28805500 : DEFINE_ICLOG_EVENT(xlog_iclog_sync);
    4632    28805542 : DEFINE_ICLOG_EVENT(xlog_iclog_syncing);
    4633    28805549 : DEFINE_ICLOG_EVENT(xlog_iclog_sync_done);
    4634           0 : DEFINE_ICLOG_EVENT(xlog_iclog_want_sync);
    4635    10667590 : DEFINE_ICLOG_EVENT(xlog_iclog_wait_on);
    4636    28804746 : DEFINE_ICLOG_EVENT(xlog_iclog_write);
    4637             : 
    4638             : TRACE_DEFINE_ENUM(XFS_DAS_UNINIT);
    4639             : TRACE_DEFINE_ENUM(XFS_DAS_SF_ADD);
    4640             : TRACE_DEFINE_ENUM(XFS_DAS_SF_REMOVE);
    4641             : TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ADD);
    4642             : TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE);
    4643             : TRACE_DEFINE_ENUM(XFS_DAS_NODE_ADD);
    4644             : TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE);
    4645             : TRACE_DEFINE_ENUM(XFS_DAS_LEAF_SET_RMT);
    4646             : TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ALLOC_RMT);
    4647             : TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REPLACE);
    4648             : TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_OLD);
    4649             : TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_RMT);
    4650             : TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_ATTR);
    4651             : TRACE_DEFINE_ENUM(XFS_DAS_NODE_SET_RMT);
    4652             : TRACE_DEFINE_ENUM(XFS_DAS_NODE_ALLOC_RMT);
    4653             : TRACE_DEFINE_ENUM(XFS_DAS_NODE_REPLACE);
    4654             : TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_OLD);
    4655             : TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_RMT);
    4656             : TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_ATTR);
    4657             : TRACE_DEFINE_ENUM(XFS_DAS_DONE);
    4658             : 
    4659           0 : DECLARE_EVENT_CLASS(xfs_das_state_class,
    4660             :         TP_PROTO(int das, struct xfs_inode *ip),
    4661             :         TP_ARGS(das, ip),
    4662             :         TP_STRUCT__entry(
    4663             :                 __field(int, das)
    4664             :                 __field(xfs_ino_t, ino)
    4665             :         ),
    4666             :         TP_fast_assign(
    4667             :                 __entry->das = das;
    4668             :                 __entry->ino = ip->i_ino;
    4669             :         ),
    4670             :         TP_printk("state change %s ino 0x%llx",
    4671             :                   __print_symbolic(__entry->das, XFS_DAS_STRINGS),
    4672             :                   __entry->ino)
    4673             : )
    4674             : 
    4675             : #define DEFINE_DAS_STATE_EVENT(name) \
    4676             : DEFINE_EVENT(xfs_das_state_class, name, \
    4677             :         TP_PROTO(int das, struct xfs_inode *ip), \
    4678             :         TP_ARGS(das, ip))
    4679   199704690 : DEFINE_DAS_STATE_EVENT(xfs_attr_sf_addname_return);
    4680   190633575 : DEFINE_DAS_STATE_EVENT(xfs_attr_set_iter_return);
    4681    76928613 : DEFINE_DAS_STATE_EVENT(xfs_attr_leaf_addname_return);
    4682     2160650 : DEFINE_DAS_STATE_EVENT(xfs_attr_node_addname_return);
    4683           0 : DEFINE_DAS_STATE_EVENT(xfs_attr_remove_iter_return);
    4684        2963 : DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_alloc);
    4685           0 : DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_remove_return);
    4686   191240807 : DEFINE_DAS_STATE_EVENT(xfs_attr_defer_add);
    4687    82883298 : DEFINE_DAS_STATE_EVENT(xfs_attr_defer_replace);
    4688    96472014 : DEFINE_DAS_STATE_EVENT(xfs_attr_defer_remove);
    4689             : 
    4690             : 
    4691        9251 : TRACE_EVENT(xfs_force_shutdown,
    4692             :         TP_PROTO(struct xfs_mount *mp, int ptag, int flags, const char *fname,
    4693             :                  int line_num),
    4694             :         TP_ARGS(mp, ptag, flags, fname, line_num),
    4695             :         TP_STRUCT__entry(
    4696             :                 __field(dev_t, dev)
    4697             :                 __field(int, ptag)
    4698             :                 __field(int, flags)
    4699             :                 __string(fname, fname)
    4700             :                 __field(int, line_num)
    4701             :         ),
    4702             :         TP_fast_assign(
    4703             :                 __entry->dev = mp->m_super->s_dev;
    4704             :                 __entry->ptag = ptag;
    4705             :                 __entry->flags = flags;
    4706             :                 __assign_str(fname, fname);
    4707             :                 __entry->line_num = line_num;
    4708             :         ),
    4709             :         TP_printk("dev %d:%d tag %s flags %s file %s line_num %d",
    4710             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4711             :                 __print_flags(__entry->ptag, "|", XFS_PTAG_STRINGS),
    4712             :                 __print_flags(__entry->flags, "|", XFS_SHUTDOWN_STRINGS),
    4713             :                 __get_str(fname),
    4714             :                 __entry->line_num)
    4715             : );
    4716             : 
    4717             : #ifdef CONFIG_XFS_DRAIN_INTENTS
    4718           0 : DECLARE_EVENT_CLASS(xfs_perag_intents_class,
    4719             :         TP_PROTO(struct xfs_perag *pag, void *caller_ip),
    4720             :         TP_ARGS(pag, caller_ip),
    4721             :         TP_STRUCT__entry(
    4722             :                 __field(dev_t, dev)
    4723             :                 __field(xfs_agnumber_t, agno)
    4724             :                 __field(long, nr_intents)
    4725             :                 __field(void *, caller_ip)
    4726             :         ),
    4727             :         TP_fast_assign(
    4728             :                 __entry->dev = pag->pag_mount->m_super->s_dev;
    4729             :                 __entry->agno = pag->pag_agno;
    4730             :                 __entry->nr_intents = atomic_read(&pag->pag_intents_drain.dr_count);
    4731             :                 __entry->caller_ip = caller_ip;
    4732             :         ),
    4733             :         TP_printk("dev %d:%d agno 0x%x intents %ld caller %pS",
    4734             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4735             :                   __entry->agno,
    4736             :                   __entry->nr_intents,
    4737             :                   __entry->caller_ip)
    4738             : );
    4739             : 
    4740             : #define DEFINE_PERAG_INTENTS_EVENT(name)        \
    4741             : DEFINE_EVENT(xfs_perag_intents_class, name,                                     \
    4742             :         TP_PROTO(struct xfs_perag *pag, void *caller_ip), \
    4743             :         TP_ARGS(pag, caller_ip))
    4744   889175047 : DEFINE_PERAG_INTENTS_EVENT(xfs_perag_intent_hold);
    4745   889205144 : DEFINE_PERAG_INTENTS_EVENT(xfs_perag_intent_rele);
    4746       50592 : DEFINE_PERAG_INTENTS_EVENT(xfs_perag_wait_intents);
    4747             : 
    4748             : #endif /* CONFIG_XFS_DRAIN_INTENTS */
    4749             : 
    4750     5816553 : TRACE_EVENT(xfs_swapext_overhead,
    4751             :         TP_PROTO(struct xfs_mount *mp, unsigned long long bmbt_blocks,
    4752             :                  unsigned long long rmapbt_blocks),
    4753             :         TP_ARGS(mp, bmbt_blocks, rmapbt_blocks),
    4754             :         TP_STRUCT__entry(
    4755             :                 __field(dev_t, dev)
    4756             :                 __field(unsigned long long, bmbt_blocks)
    4757             :                 __field(unsigned long long, rmapbt_blocks)
    4758             :         ),
    4759             :         TP_fast_assign(
    4760             :                 __entry->dev = mp->m_super->s_dev;
    4761             :                 __entry->bmbt_blocks = bmbt_blocks;
    4762             :                 __entry->rmapbt_blocks = rmapbt_blocks;
    4763             :         ),
    4764             :         TP_printk("dev %d:%d bmbt_blocks 0x%llx rmapbt_blocks 0x%llx",
    4765             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4766             :                   __entry->bmbt_blocks,
    4767             :                   __entry->rmapbt_blocks)
    4768             : );
    4769             : 
    4770           0 : DECLARE_EVENT_CLASS(xfs_swapext_estimate_class,
    4771             :         TP_PROTO(const struct xfs_swapext_req *req),
    4772             :         TP_ARGS(req),
    4773             :         TP_STRUCT__entry(
    4774             :                 __field(dev_t, dev)
    4775             :                 __field(xfs_ino_t, ino1)
    4776             :                 __field(xfs_ino_t, ino2)
    4777             :                 __field(xfs_fileoff_t, startoff1)
    4778             :                 __field(xfs_fileoff_t, startoff2)
    4779             :                 __field(xfs_filblks_t, blockcount)
    4780             :                 __field(int, whichfork)
    4781             :                 __field(unsigned int, req_flags)
    4782             :                 __field(xfs_filblks_t, ip1_bcount)
    4783             :                 __field(xfs_filblks_t, ip2_bcount)
    4784             :                 __field(xfs_filblks_t, ip1_rtbcount)
    4785             :                 __field(xfs_filblks_t, ip2_rtbcount)
    4786             :                 __field(unsigned long long, resblks)
    4787             :                 __field(unsigned long long, nr_exchanges)
    4788             :         ),
    4789             :         TP_fast_assign(
    4790             :                 __entry->dev = req->ip1->i_mount->m_super->s_dev;
    4791             :                 __entry->ino1 = req->ip1->i_ino;
    4792             :                 __entry->ino2 = req->ip2->i_ino;
    4793             :                 __entry->startoff1 = req->startoff1;
    4794             :                 __entry->startoff2 = req->startoff2;
    4795             :                 __entry->blockcount = req->blockcount;
    4796             :                 __entry->whichfork = req->whichfork;
    4797             :                 __entry->req_flags = req->req_flags;
    4798             :                 __entry->ip1_bcount = req->ip1_bcount;
    4799             :                 __entry->ip2_bcount = req->ip2_bcount;
    4800             :                 __entry->ip1_rtbcount = req->ip1_rtbcount;
    4801             :                 __entry->ip2_rtbcount = req->ip2_rtbcount;
    4802             :                 __entry->resblks = req->resblks;
    4803             :                 __entry->nr_exchanges = req->nr_exchanges;
    4804             :         ),
    4805             :         TP_printk("dev %d:%d ino1 0x%llx fileoff1 0x%llx ino2 0x%llx fileoff2 0x%llx fsbcount 0x%llx flags (%s) fork %s bcount1 0x%llx rtbcount1 0x%llx bcount2 0x%llx rtbcount2 0x%llx resblks 0x%llx nr_exchanges %llu",
    4806             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4807             :                   __entry->ino1, __entry->startoff1,
    4808             :                   __entry->ino2, __entry->startoff2,
    4809             :                   __entry->blockcount,
    4810             :                   __print_flags(__entry->req_flags, "|", XFS_SWAP_REQ_STRINGS),
    4811             :                   __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
    4812             :                   __entry->ip1_bcount,
    4813             :                   __entry->ip1_rtbcount,
    4814             :                   __entry->ip2_bcount,
    4815             :                   __entry->ip2_rtbcount,
    4816             :                   __entry->resblks,
    4817             :                   __entry->nr_exchanges)
    4818             : );
    4819             : 
    4820             : #define DEFINE_SWAPEXT_ESTIMATE_EVENT(name)     \
    4821             : DEFINE_EVENT(xfs_swapext_estimate_class, name,  \
    4822             :         TP_PROTO(const struct xfs_swapext_req *req), \
    4823             :         TP_ARGS(req))
    4824     1302128 : DEFINE_SWAPEXT_ESTIMATE_EVENT(xfs_swapext_initial_estimate);
    4825     5816442 : DEFINE_SWAPEXT_ESTIMATE_EVENT(xfs_swapext_final_estimate);
    4826             : 
    4827           0 : DECLARE_EVENT_CLASS(xfs_swapext_intent_class,
    4828             :         TP_PROTO(struct xfs_mount *mp, const struct xfs_swapext_intent *sxi),
    4829             :         TP_ARGS(mp, sxi),
    4830             :         TP_STRUCT__entry(
    4831             :                 __field(dev_t, dev)
    4832             :                 __field(xfs_ino_t, ino1)
    4833             :                 __field(xfs_ino_t, ino2)
    4834             :                 __field(unsigned int, flags)
    4835             :                 __field(unsigned int, opflags)
    4836             :                 __field(xfs_fileoff_t, startoff1)
    4837             :                 __field(xfs_fileoff_t, startoff2)
    4838             :                 __field(xfs_filblks_t, blockcount)
    4839             :                 __field(xfs_fsize_t, isize1)
    4840             :                 __field(xfs_fsize_t, isize2)
    4841             :                 __field(xfs_fsize_t, new_isize1)
    4842             :                 __field(xfs_fsize_t, new_isize2)
    4843             :         ),
    4844             :         TP_fast_assign(
    4845             :                 __entry->dev = mp->m_super->s_dev;
    4846             :                 __entry->ino1 = sxi->sxi_ip1->i_ino;
    4847             :                 __entry->ino2 = sxi->sxi_ip2->i_ino;
    4848             :                 __entry->flags = sxi->sxi_flags;
    4849             :                 __entry->opflags = sxi->sxi_op_flags;
    4850             :                 __entry->startoff1 = sxi->sxi_startoff1;
    4851             :                 __entry->startoff2 = sxi->sxi_startoff2;
    4852             :                 __entry->blockcount = sxi->sxi_blockcount;
    4853             :                 __entry->isize1 = sxi->sxi_ip1->i_disk_size;
    4854             :                 __entry->isize2 = sxi->sxi_ip2->i_disk_size;
    4855             :                 __entry->new_isize1 = sxi->sxi_isize1;
    4856             :                 __entry->new_isize2 = sxi->sxi_isize2;
    4857             :         ),
    4858             :         TP_printk("dev %d:%d ino1 0x%llx fileoff1 0x%llx ino2 0x%llx fileoff2 0x%llx fsbcount 0x%llx flags (%s) opflags (%s) isize1 0x%llx newisize1 0x%llx isize2 0x%llx newisize2 0x%llx",
    4859             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4860             :                   __entry->ino1, __entry->startoff1,
    4861             :                   __entry->ino2, __entry->startoff2,
    4862             :                   __entry->blockcount,
    4863             :                   __print_flags(__entry->flags, "|", XFS_SWAP_EXT_STRINGS),
    4864             :                   __print_flags(__entry->opflags, "|", XFS_SWAP_EXT_OP_STRINGS),
    4865             :                   __entry->isize1, __entry->new_isize1,
    4866             :                   __entry->isize2, __entry->new_isize2)
    4867             : );
    4868             : 
    4869             : #define DEFINE_SWAPEXT_INTENT_EVENT(name)       \
    4870             : DEFINE_EVENT(xfs_swapext_intent_class, name,    \
    4871             :         TP_PROTO(struct xfs_mount *mp, const struct xfs_swapext_intent *sxi), \
    4872             :         TP_ARGS(mp, sxi))
    4873     5117773 : DEFINE_SWAPEXT_INTENT_EVENT(xfs_swapext_defer);
    4874          17 : DEFINE_SWAPEXT_INTENT_EVENT(xfs_swapext_recover);
    4875             : 
    4876    10694840 : TRACE_EVENT(xfs_swapext_delta_nextents_step,
    4877             :         TP_PROTO(struct xfs_mount *mp,
    4878             :                  const struct xfs_bmbt_irec *left,
    4879             :                  const struct xfs_bmbt_irec *curr,
    4880             :                  const struct xfs_bmbt_irec *new,
    4881             :                  const struct xfs_bmbt_irec *right,
    4882             :                  int delta, unsigned int state),
    4883             :         TP_ARGS(mp, left, curr, new, right, delta, state),
    4884             :         TP_STRUCT__entry(
    4885             :                 __field(dev_t, dev)
    4886             :                 __field(xfs_fileoff_t, loff)
    4887             :                 __field(xfs_fsblock_t, lstart)
    4888             :                 __field(xfs_filblks_t, lcount)
    4889             :                 __field(xfs_fileoff_t, coff)
    4890             :                 __field(xfs_fsblock_t, cstart)
    4891             :                 __field(xfs_filblks_t, ccount)
    4892             :                 __field(xfs_fileoff_t, noff)
    4893             :                 __field(xfs_fsblock_t, nstart)
    4894             :                 __field(xfs_filblks_t, ncount)
    4895             :                 __field(xfs_fileoff_t, roff)
    4896             :                 __field(xfs_fsblock_t, rstart)
    4897             :                 __field(xfs_filblks_t, rcount)
    4898             :                 __field(int, delta)
    4899             :                 __field(unsigned int, state)
    4900             :         ),
    4901             :         TP_fast_assign(
    4902             :                 __entry->dev = mp->m_super->s_dev;
    4903             :                 __entry->loff = left->br_startoff;
    4904             :                 __entry->lstart = left->br_startblock;
    4905             :                 __entry->lcount = left->br_blockcount;
    4906             :                 __entry->coff = curr->br_startoff;
    4907             :                 __entry->cstart = curr->br_startblock;
    4908             :                 __entry->ccount = curr->br_blockcount;
    4909             :                 __entry->noff = new->br_startoff;
    4910             :                 __entry->nstart = new->br_startblock;
    4911             :                 __entry->ncount = new->br_blockcount;
    4912             :                 __entry->roff = right->br_startoff;
    4913             :                 __entry->rstart = right->br_startblock;
    4914             :                 __entry->rcount = right->br_blockcount;
    4915             :                 __entry->delta = delta;
    4916             :                 __entry->state = state;
    4917             :         ),
    4918             :         TP_printk("dev %d:%d left 0x%llx:0x%llx:0x%llx; curr 0x%llx:0x%llx:0x%llx <- new 0x%llx:0x%llx:0x%llx; right 0x%llx:0x%llx:0x%llx delta %d state 0x%x",
    4919             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4920             :                 __entry->loff, __entry->lstart, __entry->lcount,
    4921             :                 __entry->coff, __entry->cstart, __entry->ccount,
    4922             :                 __entry->noff, __entry->nstart, __entry->ncount,
    4923             :                 __entry->roff, __entry->rstart, __entry->rcount,
    4924             :                 __entry->delta, __entry->state)
    4925             : );
    4926             : 
    4927     1302140 : TRACE_EVENT(xfs_swapext_delta_nextents,
    4928             :         TP_PROTO(const struct xfs_swapext_req *req, int64_t d_nexts1,
    4929             :                  int64_t d_nexts2),
    4930             :         TP_ARGS(req, d_nexts1, d_nexts2),
    4931             :         TP_STRUCT__entry(
    4932             :                 __field(dev_t, dev)
    4933             :                 __field(xfs_ino_t, ino1)
    4934             :                 __field(xfs_ino_t, ino2)
    4935             :                 __field(xfs_extnum_t, nexts1)
    4936             :                 __field(xfs_extnum_t, nexts2)
    4937             :                 __field(int64_t, d_nexts1)
    4938             :                 __field(int64_t, d_nexts2)
    4939             :         ),
    4940             :         TP_fast_assign(
    4941             :                 __entry->dev = req->ip1->i_mount->m_super->s_dev;
    4942             :                 __entry->ino1 = req->ip1->i_ino;
    4943             :                 __entry->ino2 = req->ip2->i_ino;
    4944             :                 __entry->nexts1 = xfs_ifork_ptr(req->ip1, req->whichfork)->if_nextents;
    4945             :                 __entry->nexts2 = xfs_ifork_ptr(req->ip2, req->whichfork)->if_nextents;
    4946             :                 __entry->d_nexts1 = d_nexts1;
    4947             :                 __entry->d_nexts2 = d_nexts2;
    4948             :         ),
    4949             :         TP_printk("dev %d:%d ino1 0x%llx nexts %llu ino2 0x%llx nexts %llu delta1 %lld delta2 %lld",
    4950             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4951             :                   __entry->ino1, __entry->nexts1,
    4952             :                   __entry->ino2, __entry->nexts2,
    4953             :                   __entry->d_nexts1, __entry->d_nexts2)
    4954             : );
    4955             : 
    4956   430397578 : TRACE_EVENT(xfs_getparent_listent,
    4957             :         TP_PROTO(struct xfs_inode *ip, const struct xfs_getparents *ppi,
    4958             :                  const struct xfs_parent_name_irec *irec),
    4959             :         TP_ARGS(ip, ppi, irec),
    4960             :         TP_STRUCT__entry(
    4961             :                 __field(dev_t, dev)
    4962             :                 __field(xfs_ino_t, ino)
    4963             :                 __field(unsigned int, count)
    4964             :                 __field(unsigned int, bufsize)
    4965             :                 __field(xfs_ino_t, parent_ino)
    4966             :                 __field(unsigned int, parent_gen)
    4967             :                 __field(unsigned int, namelen)
    4968             :                 __dynamic_array(char, name, irec->p_namelen)
    4969             :         ),
    4970             :         TP_fast_assign(
    4971             :                 __entry->dev = ip->i_mount->m_super->s_dev;
    4972             :                 __entry->ino = ip->i_ino;
    4973             :                 __entry->count = ppi->gp_count;
    4974             :                 __entry->bufsize = ppi->gp_bufsize;
    4975             :                 __entry->parent_ino = irec->p_ino;
    4976             :                 __entry->parent_gen = irec->p_gen;
    4977             :                 __entry->namelen = irec->p_namelen;
    4978             :                 memcpy(__get_str(name), irec->p_name, irec->p_namelen);
    4979             :         ),
    4980             :         TP_printk("dev %d:%d ino 0x%llx bufsize %u count %u: parent_ino 0x%llx parent_gen 0x%x name '%.*s'",
    4981             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    4982             :                   __entry->ino,
    4983             :                   __entry->bufsize,
    4984             :                   __entry->count,
    4985             :                   __entry->parent_ino,
    4986             :                   __entry->parent_gen,
    4987             :                   __entry->namelen,
    4988             :                   __get_str(name))
    4989             : );
    4990             : 
    4991   508604513 : TRACE_EVENT(xfs_getparent_pointers,
    4992             :         TP_PROTO(struct xfs_inode *ip, const struct xfs_getparents *ppi,
    4993             :                  const struct xfs_attrlist_cursor_kern *cur),
    4994             :         TP_ARGS(ip, ppi, cur),
    4995             :         TP_STRUCT__entry(
    4996             :                 __field(dev_t, dev)
    4997             :                 __field(xfs_ino_t, ino)
    4998             :                 __field(unsigned int, flags)
    4999             :                 __field(unsigned int, bufsize)
    5000             :                 __field(unsigned int, hashval)
    5001             :                 __field(unsigned int, blkno)
    5002             :                 __field(unsigned int, offset)
    5003             :                 __field(int, initted)
    5004             :         ),
    5005             :         TP_fast_assign(
    5006             :                 __entry->dev = ip->i_mount->m_super->s_dev;
    5007             :                 __entry->ino = ip->i_ino;
    5008             :                 __entry->flags = ppi->gp_flags;
    5009             :                 __entry->bufsize = ppi->gp_bufsize;
    5010             :                 __entry->hashval = cur->hashval;
    5011             :                 __entry->blkno = cur->blkno;
    5012             :                 __entry->offset = cur->offset;
    5013             :                 __entry->initted = cur->initted;
    5014             :         ),
    5015             :         TP_printk("dev %d:%d ino 0x%llx flags 0x%x bufsize %u cur_init? %d hashval 0x%x blkno %u offset %u",
    5016             :                   MAJOR(__entry->dev), MINOR(__entry->dev),
    5017             :                   __entry->ino,
    5018             :                   __entry->flags,
    5019             :                   __entry->bufsize,
    5020             :                   __entry->initted,
    5021             :                   __entry->hashval,
    5022             :                   __entry->blkno,
    5023             :                   __entry->offset)
    5024             : );
    5025             : 
    5026             : #endif /* _TRACE_XFS_H */
    5027             : 
    5028             : #undef TRACE_INCLUDE_PATH
    5029             : #define TRACE_INCLUDE_PATH .
    5030             : #define TRACE_INCLUDE_FILE xfs_trace
    5031             : #include <trace/define_trace.h>

Generated by: LCOV version 1.14