Dave Chinner | 0b61f8a | 2018-06-05 19:42:14 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2009, Christoph Hellwig |
| 4 | * All Rights Reserved. |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 5 | */ |
| 6 | #undef TRACE_SYSTEM |
| 7 | #define TRACE_SYSTEM xfs |
| 8 | |
| 9 | #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ) |
| 10 | #define _TRACE_XFS_H |
| 11 | |
| 12 | #include <linux/tracepoint.h> |
| 13 | |
| 14 | struct xfs_agf; |
| 15 | struct xfs_alloc_arg; |
| 16 | struct xfs_attr_list_context; |
| 17 | struct xfs_buf_log_item; |
| 18 | struct xfs_da_args; |
| 19 | struct xfs_da_node_entry; |
| 20 | struct xfs_dquot; |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 21 | struct xfs_log_item; |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 22 | struct xlog; |
Dave Chinner | 750b9c9 | 2013-11-01 15:27:18 +1100 | [diff] [blame] | 23 | struct xlog_ticket; |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 24 | struct xlog_recover; |
| 25 | struct xlog_recover_item; |
Dave Chinner | 0ad9568 | 2019-08-26 12:08:10 -0700 | [diff] [blame] | 26 | struct xlog_rec_header; |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 27 | struct xfs_buf_log_format; |
| 28 | struct xfs_inode_log_format; |
Alex Elder | 1ed845d | 2012-08-01 09:56:49 -0500 | [diff] [blame] | 29 | struct xfs_bmbt_irec; |
Darrick J. Wong | 2c813ad | 2016-08-03 11:08:36 +1000 | [diff] [blame] | 30 | struct xfs_btree_cur; |
Darrick J. Wong | 1946b91 | 2016-10-03 09:11:18 -0700 | [diff] [blame] | 31 | struct xfs_refcount_irec; |
Darrick J. Wong | e89c041 | 2017-03-28 14:56:37 -0700 | [diff] [blame] | 32 | struct xfs_fsmap; |
| 33 | struct xfs_rmap_irec; |
Dave Chinner | 0ad9568 | 2019-08-26 12:08:10 -0700 | [diff] [blame] | 34 | struct xfs_icreate_log; |
| 35 | struct xfs_owner_info; |
| 36 | struct xfs_trans_res; |
| 37 | struct xfs_inobt_rec_incore; |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 38 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 39 | DECLARE_EVENT_CLASS(xfs_attr_list_class, |
| 40 | TP_PROTO(struct xfs_attr_list_context *ctx), |
| 41 | TP_ARGS(ctx), |
| 42 | TP_STRUCT__entry( |
| 43 | __field(dev_t, dev) |
| 44 | __field(xfs_ino_t, ino) |
| 45 | __field(u32, hashval) |
| 46 | __field(u32, blkno) |
| 47 | __field(u32, offset) |
| 48 | __field(void *, alist) |
| 49 | __field(int, bufsize) |
| 50 | __field(int, count) |
| 51 | __field(int, firstu) |
| 52 | __field(int, dupcnt) |
| 53 | __field(int, flags) |
| 54 | ), |
| 55 | TP_fast_assign( |
| 56 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; |
| 57 | __entry->ino = ctx->dp->i_ino; |
| 58 | __entry->hashval = ctx->cursor->hashval; |
| 59 | __entry->blkno = ctx->cursor->blkno; |
| 60 | __entry->offset = ctx->cursor->offset; |
| 61 | __entry->alist = ctx->alist; |
| 62 | __entry->bufsize = ctx->bufsize; |
| 63 | __entry->count = ctx->count; |
| 64 | __entry->firstu = ctx->firstu; |
| 65 | __entry->flags = ctx->flags; |
| 66 | ), |
| 67 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " |
Darrick J. Wong | 3d170aa | 2018-01-09 11:43:36 -0800 | [diff] [blame] | 68 | "alist %p size %u count %u firstu %u flags %d %s", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 69 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 70 | __entry->ino, |
| 71 | __entry->hashval, |
| 72 | __entry->blkno, |
| 73 | __entry->offset, |
| 74 | __entry->dupcnt, |
| 75 | __entry->alist, |
| 76 | __entry->bufsize, |
| 77 | __entry->count, |
| 78 | __entry->firstu, |
| 79 | __entry->flags, |
| 80 | __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS) |
| 81 | ) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 82 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 83 | |
| 84 | #define DEFINE_ATTR_LIST_EVENT(name) \ |
| 85 | DEFINE_EVENT(xfs_attr_list_class, name, \ |
| 86 | TP_PROTO(struct xfs_attr_list_context *ctx), \ |
| 87 | TP_ARGS(ctx)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 88 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf); |
| 89 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all); |
| 90 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf); |
| 91 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end); |
| 92 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full); |
| 93 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add); |
| 94 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); |
| 95 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 96 | DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list); |
| 97 | DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 98 | |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 99 | DECLARE_EVENT_CLASS(xfs_perag_class, |
| 100 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, |
| 101 | unsigned long caller_ip), |
| 102 | TP_ARGS(mp, agno, refcount, caller_ip), |
| 103 | TP_STRUCT__entry( |
| 104 | __field(dev_t, dev) |
| 105 | __field(xfs_agnumber_t, agno) |
| 106 | __field(int, refcount) |
| 107 | __field(unsigned long, caller_ip) |
| 108 | ), |
| 109 | TP_fast_assign( |
| 110 | __entry->dev = mp->m_super->s_dev; |
| 111 | __entry->agno = agno; |
| 112 | __entry->refcount = refcount; |
| 113 | __entry->caller_ip = caller_ip; |
| 114 | ), |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 115 | TP_printk("dev %d:%d agno %u refcount %d caller %pS", |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 116 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 117 | __entry->agno, |
| 118 | __entry->refcount, |
| 119 | (char *)__entry->caller_ip) |
| 120 | ); |
| 121 | |
| 122 | #define DEFINE_PERAG_REF_EVENT(name) \ |
| 123 | DEFINE_EVENT(xfs_perag_class, name, \ |
| 124 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \ |
| 125 | unsigned long caller_ip), \ |
| 126 | TP_ARGS(mp, agno, refcount, caller_ip)) |
| 127 | DEFINE_PERAG_REF_EVENT(xfs_perag_get); |
Dave Chinner | 65d0f20 | 2010-09-24 18:40:15 +1000 | [diff] [blame] | 128 | DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag); |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 129 | DEFINE_PERAG_REF_EVENT(xfs_perag_put); |
Dave Chinner | 16fd536 | 2010-07-20 09:43:39 +1000 | [diff] [blame] | 130 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim); |
| 131 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim); |
Brian Foster | 27b5286 | 2012-11-06 09:50:38 -0500 | [diff] [blame] | 132 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks); |
| 133 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks); |
Darrick J. Wong | 83104d4 | 2016-10-03 09:11:46 -0700 | [diff] [blame] | 134 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks); |
| 135 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks); |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 136 | |
Dave Chinner | d123031 | 2013-11-01 15:27:19 +1100 | [diff] [blame] | 137 | DECLARE_EVENT_CLASS(xfs_ag_class, |
| 138 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), |
| 139 | TP_ARGS(mp, agno), |
| 140 | TP_STRUCT__entry( |
| 141 | __field(dev_t, dev) |
| 142 | __field(xfs_agnumber_t, agno) |
| 143 | ), |
| 144 | TP_fast_assign( |
| 145 | __entry->dev = mp->m_super->s_dev; |
| 146 | __entry->agno = agno; |
| 147 | ), |
| 148 | TP_printk("dev %d:%d agno %u", |
| 149 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 150 | __entry->agno) |
| 151 | ); |
| 152 | #define DEFINE_AG_EVENT(name) \ |
| 153 | DEFINE_EVENT(xfs_ag_class, name, \ |
| 154 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \ |
| 155 | TP_ARGS(mp, agno)) |
| 156 | |
| 157 | DEFINE_AG_EVENT(xfs_read_agf); |
| 158 | DEFINE_AG_EVENT(xfs_alloc_read_agf); |
| 159 | DEFINE_AG_EVENT(xfs_read_agi); |
| 160 | DEFINE_AG_EVENT(xfs_ialloc_read_agi); |
| 161 | |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 162 | TRACE_EVENT(xfs_attr_list_node_descend, |
| 163 | TP_PROTO(struct xfs_attr_list_context *ctx, |
| 164 | struct xfs_da_node_entry *btree), |
| 165 | TP_ARGS(ctx, btree), |
| 166 | TP_STRUCT__entry( |
| 167 | __field(dev_t, dev) |
| 168 | __field(xfs_ino_t, ino) |
| 169 | __field(u32, hashval) |
| 170 | __field(u32, blkno) |
| 171 | __field(u32, offset) |
| 172 | __field(void *, alist) |
| 173 | __field(int, bufsize) |
| 174 | __field(int, count) |
| 175 | __field(int, firstu) |
| 176 | __field(int, dupcnt) |
| 177 | __field(int, flags) |
| 178 | __field(u32, bt_hashval) |
| 179 | __field(u32, bt_before) |
| 180 | ), |
| 181 | TP_fast_assign( |
| 182 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; |
| 183 | __entry->ino = ctx->dp->i_ino; |
| 184 | __entry->hashval = ctx->cursor->hashval; |
| 185 | __entry->blkno = ctx->cursor->blkno; |
| 186 | __entry->offset = ctx->cursor->offset; |
| 187 | __entry->alist = ctx->alist; |
| 188 | __entry->bufsize = ctx->bufsize; |
| 189 | __entry->count = ctx->count; |
| 190 | __entry->firstu = ctx->firstu; |
| 191 | __entry->flags = ctx->flags; |
| 192 | __entry->bt_hashval = be32_to_cpu(btree->hashval); |
| 193 | __entry->bt_before = be32_to_cpu(btree->before); |
| 194 | ), |
| 195 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " |
Darrick J. Wong | 3d170aa | 2018-01-09 11:43:36 -0800 | [diff] [blame] | 196 | "alist %p size %u count %u firstu %u flags %d %s " |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 197 | "node hashval %u, node before %u", |
| 198 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 199 | __entry->ino, |
| 200 | __entry->hashval, |
| 201 | __entry->blkno, |
| 202 | __entry->offset, |
| 203 | __entry->dupcnt, |
| 204 | __entry->alist, |
| 205 | __entry->bufsize, |
| 206 | __entry->count, |
| 207 | __entry->firstu, |
| 208 | __entry->flags, |
| 209 | __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS), |
| 210 | __entry->bt_hashval, |
| 211 | __entry->bt_before) |
| 212 | ); |
| 213 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 214 | DECLARE_EVENT_CLASS(xfs_bmap_class, |
Christoph Hellwig | b2b1712 | 2017-11-03 10:34:43 -0700 | [diff] [blame] | 215 | TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 216 | unsigned long caller_ip), |
Christoph Hellwig | b2b1712 | 2017-11-03 10:34:43 -0700 | [diff] [blame] | 217 | TP_ARGS(ip, cur, state, caller_ip), |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 218 | TP_STRUCT__entry( |
| 219 | __field(dev_t, dev) |
| 220 | __field(xfs_ino_t, ino) |
Christoph Hellwig | 6bdcf26 | 2017-11-03 10:34:46 -0700 | [diff] [blame] | 221 | __field(void *, leaf); |
| 222 | __field(int, pos); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 223 | __field(xfs_fileoff_t, startoff) |
| 224 | __field(xfs_fsblock_t, startblock) |
| 225 | __field(xfs_filblks_t, blockcount) |
| 226 | __field(xfs_exntst_t, state) |
| 227 | __field(int, bmap_state) |
| 228 | __field(unsigned long, caller_ip) |
| 229 | ), |
| 230 | TP_fast_assign( |
Darrick J. Wong | 3993bae | 2016-10-03 09:11:32 -0700 | [diff] [blame] | 231 | struct xfs_ifork *ifp; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 232 | struct xfs_bmbt_irec r; |
| 233 | |
Darrick J. Wong | 3993bae | 2016-10-03 09:11:32 -0700 | [diff] [blame] | 234 | ifp = xfs_iext_state_to_fork(ip, state); |
Christoph Hellwig | b2b1712 | 2017-11-03 10:34:43 -0700 | [diff] [blame] | 235 | xfs_iext_get_extent(ifp, cur, &r); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 236 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 237 | __entry->ino = ip->i_ino; |
Christoph Hellwig | 6bdcf26 | 2017-11-03 10:34:46 -0700 | [diff] [blame] | 238 | __entry->leaf = cur->leaf; |
| 239 | __entry->pos = cur->pos; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 240 | __entry->startoff = r.br_startoff; |
| 241 | __entry->startblock = r.br_startblock; |
| 242 | __entry->blockcount = r.br_blockcount; |
| 243 | __entry->state = r.br_state; |
| 244 | __entry->bmap_state = state; |
| 245 | __entry->caller_ip = caller_ip; |
| 246 | ), |
Darrick J. Wong | 3d170aa | 2018-01-09 11:43:36 -0800 | [diff] [blame] | 247 | TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d " |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 248 | "offset %lld block %lld count %lld flag %d caller %pS", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 249 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 250 | __entry->ino, |
| 251 | __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), |
Christoph Hellwig | 6bdcf26 | 2017-11-03 10:34:46 -0700 | [diff] [blame] | 252 | __entry->leaf, |
| 253 | __entry->pos, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 254 | __entry->startoff, |
Darrick J. Wong | c8ce540 | 2017-06-16 11:00:05 -0700 | [diff] [blame] | 255 | (int64_t)__entry->startblock, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 256 | __entry->blockcount, |
| 257 | __entry->state, |
| 258 | (char *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 259 | ) |
| 260 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 261 | #define DEFINE_BMAP_EVENT(name) \ |
| 262 | DEFINE_EVENT(xfs_bmap_class, name, \ |
Christoph Hellwig | b2b1712 | 2017-11-03 10:34:43 -0700 | [diff] [blame] | 263 | TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 264 | unsigned long caller_ip), \ |
Christoph Hellwig | b2b1712 | 2017-11-03 10:34:43 -0700 | [diff] [blame] | 265 | TP_ARGS(ip, cur, state, caller_ip)) |
Christoph Hellwig | 6bdcf26 | 2017-11-03 10:34:46 -0700 | [diff] [blame] | 266 | DEFINE_BMAP_EVENT(xfs_iext_insert); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 267 | DEFINE_BMAP_EVENT(xfs_iext_remove); |
| 268 | DEFINE_BMAP_EVENT(xfs_bmap_pre_update); |
| 269 | DEFINE_BMAP_EVENT(xfs_bmap_post_update); |
Christoph Hellwig | e8e0e17 | 2017-10-19 11:06:29 -0700 | [diff] [blame] | 270 | DEFINE_BMAP_EVENT(xfs_read_extent); |
| 271 | DEFINE_BMAP_EVENT(xfs_write_extent); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 272 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 273 | DECLARE_EVENT_CLASS(xfs_buf_class, |
| 274 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), |
| 275 | TP_ARGS(bp, caller_ip), |
| 276 | TP_STRUCT__entry( |
| 277 | __field(dev_t, dev) |
| 278 | __field(xfs_daddr_t, bno) |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 279 | __field(int, nblks) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 280 | __field(int, hold) |
| 281 | __field(int, pincount) |
| 282 | __field(unsigned, lockval) |
| 283 | __field(unsigned, flags) |
| 284 | __field(unsigned long, caller_ip) |
| 285 | ), |
| 286 | TP_fast_assign( |
| 287 | __entry->dev = bp->b_target->bt_dev; |
Dave Chinner | d61fa8c | 2018-11-19 13:31:07 -0800 | [diff] [blame] | 288 | if (bp->b_bn == XFS_BUF_DADDR_NULL) |
| 289 | __entry->bno = bp->b_maps[0].bm_bn; |
| 290 | else |
| 291 | __entry->bno = bp->b_bn; |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 292 | __entry->nblks = bp->b_length; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 293 | __entry->hold = atomic_read(&bp->b_hold); |
| 294 | __entry->pincount = atomic_read(&bp->b_pin_count); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 295 | __entry->lockval = bp->b_sema.count; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 296 | __entry->flags = bp->b_flags; |
| 297 | __entry->caller_ip = caller_ip; |
| 298 | ), |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 299 | TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d " |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 300 | "lock %d flags %s caller %pS", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 301 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 302 | (unsigned long long)__entry->bno, |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 303 | __entry->nblks, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 304 | __entry->hold, |
| 305 | __entry->pincount, |
| 306 | __entry->lockval, |
| 307 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), |
| 308 | (void *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 309 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 310 | |
| 311 | #define DEFINE_BUF_EVENT(name) \ |
| 312 | DEFINE_EVENT(xfs_buf_class, name, \ |
| 313 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \ |
| 314 | TP_ARGS(bp, caller_ip)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 315 | DEFINE_BUF_EVENT(xfs_buf_init); |
| 316 | DEFINE_BUF_EVENT(xfs_buf_free); |
| 317 | DEFINE_BUF_EVENT(xfs_buf_hold); |
| 318 | DEFINE_BUF_EVENT(xfs_buf_rele); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 319 | DEFINE_BUF_EVENT(xfs_buf_iodone); |
Dave Chinner | 595bff7 | 2014-10-02 09:05:14 +1000 | [diff] [blame] | 320 | DEFINE_BUF_EVENT(xfs_buf_submit); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 321 | DEFINE_BUF_EVENT(xfs_buf_lock); |
| 322 | DEFINE_BUF_EVENT(xfs_buf_lock_done); |
Darrick J. Wong | 479c641 | 2016-06-21 11:53:28 +1000 | [diff] [blame] | 323 | DEFINE_BUF_EVENT(xfs_buf_trylock_fail); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 324 | DEFINE_BUF_EVENT(xfs_buf_trylock); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 325 | DEFINE_BUF_EVENT(xfs_buf_unlock); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 326 | DEFINE_BUF_EVENT(xfs_buf_iowait); |
| 327 | DEFINE_BUF_EVENT(xfs_buf_iowait_done); |
| 328 | DEFINE_BUF_EVENT(xfs_buf_delwri_queue); |
Christoph Hellwig | 43ff212 | 2012-04-23 15:58:39 +1000 | [diff] [blame] | 329 | DEFINE_BUF_EVENT(xfs_buf_delwri_queued); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 330 | DEFINE_BUF_EVENT(xfs_buf_delwri_split); |
Brian Foster | 7912e7f | 2017-06-14 21:21:45 -0700 | [diff] [blame] | 331 | DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf); |
Dave Chinner | 686865f | 2010-09-24 20:07:47 +1000 | [diff] [blame] | 332 | DEFINE_BUF_EVENT(xfs_buf_get_uncached); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 333 | DEFINE_BUF_EVENT(xfs_buf_item_relse); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 334 | DEFINE_BUF_EVENT(xfs_buf_item_iodone_async); |
| 335 | DEFINE_BUF_EVENT(xfs_buf_error_relse); |
Dave Chinner | 9f87832 | 2013-01-21 23:53:55 +1100 | [diff] [blame] | 336 | DEFINE_BUF_EVENT(xfs_buf_wait_buftarg); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 337 | DEFINE_BUF_EVENT(xfs_trans_read_buf_shut); |
| 338 | |
| 339 | /* not really buffer traces, but the buf provides useful information */ |
| 340 | DEFINE_BUF_EVENT(xfs_btree_corrupt); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 341 | DEFINE_BUF_EVENT(xfs_reset_dqcounts); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 342 | |
| 343 | /* pass flags explicitly */ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 344 | DECLARE_EVENT_CLASS(xfs_buf_flags_class, |
| 345 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), |
| 346 | TP_ARGS(bp, flags, caller_ip), |
| 347 | TP_STRUCT__entry( |
| 348 | __field(dev_t, dev) |
| 349 | __field(xfs_daddr_t, bno) |
| 350 | __field(size_t, buffer_length) |
| 351 | __field(int, hold) |
| 352 | __field(int, pincount) |
| 353 | __field(unsigned, lockval) |
| 354 | __field(unsigned, flags) |
| 355 | __field(unsigned long, caller_ip) |
| 356 | ), |
| 357 | TP_fast_assign( |
| 358 | __entry->dev = bp->b_target->bt_dev; |
| 359 | __entry->bno = bp->b_bn; |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 360 | __entry->buffer_length = BBTOB(bp->b_length); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 361 | __entry->flags = flags; |
| 362 | __entry->hold = atomic_read(&bp->b_hold); |
| 363 | __entry->pincount = atomic_read(&bp->b_pin_count); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 364 | __entry->lockval = bp->b_sema.count; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 365 | __entry->caller_ip = caller_ip; |
| 366 | ), |
| 367 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 368 | "lock %d flags %s caller %pS", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 369 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 370 | (unsigned long long)__entry->bno, |
| 371 | __entry->buffer_length, |
| 372 | __entry->hold, |
| 373 | __entry->pincount, |
| 374 | __entry->lockval, |
| 375 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), |
| 376 | (void *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 377 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 378 | |
| 379 | #define DEFINE_BUF_FLAGS_EVENT(name) \ |
| 380 | DEFINE_EVENT(xfs_buf_flags_class, name, \ |
| 381 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \ |
| 382 | TP_ARGS(bp, flags, caller_ip)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 383 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_find); |
| 384 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_get); |
| 385 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_read); |
| 386 | |
| 387 | TRACE_EVENT(xfs_buf_ioerror, |
Darrick J. Wong | 31ca03c | 2018-01-08 10:51:02 -0800 | [diff] [blame] | 388 | TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip), |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 389 | TP_ARGS(bp, error, caller_ip), |
| 390 | TP_STRUCT__entry( |
| 391 | __field(dev_t, dev) |
| 392 | __field(xfs_daddr_t, bno) |
| 393 | __field(size_t, buffer_length) |
| 394 | __field(unsigned, flags) |
| 395 | __field(int, hold) |
| 396 | __field(int, pincount) |
| 397 | __field(unsigned, lockval) |
| 398 | __field(int, error) |
Darrick J. Wong | 31ca03c | 2018-01-08 10:51:02 -0800 | [diff] [blame] | 399 | __field(xfs_failaddr_t, caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 400 | ), |
| 401 | TP_fast_assign( |
| 402 | __entry->dev = bp->b_target->bt_dev; |
| 403 | __entry->bno = bp->b_bn; |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 404 | __entry->buffer_length = BBTOB(bp->b_length); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 405 | __entry->hold = atomic_read(&bp->b_hold); |
| 406 | __entry->pincount = atomic_read(&bp->b_pin_count); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 407 | __entry->lockval = bp->b_sema.count; |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 408 | __entry->error = error; |
| 409 | __entry->flags = bp->b_flags; |
| 410 | __entry->caller_ip = caller_ip; |
| 411 | ), |
| 412 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " |
Darrick J. Wong | 31ca03c | 2018-01-08 10:51:02 -0800 | [diff] [blame] | 413 | "lock %d error %d flags %s caller %pS", |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 414 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 415 | (unsigned long long)__entry->bno, |
| 416 | __entry->buffer_length, |
| 417 | __entry->hold, |
| 418 | __entry->pincount, |
| 419 | __entry->lockval, |
| 420 | __entry->error, |
| 421 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), |
| 422 | (void *)__entry->caller_ip) |
| 423 | ); |
| 424 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 425 | DECLARE_EVENT_CLASS(xfs_buf_item_class, |
| 426 | TP_PROTO(struct xfs_buf_log_item *bip), |
| 427 | TP_ARGS(bip), |
| 428 | TP_STRUCT__entry( |
| 429 | __field(dev_t, dev) |
| 430 | __field(xfs_daddr_t, buf_bno) |
| 431 | __field(size_t, buf_len) |
| 432 | __field(int, buf_hold) |
| 433 | __field(int, buf_pincount) |
| 434 | __field(int, buf_lockval) |
| 435 | __field(unsigned, buf_flags) |
| 436 | __field(unsigned, bli_recur) |
| 437 | __field(int, bli_refcount) |
| 438 | __field(unsigned, bli_flags) |
Dave Chinner | 22525c1 | 2018-05-09 07:47:34 -0700 | [diff] [blame] | 439 | __field(unsigned long, li_flags) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 440 | ), |
| 441 | TP_fast_assign( |
| 442 | __entry->dev = bip->bli_buf->b_target->bt_dev; |
| 443 | __entry->bli_flags = bip->bli_flags; |
| 444 | __entry->bli_recur = bip->bli_recur; |
| 445 | __entry->bli_refcount = atomic_read(&bip->bli_refcount); |
| 446 | __entry->buf_bno = bip->bli_buf->b_bn; |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 447 | __entry->buf_len = BBTOB(bip->bli_buf->b_length); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 448 | __entry->buf_flags = bip->bli_buf->b_flags; |
| 449 | __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold); |
| 450 | __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 451 | __entry->buf_lockval = bip->bli_buf->b_sema.count; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 452 | __entry->li_flags = bip->bli_item.li_flags; |
| 453 | ), |
| 454 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " |
| 455 | "lock %d flags %s recur %d refcount %d bliflags %s " |
Dave Chinner | e6631f8 | 2018-05-09 07:49:37 -0700 | [diff] [blame] | 456 | "liflags %s", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 457 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 458 | (unsigned long long)__entry->buf_bno, |
| 459 | __entry->buf_len, |
| 460 | __entry->buf_hold, |
| 461 | __entry->buf_pincount, |
| 462 | __entry->buf_lockval, |
| 463 | __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS), |
| 464 | __entry->bli_recur, |
| 465 | __entry->bli_refcount, |
| 466 | __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS), |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 467 | __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 468 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 469 | |
| 470 | #define DEFINE_BUF_ITEM_EVENT(name) \ |
| 471 | DEFINE_EVENT(xfs_buf_item_class, name, \ |
| 472 | TP_PROTO(struct xfs_buf_log_item *bip), \ |
| 473 | TP_ARGS(bip)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 474 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size); |
Dave Chinner | 5f6bed7 | 2013-06-27 16:04:52 +1000 | [diff] [blame] | 475 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 476 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale); |
| 477 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format); |
| 478 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale); |
Dave Chinner | 5f6bed7 | 2013-06-27 16:04:52 +1000 | [diff] [blame] | 479 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 480 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin); |
| 481 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin); |
| 482 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale); |
Christoph Hellwig | ddf9205 | 2019-06-28 19:27:32 -0700 | [diff] [blame] | 483 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 484 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed); |
| 485 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push); |
| 486 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf); |
| 487 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur); |
| 488 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb); |
| 489 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur); |
| 490 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf); |
| 491 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur); |
| 492 | DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf); |
| 493 | DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse); |
| 494 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin); |
| 495 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold); |
| 496 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release); |
| 497 | DEFINE_BUF_ITEM_EVENT(xfs_trans_binval); |
| 498 | |
Christoph Hellwig | b94acd4 | 2014-04-23 07:11:52 +1000 | [diff] [blame] | 499 | DECLARE_EVENT_CLASS(xfs_filestream_class, |
Christoph Hellwig | 7fcd3ef | 2018-04-09 10:23:39 -0700 | [diff] [blame] | 500 | TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), |
| 501 | TP_ARGS(mp, ino, agno), |
Christoph Hellwig | b94acd4 | 2014-04-23 07:11:52 +1000 | [diff] [blame] | 502 | TP_STRUCT__entry( |
| 503 | __field(dev_t, dev) |
| 504 | __field(xfs_ino_t, ino) |
| 505 | __field(xfs_agnumber_t, agno) |
| 506 | __field(int, streams) |
| 507 | ), |
| 508 | TP_fast_assign( |
Christoph Hellwig | 7fcd3ef | 2018-04-09 10:23:39 -0700 | [diff] [blame] | 509 | __entry->dev = mp->m_super->s_dev; |
| 510 | __entry->ino = ino; |
Christoph Hellwig | b94acd4 | 2014-04-23 07:11:52 +1000 | [diff] [blame] | 511 | __entry->agno = agno; |
Christoph Hellwig | 7fcd3ef | 2018-04-09 10:23:39 -0700 | [diff] [blame] | 512 | __entry->streams = xfs_filestream_peek_ag(mp, agno); |
Christoph Hellwig | b94acd4 | 2014-04-23 07:11:52 +1000 | [diff] [blame] | 513 | ), |
| 514 | TP_printk("dev %d:%d ino 0x%llx agno %u streams %d", |
| 515 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 516 | __entry->ino, |
| 517 | __entry->agno, |
| 518 | __entry->streams) |
| 519 | ) |
| 520 | #define DEFINE_FILESTREAM_EVENT(name) \ |
| 521 | DEFINE_EVENT(xfs_filestream_class, name, \ |
Christoph Hellwig | 7fcd3ef | 2018-04-09 10:23:39 -0700 | [diff] [blame] | 522 | TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \ |
| 523 | TP_ARGS(mp, ino, agno)) |
Christoph Hellwig | b94acd4 | 2014-04-23 07:11:52 +1000 | [diff] [blame] | 524 | DEFINE_FILESTREAM_EVENT(xfs_filestream_free); |
| 525 | DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup); |
| 526 | DEFINE_FILESTREAM_EVENT(xfs_filestream_scan); |
| 527 | |
| 528 | TRACE_EVENT(xfs_filestream_pick, |
| 529 | TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno, |
| 530 | xfs_extlen_t free, int nscan), |
| 531 | TP_ARGS(ip, agno, free, nscan), |
| 532 | TP_STRUCT__entry( |
| 533 | __field(dev_t, dev) |
| 534 | __field(xfs_ino_t, ino) |
| 535 | __field(xfs_agnumber_t, agno) |
| 536 | __field(int, streams) |
| 537 | __field(xfs_extlen_t, free) |
| 538 | __field(int, nscan) |
| 539 | ), |
| 540 | TP_fast_assign( |
| 541 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 542 | __entry->ino = ip->i_ino; |
| 543 | __entry->agno = agno; |
| 544 | __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno); |
| 545 | __entry->free = free; |
| 546 | __entry->nscan = nscan; |
| 547 | ), |
| 548 | TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d", |
| 549 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 550 | __entry->ino, |
| 551 | __entry->agno, |
| 552 | __entry->streams, |
| 553 | __entry->free, |
| 554 | __entry->nscan) |
| 555 | ); |
| 556 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 557 | DECLARE_EVENT_CLASS(xfs_lock_class, |
| 558 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, |
| 559 | unsigned long caller_ip), |
| 560 | TP_ARGS(ip, lock_flags, caller_ip), |
| 561 | TP_STRUCT__entry( |
| 562 | __field(dev_t, dev) |
| 563 | __field(xfs_ino_t, ino) |
| 564 | __field(int, lock_flags) |
| 565 | __field(unsigned long, caller_ip) |
| 566 | ), |
| 567 | TP_fast_assign( |
| 568 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 569 | __entry->ino = ip->i_ino; |
| 570 | __entry->lock_flags = lock_flags; |
| 571 | __entry->caller_ip = caller_ip; |
| 572 | ), |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 573 | TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 574 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 575 | __entry->ino, |
| 576 | __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS), |
| 577 | (void *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 578 | ) |
| 579 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 580 | #define DEFINE_LOCK_EVENT(name) \ |
| 581 | DEFINE_EVENT(xfs_lock_class, name, \ |
| 582 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ |
| 583 | unsigned long caller_ip), \ |
| 584 | TP_ARGS(ip, lock_flags, caller_ip)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 585 | DEFINE_LOCK_EVENT(xfs_ilock); |
| 586 | DEFINE_LOCK_EVENT(xfs_ilock_nowait); |
| 587 | DEFINE_LOCK_EVENT(xfs_ilock_demote); |
| 588 | DEFINE_LOCK_EVENT(xfs_iunlock); |
| 589 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 590 | DECLARE_EVENT_CLASS(xfs_inode_class, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 591 | TP_PROTO(struct xfs_inode *ip), |
| 592 | TP_ARGS(ip), |
| 593 | TP_STRUCT__entry( |
| 594 | __field(dev_t, dev) |
| 595 | __field(xfs_ino_t, ino) |
| 596 | ), |
| 597 | TP_fast_assign( |
| 598 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 599 | __entry->ino = ip->i_ino; |
| 600 | ), |
| 601 | TP_printk("dev %d:%d ino 0x%llx", |
| 602 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 603 | __entry->ino) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 604 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 605 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 606 | #define DEFINE_INODE_EVENT(name) \ |
| 607 | DEFINE_EVENT(xfs_inode_class, name, \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 608 | TP_PROTO(struct xfs_inode *ip), \ |
| 609 | TP_ARGS(ip)) |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 610 | DEFINE_INODE_EVENT(xfs_iget_skip); |
| 611 | DEFINE_INODE_EVENT(xfs_iget_reclaim); |
| 612 | DEFINE_INODE_EVENT(xfs_iget_reclaim_fail); |
| 613 | DEFINE_INODE_EVENT(xfs_iget_hit); |
| 614 | DEFINE_INODE_EVENT(xfs_iget_miss); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 615 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 616 | DEFINE_INODE_EVENT(xfs_getattr); |
| 617 | DEFINE_INODE_EVENT(xfs_setattr); |
| 618 | DEFINE_INODE_EVENT(xfs_readlink); |
Mark Tinguely | 725eb1e | 2013-06-17 15:35:57 -0500 | [diff] [blame] | 619 | DEFINE_INODE_EVENT(xfs_inactive_symlink); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 620 | DEFINE_INODE_EVENT(xfs_alloc_file_space); |
| 621 | DEFINE_INODE_EVENT(xfs_free_file_space); |
Dave Chinner | 897b73b | 2014-04-14 18:15:11 +1000 | [diff] [blame] | 622 | DEFINE_INODE_EVENT(xfs_zero_file_space); |
Namjae Jeon | e1d8fb8 | 2014-02-24 10:58:19 +1100 | [diff] [blame] | 623 | DEFINE_INODE_EVENT(xfs_collapse_file_space); |
Namjae Jeon | a904b1c | 2015-03-25 15:08:56 +1100 | [diff] [blame] | 624 | DEFINE_INODE_EVENT(xfs_insert_file_space); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 625 | DEFINE_INODE_EVENT(xfs_readdir); |
Tony Luck | 0f1a932 | 2010-07-20 17:54:41 +1000 | [diff] [blame] | 626 | #ifdef CONFIG_XFS_POSIX_ACL |
Christoph Hellwig | 4e34e71 | 2011-07-23 17:37:31 +0200 | [diff] [blame] | 627 | DEFINE_INODE_EVENT(xfs_get_acl); |
Tony Luck | 0f1a932 | 2010-07-20 17:54:41 +1000 | [diff] [blame] | 628 | #endif |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 629 | DEFINE_INODE_EVENT(xfs_vm_bmap); |
| 630 | DEFINE_INODE_EVENT(xfs_file_ioctl); |
| 631 | DEFINE_INODE_EVENT(xfs_file_compat_ioctl); |
| 632 | DEFINE_INODE_EVENT(xfs_ioctl_setattr); |
Christoph Hellwig | 1da2f2d | 2011-10-02 14:25:16 +0000 | [diff] [blame] | 633 | DEFINE_INODE_EVENT(xfs_dir_fsync); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 634 | DEFINE_INODE_EVENT(xfs_file_fsync); |
| 635 | DEFINE_INODE_EVENT(xfs_destroy_inode); |
Christoph Hellwig | 69ff282 | 2012-06-06 17:01:28 -0400 | [diff] [blame] | 636 | DEFINE_INODE_EVENT(xfs_update_time); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 637 | |
| 638 | DEFINE_INODE_EVENT(xfs_dquot_dqalloc); |
| 639 | DEFINE_INODE_EVENT(xfs_dquot_dqdetach); |
| 640 | |
Brian Foster | 27b5286 | 2012-11-06 09:50:38 -0500 | [diff] [blame] | 641 | DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag); |
| 642 | DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag); |
Brian Foster | 41176a6 | 2012-11-06 09:50:42 -0500 | [diff] [blame] | 643 | DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid); |
Darrick J. Wong | 83104d4 | 2016-10-03 09:11:46 -0700 | [diff] [blame] | 644 | DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag); |
| 645 | DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag); |
| 646 | DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid); |
Brian Foster | 27b5286 | 2012-11-06 09:50:38 -0500 | [diff] [blame] | 647 | |
Darrick J. Wong | 85f8dff | 2018-12-18 14:32:29 -0800 | [diff] [blame] | 648 | /* |
| 649 | * ftrace's __print_symbolic requires that all enum values be wrapped in the |
| 650 | * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace |
| 651 | * ring buffer. Somehow this was only worth mentioning in the ftrace sample |
| 652 | * code. |
| 653 | */ |
| 654 | TRACE_DEFINE_ENUM(PE_SIZE_PTE); |
| 655 | TRACE_DEFINE_ENUM(PE_SIZE_PMD); |
| 656 | TRACE_DEFINE_ENUM(PE_SIZE_PUD); |
| 657 | |
Christoph Hellwig | d522d56 | 2017-08-29 10:08:41 -0700 | [diff] [blame] | 658 | TRACE_EVENT(xfs_filemap_fault, |
| 659 | TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size, |
| 660 | bool write_fault), |
| 661 | TP_ARGS(ip, pe_size, write_fault), |
| 662 | TP_STRUCT__entry( |
| 663 | __field(dev_t, dev) |
| 664 | __field(xfs_ino_t, ino) |
| 665 | __field(enum page_entry_size, pe_size) |
| 666 | __field(bool, write_fault) |
| 667 | ), |
| 668 | TP_fast_assign( |
| 669 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 670 | __entry->ino = ip->i_ino; |
| 671 | __entry->pe_size = pe_size; |
| 672 | __entry->write_fault = write_fault; |
| 673 | ), |
| 674 | TP_printk("dev %d:%d ino 0x%llx %s write_fault %d", |
| 675 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 676 | __entry->ino, |
| 677 | __print_symbolic(__entry->pe_size, |
| 678 | { PE_SIZE_PTE, "PTE" }, |
| 679 | { PE_SIZE_PMD, "PMD" }, |
| 680 | { PE_SIZE_PUD, "PUD" }), |
| 681 | __entry->write_fault) |
| 682 | ) |
| 683 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 684 | DECLARE_EVENT_CLASS(xfs_iref_class, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 685 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), |
| 686 | TP_ARGS(ip, caller_ip), |
| 687 | TP_STRUCT__entry( |
| 688 | __field(dev_t, dev) |
| 689 | __field(xfs_ino_t, ino) |
| 690 | __field(int, count) |
Dave Chinner | 4aaf15d | 2010-03-08 11:24:07 +1100 | [diff] [blame] | 691 | __field(int, pincount) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 692 | __field(unsigned long, caller_ip) |
| 693 | ), |
| 694 | TP_fast_assign( |
| 695 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 696 | __entry->ino = ip->i_ino; |
| 697 | __entry->count = atomic_read(&VFS_I(ip)->i_count); |
Dave Chinner | 4aaf15d | 2010-03-08 11:24:07 +1100 | [diff] [blame] | 698 | __entry->pincount = atomic_read(&ip->i_pincount); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 699 | __entry->caller_ip = caller_ip; |
| 700 | ), |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 701 | TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 702 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 703 | __entry->ino, |
| 704 | __entry->count, |
Dave Chinner | 4aaf15d | 2010-03-08 11:24:07 +1100 | [diff] [blame] | 705 | __entry->pincount, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 706 | (char *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 707 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 708 | |
Brian Foster | 19cb7e3 | 2013-03-18 10:51:48 -0400 | [diff] [blame] | 709 | TRACE_EVENT(xfs_iomap_prealloc_size, |
| 710 | TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift, |
| 711 | unsigned int writeio_blocks), |
| 712 | TP_ARGS(ip, blocks, shift, writeio_blocks), |
| 713 | TP_STRUCT__entry( |
| 714 | __field(dev_t, dev) |
| 715 | __field(xfs_ino_t, ino) |
| 716 | __field(xfs_fsblock_t, blocks) |
| 717 | __field(int, shift) |
| 718 | __field(unsigned int, writeio_blocks) |
| 719 | ), |
| 720 | TP_fast_assign( |
| 721 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 722 | __entry->ino = ip->i_ino; |
| 723 | __entry->blocks = blocks; |
| 724 | __entry->shift = shift; |
| 725 | __entry->writeio_blocks = writeio_blocks; |
| 726 | ), |
| 727 | TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d " |
| 728 | "m_writeio_blocks %u", |
| 729 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, |
| 730 | __entry->blocks, __entry->shift, __entry->writeio_blocks) |
| 731 | ) |
| 732 | |
Brian Foster | 56d1115 | 2015-05-29 09:18:32 +1000 | [diff] [blame] | 733 | TRACE_EVENT(xfs_irec_merge_pre, |
| 734 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, |
| 735 | uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask), |
| 736 | TP_ARGS(mp, agno, agino, holemask, nagino, nholemask), |
| 737 | TP_STRUCT__entry( |
| 738 | __field(dev_t, dev) |
| 739 | __field(xfs_agnumber_t, agno) |
| 740 | __field(xfs_agino_t, agino) |
| 741 | __field(uint16_t, holemask) |
| 742 | __field(xfs_agino_t, nagino) |
| 743 | __field(uint16_t, nholemask) |
| 744 | ), |
| 745 | TP_fast_assign( |
| 746 | __entry->dev = mp->m_super->s_dev; |
| 747 | __entry->agno = agno; |
| 748 | __entry->agino = agino; |
| 749 | __entry->holemask = holemask; |
| 750 | __entry->nagino = nagino; |
| 751 | __entry->nholemask = holemask; |
| 752 | ), |
| 753 | TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)", |
| 754 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, |
| 755 | __entry->agino, __entry->holemask, __entry->nagino, |
| 756 | __entry->nholemask) |
| 757 | ) |
| 758 | |
| 759 | TRACE_EVENT(xfs_irec_merge_post, |
| 760 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, |
| 761 | uint16_t holemask), |
| 762 | TP_ARGS(mp, agno, agino, holemask), |
| 763 | TP_STRUCT__entry( |
| 764 | __field(dev_t, dev) |
| 765 | __field(xfs_agnumber_t, agno) |
| 766 | __field(xfs_agino_t, agino) |
| 767 | __field(uint16_t, holemask) |
| 768 | ), |
| 769 | TP_fast_assign( |
| 770 | __entry->dev = mp->m_super->s_dev; |
| 771 | __entry->agno = agno; |
| 772 | __entry->agino = agino; |
| 773 | __entry->holemask = holemask; |
| 774 | ), |
| 775 | TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev), |
| 776 | MINOR(__entry->dev), __entry->agno, __entry->agino, |
| 777 | __entry->holemask) |
| 778 | ) |
| 779 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 780 | #define DEFINE_IREF_EVENT(name) \ |
| 781 | DEFINE_EVENT(xfs_iref_class, name, \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 782 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \ |
| 783 | TP_ARGS(ip, caller_ip)) |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 784 | DEFINE_IREF_EVENT(xfs_irele); |
| 785 | DEFINE_IREF_EVENT(xfs_inode_pin); |
| 786 | DEFINE_IREF_EVENT(xfs_inode_unpin); |
| 787 | DEFINE_IREF_EVENT(xfs_inode_unpin_nowait); |
Dave Chinner | 4aaf15d | 2010-03-08 11:24:07 +1100 | [diff] [blame] | 788 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 789 | DECLARE_EVENT_CLASS(xfs_namespace_class, |
| 790 | TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), |
| 791 | TP_ARGS(dp, name), |
| 792 | TP_STRUCT__entry( |
| 793 | __field(dev_t, dev) |
| 794 | __field(xfs_ino_t, dp_ino) |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 795 | __field(int, namelen) |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 796 | __dynamic_array(char, name, name->len) |
| 797 | ), |
| 798 | TP_fast_assign( |
| 799 | __entry->dev = VFS_I(dp)->i_sb->s_dev; |
| 800 | __entry->dp_ino = dp->i_ino; |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 801 | __entry->namelen = name->len; |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 802 | memcpy(__get_str(name), name->name, name->len); |
| 803 | ), |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 804 | TP_printk("dev %d:%d dp ino 0x%llx name %.*s", |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 805 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 806 | __entry->dp_ino, |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 807 | __entry->namelen, |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 808 | __get_str(name)) |
| 809 | ) |
| 810 | |
| 811 | #define DEFINE_NAMESPACE_EVENT(name) \ |
| 812 | DEFINE_EVENT(xfs_namespace_class, name, \ |
| 813 | TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \ |
| 814 | TP_ARGS(dp, name)) |
| 815 | DEFINE_NAMESPACE_EVENT(xfs_remove); |
| 816 | DEFINE_NAMESPACE_EVENT(xfs_link); |
| 817 | DEFINE_NAMESPACE_EVENT(xfs_lookup); |
| 818 | DEFINE_NAMESPACE_EVENT(xfs_create); |
| 819 | DEFINE_NAMESPACE_EVENT(xfs_symlink); |
| 820 | |
| 821 | TRACE_EVENT(xfs_rename, |
| 822 | TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp, |
| 823 | struct xfs_name *src_name, struct xfs_name *target_name), |
| 824 | TP_ARGS(src_dp, target_dp, src_name, target_name), |
| 825 | TP_STRUCT__entry( |
| 826 | __field(dev_t, dev) |
| 827 | __field(xfs_ino_t, src_dp_ino) |
| 828 | __field(xfs_ino_t, target_dp_ino) |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 829 | __field(int, src_namelen) |
| 830 | __field(int, target_namelen) |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 831 | __dynamic_array(char, src_name, src_name->len) |
| 832 | __dynamic_array(char, target_name, target_name->len) |
| 833 | ), |
| 834 | TP_fast_assign( |
| 835 | __entry->dev = VFS_I(src_dp)->i_sb->s_dev; |
| 836 | __entry->src_dp_ino = src_dp->i_ino; |
| 837 | __entry->target_dp_ino = target_dp->i_ino; |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 838 | __entry->src_namelen = src_name->len; |
| 839 | __entry->target_namelen = target_name->len; |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 840 | memcpy(__get_str(src_name), src_name->name, src_name->len); |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 841 | memcpy(__get_str(target_name), target_name->name, |
| 842 | target_name->len); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 843 | ), |
| 844 | TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx" |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 845 | " src name %.*s target name %.*s", |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 846 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 847 | __entry->src_dp_ino, |
| 848 | __entry->target_dp_ino, |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 849 | __entry->src_namelen, |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 850 | __get_str(src_name), |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 851 | __entry->target_namelen, |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 852 | __get_str(target_name)) |
| 853 | ) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 854 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 855 | DECLARE_EVENT_CLASS(xfs_dquot_class, |
| 856 | TP_PROTO(struct xfs_dquot *dqp), |
| 857 | TP_ARGS(dqp), |
| 858 | TP_STRUCT__entry( |
| 859 | __field(dev_t, dev) |
Christoph Hellwig | b262e5d | 2010-02-14 22:01:45 +0000 | [diff] [blame] | 860 | __field(u32, id) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 861 | __field(unsigned, flags) |
| 862 | __field(unsigned, nrefs) |
| 863 | __field(unsigned long long, res_bcount) |
| 864 | __field(unsigned long long, bcount) |
| 865 | __field(unsigned long long, icount) |
| 866 | __field(unsigned long long, blk_hardlimit) |
| 867 | __field(unsigned long long, blk_softlimit) |
| 868 | __field(unsigned long long, ino_hardlimit) |
| 869 | __field(unsigned long long, ino_softlimit) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 870 | ), \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 871 | TP_fast_assign( |
| 872 | __entry->dev = dqp->q_mount->m_super->s_dev; |
Christoph Hellwig | b262e5d | 2010-02-14 22:01:45 +0000 | [diff] [blame] | 873 | __entry->id = be32_to_cpu(dqp->q_core.d_id); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 874 | __entry->flags = dqp->dq_flags; |
| 875 | __entry->nrefs = dqp->q_nrefs; |
| 876 | __entry->res_bcount = dqp->q_res_bcount; |
| 877 | __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount); |
| 878 | __entry->icount = be64_to_cpu(dqp->q_core.d_icount); |
| 879 | __entry->blk_hardlimit = |
| 880 | be64_to_cpu(dqp->q_core.d_blk_hardlimit); |
| 881 | __entry->blk_softlimit = |
| 882 | be64_to_cpu(dqp->q_core.d_blk_softlimit); |
| 883 | __entry->ino_hardlimit = |
| 884 | be64_to_cpu(dqp->q_core.d_ino_hardlimit); |
| 885 | __entry->ino_softlimit = |
| 886 | be64_to_cpu(dqp->q_core.d_ino_softlimit); |
| 887 | ), |
| 888 | TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx " |
Christoph Hellwig | b262e5d | 2010-02-14 22:01:45 +0000 | [diff] [blame] | 889 | "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx " |
| 890 | "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 891 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Christoph Hellwig | b262e5d | 2010-02-14 22:01:45 +0000 | [diff] [blame] | 892 | __entry->id, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 893 | __print_flags(__entry->flags, "|", XFS_DQ_FLAGS), |
| 894 | __entry->nrefs, |
| 895 | __entry->res_bcount, |
| 896 | __entry->bcount, |
| 897 | __entry->blk_hardlimit, |
| 898 | __entry->blk_softlimit, |
| 899 | __entry->icount, |
| 900 | __entry->ino_hardlimit, |
| 901 | __entry->ino_softlimit) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 902 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 903 | |
| 904 | #define DEFINE_DQUOT_EVENT(name) \ |
| 905 | DEFINE_EVENT(xfs_dquot_class, name, \ |
| 906 | TP_PROTO(struct xfs_dquot *dqp), \ |
| 907 | TP_ARGS(dqp)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 908 | DEFINE_DQUOT_EVENT(xfs_dqadjust); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 909 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_want); |
| 910 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty); |
Christoph Hellwig | 92b2e5b | 2012-02-01 13:57:20 +0000 | [diff] [blame] | 911 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy); |
| 912 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_done); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 913 | DEFINE_DQUOT_EVENT(xfs_dqattach_found); |
| 914 | DEFINE_DQUOT_EVENT(xfs_dqattach_get); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 915 | DEFINE_DQUOT_EVENT(xfs_dqalloc); |
| 916 | DEFINE_DQUOT_EVENT(xfs_dqtobp_read); |
| 917 | DEFINE_DQUOT_EVENT(xfs_dqread); |
| 918 | DEFINE_DQUOT_EVENT(xfs_dqread_fail); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 919 | DEFINE_DQUOT_EVENT(xfs_dqget_hit); |
| 920 | DEFINE_DQUOT_EVENT(xfs_dqget_miss); |
Christoph Hellwig | 9f920f1 | 2012-03-13 08:52:35 +0000 | [diff] [blame] | 921 | DEFINE_DQUOT_EVENT(xfs_dqget_freeing); |
| 922 | DEFINE_DQUOT_EVENT(xfs_dqget_dup); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 923 | DEFINE_DQUOT_EVENT(xfs_dqput); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 924 | DEFINE_DQUOT_EVENT(xfs_dqput_free); |
| 925 | DEFINE_DQUOT_EVENT(xfs_dqrele); |
| 926 | DEFINE_DQUOT_EVENT(xfs_dqflush); |
| 927 | DEFINE_DQUOT_EVENT(xfs_dqflush_force); |
| 928 | DEFINE_DQUOT_EVENT(xfs_dqflush_done); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 929 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 930 | DECLARE_EVENT_CLASS(xfs_loggrant_class, |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 931 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 932 | TP_ARGS(log, tic), |
| 933 | TP_STRUCT__entry( |
| 934 | __field(dev_t, dev) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 935 | __field(char, ocnt) |
| 936 | __field(char, cnt) |
| 937 | __field(int, curr_res) |
| 938 | __field(int, unit_res) |
| 939 | __field(unsigned int, flags) |
Dave Chinner | 1054794 | 2010-12-21 12:02:25 +1100 | [diff] [blame] | 940 | __field(int, reserveq) |
| 941 | __field(int, writeq) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 942 | __field(int, grant_reserve_cycle) |
| 943 | __field(int, grant_reserve_bytes) |
| 944 | __field(int, grant_write_cycle) |
| 945 | __field(int, grant_write_bytes) |
| 946 | __field(int, curr_cycle) |
| 947 | __field(int, curr_block) |
| 948 | __field(xfs_lsn_t, tail_lsn) |
| 949 | ), |
| 950 | TP_fast_assign( |
| 951 | __entry->dev = log->l_mp->m_super->s_dev; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 952 | __entry->ocnt = tic->t_ocnt; |
| 953 | __entry->cnt = tic->t_cnt; |
| 954 | __entry->curr_res = tic->t_curr_res; |
| 955 | __entry->unit_res = tic->t_unit_res; |
| 956 | __entry->flags = tic->t_flags; |
Christoph Hellwig | 2849696 | 2012-02-20 02:31:25 +0000 | [diff] [blame] | 957 | __entry->reserveq = list_empty(&log->l_reserve_head.waiters); |
| 958 | __entry->writeq = list_empty(&log->l_write_head.waiters); |
| 959 | xlog_crack_grant_head(&log->l_reserve_head.grant, |
Dave Chinner | a69ed03 | 2010-12-21 12:08:20 +1100 | [diff] [blame] | 960 | &__entry->grant_reserve_cycle, |
| 961 | &__entry->grant_reserve_bytes); |
Christoph Hellwig | 2849696 | 2012-02-20 02:31:25 +0000 | [diff] [blame] | 962 | xlog_crack_grant_head(&log->l_write_head.grant, |
Dave Chinner | a69ed03 | 2010-12-21 12:08:20 +1100 | [diff] [blame] | 963 | &__entry->grant_write_cycle, |
| 964 | &__entry->grant_write_bytes); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 965 | __entry->curr_cycle = log->l_curr_cycle; |
| 966 | __entry->curr_block = log->l_curr_block; |
Dave Chinner | 1c3cb9e | 2010-12-21 12:28:39 +1100 | [diff] [blame] | 967 | __entry->tail_lsn = atomic64_read(&log->l_tail_lsn); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 968 | ), |
Christoph Hellwig | 710b1e2 | 2016-04-06 09:20:36 +1000 | [diff] [blame] | 969 | TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u " |
Dave Chinner | 1054794 | 2010-12-21 12:02:25 +1100 | [diff] [blame] | 970 | "t_unit_res %u t_flags %s reserveq %s " |
| 971 | "writeq %s grant_reserve_cycle %d " |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 972 | "grant_reserve_bytes %d grant_write_cycle %d " |
| 973 | "grant_write_bytes %d curr_cycle %d curr_block %d " |
| 974 | "tail_cycle %d tail_block %d", |
| 975 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 976 | __entry->ocnt, |
| 977 | __entry->cnt, |
| 978 | __entry->curr_res, |
| 979 | __entry->unit_res, |
| 980 | __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS), |
Dave Chinner | 1054794 | 2010-12-21 12:02:25 +1100 | [diff] [blame] | 981 | __entry->reserveq ? "empty" : "active", |
| 982 | __entry->writeq ? "empty" : "active", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 983 | __entry->grant_reserve_cycle, |
| 984 | __entry->grant_reserve_bytes, |
| 985 | __entry->grant_write_cycle, |
| 986 | __entry->grant_write_bytes, |
| 987 | __entry->curr_cycle, |
| 988 | __entry->curr_block, |
| 989 | CYCLE_LSN(__entry->tail_lsn), |
| 990 | BLOCK_LSN(__entry->tail_lsn) |
| 991 | ) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 992 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 993 | |
| 994 | #define DEFINE_LOGGRANT_EVENT(name) \ |
| 995 | DEFINE_EVENT(xfs_loggrant_class, name, \ |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 996 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 997 | TP_ARGS(log, tic)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 998 | DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm); |
| 999 | DEFINE_LOGGRANT_EVENT(xfs_log_done_perm); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1000 | DEFINE_LOGGRANT_EVENT(xfs_log_umount_write); |
Christoph Hellwig | 9f9c19e | 2011-11-28 08:17:36 +0000 | [diff] [blame] | 1001 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep); |
| 1002 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake); |
Dave Chinner | 3f16b98 | 2010-12-21 12:29:01 +1100 | [diff] [blame] | 1003 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up); |
Christoph Hellwig | 9006fb9 | 2012-02-20 02:31:31 +0000 | [diff] [blame] | 1004 | DEFINE_LOGGRANT_EVENT(xfs_log_reserve); |
| 1005 | DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit); |
| 1006 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant); |
| 1007 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1008 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter); |
| 1009 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit); |
| 1010 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub); |
| 1011 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter); |
| 1012 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit); |
| 1013 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub); |
| 1014 | |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 1015 | DECLARE_EVENT_CLASS(xfs_log_item_class, |
| 1016 | TP_PROTO(struct xfs_log_item *lip), |
| 1017 | TP_ARGS(lip), |
| 1018 | TP_STRUCT__entry( |
| 1019 | __field(dev_t, dev) |
| 1020 | __field(void *, lip) |
| 1021 | __field(uint, type) |
Dave Chinner | 22525c1 | 2018-05-09 07:47:34 -0700 | [diff] [blame] | 1022 | __field(unsigned long, flags) |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 1023 | __field(xfs_lsn_t, lsn) |
| 1024 | ), |
| 1025 | TP_fast_assign( |
| 1026 | __entry->dev = lip->li_mountp->m_super->s_dev; |
| 1027 | __entry->lip = lip; |
| 1028 | __entry->type = lip->li_type; |
| 1029 | __entry->flags = lip->li_flags; |
| 1030 | __entry->lsn = lip->li_lsn; |
| 1031 | ), |
Darrick J. Wong | 3d170aa | 2018-01-09 11:43:36 -0800 | [diff] [blame] | 1032 | TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s", |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 1033 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1034 | __entry->lip, |
| 1035 | CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn), |
| 1036 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), |
| 1037 | __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) |
| 1038 | ) |
| 1039 | |
Dave Chinner | 14c26c6 | 2012-04-24 16:33:31 +1000 | [diff] [blame] | 1040 | TRACE_EVENT(xfs_log_force, |
Carlos Maiolino | 9f27889 | 2016-04-06 09:46:30 +1000 | [diff] [blame] | 1041 | TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip), |
| 1042 | TP_ARGS(mp, lsn, caller_ip), |
Dave Chinner | 14c26c6 | 2012-04-24 16:33:31 +1000 | [diff] [blame] | 1043 | TP_STRUCT__entry( |
| 1044 | __field(dev_t, dev) |
| 1045 | __field(xfs_lsn_t, lsn) |
Carlos Maiolino | 9f27889 | 2016-04-06 09:46:30 +1000 | [diff] [blame] | 1046 | __field(unsigned long, caller_ip) |
Dave Chinner | 14c26c6 | 2012-04-24 16:33:31 +1000 | [diff] [blame] | 1047 | ), |
| 1048 | TP_fast_assign( |
| 1049 | __entry->dev = mp->m_super->s_dev; |
| 1050 | __entry->lsn = lsn; |
Carlos Maiolino | 9f27889 | 2016-04-06 09:46:30 +1000 | [diff] [blame] | 1051 | __entry->caller_ip = caller_ip; |
Dave Chinner | 14c26c6 | 2012-04-24 16:33:31 +1000 | [diff] [blame] | 1052 | ), |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 1053 | TP_printk("dev %d:%d lsn 0x%llx caller %pS", |
Dave Chinner | 14c26c6 | 2012-04-24 16:33:31 +1000 | [diff] [blame] | 1054 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Carlos Maiolino | 9f27889 | 2016-04-06 09:46:30 +1000 | [diff] [blame] | 1055 | __entry->lsn, (void *)__entry->caller_ip) |
Dave Chinner | 14c26c6 | 2012-04-24 16:33:31 +1000 | [diff] [blame] | 1056 | ) |
| 1057 | |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 1058 | #define DEFINE_LOG_ITEM_EVENT(name) \ |
| 1059 | DEFINE_EVENT(xfs_log_item_class, name, \ |
| 1060 | TP_PROTO(struct xfs_log_item *lip), \ |
| 1061 | TP_ARGS(lip)) |
| 1062 | DEFINE_LOG_ITEM_EVENT(xfs_ail_push); |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 1063 | DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned); |
| 1064 | DEFINE_LOG_ITEM_EVENT(xfs_ail_locked); |
Christoph Hellwig | 43ff212 | 2012-04-23 15:58:39 +1000 | [diff] [blame] | 1065 | DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing); |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 1066 | |
Dave Chinner | 750b9c9 | 2013-11-01 15:27:18 +1100 | [diff] [blame] | 1067 | DECLARE_EVENT_CLASS(xfs_ail_class, |
| 1068 | TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), |
| 1069 | TP_ARGS(lip, old_lsn, new_lsn), |
| 1070 | TP_STRUCT__entry( |
| 1071 | __field(dev_t, dev) |
| 1072 | __field(void *, lip) |
| 1073 | __field(uint, type) |
Dave Chinner | 22525c1 | 2018-05-09 07:47:34 -0700 | [diff] [blame] | 1074 | __field(unsigned long, flags) |
Dave Chinner | 750b9c9 | 2013-11-01 15:27:18 +1100 | [diff] [blame] | 1075 | __field(xfs_lsn_t, old_lsn) |
| 1076 | __field(xfs_lsn_t, new_lsn) |
| 1077 | ), |
| 1078 | TP_fast_assign( |
| 1079 | __entry->dev = lip->li_mountp->m_super->s_dev; |
| 1080 | __entry->lip = lip; |
| 1081 | __entry->type = lip->li_type; |
| 1082 | __entry->flags = lip->li_flags; |
| 1083 | __entry->old_lsn = old_lsn; |
| 1084 | __entry->new_lsn = new_lsn; |
| 1085 | ), |
Darrick J. Wong | 3d170aa | 2018-01-09 11:43:36 -0800 | [diff] [blame] | 1086 | TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s", |
Dave Chinner | 750b9c9 | 2013-11-01 15:27:18 +1100 | [diff] [blame] | 1087 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1088 | __entry->lip, |
| 1089 | CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), |
| 1090 | CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), |
| 1091 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), |
| 1092 | __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) |
| 1093 | ) |
| 1094 | |
| 1095 | #define DEFINE_AIL_EVENT(name) \ |
| 1096 | DEFINE_EVENT(xfs_ail_class, name, \ |
| 1097 | TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \ |
| 1098 | TP_ARGS(lip, old_lsn, new_lsn)) |
| 1099 | DEFINE_AIL_EVENT(xfs_ail_insert); |
| 1100 | DEFINE_AIL_EVENT(xfs_ail_move); |
| 1101 | DEFINE_AIL_EVENT(xfs_ail_delete); |
| 1102 | |
| 1103 | TRACE_EVENT(xfs_log_assign_tail_lsn, |
| 1104 | TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn), |
| 1105 | TP_ARGS(log, new_lsn), |
| 1106 | TP_STRUCT__entry( |
| 1107 | __field(dev_t, dev) |
| 1108 | __field(xfs_lsn_t, new_lsn) |
| 1109 | __field(xfs_lsn_t, old_lsn) |
| 1110 | __field(xfs_lsn_t, last_sync_lsn) |
| 1111 | ), |
| 1112 | TP_fast_assign( |
| 1113 | __entry->dev = log->l_mp->m_super->s_dev; |
| 1114 | __entry->new_lsn = new_lsn; |
| 1115 | __entry->old_lsn = atomic64_read(&log->l_tail_lsn); |
| 1116 | __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn); |
| 1117 | ), |
| 1118 | TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d", |
| 1119 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1120 | CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), |
| 1121 | CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), |
| 1122 | CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn)) |
| 1123 | ) |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 1124 | |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1125 | DECLARE_EVENT_CLASS(xfs_file_class, |
Christoph Hellwig | 3176c3e | 2016-07-20 11:31:42 +1000 | [diff] [blame] | 1126 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), |
| 1127 | TP_ARGS(ip, count, offset), |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1128 | TP_STRUCT__entry( |
| 1129 | __field(dev_t, dev) |
| 1130 | __field(xfs_ino_t, ino) |
| 1131 | __field(xfs_fsize_t, size) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1132 | __field(loff_t, offset) |
| 1133 | __field(size_t, count) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1134 | ), |
| 1135 | TP_fast_assign( |
| 1136 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1137 | __entry->ino = ip->i_ino; |
| 1138 | __entry->size = ip->i_d.di_size; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1139 | __entry->offset = offset; |
| 1140 | __entry->count = count; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1141 | ), |
Christoph Hellwig | 3176c3e | 2016-07-20 11:31:42 +1000 | [diff] [blame] | 1142 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx", |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1143 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1144 | __entry->ino, |
| 1145 | __entry->size, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1146 | __entry->offset, |
Christoph Hellwig | 3176c3e | 2016-07-20 11:31:42 +1000 | [diff] [blame] | 1147 | __entry->count) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1148 | ) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1149 | |
| 1150 | #define DEFINE_RW_EVENT(name) \ |
| 1151 | DEFINE_EVENT(xfs_file_class, name, \ |
Christoph Hellwig | 3176c3e | 2016-07-20 11:31:42 +1000 | [diff] [blame] | 1152 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \ |
| 1153 | TP_ARGS(ip, count, offset)) |
| 1154 | DEFINE_RW_EVENT(xfs_file_buffered_read); |
| 1155 | DEFINE_RW_EVENT(xfs_file_direct_read); |
Christoph Hellwig | 16d4d43 | 2016-07-20 11:38:55 +1000 | [diff] [blame] | 1156 | DEFINE_RW_EVENT(xfs_file_dax_read); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1157 | DEFINE_RW_EVENT(xfs_file_buffered_write); |
| 1158 | DEFINE_RW_EVENT(xfs_file_direct_write); |
Christoph Hellwig | 16d4d43 | 2016-07-20 11:38:55 +1000 | [diff] [blame] | 1159 | DEFINE_RW_EVENT(xfs_file_dax_write); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1160 | |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 1161 | DECLARE_EVENT_CLASS(xfs_imap_class, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1162 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, |
Christoph Hellwig | be225fe | 2019-02-15 08:02:46 -0800 | [diff] [blame] | 1163 | int whichfork, struct xfs_bmbt_irec *irec), |
| 1164 | TP_ARGS(ip, offset, count, whichfork, irec), |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1165 | TP_STRUCT__entry( |
| 1166 | __field(dev_t, dev) |
| 1167 | __field(xfs_ino_t, ino) |
| 1168 | __field(loff_t, size) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1169 | __field(loff_t, offset) |
| 1170 | __field(size_t, count) |
Christoph Hellwig | be225fe | 2019-02-15 08:02:46 -0800 | [diff] [blame] | 1171 | __field(int, whichfork) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1172 | __field(xfs_fileoff_t, startoff) |
| 1173 | __field(xfs_fsblock_t, startblock) |
| 1174 | __field(xfs_filblks_t, blockcount) |
| 1175 | ), |
| 1176 | TP_fast_assign( |
| 1177 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1178 | __entry->ino = ip->i_ino; |
| 1179 | __entry->size = ip->i_d.di_size; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1180 | __entry->offset = offset; |
| 1181 | __entry->count = count; |
Christoph Hellwig | be225fe | 2019-02-15 08:02:46 -0800 | [diff] [blame] | 1182 | __entry->whichfork = whichfork; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1183 | __entry->startoff = irec ? irec->br_startoff : 0; |
| 1184 | __entry->startblock = irec ? irec->br_startblock : 0; |
| 1185 | __entry->blockcount = irec ? irec->br_blockcount : 0; |
| 1186 | ), |
Christoph Hellwig | 2813d68 | 2011-12-18 20:00:12 +0000 | [diff] [blame] | 1187 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd " |
Christoph Hellwig | be225fe | 2019-02-15 08:02:46 -0800 | [diff] [blame] | 1188 | "fork %s startoff 0x%llx startblock %lld blockcount 0x%llx", |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1189 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1190 | __entry->ino, |
| 1191 | __entry->size, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1192 | __entry->offset, |
| 1193 | __entry->count, |
Christoph Hellwig | be225fe | 2019-02-15 08:02:46 -0800 | [diff] [blame] | 1194 | __entry->whichfork == XFS_COW_FORK ? "cow" : "data", |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1195 | __entry->startoff, |
Darrick J. Wong | c8ce540 | 2017-06-16 11:00:05 -0700 | [diff] [blame] | 1196 | (int64_t)__entry->startblock, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1197 | __entry->blockcount) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1198 | ) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1199 | |
Christoph Hellwig | be225fe | 2019-02-15 08:02:46 -0800 | [diff] [blame] | 1200 | #define DEFINE_IMAP_EVENT(name) \ |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 1201 | DEFINE_EVENT(xfs_imap_class, name, \ |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1202 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \ |
Christoph Hellwig | be225fe | 2019-02-15 08:02:46 -0800 | [diff] [blame] | 1203 | int whichfork, struct xfs_bmbt_irec *irec), \ |
| 1204 | TP_ARGS(ip, offset, count, whichfork, irec)) |
| 1205 | DEFINE_IMAP_EVENT(xfs_map_blocks_found); |
| 1206 | DEFINE_IMAP_EVENT(xfs_map_blocks_alloc); |
| 1207 | DEFINE_IMAP_EVENT(xfs_iomap_alloc); |
| 1208 | DEFINE_IMAP_EVENT(xfs_iomap_found); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1209 | |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1210 | DECLARE_EVENT_CLASS(xfs_simple_io_class, |
| 1211 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), |
| 1212 | TP_ARGS(ip, offset, count), |
| 1213 | TP_STRUCT__entry( |
| 1214 | __field(dev_t, dev) |
| 1215 | __field(xfs_ino_t, ino) |
Dave Chinner | 55fb25d5 | 2011-07-18 03:40:19 +0000 | [diff] [blame] | 1216 | __field(loff_t, isize) |
| 1217 | __field(loff_t, disize) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1218 | __field(loff_t, offset) |
| 1219 | __field(size_t, count) |
| 1220 | ), |
| 1221 | TP_fast_assign( |
| 1222 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1223 | __entry->ino = ip->i_ino; |
Christoph Hellwig | ce7ae151 | 2011-12-18 20:00:11 +0000 | [diff] [blame] | 1224 | __entry->isize = VFS_I(ip)->i_size; |
Dave Chinner | 55fb25d5 | 2011-07-18 03:40:19 +0000 | [diff] [blame] | 1225 | __entry->disize = ip->i_d.di_size; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1226 | __entry->offset = offset; |
| 1227 | __entry->count = count; |
| 1228 | ), |
Christoph Hellwig | 2813d68 | 2011-12-18 20:00:12 +0000 | [diff] [blame] | 1229 | TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx " |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1230 | "offset 0x%llx count %zd", |
| 1231 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1232 | __entry->ino, |
Dave Chinner | 55fb25d5 | 2011-07-18 03:40:19 +0000 | [diff] [blame] | 1233 | __entry->isize, |
| 1234 | __entry->disize, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1235 | __entry->offset, |
| 1236 | __entry->count) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1237 | ); |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1238 | |
| 1239 | #define DEFINE_SIMPLE_IO_EVENT(name) \ |
| 1240 | DEFINE_EVENT(xfs_simple_io_class, name, \ |
| 1241 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \ |
| 1242 | TP_ARGS(ip, offset, count)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1243 | DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc); |
| 1244 | DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); |
Dave Chinner | 55fb25d5 | 2011-07-18 03:40:19 +0000 | [diff] [blame] | 1245 | DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize); |
Brian Foster | 0a50f16 | 2015-10-12 16:02:08 +1100 | [diff] [blame] | 1246 | DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof); |
Christoph Hellwig | 273dda7 | 2016-02-08 14:40:51 +1100 | [diff] [blame] | 1247 | DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write); |
| 1248 | DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten); |
| 1249 | DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1250 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1251 | DECLARE_EVENT_CLASS(xfs_itrunc_class, |
| 1252 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), |
| 1253 | TP_ARGS(ip, new_size), |
| 1254 | TP_STRUCT__entry( |
| 1255 | __field(dev_t, dev) |
| 1256 | __field(xfs_ino_t, ino) |
| 1257 | __field(xfs_fsize_t, size) |
| 1258 | __field(xfs_fsize_t, new_size) |
| 1259 | ), |
| 1260 | TP_fast_assign( |
| 1261 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1262 | __entry->ino = ip->i_ino; |
| 1263 | __entry->size = ip->i_d.di_size; |
| 1264 | __entry->new_size = new_size; |
| 1265 | ), |
| 1266 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx", |
| 1267 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1268 | __entry->ino, |
| 1269 | __entry->size, |
| 1270 | __entry->new_size) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1271 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1272 | |
| 1273 | #define DEFINE_ITRUNC_EVENT(name) \ |
| 1274 | DEFINE_EVENT(xfs_itrunc_class, name, \ |
| 1275 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \ |
| 1276 | TP_ARGS(ip, new_size)) |
Christoph Hellwig | 673e8e5 | 2011-12-18 20:00:04 +0000 | [diff] [blame] | 1277 | DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start); |
| 1278 | DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1279 | |
| 1280 | TRACE_EVENT(xfs_pagecache_inval, |
| 1281 | TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish), |
| 1282 | TP_ARGS(ip, start, finish), |
| 1283 | TP_STRUCT__entry( |
| 1284 | __field(dev_t, dev) |
| 1285 | __field(xfs_ino_t, ino) |
| 1286 | __field(xfs_fsize_t, size) |
| 1287 | __field(xfs_off_t, start) |
| 1288 | __field(xfs_off_t, finish) |
| 1289 | ), |
| 1290 | TP_fast_assign( |
| 1291 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1292 | __entry->ino = ip->i_ino; |
| 1293 | __entry->size = ip->i_d.di_size; |
| 1294 | __entry->start = start; |
| 1295 | __entry->finish = finish; |
| 1296 | ), |
| 1297 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx", |
| 1298 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1299 | __entry->ino, |
| 1300 | __entry->size, |
| 1301 | __entry->start, |
| 1302 | __entry->finish) |
| 1303 | ); |
| 1304 | |
| 1305 | TRACE_EVENT(xfs_bunmap, |
| 1306 | TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len, |
| 1307 | int flags, unsigned long caller_ip), |
| 1308 | TP_ARGS(ip, bno, len, flags, caller_ip), |
| 1309 | TP_STRUCT__entry( |
| 1310 | __field(dev_t, dev) |
| 1311 | __field(xfs_ino_t, ino) |
| 1312 | __field(xfs_fsize_t, size) |
| 1313 | __field(xfs_fileoff_t, bno) |
| 1314 | __field(xfs_filblks_t, len) |
| 1315 | __field(unsigned long, caller_ip) |
| 1316 | __field(int, flags) |
| 1317 | ), |
| 1318 | TP_fast_assign( |
| 1319 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1320 | __entry->ino = ip->i_ino; |
| 1321 | __entry->size = ip->i_d.di_size; |
| 1322 | __entry->bno = bno; |
| 1323 | __entry->len = len; |
| 1324 | __entry->caller_ip = caller_ip; |
| 1325 | __entry->flags = flags; |
| 1326 | ), |
| 1327 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx" |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 1328 | "flags %s caller %pS", |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1329 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1330 | __entry->ino, |
| 1331 | __entry->size, |
| 1332 | __entry->bno, |
| 1333 | __entry->len, |
| 1334 | __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS), |
| 1335 | (void *)__entry->caller_ip) |
| 1336 | |
| 1337 | ); |
| 1338 | |
Dave Chinner | 4ecbfe6 | 2012-04-29 10:41:10 +0000 | [diff] [blame] | 1339 | DECLARE_EVENT_CLASS(xfs_extent_busy_class, |
Dave Chinner | ed3b4d6 | 2010-05-21 12:07:08 +1000 | [diff] [blame] | 1340 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 1341 | xfs_agblock_t agbno, xfs_extlen_t len), |
| 1342 | TP_ARGS(mp, agno, agbno, len), |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1343 | TP_STRUCT__entry( |
| 1344 | __field(dev_t, dev) |
| 1345 | __field(xfs_agnumber_t, agno) |
| 1346 | __field(xfs_agblock_t, agbno) |
| 1347 | __field(xfs_extlen_t, len) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1348 | ), |
| 1349 | TP_fast_assign( |
| 1350 | __entry->dev = mp->m_super->s_dev; |
| 1351 | __entry->agno = agno; |
| 1352 | __entry->agbno = agbno; |
| 1353 | __entry->len = len; |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1354 | ), |
Dave Chinner | ed3b4d6 | 2010-05-21 12:07:08 +1000 | [diff] [blame] | 1355 | TP_printk("dev %d:%d agno %u agbno %u len %u", |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1356 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1357 | __entry->agno, |
| 1358 | __entry->agbno, |
Dave Chinner | ed3b4d6 | 2010-05-21 12:07:08 +1000 | [diff] [blame] | 1359 | __entry->len) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1360 | ); |
Christoph Hellwig | 97d3ac7 | 2011-04-24 19:06:16 +0000 | [diff] [blame] | 1361 | #define DEFINE_BUSY_EVENT(name) \ |
Dave Chinner | 4ecbfe6 | 2012-04-29 10:41:10 +0000 | [diff] [blame] | 1362 | DEFINE_EVENT(xfs_extent_busy_class, name, \ |
Christoph Hellwig | 97d3ac7 | 2011-04-24 19:06:16 +0000 | [diff] [blame] | 1363 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 1364 | xfs_agblock_t agbno, xfs_extlen_t len), \ |
| 1365 | TP_ARGS(mp, agno, agbno, len)) |
Dave Chinner | 4ecbfe6 | 2012-04-29 10:41:10 +0000 | [diff] [blame] | 1366 | DEFINE_BUSY_EVENT(xfs_extent_busy); |
| 1367 | DEFINE_BUSY_EVENT(xfs_extent_busy_enomem); |
| 1368 | DEFINE_BUSY_EVENT(xfs_extent_busy_force); |
| 1369 | DEFINE_BUSY_EVENT(xfs_extent_busy_reuse); |
| 1370 | DEFINE_BUSY_EVENT(xfs_extent_busy_clear); |
Dave Chinner | ed3b4d6 | 2010-05-21 12:07:08 +1000 | [diff] [blame] | 1371 | |
Dave Chinner | 4ecbfe6 | 2012-04-29 10:41:10 +0000 | [diff] [blame] | 1372 | TRACE_EVENT(xfs_extent_busy_trim, |
Christoph Hellwig | e26f050 | 2011-04-24 19:06:15 +0000 | [diff] [blame] | 1373 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 1374 | xfs_agblock_t agbno, xfs_extlen_t len, |
| 1375 | xfs_agblock_t tbno, xfs_extlen_t tlen), |
| 1376 | TP_ARGS(mp, agno, agbno, len, tbno, tlen), |
| 1377 | TP_STRUCT__entry( |
| 1378 | __field(dev_t, dev) |
| 1379 | __field(xfs_agnumber_t, agno) |
| 1380 | __field(xfs_agblock_t, agbno) |
| 1381 | __field(xfs_extlen_t, len) |
| 1382 | __field(xfs_agblock_t, tbno) |
| 1383 | __field(xfs_extlen_t, tlen) |
| 1384 | ), |
| 1385 | TP_fast_assign( |
| 1386 | __entry->dev = mp->m_super->s_dev; |
| 1387 | __entry->agno = agno; |
| 1388 | __entry->agbno = agbno; |
| 1389 | __entry->len = len; |
| 1390 | __entry->tbno = tbno; |
| 1391 | __entry->tlen = tlen; |
| 1392 | ), |
| 1393 | TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u", |
| 1394 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1395 | __entry->agno, |
| 1396 | __entry->agbno, |
| 1397 | __entry->len, |
| 1398 | __entry->tbno, |
| 1399 | __entry->tlen) |
| 1400 | ); |
| 1401 | |
Brian Foster | a27ba26 | 2018-03-15 10:51:58 -0700 | [diff] [blame] | 1402 | DECLARE_EVENT_CLASS(xfs_agf_class, |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1403 | TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, |
| 1404 | unsigned long caller_ip), |
| 1405 | TP_ARGS(mp, agf, flags, caller_ip), |
| 1406 | TP_STRUCT__entry( |
| 1407 | __field(dev_t, dev) |
| 1408 | __field(xfs_agnumber_t, agno) |
| 1409 | __field(int, flags) |
| 1410 | __field(__u32, length) |
| 1411 | __field(__u32, bno_root) |
| 1412 | __field(__u32, cnt_root) |
| 1413 | __field(__u32, bno_level) |
| 1414 | __field(__u32, cnt_level) |
| 1415 | __field(__u32, flfirst) |
| 1416 | __field(__u32, fllast) |
| 1417 | __field(__u32, flcount) |
| 1418 | __field(__u32, freeblks) |
| 1419 | __field(__u32, longest) |
| 1420 | __field(unsigned long, caller_ip) |
| 1421 | ), |
| 1422 | TP_fast_assign( |
| 1423 | __entry->dev = mp->m_super->s_dev; |
| 1424 | __entry->agno = be32_to_cpu(agf->agf_seqno), |
| 1425 | __entry->flags = flags; |
| 1426 | __entry->length = be32_to_cpu(agf->agf_length), |
| 1427 | __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]), |
| 1428 | __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]), |
| 1429 | __entry->bno_level = |
| 1430 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]), |
| 1431 | __entry->cnt_level = |
| 1432 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]), |
| 1433 | __entry->flfirst = be32_to_cpu(agf->agf_flfirst), |
| 1434 | __entry->fllast = be32_to_cpu(agf->agf_fllast), |
| 1435 | __entry->flcount = be32_to_cpu(agf->agf_flcount), |
| 1436 | __entry->freeblks = be32_to_cpu(agf->agf_freeblks), |
| 1437 | __entry->longest = be32_to_cpu(agf->agf_longest); |
| 1438 | __entry->caller_ip = caller_ip; |
| 1439 | ), |
| 1440 | TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u " |
| 1441 | "levels b %u c %u flfirst %u fllast %u flcount %u " |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 1442 | "freeblks %u longest %u caller %pS", |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1443 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1444 | __entry->agno, |
| 1445 | __print_flags(__entry->flags, "|", XFS_AGF_FLAGS), |
| 1446 | __entry->length, |
| 1447 | __entry->bno_root, |
| 1448 | __entry->cnt_root, |
| 1449 | __entry->bno_level, |
| 1450 | __entry->cnt_level, |
| 1451 | __entry->flfirst, |
| 1452 | __entry->fllast, |
| 1453 | __entry->flcount, |
| 1454 | __entry->freeblks, |
| 1455 | __entry->longest, |
| 1456 | (void *)__entry->caller_ip) |
| 1457 | ); |
Brian Foster | a27ba26 | 2018-03-15 10:51:58 -0700 | [diff] [blame] | 1458 | #define DEFINE_AGF_EVENT(name) \ |
| 1459 | DEFINE_EVENT(xfs_agf_class, name, \ |
| 1460 | TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \ |
| 1461 | unsigned long caller_ip), \ |
| 1462 | TP_ARGS(mp, agf, flags, caller_ip)) |
| 1463 | DEFINE_AGF_EVENT(xfs_agf); |
| 1464 | DEFINE_AGF_EVENT(xfs_agfl_reset); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1465 | |
| 1466 | TRACE_EVENT(xfs_free_extent, |
| 1467 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 1468 | xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft, |
| 1469 | int haveright), |
| 1470 | TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright), |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1471 | TP_STRUCT__entry( |
| 1472 | __field(dev_t, dev) |
| 1473 | __field(xfs_agnumber_t, agno) |
| 1474 | __field(xfs_agblock_t, agbno) |
| 1475 | __field(xfs_extlen_t, len) |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 1476 | __field(int, resv) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1477 | __field(int, haveleft) |
| 1478 | __field(int, haveright) |
| 1479 | ), |
| 1480 | TP_fast_assign( |
| 1481 | __entry->dev = mp->m_super->s_dev; |
| 1482 | __entry->agno = agno; |
| 1483 | __entry->agbno = agbno; |
| 1484 | __entry->len = len; |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 1485 | __entry->resv = resv; |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1486 | __entry->haveleft = haveleft; |
| 1487 | __entry->haveright = haveright; |
| 1488 | ), |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 1489 | TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s", |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1490 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1491 | __entry->agno, |
| 1492 | __entry->agbno, |
| 1493 | __entry->len, |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 1494 | __entry->resv, |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1495 | __entry->haveleft ? |
| 1496 | (__entry->haveright ? "both" : "left") : |
| 1497 | (__entry->haveright ? "right" : "none")) |
| 1498 | |
| 1499 | ); |
| 1500 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1501 | DECLARE_EVENT_CLASS(xfs_alloc_class, |
| 1502 | TP_PROTO(struct xfs_alloc_arg *args), |
| 1503 | TP_ARGS(args), |
| 1504 | TP_STRUCT__entry( |
| 1505 | __field(dev_t, dev) |
| 1506 | __field(xfs_agnumber_t, agno) |
| 1507 | __field(xfs_agblock_t, agbno) |
| 1508 | __field(xfs_extlen_t, minlen) |
| 1509 | __field(xfs_extlen_t, maxlen) |
| 1510 | __field(xfs_extlen_t, mod) |
| 1511 | __field(xfs_extlen_t, prod) |
| 1512 | __field(xfs_extlen_t, minleft) |
| 1513 | __field(xfs_extlen_t, total) |
| 1514 | __field(xfs_extlen_t, alignment) |
| 1515 | __field(xfs_extlen_t, minalignslop) |
| 1516 | __field(xfs_extlen_t, len) |
| 1517 | __field(short, type) |
| 1518 | __field(short, otype) |
| 1519 | __field(char, wasdel) |
| 1520 | __field(char, wasfromfl) |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 1521 | __field(int, resv) |
Dave Chinner | 292378e | 2016-09-26 08:21:28 +1000 | [diff] [blame] | 1522 | __field(int, datatype) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1523 | __field(xfs_fsblock_t, firstblock) |
| 1524 | ), |
| 1525 | TP_fast_assign( |
| 1526 | __entry->dev = args->mp->m_super->s_dev; |
| 1527 | __entry->agno = args->agno; |
| 1528 | __entry->agbno = args->agbno; |
| 1529 | __entry->minlen = args->minlen; |
| 1530 | __entry->maxlen = args->maxlen; |
| 1531 | __entry->mod = args->mod; |
| 1532 | __entry->prod = args->prod; |
| 1533 | __entry->minleft = args->minleft; |
| 1534 | __entry->total = args->total; |
| 1535 | __entry->alignment = args->alignment; |
| 1536 | __entry->minalignslop = args->minalignslop; |
| 1537 | __entry->len = args->len; |
| 1538 | __entry->type = args->type; |
| 1539 | __entry->otype = args->otype; |
| 1540 | __entry->wasdel = args->wasdel; |
| 1541 | __entry->wasfromfl = args->wasfromfl; |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 1542 | __entry->resv = args->resv; |
Dave Chinner | 292378e | 2016-09-26 08:21:28 +1000 | [diff] [blame] | 1543 | __entry->datatype = args->datatype; |
Brian Foster | 64396ff | 2018-07-11 22:26:30 -0700 | [diff] [blame] | 1544 | __entry->firstblock = args->tp->t_firstblock; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1545 | ), |
| 1546 | TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u " |
| 1547 | "prod %u minleft %u total %u alignment %u minalignslop %u " |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 1548 | "len %u type %s otype %s wasdel %d wasfromfl %d resv %d " |
Dave Chinner | 292378e | 2016-09-26 08:21:28 +1000 | [diff] [blame] | 1549 | "datatype 0x%x firstblock 0x%llx", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1550 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1551 | __entry->agno, |
| 1552 | __entry->agbno, |
| 1553 | __entry->minlen, |
| 1554 | __entry->maxlen, |
| 1555 | __entry->mod, |
| 1556 | __entry->prod, |
| 1557 | __entry->minleft, |
| 1558 | __entry->total, |
| 1559 | __entry->alignment, |
| 1560 | __entry->minalignslop, |
| 1561 | __entry->len, |
| 1562 | __print_symbolic(__entry->type, XFS_ALLOC_TYPES), |
| 1563 | __print_symbolic(__entry->otype, XFS_ALLOC_TYPES), |
| 1564 | __entry->wasdel, |
| 1565 | __entry->wasfromfl, |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 1566 | __entry->resv, |
Dave Chinner | 292378e | 2016-09-26 08:21:28 +1000 | [diff] [blame] | 1567 | __entry->datatype, |
Christoph Hellwig | 1a18a29 | 2011-04-24 19:02:58 +0000 | [diff] [blame] | 1568 | (unsigned long long)__entry->firstblock) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1569 | ) |
| 1570 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1571 | #define DEFINE_ALLOC_EVENT(name) \ |
| 1572 | DEFINE_EVENT(xfs_alloc_class, name, \ |
| 1573 | TP_PROTO(struct xfs_alloc_arg *args), \ |
| 1574 | TP_ARGS(args)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1575 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_done); |
Christoph Hellwig | 9f9baab | 2010-12-10 15:03:57 +0000 | [diff] [blame] | 1576 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1577 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_error); |
| 1578 | DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft); |
| 1579 | DEFINE_ALLOC_EVENT(xfs_alloc_near_first); |
| 1580 | DEFINE_ALLOC_EVENT(xfs_alloc_near_greater); |
| 1581 | DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser); |
| 1582 | DEFINE_ALLOC_EVENT(xfs_alloc_near_error); |
Christoph Hellwig | e26f050 | 2011-04-24 19:06:15 +0000 | [diff] [blame] | 1583 | DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry); |
| 1584 | DEFINE_ALLOC_EVENT(xfs_alloc_near_busy); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1585 | DEFINE_ALLOC_EVENT(xfs_alloc_size_neither); |
| 1586 | DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry); |
| 1587 | DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft); |
| 1588 | DEFINE_ALLOC_EVENT(xfs_alloc_size_done); |
| 1589 | DEFINE_ALLOC_EVENT(xfs_alloc_size_error); |
Christoph Hellwig | e26f050 | 2011-04-24 19:06:15 +0000 | [diff] [blame] | 1590 | DEFINE_ALLOC_EVENT(xfs_alloc_size_busy); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1591 | DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist); |
| 1592 | DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough); |
| 1593 | DEFINE_ALLOC_EVENT(xfs_alloc_small_done); |
| 1594 | DEFINE_ALLOC_EVENT(xfs_alloc_small_error); |
| 1595 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs); |
| 1596 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix); |
| 1597 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp); |
| 1598 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed); |
| 1599 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed); |
| 1600 | |
Brian Foster | 396bbf3 | 2019-10-13 17:10:33 -0700 | [diff] [blame^] | 1601 | TRACE_EVENT(xfs_alloc_cur_check, |
| 1602 | TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno, |
| 1603 | xfs_extlen_t len, xfs_extlen_t diff, bool new), |
| 1604 | TP_ARGS(mp, btnum, bno, len, diff, new), |
| 1605 | TP_STRUCT__entry( |
| 1606 | __field(dev_t, dev) |
| 1607 | __field(xfs_btnum_t, btnum) |
| 1608 | __field(xfs_agblock_t, bno) |
| 1609 | __field(xfs_extlen_t, len) |
| 1610 | __field(xfs_extlen_t, diff) |
| 1611 | __field(bool, new) |
| 1612 | ), |
| 1613 | TP_fast_assign( |
| 1614 | __entry->dev = mp->m_super->s_dev; |
| 1615 | __entry->btnum = btnum; |
| 1616 | __entry->bno = bno; |
| 1617 | __entry->len = len; |
| 1618 | __entry->diff = diff; |
| 1619 | __entry->new = new; |
| 1620 | ), |
| 1621 | TP_printk("dev %d:%d btree %s bno 0x%x len 0x%x diff 0x%x new %d", |
| 1622 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1623 | __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS), |
| 1624 | __entry->bno, __entry->len, __entry->diff, __entry->new) |
| 1625 | ) |
| 1626 | |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1627 | DECLARE_EVENT_CLASS(xfs_da_class, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1628 | TP_PROTO(struct xfs_da_args *args), |
| 1629 | TP_ARGS(args), |
| 1630 | TP_STRUCT__entry( |
| 1631 | __field(dev_t, dev) |
| 1632 | __field(xfs_ino_t, ino) |
| 1633 | __dynamic_array(char, name, args->namelen) |
| 1634 | __field(int, namelen) |
| 1635 | __field(xfs_dahash_t, hashval) |
| 1636 | __field(xfs_ino_t, inumber) |
| 1637 | __field(int, op_flags) |
| 1638 | ), |
| 1639 | TP_fast_assign( |
| 1640 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; |
| 1641 | __entry->ino = args->dp->i_ino; |
| 1642 | if (args->namelen) |
| 1643 | memcpy(__get_str(name), args->name, args->namelen); |
| 1644 | __entry->namelen = args->namelen; |
| 1645 | __entry->hashval = args->hashval; |
| 1646 | __entry->inumber = args->inumber; |
| 1647 | __entry->op_flags = args->op_flags; |
| 1648 | ), |
| 1649 | TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x " |
| 1650 | "inumber 0x%llx op_flags %s", |
| 1651 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1652 | __entry->ino, |
| 1653 | __entry->namelen, |
| 1654 | __entry->namelen ? __get_str(name) : NULL, |
| 1655 | __entry->namelen, |
| 1656 | __entry->hashval, |
| 1657 | __entry->inumber, |
| 1658 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1659 | ) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1660 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1661 | #define DEFINE_DIR2_EVENT(name) \ |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1662 | DEFINE_EVENT(xfs_da_class, name, \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1663 | TP_PROTO(struct xfs_da_args *args), \ |
| 1664 | TP_ARGS(args)) |
| 1665 | DEFINE_DIR2_EVENT(xfs_dir2_sf_addname); |
| 1666 | DEFINE_DIR2_EVENT(xfs_dir2_sf_create); |
| 1667 | DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup); |
| 1668 | DEFINE_DIR2_EVENT(xfs_dir2_sf_replace); |
| 1669 | DEFINE_DIR2_EVENT(xfs_dir2_sf_removename); |
| 1670 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4); |
| 1671 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8); |
| 1672 | DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block); |
| 1673 | DEFINE_DIR2_EVENT(xfs_dir2_block_addname); |
| 1674 | DEFINE_DIR2_EVENT(xfs_dir2_block_lookup); |
| 1675 | DEFINE_DIR2_EVENT(xfs_dir2_block_replace); |
| 1676 | DEFINE_DIR2_EVENT(xfs_dir2_block_removename); |
| 1677 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf); |
| 1678 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf); |
| 1679 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname); |
| 1680 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup); |
| 1681 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace); |
| 1682 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename); |
| 1683 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block); |
| 1684 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node); |
| 1685 | DEFINE_DIR2_EVENT(xfs_dir2_node_addname); |
| 1686 | DEFINE_DIR2_EVENT(xfs_dir2_node_lookup); |
| 1687 | DEFINE_DIR2_EVENT(xfs_dir2_node_replace); |
| 1688 | DEFINE_DIR2_EVENT(xfs_dir2_node_removename); |
| 1689 | DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf); |
| 1690 | |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1691 | DECLARE_EVENT_CLASS(xfs_attr_class, |
| 1692 | TP_PROTO(struct xfs_da_args *args), |
| 1693 | TP_ARGS(args), |
| 1694 | TP_STRUCT__entry( |
| 1695 | __field(dev_t, dev) |
| 1696 | __field(xfs_ino_t, ino) |
| 1697 | __dynamic_array(char, name, args->namelen) |
| 1698 | __field(int, namelen) |
| 1699 | __field(int, valuelen) |
| 1700 | __field(xfs_dahash_t, hashval) |
Eric Sandeen | e443523 | 2018-04-17 17:17:35 -0700 | [diff] [blame] | 1701 | __field(int, flags) |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1702 | __field(int, op_flags) |
| 1703 | ), |
| 1704 | TP_fast_assign( |
| 1705 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; |
| 1706 | __entry->ino = args->dp->i_ino; |
| 1707 | if (args->namelen) |
| 1708 | memcpy(__get_str(name), args->name, args->namelen); |
| 1709 | __entry->namelen = args->namelen; |
| 1710 | __entry->valuelen = args->valuelen; |
| 1711 | __entry->hashval = args->hashval; |
Eric Sandeen | e443523 | 2018-04-17 17:17:35 -0700 | [diff] [blame] | 1712 | __entry->flags = args->flags; |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1713 | __entry->op_flags = args->op_flags; |
| 1714 | ), |
| 1715 | TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d " |
Eric Sandeen | e443523 | 2018-04-17 17:17:35 -0700 | [diff] [blame] | 1716 | "hashval 0x%x flags %s op_flags %s", |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1717 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1718 | __entry->ino, |
| 1719 | __entry->namelen, |
| 1720 | __entry->namelen ? __get_str(name) : NULL, |
| 1721 | __entry->namelen, |
| 1722 | __entry->valuelen, |
| 1723 | __entry->hashval, |
Eric Sandeen | e443523 | 2018-04-17 17:17:35 -0700 | [diff] [blame] | 1724 | __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS), |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1725 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) |
| 1726 | ) |
| 1727 | |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1728 | #define DEFINE_ATTR_EVENT(name) \ |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1729 | DEFINE_EVENT(xfs_attr_class, name, \ |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1730 | TP_PROTO(struct xfs_da_args *args), \ |
| 1731 | TP_ARGS(args)) |
| 1732 | DEFINE_ATTR_EVENT(xfs_attr_sf_add); |
| 1733 | DEFINE_ATTR_EVENT(xfs_attr_sf_addname); |
| 1734 | DEFINE_ATTR_EVENT(xfs_attr_sf_create); |
| 1735 | DEFINE_ATTR_EVENT(xfs_attr_sf_lookup); |
| 1736 | DEFINE_ATTR_EVENT(xfs_attr_sf_remove); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1737 | DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf); |
| 1738 | |
| 1739 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add); |
| 1740 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old); |
| 1741 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1742 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1743 | DEFINE_ATTR_EVENT(xfs_attr_leaf_addname); |
| 1744 | DEFINE_ATTR_EVENT(xfs_attr_leaf_create); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1745 | DEFINE_ATTR_EVENT(xfs_attr_leaf_compact); |
| 1746 | DEFINE_ATTR_EVENT(xfs_attr_leaf_get); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1747 | DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup); |
| 1748 | DEFINE_ATTR_EVENT(xfs_attr_leaf_replace); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1749 | DEFINE_ATTR_EVENT(xfs_attr_leaf_remove); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1750 | DEFINE_ATTR_EVENT(xfs_attr_leaf_removename); |
| 1751 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split); |
| 1752 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before); |
| 1753 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after); |
| 1754 | DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag); |
| 1755 | DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag); |
| 1756 | DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags); |
| 1757 | DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf); |
| 1758 | DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node); |
| 1759 | DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance); |
| 1760 | DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1761 | DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1762 | |
| 1763 | DEFINE_ATTR_EVENT(xfs_attr_node_addname); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1764 | DEFINE_ATTR_EVENT(xfs_attr_node_get); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1765 | DEFINE_ATTR_EVENT(xfs_attr_node_replace); |
| 1766 | DEFINE_ATTR_EVENT(xfs_attr_node_removename); |
| 1767 | |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1768 | DEFINE_ATTR_EVENT(xfs_attr_fillstate); |
| 1769 | DEFINE_ATTR_EVENT(xfs_attr_refillstate); |
| 1770 | |
| 1771 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_get); |
| 1772 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_set); |
| 1773 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove); |
| 1774 | |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1775 | #define DEFINE_DA_EVENT(name) \ |
| 1776 | DEFINE_EVENT(xfs_da_class, name, \ |
| 1777 | TP_PROTO(struct xfs_da_args *args), \ |
| 1778 | TP_ARGS(args)) |
| 1779 | DEFINE_DA_EVENT(xfs_da_split); |
| 1780 | DEFINE_DA_EVENT(xfs_da_join); |
| 1781 | DEFINE_DA_EVENT(xfs_da_link_before); |
| 1782 | DEFINE_DA_EVENT(xfs_da_link_after); |
| 1783 | DEFINE_DA_EVENT(xfs_da_unlink_back); |
| 1784 | DEFINE_DA_EVENT(xfs_da_unlink_forward); |
| 1785 | DEFINE_DA_EVENT(xfs_da_root_split); |
| 1786 | DEFINE_DA_EVENT(xfs_da_root_join); |
| 1787 | DEFINE_DA_EVENT(xfs_da_node_add); |
| 1788 | DEFINE_DA_EVENT(xfs_da_node_create); |
| 1789 | DEFINE_DA_EVENT(xfs_da_node_split); |
| 1790 | DEFINE_DA_EVENT(xfs_da_node_remove); |
| 1791 | DEFINE_DA_EVENT(xfs_da_node_rebalance); |
| 1792 | DEFINE_DA_EVENT(xfs_da_node_unbalance); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1793 | DEFINE_DA_EVENT(xfs_da_node_toosmall); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1794 | DEFINE_DA_EVENT(xfs_da_swap_lastblock); |
| 1795 | DEFINE_DA_EVENT(xfs_da_grow_inode); |
| 1796 | DEFINE_DA_EVENT(xfs_da_shrink_inode); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1797 | DEFINE_DA_EVENT(xfs_da_fixhashpath); |
| 1798 | DEFINE_DA_EVENT(xfs_da_path_shift); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1799 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1800 | DECLARE_EVENT_CLASS(xfs_dir2_space_class, |
| 1801 | TP_PROTO(struct xfs_da_args *args, int idx), |
| 1802 | TP_ARGS(args, idx), |
| 1803 | TP_STRUCT__entry( |
| 1804 | __field(dev_t, dev) |
| 1805 | __field(xfs_ino_t, ino) |
| 1806 | __field(int, op_flags) |
| 1807 | __field(int, idx) |
| 1808 | ), |
| 1809 | TP_fast_assign( |
| 1810 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; |
| 1811 | __entry->ino = args->dp->i_ino; |
| 1812 | __entry->op_flags = args->op_flags; |
| 1813 | __entry->idx = idx; |
| 1814 | ), |
| 1815 | TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d", |
| 1816 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1817 | __entry->ino, |
| 1818 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), |
| 1819 | __entry->idx) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1820 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1821 | |
| 1822 | #define DEFINE_DIR2_SPACE_EVENT(name) \ |
| 1823 | DEFINE_EVENT(xfs_dir2_space_class, name, \ |
| 1824 | TP_PROTO(struct xfs_da_args *args, int idx), \ |
| 1825 | TP_ARGS(args, idx)) |
| 1826 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add); |
| 1827 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove); |
| 1828 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode); |
| 1829 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1830 | |
| 1831 | TRACE_EVENT(xfs_dir2_leafn_moveents, |
| 1832 | TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count), |
| 1833 | TP_ARGS(args, src_idx, dst_idx, count), |
| 1834 | TP_STRUCT__entry( |
| 1835 | __field(dev_t, dev) |
| 1836 | __field(xfs_ino_t, ino) |
| 1837 | __field(int, op_flags) |
| 1838 | __field(int, src_idx) |
| 1839 | __field(int, dst_idx) |
| 1840 | __field(int, count) |
| 1841 | ), |
| 1842 | TP_fast_assign( |
| 1843 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; |
| 1844 | __entry->ino = args->dp->i_ino; |
| 1845 | __entry->op_flags = args->op_flags; |
| 1846 | __entry->src_idx = src_idx; |
| 1847 | __entry->dst_idx = dst_idx; |
| 1848 | __entry->count = count; |
| 1849 | ), |
| 1850 | TP_printk("dev %d:%d ino 0x%llx op_flags %s " |
| 1851 | "src_idx %d dst_idx %d count %d", |
| 1852 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1853 | __entry->ino, |
| 1854 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), |
| 1855 | __entry->src_idx, |
| 1856 | __entry->dst_idx, |
| 1857 | __entry->count) |
| 1858 | ); |
| 1859 | |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1860 | #define XFS_SWAPEXT_INODES \ |
| 1861 | { 0, "target" }, \ |
| 1862 | { 1, "temp" } |
| 1863 | |
Darrick J. Wong | 0357d21 | 2018-12-18 14:32:30 -0800 | [diff] [blame] | 1864 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV); |
| 1865 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL); |
| 1866 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS); |
| 1867 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE); |
| 1868 | TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID); |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1869 | |
| 1870 | DECLARE_EVENT_CLASS(xfs_swap_extent_class, |
| 1871 | TP_PROTO(struct xfs_inode *ip, int which), |
| 1872 | TP_ARGS(ip, which), |
| 1873 | TP_STRUCT__entry( |
| 1874 | __field(dev_t, dev) |
| 1875 | __field(int, which) |
| 1876 | __field(xfs_ino_t, ino) |
| 1877 | __field(int, format) |
| 1878 | __field(int, nex) |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1879 | __field(int, broot_size) |
| 1880 | __field(int, fork_off) |
| 1881 | ), |
| 1882 | TP_fast_assign( |
| 1883 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1884 | __entry->which = which; |
| 1885 | __entry->ino = ip->i_ino; |
| 1886 | __entry->format = ip->i_d.di_format; |
| 1887 | __entry->nex = ip->i_d.di_nextents; |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1888 | __entry->broot_size = ip->i_df.if_broot_bytes; |
| 1889 | __entry->fork_off = XFS_IFORK_BOFF(ip); |
| 1890 | ), |
| 1891 | TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, " |
Christoph Hellwig | 8096b1e | 2011-12-18 20:00:07 +0000 | [diff] [blame] | 1892 | "broot size %d, fork offset %d", |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1893 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1894 | __entry->ino, |
| 1895 | __print_symbolic(__entry->which, XFS_SWAPEXT_INODES), |
| 1896 | __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR), |
| 1897 | __entry->nex, |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1898 | __entry->broot_size, |
| 1899 | __entry->fork_off) |
| 1900 | ) |
| 1901 | |
| 1902 | #define DEFINE_SWAPEXT_EVENT(name) \ |
| 1903 | DEFINE_EVENT(xfs_swap_extent_class, name, \ |
| 1904 | TP_PROTO(struct xfs_inode *ip, int which), \ |
| 1905 | TP_ARGS(ip, which)) |
| 1906 | |
| 1907 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before); |
| 1908 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after); |
| 1909 | |
Brian Foster | e67d3d4 | 2017-08-08 18:21:53 -0700 | [diff] [blame] | 1910 | TRACE_EVENT(xfs_log_recover, |
| 1911 | TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk), |
| 1912 | TP_ARGS(log, headblk, tailblk), |
| 1913 | TP_STRUCT__entry( |
| 1914 | __field(dev_t, dev) |
| 1915 | __field(xfs_daddr_t, headblk) |
| 1916 | __field(xfs_daddr_t, tailblk) |
| 1917 | ), |
| 1918 | TP_fast_assign( |
| 1919 | __entry->dev = log->l_mp->m_super->s_dev; |
| 1920 | __entry->headblk = headblk; |
| 1921 | __entry->tailblk = tailblk; |
| 1922 | ), |
| 1923 | TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx", |
| 1924 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk, |
| 1925 | __entry->tailblk) |
| 1926 | ) |
| 1927 | |
Brian Foster | 5cd9cee | 2016-09-26 08:34:52 +1000 | [diff] [blame] | 1928 | TRACE_EVENT(xfs_log_recover_record, |
| 1929 | TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass), |
| 1930 | TP_ARGS(log, rhead, pass), |
| 1931 | TP_STRUCT__entry( |
| 1932 | __field(dev_t, dev) |
| 1933 | __field(xfs_lsn_t, lsn) |
| 1934 | __field(int, len) |
| 1935 | __field(int, num_logops) |
| 1936 | __field(int, pass) |
| 1937 | ), |
| 1938 | TP_fast_assign( |
| 1939 | __entry->dev = log->l_mp->m_super->s_dev; |
| 1940 | __entry->lsn = be64_to_cpu(rhead->h_lsn); |
| 1941 | __entry->len = be32_to_cpu(rhead->h_len); |
| 1942 | __entry->num_logops = be32_to_cpu(rhead->h_num_logops); |
| 1943 | __entry->pass = pass; |
| 1944 | ), |
| 1945 | TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d", |
| 1946 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1947 | __entry->lsn, __entry->len, __entry->num_logops, |
| 1948 | __entry->pass) |
| 1949 | ) |
| 1950 | |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1951 | DECLARE_EVENT_CLASS(xfs_log_recover_item_class, |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 1952 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1953 | struct xlog_recover_item *item, int pass), |
| 1954 | TP_ARGS(log, trans, item, pass), |
| 1955 | TP_STRUCT__entry( |
| 1956 | __field(dev_t, dev) |
| 1957 | __field(unsigned long, item) |
| 1958 | __field(xlog_tid_t, tid) |
Brian Foster | 5cd9cee | 2016-09-26 08:34:52 +1000 | [diff] [blame] | 1959 | __field(xfs_lsn_t, lsn) |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1960 | __field(int, type) |
| 1961 | __field(int, pass) |
| 1962 | __field(int, count) |
| 1963 | __field(int, total) |
| 1964 | ), |
| 1965 | TP_fast_assign( |
| 1966 | __entry->dev = log->l_mp->m_super->s_dev; |
| 1967 | __entry->item = (unsigned long)item; |
| 1968 | __entry->tid = trans->r_log_tid; |
Brian Foster | 5cd9cee | 2016-09-26 08:34:52 +1000 | [diff] [blame] | 1969 | __entry->lsn = trans->r_lsn; |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1970 | __entry->type = ITEM_TYPE(item); |
| 1971 | __entry->pass = pass; |
| 1972 | __entry->count = item->ri_cnt; |
| 1973 | __entry->total = item->ri_total; |
| 1974 | ), |
Darrick J. Wong | 3d170aa | 2018-01-09 11:43:36 -0800 | [diff] [blame] | 1975 | TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, " |
Brian Foster | 5cd9cee | 2016-09-26 08:34:52 +1000 | [diff] [blame] | 1976 | "item type %s item region count/total %d/%d", |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1977 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1978 | __entry->tid, |
Brian Foster | 5cd9cee | 2016-09-26 08:34:52 +1000 | [diff] [blame] | 1979 | __entry->lsn, |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1980 | __entry->pass, |
| 1981 | (void *)__entry->item, |
| 1982 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), |
| 1983 | __entry->count, |
| 1984 | __entry->total) |
| 1985 | ) |
| 1986 | |
| 1987 | #define DEFINE_LOG_RECOVER_ITEM(name) \ |
| 1988 | DEFINE_EVENT(xfs_log_recover_item_class, name, \ |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 1989 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, \ |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1990 | struct xlog_recover_item *item, int pass), \ |
| 1991 | TP_ARGS(log, trans, item, pass)) |
| 1992 | |
| 1993 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add); |
| 1994 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont); |
| 1995 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head); |
| 1996 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail); |
| 1997 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover); |
| 1998 | |
| 1999 | DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class, |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 2000 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 2001 | TP_ARGS(log, buf_f), |
| 2002 | TP_STRUCT__entry( |
| 2003 | __field(dev_t, dev) |
Darrick J. Wong | c8ce540 | 2017-06-16 11:00:05 -0700 | [diff] [blame] | 2004 | __field(int64_t, blkno) |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 2005 | __field(unsigned short, len) |
| 2006 | __field(unsigned short, flags) |
| 2007 | __field(unsigned short, size) |
| 2008 | __field(unsigned int, map_size) |
| 2009 | ), |
| 2010 | TP_fast_assign( |
| 2011 | __entry->dev = log->l_mp->m_super->s_dev; |
| 2012 | __entry->blkno = buf_f->blf_blkno; |
| 2013 | __entry->len = buf_f->blf_len; |
| 2014 | __entry->flags = buf_f->blf_flags; |
| 2015 | __entry->size = buf_f->blf_size; |
| 2016 | __entry->map_size = buf_f->blf_map_size; |
| 2017 | ), |
| 2018 | TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, " |
| 2019 | "map_size %d", |
| 2020 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2021 | __entry->blkno, |
| 2022 | __entry->len, |
| 2023 | __entry->flags, |
| 2024 | __entry->size, |
| 2025 | __entry->map_size) |
| 2026 | ) |
| 2027 | |
| 2028 | #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \ |
| 2029 | DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \ |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 2030 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \ |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 2031 | TP_ARGS(log, buf_f)) |
| 2032 | |
| 2033 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel); |
| 2034 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel); |
| 2035 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add); |
| 2036 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc); |
| 2037 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover); |
Brian Foster | 5cd9cee | 2016-09-26 08:34:52 +1000 | [diff] [blame] | 2038 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip); |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 2039 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf); |
| 2040 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf); |
| 2041 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf); |
| 2042 | |
| 2043 | DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class, |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 2044 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 2045 | TP_ARGS(log, in_f), |
| 2046 | TP_STRUCT__entry( |
| 2047 | __field(dev_t, dev) |
| 2048 | __field(xfs_ino_t, ino) |
| 2049 | __field(unsigned short, size) |
| 2050 | __field(int, fields) |
| 2051 | __field(unsigned short, asize) |
| 2052 | __field(unsigned short, dsize) |
Darrick J. Wong | c8ce540 | 2017-06-16 11:00:05 -0700 | [diff] [blame] | 2053 | __field(int64_t, blkno) |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 2054 | __field(int, len) |
| 2055 | __field(int, boffset) |
| 2056 | ), |
| 2057 | TP_fast_assign( |
| 2058 | __entry->dev = log->l_mp->m_super->s_dev; |
| 2059 | __entry->ino = in_f->ilf_ino; |
| 2060 | __entry->size = in_f->ilf_size; |
| 2061 | __entry->fields = in_f->ilf_fields; |
| 2062 | __entry->asize = in_f->ilf_asize; |
| 2063 | __entry->dsize = in_f->ilf_dsize; |
| 2064 | __entry->blkno = in_f->ilf_blkno; |
| 2065 | __entry->len = in_f->ilf_len; |
| 2066 | __entry->boffset = in_f->ilf_boffset; |
| 2067 | ), |
| 2068 | TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, " |
| 2069 | "dsize %d, blkno 0x%llx, len %d, boffset %d", |
| 2070 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2071 | __entry->ino, |
| 2072 | __entry->size, |
| 2073 | __entry->fields, |
| 2074 | __entry->asize, |
| 2075 | __entry->dsize, |
| 2076 | __entry->blkno, |
| 2077 | __entry->len, |
| 2078 | __entry->boffset) |
| 2079 | ) |
| 2080 | #define DEFINE_LOG_RECOVER_INO_ITEM(name) \ |
| 2081 | DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \ |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 2082 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \ |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 2083 | TP_ARGS(log, in_f)) |
| 2084 | |
| 2085 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover); |
| 2086 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel); |
| 2087 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip); |
| 2088 | |
Brian Foster | 78d57e4 | 2015-08-19 09:58:48 +1000 | [diff] [blame] | 2089 | DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class, |
| 2090 | TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), |
| 2091 | TP_ARGS(log, in_f), |
| 2092 | TP_STRUCT__entry( |
| 2093 | __field(dev_t, dev) |
| 2094 | __field(xfs_agnumber_t, agno) |
| 2095 | __field(xfs_agblock_t, agbno) |
| 2096 | __field(unsigned int, count) |
| 2097 | __field(unsigned int, isize) |
| 2098 | __field(xfs_agblock_t, length) |
| 2099 | __field(unsigned int, gen) |
| 2100 | ), |
| 2101 | TP_fast_assign( |
| 2102 | __entry->dev = log->l_mp->m_super->s_dev; |
| 2103 | __entry->agno = be32_to_cpu(in_f->icl_ag); |
| 2104 | __entry->agbno = be32_to_cpu(in_f->icl_agbno); |
| 2105 | __entry->count = be32_to_cpu(in_f->icl_count); |
| 2106 | __entry->isize = be32_to_cpu(in_f->icl_isize); |
| 2107 | __entry->length = be32_to_cpu(in_f->icl_length); |
| 2108 | __entry->gen = be32_to_cpu(in_f->icl_gen); |
| 2109 | ), |
| 2110 | TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u " |
| 2111 | "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2112 | __entry->agno, __entry->agbno, __entry->count, __entry->isize, |
| 2113 | __entry->length, __entry->gen) |
| 2114 | ) |
| 2115 | #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \ |
| 2116 | DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \ |
| 2117 | TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \ |
| 2118 | TP_ARGS(log, in_f)) |
| 2119 | |
| 2120 | DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel); |
| 2121 | DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover); |
| 2122 | |
Christoph Hellwig | a46db60 | 2011-01-07 13:02:04 +0000 | [diff] [blame] | 2123 | DECLARE_EVENT_CLASS(xfs_discard_class, |
| 2124 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2125 | xfs_agblock_t agbno, xfs_extlen_t len), |
| 2126 | TP_ARGS(mp, agno, agbno, len), |
| 2127 | TP_STRUCT__entry( |
| 2128 | __field(dev_t, dev) |
| 2129 | __field(xfs_agnumber_t, agno) |
| 2130 | __field(xfs_agblock_t, agbno) |
| 2131 | __field(xfs_extlen_t, len) |
| 2132 | ), |
| 2133 | TP_fast_assign( |
| 2134 | __entry->dev = mp->m_super->s_dev; |
| 2135 | __entry->agno = agno; |
| 2136 | __entry->agbno = agbno; |
| 2137 | __entry->len = len; |
| 2138 | ), |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 2139 | TP_printk("dev %d:%d agno %u agbno %u len %u", |
Christoph Hellwig | a46db60 | 2011-01-07 13:02:04 +0000 | [diff] [blame] | 2140 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2141 | __entry->agno, |
| 2142 | __entry->agbno, |
| 2143 | __entry->len) |
| 2144 | ) |
| 2145 | |
| 2146 | #define DEFINE_DISCARD_EVENT(name) \ |
| 2147 | DEFINE_EVENT(xfs_discard_class, name, \ |
| 2148 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2149 | xfs_agblock_t agbno, xfs_extlen_t len), \ |
| 2150 | TP_ARGS(mp, agno, agbno, len)) |
| 2151 | DEFINE_DISCARD_EVENT(xfs_discard_extent); |
| 2152 | DEFINE_DISCARD_EVENT(xfs_discard_toosmall); |
| 2153 | DEFINE_DISCARD_EVENT(xfs_discard_exclude); |
| 2154 | DEFINE_DISCARD_EVENT(xfs_discard_busy); |
| 2155 | |
Darrick J. Wong | 2c813ad | 2016-08-03 11:08:36 +1000 | [diff] [blame] | 2156 | /* btree cursor events */ |
Darrick J. Wong | c494213 | 2018-12-18 14:32:31 -0800 | [diff] [blame] | 2157 | TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi); |
| 2158 | TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi); |
| 2159 | TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi); |
| 2160 | TRACE_DEFINE_ENUM(XFS_BTNUM_INOi); |
| 2161 | TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi); |
| 2162 | TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi); |
| 2163 | TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi); |
| 2164 | |
Darrick J. Wong | 2c813ad | 2016-08-03 11:08:36 +1000 | [diff] [blame] | 2165 | DECLARE_EVENT_CLASS(xfs_btree_cur_class, |
| 2166 | TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), |
| 2167 | TP_ARGS(cur, level, bp), |
| 2168 | TP_STRUCT__entry( |
| 2169 | __field(dev_t, dev) |
| 2170 | __field(xfs_btnum_t, btnum) |
| 2171 | __field(int, level) |
| 2172 | __field(int, nlevels) |
| 2173 | __field(int, ptr) |
| 2174 | __field(xfs_daddr_t, daddr) |
| 2175 | ), |
| 2176 | TP_fast_assign( |
| 2177 | __entry->dev = cur->bc_mp->m_super->s_dev; |
| 2178 | __entry->btnum = cur->bc_btnum; |
| 2179 | __entry->level = level; |
| 2180 | __entry->nlevels = cur->bc_nlevels; |
| 2181 | __entry->ptr = cur->bc_ptrs[level]; |
| 2182 | __entry->daddr = bp ? bp->b_bn : -1; |
| 2183 | ), |
Darrick J. Wong | c494213 | 2018-12-18 14:32:31 -0800 | [diff] [blame] | 2184 | TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx", |
Darrick J. Wong | 2c813ad | 2016-08-03 11:08:36 +1000 | [diff] [blame] | 2185 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Darrick J. Wong | c494213 | 2018-12-18 14:32:31 -0800 | [diff] [blame] | 2186 | __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS), |
Darrick J. Wong | 2c813ad | 2016-08-03 11:08:36 +1000 | [diff] [blame] | 2187 | __entry->level, |
| 2188 | __entry->nlevels, |
| 2189 | __entry->ptr, |
| 2190 | (unsigned long long)__entry->daddr) |
| 2191 | ) |
| 2192 | |
| 2193 | #define DEFINE_BTREE_CUR_EVENT(name) \ |
| 2194 | DEFINE_EVENT(xfs_btree_cur_class, name, \ |
| 2195 | TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \ |
| 2196 | TP_ARGS(cur, level, bp)) |
| 2197 | DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys); |
Darrick J. Wong | 105f7d8 | 2016-08-03 11:10:21 +1000 | [diff] [blame] | 2198 | DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range); |
Darrick J. Wong | 2c813ad | 2016-08-03 11:08:36 +1000 | [diff] [blame] | 2199 | |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2200 | /* deferred ops */ |
| 2201 | struct xfs_defer_pending; |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2202 | |
| 2203 | DECLARE_EVENT_CLASS(xfs_defer_class, |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2204 | TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), |
| 2205 | TP_ARGS(tp, caller_ip), |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2206 | TP_STRUCT__entry( |
| 2207 | __field(dev_t, dev) |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2208 | __field(struct xfs_trans *, tp) |
Christoph Hellwig | 3f88a15 | 2017-04-21 11:24:42 -0700 | [diff] [blame] | 2209 | __field(char, committed) |
Dave Chinner | e632a56 | 2018-05-09 07:48:52 -0700 | [diff] [blame] | 2210 | __field(unsigned long, caller_ip) |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2211 | ), |
| 2212 | TP_fast_assign( |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2213 | __entry->dev = tp->t_mountp->m_super->s_dev; |
| 2214 | __entry->tp = tp; |
Dave Chinner | e632a56 | 2018-05-09 07:48:52 -0700 | [diff] [blame] | 2215 | __entry->caller_ip = caller_ip; |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2216 | ), |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2217 | TP_printk("dev %d:%d tp %p caller %pS", |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2218 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2219 | __entry->tp, |
Dave Chinner | e632a56 | 2018-05-09 07:48:52 -0700 | [diff] [blame] | 2220 | (char *)__entry->caller_ip) |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2221 | ) |
| 2222 | #define DEFINE_DEFER_EVENT(name) \ |
| 2223 | DEFINE_EVENT(xfs_defer_class, name, \ |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2224 | TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \ |
| 2225 | TP_ARGS(tp, caller_ip)) |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2226 | |
| 2227 | DECLARE_EVENT_CLASS(xfs_defer_error_class, |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2228 | TP_PROTO(struct xfs_trans *tp, int error), |
| 2229 | TP_ARGS(tp, error), |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2230 | TP_STRUCT__entry( |
| 2231 | __field(dev_t, dev) |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2232 | __field(struct xfs_trans *, tp) |
Christoph Hellwig | 3f88a15 | 2017-04-21 11:24:42 -0700 | [diff] [blame] | 2233 | __field(char, committed) |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2234 | __field(int, error) |
| 2235 | ), |
| 2236 | TP_fast_assign( |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2237 | __entry->dev = tp->t_mountp->m_super->s_dev; |
| 2238 | __entry->tp = tp; |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2239 | __entry->error = error; |
| 2240 | ), |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2241 | TP_printk("dev %d:%d tp %p err %d", |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2242 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2243 | __entry->tp, |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2244 | __entry->error) |
| 2245 | ) |
| 2246 | #define DEFINE_DEFER_ERROR_EVENT(name) \ |
| 2247 | DEFINE_EVENT(xfs_defer_error_class, name, \ |
Brian Foster | 9d9e623 | 2018-08-01 07:20:35 -0700 | [diff] [blame] | 2248 | TP_PROTO(struct xfs_trans *tp, int error), \ |
| 2249 | TP_ARGS(tp, error)) |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2250 | |
| 2251 | DECLARE_EVENT_CLASS(xfs_defer_pending_class, |
| 2252 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), |
| 2253 | TP_ARGS(mp, dfp), |
| 2254 | TP_STRUCT__entry( |
| 2255 | __field(dev_t, dev) |
| 2256 | __field(int, type) |
| 2257 | __field(void *, intent) |
Christoph Hellwig | 3f88a15 | 2017-04-21 11:24:42 -0700 | [diff] [blame] | 2258 | __field(char, committed) |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2259 | __field(int, nr) |
| 2260 | ), |
| 2261 | TP_fast_assign( |
| 2262 | __entry->dev = mp ? mp->m_super->s_dev : 0; |
Darrick J. Wong | 02b100f | 2018-12-12 08:46:22 -0800 | [diff] [blame] | 2263 | __entry->type = dfp->dfp_type; |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2264 | __entry->intent = dfp->dfp_intent; |
Darrick J. Wong | ea78d80 | 2016-08-30 13:51:39 +1000 | [diff] [blame] | 2265 | __entry->committed = dfp->dfp_done != NULL; |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2266 | __entry->nr = dfp->dfp_count; |
| 2267 | ), |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 2268 | TP_printk("dev %d:%d optype %d intent %p committed %d nr %d", |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2269 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2270 | __entry->type, |
| 2271 | __entry->intent, |
| 2272 | __entry->committed, |
| 2273 | __entry->nr) |
| 2274 | ) |
| 2275 | #define DEFINE_DEFER_PENDING_EVENT(name) \ |
| 2276 | DEFINE_EVENT(xfs_defer_pending_class, name, \ |
| 2277 | TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \ |
| 2278 | TP_ARGS(mp, dfp)) |
| 2279 | |
| 2280 | DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class, |
| 2281 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2282 | int type, xfs_agblock_t agbno, xfs_extlen_t len), |
| 2283 | TP_ARGS(mp, agno, type, agbno, len), |
| 2284 | TP_STRUCT__entry( |
| 2285 | __field(dev_t, dev) |
| 2286 | __field(xfs_agnumber_t, agno) |
| 2287 | __field(int, type) |
| 2288 | __field(xfs_agblock_t, agbno) |
| 2289 | __field(xfs_extlen_t, len) |
| 2290 | ), |
| 2291 | TP_fast_assign( |
| 2292 | __entry->dev = mp->m_super->s_dev; |
| 2293 | __entry->agno = agno; |
| 2294 | __entry->type = type; |
| 2295 | __entry->agbno = agbno; |
| 2296 | __entry->len = len; |
| 2297 | ), |
| 2298 | TP_printk("dev %d:%d op %d agno %u agbno %u len %u", |
| 2299 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2300 | __entry->type, |
| 2301 | __entry->agno, |
| 2302 | __entry->agbno, |
| 2303 | __entry->len) |
| 2304 | ); |
| 2305 | #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \ |
| 2306 | DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \ |
| 2307 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2308 | int type, \ |
| 2309 | xfs_agblock_t bno, \ |
| 2310 | xfs_extlen_t len), \ |
| 2311 | TP_ARGS(mp, agno, type, bno, len)) |
| 2312 | |
| 2313 | DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class, |
| 2314 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2315 | int op, |
| 2316 | xfs_agblock_t agbno, |
| 2317 | xfs_ino_t ino, |
| 2318 | int whichfork, |
| 2319 | xfs_fileoff_t offset, |
| 2320 | xfs_filblks_t len, |
| 2321 | xfs_exntst_t state), |
| 2322 | TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state), |
| 2323 | TP_STRUCT__entry( |
| 2324 | __field(dev_t, dev) |
| 2325 | __field(xfs_agnumber_t, agno) |
| 2326 | __field(xfs_ino_t, ino) |
| 2327 | __field(xfs_agblock_t, agbno) |
| 2328 | __field(int, whichfork) |
| 2329 | __field(xfs_fileoff_t, l_loff) |
| 2330 | __field(xfs_filblks_t, l_len) |
| 2331 | __field(xfs_exntst_t, l_state) |
| 2332 | __field(int, op) |
| 2333 | ), |
| 2334 | TP_fast_assign( |
| 2335 | __entry->dev = mp->m_super->s_dev; |
| 2336 | __entry->agno = agno; |
| 2337 | __entry->ino = ino; |
| 2338 | __entry->agbno = agbno; |
| 2339 | __entry->whichfork = whichfork; |
| 2340 | __entry->l_loff = offset; |
| 2341 | __entry->l_len = len; |
| 2342 | __entry->l_state = state; |
| 2343 | __entry->op = op; |
| 2344 | ), |
| 2345 | TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d", |
| 2346 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2347 | __entry->op, |
| 2348 | __entry->agno, |
| 2349 | __entry->agbno, |
| 2350 | __entry->ino, |
| 2351 | __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data", |
| 2352 | __entry->l_loff, |
| 2353 | __entry->l_len, |
| 2354 | __entry->l_state) |
| 2355 | ); |
| 2356 | #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \ |
| 2357 | DEFINE_EVENT(xfs_map_extent_deferred_class, name, \ |
| 2358 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2359 | int op, \ |
| 2360 | xfs_agblock_t agbno, \ |
| 2361 | xfs_ino_t ino, \ |
| 2362 | int whichfork, \ |
| 2363 | xfs_fileoff_t offset, \ |
| 2364 | xfs_filblks_t len, \ |
| 2365 | xfs_exntst_t state), \ |
| 2366 | TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state)) |
| 2367 | |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2368 | DEFINE_DEFER_EVENT(xfs_defer_cancel); |
| 2369 | DEFINE_DEFER_EVENT(xfs_defer_trans_roll); |
| 2370 | DEFINE_DEFER_EVENT(xfs_defer_trans_abort); |
| 2371 | DEFINE_DEFER_EVENT(xfs_defer_finish); |
| 2372 | DEFINE_DEFER_EVENT(xfs_defer_finish_done); |
| 2373 | |
| 2374 | DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error); |
| 2375 | DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error); |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2376 | |
Brian Foster | 1ae093cb | 2018-08-01 07:20:34 -0700 | [diff] [blame] | 2377 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent); |
| 2378 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list); |
Darrick J. Wong | 3cd48ab | 2016-08-03 11:13:02 +1000 | [diff] [blame] | 2379 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish); |
| 2380 | DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort); |
| 2381 | |
Darrick J. Wong | ba9e780 | 2016-08-03 11:26:33 +1000 | [diff] [blame] | 2382 | #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT |
| 2383 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer); |
| 2384 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred); |
Brian Foster | f8f2835 | 2018-05-07 17:38:47 -0700 | [diff] [blame] | 2385 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer); |
| 2386 | DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred); |
Darrick J. Wong | ba9e780 | 2016-08-03 11:26:33 +1000 | [diff] [blame] | 2387 | |
Darrick J. Wong | 673930c | 2016-08-03 11:33:43 +1000 | [diff] [blame] | 2388 | /* rmap tracepoints */ |
| 2389 | DECLARE_EVENT_CLASS(xfs_rmap_class, |
| 2390 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2391 | xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, |
Darrick J. Wong | 66e3237 | 2018-12-12 08:46:23 -0800 | [diff] [blame] | 2392 | const struct xfs_owner_info *oinfo), |
Darrick J. Wong | 673930c | 2016-08-03 11:33:43 +1000 | [diff] [blame] | 2393 | TP_ARGS(mp, agno, agbno, len, unwritten, oinfo), |
| 2394 | TP_STRUCT__entry( |
| 2395 | __field(dev_t, dev) |
| 2396 | __field(xfs_agnumber_t, agno) |
| 2397 | __field(xfs_agblock_t, agbno) |
| 2398 | __field(xfs_extlen_t, len) |
| 2399 | __field(uint64_t, owner) |
| 2400 | __field(uint64_t, offset) |
| 2401 | __field(unsigned long, flags) |
| 2402 | ), |
| 2403 | TP_fast_assign( |
| 2404 | __entry->dev = mp->m_super->s_dev; |
| 2405 | __entry->agno = agno; |
| 2406 | __entry->agbno = agbno; |
| 2407 | __entry->len = len; |
| 2408 | __entry->owner = oinfo->oi_owner; |
| 2409 | __entry->offset = oinfo->oi_offset; |
| 2410 | __entry->flags = oinfo->oi_flags; |
Darrick J. Wong | 035e00a | 2016-08-03 11:36:07 +1000 | [diff] [blame] | 2411 | if (unwritten) |
| 2412 | __entry->flags |= XFS_RMAP_UNWRITTEN; |
Darrick J. Wong | 673930c | 2016-08-03 11:33:43 +1000 | [diff] [blame] | 2413 | ), |
| 2414 | TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx", |
| 2415 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2416 | __entry->agno, |
| 2417 | __entry->agbno, |
| 2418 | __entry->len, |
| 2419 | __entry->owner, |
| 2420 | __entry->offset, |
| 2421 | __entry->flags) |
| 2422 | ); |
| 2423 | #define DEFINE_RMAP_EVENT(name) \ |
| 2424 | DEFINE_EVENT(xfs_rmap_class, name, \ |
| 2425 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2426 | xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \ |
Darrick J. Wong | 66e3237 | 2018-12-12 08:46:23 -0800 | [diff] [blame] | 2427 | const struct xfs_owner_info *oinfo), \ |
Darrick J. Wong | 673930c | 2016-08-03 11:33:43 +1000 | [diff] [blame] | 2428 | TP_ARGS(mp, agno, agbno, len, unwritten, oinfo)) |
| 2429 | |
| 2430 | /* simple AG-based error/%ip tracepoint class */ |
| 2431 | DECLARE_EVENT_CLASS(xfs_ag_error_class, |
| 2432 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, |
| 2433 | unsigned long caller_ip), |
| 2434 | TP_ARGS(mp, agno, error, caller_ip), |
| 2435 | TP_STRUCT__entry( |
| 2436 | __field(dev_t, dev) |
| 2437 | __field(xfs_agnumber_t, agno) |
| 2438 | __field(int, error) |
| 2439 | __field(unsigned long, caller_ip) |
| 2440 | ), |
| 2441 | TP_fast_assign( |
| 2442 | __entry->dev = mp->m_super->s_dev; |
| 2443 | __entry->agno = agno; |
| 2444 | __entry->error = error; |
| 2445 | __entry->caller_ip = caller_ip; |
| 2446 | ), |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 2447 | TP_printk("dev %d:%d agno %u error %d caller %pS", |
Darrick J. Wong | 673930c | 2016-08-03 11:33:43 +1000 | [diff] [blame] | 2448 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2449 | __entry->agno, |
| 2450 | __entry->error, |
| 2451 | (char *)__entry->caller_ip) |
| 2452 | ); |
| 2453 | |
| 2454 | #define DEFINE_AG_ERROR_EVENT(name) \ |
| 2455 | DEFINE_EVENT(xfs_ag_error_class, name, \ |
| 2456 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \ |
| 2457 | unsigned long caller_ip), \ |
| 2458 | TP_ARGS(mp, agno, error, caller_ip)) |
| 2459 | |
| 2460 | DEFINE_RMAP_EVENT(xfs_rmap_unmap); |
| 2461 | DEFINE_RMAP_EVENT(xfs_rmap_unmap_done); |
| 2462 | DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error); |
| 2463 | DEFINE_RMAP_EVENT(xfs_rmap_map); |
| 2464 | DEFINE_RMAP_EVENT(xfs_rmap_map_done); |
| 2465 | DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error); |
Darrick J. Wong | fb7d926 | 2016-08-03 12:03:19 +1000 | [diff] [blame] | 2466 | DEFINE_RMAP_EVENT(xfs_rmap_convert); |
| 2467 | DEFINE_RMAP_EVENT(xfs_rmap_convert_done); |
| 2468 | DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error); |
| 2469 | DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state); |
Darrick J. Wong | 673930c | 2016-08-03 11:33:43 +1000 | [diff] [blame] | 2470 | |
Darrick J. Wong | aa966d8 | 2016-08-03 11:43:24 +1000 | [diff] [blame] | 2471 | DECLARE_EVENT_CLASS(xfs_rmapbt_class, |
| 2472 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2473 | xfs_agblock_t agbno, xfs_extlen_t len, |
| 2474 | uint64_t owner, uint64_t offset, unsigned int flags), |
| 2475 | TP_ARGS(mp, agno, agbno, len, owner, offset, flags), |
| 2476 | TP_STRUCT__entry( |
| 2477 | __field(dev_t, dev) |
| 2478 | __field(xfs_agnumber_t, agno) |
| 2479 | __field(xfs_agblock_t, agbno) |
| 2480 | __field(xfs_extlen_t, len) |
| 2481 | __field(uint64_t, owner) |
| 2482 | __field(uint64_t, offset) |
| 2483 | __field(unsigned int, flags) |
| 2484 | ), |
| 2485 | TP_fast_assign( |
| 2486 | __entry->dev = mp->m_super->s_dev; |
| 2487 | __entry->agno = agno; |
| 2488 | __entry->agbno = agbno; |
| 2489 | __entry->len = len; |
| 2490 | __entry->owner = owner; |
| 2491 | __entry->offset = offset; |
| 2492 | __entry->flags = flags; |
| 2493 | ), |
| 2494 | TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x", |
| 2495 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2496 | __entry->agno, |
| 2497 | __entry->agbno, |
| 2498 | __entry->len, |
| 2499 | __entry->owner, |
| 2500 | __entry->offset, |
| 2501 | __entry->flags) |
| 2502 | ); |
| 2503 | #define DEFINE_RMAPBT_EVENT(name) \ |
| 2504 | DEFINE_EVENT(xfs_rmapbt_class, name, \ |
| 2505 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2506 | xfs_agblock_t agbno, xfs_extlen_t len, \ |
| 2507 | uint64_t owner, uint64_t offset, unsigned int flags), \ |
| 2508 | TP_ARGS(mp, agno, agbno, len, owner, offset, flags)) |
| 2509 | |
| 2510 | #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT |
| 2511 | DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer); |
| 2512 | DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred); |
| 2513 | |
Darrick J. Wong | 4b8ed67 | 2016-08-03 11:39:05 +1000 | [diff] [blame] | 2514 | DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block); |
| 2515 | DEFINE_BUSY_EVENT(xfs_rmapbt_free_block); |
Darrick J. Wong | aa966d8 | 2016-08-03 11:43:24 +1000 | [diff] [blame] | 2516 | DEFINE_RMAPBT_EVENT(xfs_rmap_update); |
| 2517 | DEFINE_RMAPBT_EVENT(xfs_rmap_insert); |
| 2518 | DEFINE_RMAPBT_EVENT(xfs_rmap_delete); |
| 2519 | DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error); |
| 2520 | DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error); |
| 2521 | DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error); |
Darrick J. Wong | ceeb9c8 | 2016-10-03 09:11:48 -0700 | [diff] [blame] | 2522 | |
| 2523 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate); |
| 2524 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query); |
| 2525 | DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate); |
| 2526 | DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range); |
Darrick J. Wong | 0a1b0b3 | 2016-08-03 11:44:21 +1000 | [diff] [blame] | 2527 | DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result); |
| 2528 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result); |
Darrick J. Wong | fb7d926 | 2016-08-03 12:03:19 +1000 | [diff] [blame] | 2529 | DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result); |
Darrick J. Wong | 4b8ed67 | 2016-08-03 11:39:05 +1000 | [diff] [blame] | 2530 | |
Darrick J. Wong | 9f3afb5 | 2016-10-03 09:11:28 -0700 | [diff] [blame] | 2531 | /* deferred bmbt updates */ |
| 2532 | #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT |
| 2533 | DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer); |
| 2534 | DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred); |
| 2535 | |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 2536 | /* per-AG reservation */ |
| 2537 | DECLARE_EVENT_CLASS(xfs_ag_resv_class, |
| 2538 | TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv, |
| 2539 | xfs_extlen_t len), |
| 2540 | TP_ARGS(pag, resv, len), |
| 2541 | TP_STRUCT__entry( |
| 2542 | __field(dev_t, dev) |
| 2543 | __field(xfs_agnumber_t, agno) |
| 2544 | __field(int, resv) |
| 2545 | __field(xfs_extlen_t, freeblks) |
| 2546 | __field(xfs_extlen_t, flcount) |
| 2547 | __field(xfs_extlen_t, reserved) |
| 2548 | __field(xfs_extlen_t, asked) |
| 2549 | __field(xfs_extlen_t, len) |
| 2550 | ), |
| 2551 | TP_fast_assign( |
| 2552 | struct xfs_ag_resv *r = xfs_perag_resv(pag, resv); |
| 2553 | |
| 2554 | __entry->dev = pag->pag_mount->m_super->s_dev; |
| 2555 | __entry->agno = pag->pag_agno; |
| 2556 | __entry->resv = resv; |
| 2557 | __entry->freeblks = pag->pagf_freeblks; |
| 2558 | __entry->flcount = pag->pagf_flcount; |
| 2559 | __entry->reserved = r ? r->ar_reserved : 0; |
| 2560 | __entry->asked = r ? r->ar_asked : 0; |
| 2561 | __entry->len = len; |
| 2562 | ), |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 2563 | TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u " |
| 2564 | "resv %u ask %u len %u", |
Darrick J. Wong | 3fd129b | 2016-09-19 10:30:52 +1000 | [diff] [blame] | 2565 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2566 | __entry->agno, |
| 2567 | __entry->resv, |
| 2568 | __entry->freeblks, |
| 2569 | __entry->flcount, |
| 2570 | __entry->reserved, |
| 2571 | __entry->asked, |
| 2572 | __entry->len) |
| 2573 | ) |
| 2574 | #define DEFINE_AG_RESV_EVENT(name) \ |
| 2575 | DEFINE_EVENT(xfs_ag_resv_class, name, \ |
| 2576 | TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \ |
| 2577 | xfs_extlen_t len), \ |
| 2578 | TP_ARGS(pag, type, len)) |
| 2579 | |
| 2580 | /* per-AG reservation tracepoints */ |
| 2581 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_init); |
| 2582 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_free); |
| 2583 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent); |
| 2584 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent); |
| 2585 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical); |
| 2586 | DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed); |
| 2587 | |
| 2588 | DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error); |
| 2589 | DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error); |
| 2590 | |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2591 | /* refcount tracepoint classes */ |
| 2592 | |
| 2593 | /* reuse the discard trace class for agbno/aglen-based traces */ |
| 2594 | #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name) |
| 2595 | |
| 2596 | /* ag btree lookup tracepoint class */ |
Darrick J. Wong | 85f8dff | 2018-12-18 14:32:29 -0800 | [diff] [blame] | 2597 | TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi); |
| 2598 | TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi); |
| 2599 | TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi); |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2600 | DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class, |
| 2601 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2602 | xfs_agblock_t agbno, xfs_lookup_t dir), |
| 2603 | TP_ARGS(mp, agno, agbno, dir), |
| 2604 | TP_STRUCT__entry( |
| 2605 | __field(dev_t, dev) |
| 2606 | __field(xfs_agnumber_t, agno) |
| 2607 | __field(xfs_agblock_t, agbno) |
| 2608 | __field(xfs_lookup_t, dir) |
| 2609 | ), |
| 2610 | TP_fast_assign( |
| 2611 | __entry->dev = mp->m_super->s_dev; |
| 2612 | __entry->agno = agno; |
| 2613 | __entry->agbno = agbno; |
| 2614 | __entry->dir = dir; |
| 2615 | ), |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 2616 | TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)", |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2617 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2618 | __entry->agno, |
| 2619 | __entry->agbno, |
| 2620 | __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR), |
| 2621 | __entry->dir) |
| 2622 | ) |
| 2623 | |
| 2624 | #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \ |
| 2625 | DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \ |
| 2626 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2627 | xfs_agblock_t agbno, xfs_lookup_t dir), \ |
| 2628 | TP_ARGS(mp, agno, agbno, dir)) |
| 2629 | |
| 2630 | /* single-rcext tracepoint class */ |
| 2631 | DECLARE_EVENT_CLASS(xfs_refcount_extent_class, |
| 2632 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2633 | struct xfs_refcount_irec *irec), |
| 2634 | TP_ARGS(mp, agno, irec), |
| 2635 | TP_STRUCT__entry( |
| 2636 | __field(dev_t, dev) |
| 2637 | __field(xfs_agnumber_t, agno) |
| 2638 | __field(xfs_agblock_t, startblock) |
| 2639 | __field(xfs_extlen_t, blockcount) |
| 2640 | __field(xfs_nlink_t, refcount) |
| 2641 | ), |
| 2642 | TP_fast_assign( |
| 2643 | __entry->dev = mp->m_super->s_dev; |
| 2644 | __entry->agno = agno; |
| 2645 | __entry->startblock = irec->rc_startblock; |
| 2646 | __entry->blockcount = irec->rc_blockcount; |
| 2647 | __entry->refcount = irec->rc_refcount; |
| 2648 | ), |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 2649 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u", |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2650 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2651 | __entry->agno, |
| 2652 | __entry->startblock, |
| 2653 | __entry->blockcount, |
| 2654 | __entry->refcount) |
| 2655 | ) |
| 2656 | |
| 2657 | #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \ |
| 2658 | DEFINE_EVENT(xfs_refcount_extent_class, name, \ |
| 2659 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2660 | struct xfs_refcount_irec *irec), \ |
| 2661 | TP_ARGS(mp, agno, irec)) |
| 2662 | |
| 2663 | /* single-rcext and an agbno tracepoint class */ |
| 2664 | DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class, |
| 2665 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2666 | struct xfs_refcount_irec *irec, xfs_agblock_t agbno), |
| 2667 | TP_ARGS(mp, agno, irec, agbno), |
| 2668 | TP_STRUCT__entry( |
| 2669 | __field(dev_t, dev) |
| 2670 | __field(xfs_agnumber_t, agno) |
| 2671 | __field(xfs_agblock_t, startblock) |
| 2672 | __field(xfs_extlen_t, blockcount) |
| 2673 | __field(xfs_nlink_t, refcount) |
| 2674 | __field(xfs_agblock_t, agbno) |
| 2675 | ), |
| 2676 | TP_fast_assign( |
| 2677 | __entry->dev = mp->m_super->s_dev; |
| 2678 | __entry->agno = agno; |
| 2679 | __entry->startblock = irec->rc_startblock; |
| 2680 | __entry->blockcount = irec->rc_blockcount; |
| 2681 | __entry->refcount = irec->rc_refcount; |
| 2682 | __entry->agbno = agbno; |
| 2683 | ), |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 2684 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u", |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2685 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2686 | __entry->agno, |
| 2687 | __entry->startblock, |
| 2688 | __entry->blockcount, |
| 2689 | __entry->refcount, |
| 2690 | __entry->agbno) |
| 2691 | ) |
| 2692 | |
| 2693 | #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \ |
| 2694 | DEFINE_EVENT(xfs_refcount_extent_at_class, name, \ |
| 2695 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2696 | struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \ |
| 2697 | TP_ARGS(mp, agno, irec, agbno)) |
| 2698 | |
| 2699 | /* double-rcext tracepoint class */ |
| 2700 | DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class, |
| 2701 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2702 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), |
| 2703 | TP_ARGS(mp, agno, i1, i2), |
| 2704 | TP_STRUCT__entry( |
| 2705 | __field(dev_t, dev) |
| 2706 | __field(xfs_agnumber_t, agno) |
| 2707 | __field(xfs_agblock_t, i1_startblock) |
| 2708 | __field(xfs_extlen_t, i1_blockcount) |
| 2709 | __field(xfs_nlink_t, i1_refcount) |
| 2710 | __field(xfs_agblock_t, i2_startblock) |
| 2711 | __field(xfs_extlen_t, i2_blockcount) |
| 2712 | __field(xfs_nlink_t, i2_refcount) |
| 2713 | ), |
| 2714 | TP_fast_assign( |
| 2715 | __entry->dev = mp->m_super->s_dev; |
| 2716 | __entry->agno = agno; |
| 2717 | __entry->i1_startblock = i1->rc_startblock; |
| 2718 | __entry->i1_blockcount = i1->rc_blockcount; |
| 2719 | __entry->i1_refcount = i1->rc_refcount; |
| 2720 | __entry->i2_startblock = i2->rc_startblock; |
| 2721 | __entry->i2_blockcount = i2->rc_blockcount; |
| 2722 | __entry->i2_refcount = i2->rc_refcount; |
| 2723 | ), |
| 2724 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- " |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 2725 | "agbno %u len %u refcount %u", |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2726 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2727 | __entry->agno, |
| 2728 | __entry->i1_startblock, |
| 2729 | __entry->i1_blockcount, |
| 2730 | __entry->i1_refcount, |
| 2731 | __entry->i2_startblock, |
| 2732 | __entry->i2_blockcount, |
| 2733 | __entry->i2_refcount) |
| 2734 | ) |
| 2735 | |
| 2736 | #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \ |
| 2737 | DEFINE_EVENT(xfs_refcount_double_extent_class, name, \ |
| 2738 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2739 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \ |
| 2740 | TP_ARGS(mp, agno, i1, i2)) |
| 2741 | |
| 2742 | /* double-rcext and an agbno tracepoint class */ |
| 2743 | DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class, |
| 2744 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2745 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, |
| 2746 | xfs_agblock_t agbno), |
| 2747 | TP_ARGS(mp, agno, i1, i2, agbno), |
| 2748 | TP_STRUCT__entry( |
| 2749 | __field(dev_t, dev) |
| 2750 | __field(xfs_agnumber_t, agno) |
| 2751 | __field(xfs_agblock_t, i1_startblock) |
| 2752 | __field(xfs_extlen_t, i1_blockcount) |
| 2753 | __field(xfs_nlink_t, i1_refcount) |
| 2754 | __field(xfs_agblock_t, i2_startblock) |
| 2755 | __field(xfs_extlen_t, i2_blockcount) |
| 2756 | __field(xfs_nlink_t, i2_refcount) |
| 2757 | __field(xfs_agblock_t, agbno) |
| 2758 | ), |
| 2759 | TP_fast_assign( |
| 2760 | __entry->dev = mp->m_super->s_dev; |
| 2761 | __entry->agno = agno; |
| 2762 | __entry->i1_startblock = i1->rc_startblock; |
| 2763 | __entry->i1_blockcount = i1->rc_blockcount; |
| 2764 | __entry->i1_refcount = i1->rc_refcount; |
| 2765 | __entry->i2_startblock = i2->rc_startblock; |
| 2766 | __entry->i2_blockcount = i2->rc_blockcount; |
| 2767 | __entry->i2_refcount = i2->rc_refcount; |
| 2768 | __entry->agbno = agbno; |
| 2769 | ), |
| 2770 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- " |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 2771 | "agbno %u len %u refcount %u @ agbno %u", |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2772 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2773 | __entry->agno, |
| 2774 | __entry->i1_startblock, |
| 2775 | __entry->i1_blockcount, |
| 2776 | __entry->i1_refcount, |
| 2777 | __entry->i2_startblock, |
| 2778 | __entry->i2_blockcount, |
| 2779 | __entry->i2_refcount, |
| 2780 | __entry->agbno) |
| 2781 | ) |
| 2782 | |
| 2783 | #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \ |
| 2784 | DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \ |
| 2785 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2786 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \ |
| 2787 | xfs_agblock_t agbno), \ |
| 2788 | TP_ARGS(mp, agno, i1, i2, agbno)) |
| 2789 | |
| 2790 | /* triple-rcext tracepoint class */ |
| 2791 | DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class, |
| 2792 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2793 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, |
| 2794 | struct xfs_refcount_irec *i3), |
| 2795 | TP_ARGS(mp, agno, i1, i2, i3), |
| 2796 | TP_STRUCT__entry( |
| 2797 | __field(dev_t, dev) |
| 2798 | __field(xfs_agnumber_t, agno) |
| 2799 | __field(xfs_agblock_t, i1_startblock) |
| 2800 | __field(xfs_extlen_t, i1_blockcount) |
| 2801 | __field(xfs_nlink_t, i1_refcount) |
| 2802 | __field(xfs_agblock_t, i2_startblock) |
| 2803 | __field(xfs_extlen_t, i2_blockcount) |
| 2804 | __field(xfs_nlink_t, i2_refcount) |
| 2805 | __field(xfs_agblock_t, i3_startblock) |
| 2806 | __field(xfs_extlen_t, i3_blockcount) |
| 2807 | __field(xfs_nlink_t, i3_refcount) |
| 2808 | ), |
| 2809 | TP_fast_assign( |
| 2810 | __entry->dev = mp->m_super->s_dev; |
| 2811 | __entry->agno = agno; |
| 2812 | __entry->i1_startblock = i1->rc_startblock; |
| 2813 | __entry->i1_blockcount = i1->rc_blockcount; |
| 2814 | __entry->i1_refcount = i1->rc_refcount; |
| 2815 | __entry->i2_startblock = i2->rc_startblock; |
| 2816 | __entry->i2_blockcount = i2->rc_blockcount; |
| 2817 | __entry->i2_refcount = i2->rc_refcount; |
| 2818 | __entry->i3_startblock = i3->rc_startblock; |
| 2819 | __entry->i3_blockcount = i3->rc_blockcount; |
| 2820 | __entry->i3_refcount = i3->rc_refcount; |
| 2821 | ), |
| 2822 | TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- " |
| 2823 | "agbno %u len %u refcount %u -- " |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 2824 | "agbno %u len %u refcount %u", |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2825 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2826 | __entry->agno, |
| 2827 | __entry->i1_startblock, |
| 2828 | __entry->i1_blockcount, |
| 2829 | __entry->i1_refcount, |
| 2830 | __entry->i2_startblock, |
| 2831 | __entry->i2_blockcount, |
| 2832 | __entry->i2_refcount, |
| 2833 | __entry->i3_startblock, |
| 2834 | __entry->i3_blockcount, |
| 2835 | __entry->i3_refcount) |
| 2836 | ); |
| 2837 | |
| 2838 | #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \ |
| 2839 | DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \ |
| 2840 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2841 | struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \ |
| 2842 | struct xfs_refcount_irec *i3), \ |
| 2843 | TP_ARGS(mp, agno, i1, i2, i3)) |
| 2844 | |
| 2845 | /* refcount btree tracepoints */ |
| 2846 | DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block); |
| 2847 | DEFINE_BUSY_EVENT(xfs_refcountbt_free_block); |
| 2848 | DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup); |
| 2849 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get); |
| 2850 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update); |
| 2851 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert); |
| 2852 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete); |
| 2853 | DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error); |
| 2854 | DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error); |
| 2855 | DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error); |
| 2856 | |
| 2857 | /* refcount adjustment tracepoints */ |
| 2858 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase); |
| 2859 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease); |
Darrick J. Wong | 174edb0 | 2016-10-03 09:11:39 -0700 | [diff] [blame] | 2860 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase); |
| 2861 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease); |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2862 | DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents); |
| 2863 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent); |
Darrick J. Wong | 174edb0 | 2016-10-03 09:11:39 -0700 | [diff] [blame] | 2864 | DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent); |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2865 | DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent); |
| 2866 | DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent); |
| 2867 | DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent); |
| 2868 | DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent); |
| 2869 | DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent); |
| 2870 | DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error); |
Darrick J. Wong | 174edb0 | 2016-10-03 09:11:39 -0700 | [diff] [blame] | 2871 | DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error); |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2872 | DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error); |
| 2873 | DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error); |
| 2874 | DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error); |
| 2875 | DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error); |
| 2876 | DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error); |
| 2877 | DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error); |
| 2878 | DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error); |
| 2879 | |
| 2880 | /* reflink helpers */ |
| 2881 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared); |
| 2882 | DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result); |
| 2883 | DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error); |
Darrick J. Wong | 33ba6129 | 2016-10-03 09:11:22 -0700 | [diff] [blame] | 2884 | #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT |
| 2885 | DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer); |
| 2886 | DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred); |
Darrick J. Wong | c75c752 | 2016-10-03 09:11:15 -0700 | [diff] [blame] | 2887 | |
Darrick J. Wong | f997ee2 | 2016-10-03 09:11:21 -0700 | [diff] [blame] | 2888 | TRACE_EVENT(xfs_refcount_finish_one_leftover, |
| 2889 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 2890 | int type, xfs_agblock_t agbno, xfs_extlen_t len, |
| 2891 | xfs_agblock_t new_agbno, xfs_extlen_t new_len), |
| 2892 | TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len), |
| 2893 | TP_STRUCT__entry( |
| 2894 | __field(dev_t, dev) |
| 2895 | __field(xfs_agnumber_t, agno) |
| 2896 | __field(int, type) |
| 2897 | __field(xfs_agblock_t, agbno) |
| 2898 | __field(xfs_extlen_t, len) |
| 2899 | __field(xfs_agblock_t, new_agbno) |
| 2900 | __field(xfs_extlen_t, new_len) |
| 2901 | ), |
| 2902 | TP_fast_assign( |
| 2903 | __entry->dev = mp->m_super->s_dev; |
| 2904 | __entry->agno = agno; |
| 2905 | __entry->type = type; |
| 2906 | __entry->agbno = agbno; |
| 2907 | __entry->len = len; |
| 2908 | __entry->new_agbno = new_agbno; |
| 2909 | __entry->new_len = new_len; |
| 2910 | ), |
| 2911 | TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u", |
| 2912 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2913 | __entry->type, |
| 2914 | __entry->agno, |
| 2915 | __entry->agbno, |
| 2916 | __entry->len, |
| 2917 | __entry->new_agbno, |
| 2918 | __entry->new_len) |
| 2919 | ); |
| 2920 | |
Darrick J. Wong | f65306e | 2016-10-03 09:11:27 -0700 | [diff] [blame] | 2921 | /* simple inode-based error/%ip tracepoint class */ |
| 2922 | DECLARE_EVENT_CLASS(xfs_inode_error_class, |
| 2923 | TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip), |
| 2924 | TP_ARGS(ip, error, caller_ip), |
| 2925 | TP_STRUCT__entry( |
| 2926 | __field(dev_t, dev) |
| 2927 | __field(xfs_ino_t, ino) |
| 2928 | __field(int, error) |
| 2929 | __field(unsigned long, caller_ip) |
| 2930 | ), |
| 2931 | TP_fast_assign( |
| 2932 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 2933 | __entry->ino = ip->i_ino; |
| 2934 | __entry->error = error; |
| 2935 | __entry->caller_ip = caller_ip; |
| 2936 | ), |
Darrick J. Wong | aff68a55 | 2018-01-09 11:46:05 -0800 | [diff] [blame] | 2937 | TP_printk("dev %d:%d ino %llx error %d caller %pS", |
Darrick J. Wong | f65306e | 2016-10-03 09:11:27 -0700 | [diff] [blame] | 2938 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2939 | __entry->ino, |
| 2940 | __entry->error, |
| 2941 | (char *)__entry->caller_ip) |
| 2942 | ); |
| 2943 | |
| 2944 | #define DEFINE_INODE_ERROR_EVENT(name) \ |
| 2945 | DEFINE_EVENT(xfs_inode_error_class, name, \ |
| 2946 | TP_PROTO(struct xfs_inode *ip, int error, \ |
| 2947 | unsigned long caller_ip), \ |
| 2948 | TP_ARGS(ip, error, caller_ip)) |
| 2949 | |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 2950 | /* reflink tracepoint classes */ |
| 2951 | |
| 2952 | /* two-file io tracepoint class */ |
| 2953 | DECLARE_EVENT_CLASS(xfs_double_io_class, |
| 2954 | TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, |
| 2955 | struct xfs_inode *dest, xfs_off_t doffset), |
| 2956 | TP_ARGS(src, soffset, len, dest, doffset), |
| 2957 | TP_STRUCT__entry( |
| 2958 | __field(dev_t, dev) |
| 2959 | __field(xfs_ino_t, src_ino) |
| 2960 | __field(loff_t, src_isize) |
| 2961 | __field(loff_t, src_disize) |
| 2962 | __field(loff_t, src_offset) |
| 2963 | __field(size_t, len) |
| 2964 | __field(xfs_ino_t, dest_ino) |
| 2965 | __field(loff_t, dest_isize) |
| 2966 | __field(loff_t, dest_disize) |
| 2967 | __field(loff_t, dest_offset) |
| 2968 | ), |
| 2969 | TP_fast_assign( |
| 2970 | __entry->dev = VFS_I(src)->i_sb->s_dev; |
| 2971 | __entry->src_ino = src->i_ino; |
| 2972 | __entry->src_isize = VFS_I(src)->i_size; |
| 2973 | __entry->src_disize = src->i_d.di_size; |
| 2974 | __entry->src_offset = soffset; |
| 2975 | __entry->len = len; |
| 2976 | __entry->dest_ino = dest->i_ino; |
| 2977 | __entry->dest_isize = VFS_I(dest)->i_size; |
| 2978 | __entry->dest_disize = dest->i_d.di_size; |
| 2979 | __entry->dest_offset = doffset; |
| 2980 | ), |
| 2981 | TP_printk("dev %d:%d count %zd " |
| 2982 | "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> " |
| 2983 | "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx", |
| 2984 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 2985 | __entry->len, |
| 2986 | __entry->src_ino, |
| 2987 | __entry->src_isize, |
| 2988 | __entry->src_disize, |
| 2989 | __entry->src_offset, |
| 2990 | __entry->dest_ino, |
| 2991 | __entry->dest_isize, |
| 2992 | __entry->dest_disize, |
| 2993 | __entry->dest_offset) |
| 2994 | ) |
| 2995 | |
| 2996 | #define DEFINE_DOUBLE_IO_EVENT(name) \ |
| 2997 | DEFINE_EVENT(xfs_double_io_class, name, \ |
| 2998 | TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \ |
| 2999 | struct xfs_inode *dest, xfs_off_t doffset), \ |
| 3000 | TP_ARGS(src, soffset, len, dest, doffset)) |
| 3001 | |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3002 | /* inode/irec events */ |
| 3003 | DECLARE_EVENT_CLASS(xfs_inode_irec_class, |
| 3004 | TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), |
| 3005 | TP_ARGS(ip, irec), |
| 3006 | TP_STRUCT__entry( |
| 3007 | __field(dev_t, dev) |
| 3008 | __field(xfs_ino_t, ino) |
| 3009 | __field(xfs_fileoff_t, lblk) |
| 3010 | __field(xfs_extlen_t, len) |
| 3011 | __field(xfs_fsblock_t, pblk) |
Darrick J. Wong | 5eda430 | 2017-02-02 15:14:02 -0800 | [diff] [blame] | 3012 | __field(int, state) |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3013 | ), |
| 3014 | TP_fast_assign( |
| 3015 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 3016 | __entry->ino = ip->i_ino; |
| 3017 | __entry->lblk = irec->br_startoff; |
| 3018 | __entry->len = irec->br_blockcount; |
| 3019 | __entry->pblk = irec->br_startblock; |
Darrick J. Wong | 5eda430 | 2017-02-02 15:14:02 -0800 | [diff] [blame] | 3020 | __entry->state = irec->br_state; |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3021 | ), |
Darrick J. Wong | 5eda430 | 2017-02-02 15:14:02 -0800 | [diff] [blame] | 3022 | TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d", |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3023 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3024 | __entry->ino, |
| 3025 | __entry->lblk, |
| 3026 | __entry->len, |
Darrick J. Wong | 5eda430 | 2017-02-02 15:14:02 -0800 | [diff] [blame] | 3027 | __entry->pblk, |
| 3028 | __entry->state) |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3029 | ); |
| 3030 | #define DEFINE_INODE_IREC_EVENT(name) \ |
| 3031 | DEFINE_EVENT(xfs_inode_irec_class, name, \ |
| 3032 | TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \ |
| 3033 | TP_ARGS(ip, irec)) |
| 3034 | |
| 3035 | /* refcount/reflink tracepoint definitions */ |
| 3036 | |
| 3037 | /* reflink tracepoints */ |
| 3038 | DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag); |
| 3039 | DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag); |
| 3040 | DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size); |
Christoph Hellwig | be225fe | 2019-02-15 08:02:46 -0800 | [diff] [blame] | 3041 | DEFINE_IMAP_EVENT(xfs_reflink_remap_imap); |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3042 | TRACE_EVENT(xfs_reflink_remap_blocks_loop, |
| 3043 | TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset, |
| 3044 | xfs_filblks_t len, struct xfs_inode *dest, |
| 3045 | xfs_fileoff_t doffset), |
| 3046 | TP_ARGS(src, soffset, len, dest, doffset), |
| 3047 | TP_STRUCT__entry( |
| 3048 | __field(dev_t, dev) |
| 3049 | __field(xfs_ino_t, src_ino) |
| 3050 | __field(xfs_fileoff_t, src_lblk) |
| 3051 | __field(xfs_filblks_t, len) |
| 3052 | __field(xfs_ino_t, dest_ino) |
| 3053 | __field(xfs_fileoff_t, dest_lblk) |
| 3054 | ), |
| 3055 | TP_fast_assign( |
| 3056 | __entry->dev = VFS_I(src)->i_sb->s_dev; |
| 3057 | __entry->src_ino = src->i_ino; |
| 3058 | __entry->src_lblk = soffset; |
| 3059 | __entry->len = len; |
| 3060 | __entry->dest_ino = dest->i_ino; |
| 3061 | __entry->dest_lblk = doffset; |
| 3062 | ), |
| 3063 | TP_printk("dev %d:%d len 0x%llx " |
| 3064 | "ino 0x%llx offset 0x%llx blocks -> " |
| 3065 | "ino 0x%llx offset 0x%llx blocks", |
| 3066 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3067 | __entry->len, |
| 3068 | __entry->src_ino, |
| 3069 | __entry->src_lblk, |
| 3070 | __entry->dest_ino, |
| 3071 | __entry->dest_lblk) |
| 3072 | ); |
| 3073 | TRACE_EVENT(xfs_reflink_punch_range, |
| 3074 | TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, |
| 3075 | xfs_extlen_t len), |
| 3076 | TP_ARGS(ip, lblk, len), |
| 3077 | TP_STRUCT__entry( |
| 3078 | __field(dev_t, dev) |
| 3079 | __field(xfs_ino_t, ino) |
| 3080 | __field(xfs_fileoff_t, lblk) |
| 3081 | __field(xfs_extlen_t, len) |
| 3082 | ), |
| 3083 | TP_fast_assign( |
| 3084 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 3085 | __entry->ino = ip->i_ino; |
| 3086 | __entry->lblk = lblk; |
| 3087 | __entry->len = len; |
| 3088 | ), |
| 3089 | TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x", |
| 3090 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3091 | __entry->ino, |
| 3092 | __entry->lblk, |
| 3093 | __entry->len) |
| 3094 | ); |
| 3095 | TRACE_EVENT(xfs_reflink_remap, |
| 3096 | TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, |
| 3097 | xfs_extlen_t len, xfs_fsblock_t new_pblk), |
| 3098 | TP_ARGS(ip, lblk, len, new_pblk), |
| 3099 | TP_STRUCT__entry( |
| 3100 | __field(dev_t, dev) |
| 3101 | __field(xfs_ino_t, ino) |
| 3102 | __field(xfs_fileoff_t, lblk) |
| 3103 | __field(xfs_extlen_t, len) |
| 3104 | __field(xfs_fsblock_t, new_pblk) |
| 3105 | ), |
| 3106 | TP_fast_assign( |
| 3107 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 3108 | __entry->ino = ip->i_ino; |
| 3109 | __entry->lblk = lblk; |
| 3110 | __entry->len = len; |
| 3111 | __entry->new_pblk = new_pblk; |
| 3112 | ), |
| 3113 | TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu", |
| 3114 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3115 | __entry->ino, |
| 3116 | __entry->lblk, |
| 3117 | __entry->len, |
| 3118 | __entry->new_pblk) |
| 3119 | ); |
| 3120 | DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range); |
| 3121 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error); |
| 3122 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error); |
| 3123 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error); |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3124 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error); |
| 3125 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error); |
| 3126 | |
| 3127 | /* dedupe tracepoints */ |
| 3128 | DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents); |
| 3129 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error); |
| 3130 | |
| 3131 | /* ioctl tracepoints */ |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3132 | TRACE_EVENT(xfs_ioctl_clone, |
| 3133 | TP_PROTO(struct inode *src, struct inode *dest), |
| 3134 | TP_ARGS(src, dest), |
| 3135 | TP_STRUCT__entry( |
| 3136 | __field(dev_t, dev) |
| 3137 | __field(unsigned long, src_ino) |
| 3138 | __field(loff_t, src_isize) |
| 3139 | __field(unsigned long, dest_ino) |
| 3140 | __field(loff_t, dest_isize) |
| 3141 | ), |
| 3142 | TP_fast_assign( |
| 3143 | __entry->dev = src->i_sb->s_dev; |
| 3144 | __entry->src_ino = src->i_ino; |
| 3145 | __entry->src_isize = i_size_read(src); |
| 3146 | __entry->dest_ino = dest->i_ino; |
| 3147 | __entry->dest_isize = i_size_read(dest); |
| 3148 | ), |
| 3149 | TP_printk("dev %d:%d " |
| 3150 | "ino 0x%lx isize 0x%llx -> " |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 3151 | "ino 0x%lx isize 0x%llx", |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3152 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3153 | __entry->src_ino, |
| 3154 | __entry->src_isize, |
| 3155 | __entry->dest_ino, |
| 3156 | __entry->dest_isize) |
| 3157 | ); |
| 3158 | |
| 3159 | /* unshare tracepoints */ |
| 3160 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare); |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3161 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error); |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3162 | |
| 3163 | /* copy on write */ |
| 3164 | DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared); |
Darrick J. Wong | be51f81 | 2016-10-03 09:11:32 -0700 | [diff] [blame] | 3165 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found); |
| 3166 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc); |
Darrick J. Wong | 5eda430 | 2017-02-02 15:14:02 -0800 | [diff] [blame] | 3167 | DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow); |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3168 | |
Christoph Hellwig | 54a4ef8 | 2017-02-06 13:00:54 -0800 | [diff] [blame] | 3169 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write); |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3170 | |
| 3171 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range); |
| 3172 | DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow); |
| 3173 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap); |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3174 | |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3175 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error); |
| 3176 | DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error); |
| 3177 | |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3178 | |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3179 | DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow); |
Darrick J. Wong | 53aa1c3 | 2016-10-03 09:11:30 -0700 | [diff] [blame] | 3180 | |
Darrick J. Wong | 1f08af5 | 2016-10-03 09:11:53 -0700 | [diff] [blame] | 3181 | /* rmap swapext tracepoints */ |
| 3182 | DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap); |
| 3183 | DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece); |
| 3184 | DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error); |
| 3185 | |
Darrick J. Wong | e89c041 | 2017-03-28 14:56:37 -0700 | [diff] [blame] | 3186 | /* fsmap traces */ |
| 3187 | DECLARE_EVENT_CLASS(xfs_fsmap_class, |
| 3188 | TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, |
| 3189 | struct xfs_rmap_irec *rmap), |
| 3190 | TP_ARGS(mp, keydev, agno, rmap), |
| 3191 | TP_STRUCT__entry( |
| 3192 | __field(dev_t, dev) |
| 3193 | __field(dev_t, keydev) |
| 3194 | __field(xfs_agnumber_t, agno) |
| 3195 | __field(xfs_fsblock_t, bno) |
| 3196 | __field(xfs_filblks_t, len) |
Darrick J. Wong | c8ce540 | 2017-06-16 11:00:05 -0700 | [diff] [blame] | 3197 | __field(uint64_t, owner) |
| 3198 | __field(uint64_t, offset) |
Darrick J. Wong | e89c041 | 2017-03-28 14:56:37 -0700 | [diff] [blame] | 3199 | __field(unsigned int, flags) |
| 3200 | ), |
| 3201 | TP_fast_assign( |
| 3202 | __entry->dev = mp->m_super->s_dev; |
| 3203 | __entry->keydev = new_decode_dev(keydev); |
| 3204 | __entry->agno = agno; |
| 3205 | __entry->bno = rmap->rm_startblock; |
| 3206 | __entry->len = rmap->rm_blockcount; |
| 3207 | __entry->owner = rmap->rm_owner; |
| 3208 | __entry->offset = rmap->rm_offset; |
| 3209 | __entry->flags = rmap->rm_flags; |
| 3210 | ), |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 3211 | TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld offset %llu flags 0x%x", |
Darrick J. Wong | e89c041 | 2017-03-28 14:56:37 -0700 | [diff] [blame] | 3212 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3213 | MAJOR(__entry->keydev), MINOR(__entry->keydev), |
| 3214 | __entry->agno, |
| 3215 | __entry->bno, |
| 3216 | __entry->len, |
| 3217 | __entry->owner, |
| 3218 | __entry->offset, |
| 3219 | __entry->flags) |
| 3220 | ) |
| 3221 | #define DEFINE_FSMAP_EVENT(name) \ |
| 3222 | DEFINE_EVENT(xfs_fsmap_class, name, \ |
| 3223 | TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \ |
| 3224 | struct xfs_rmap_irec *rmap), \ |
| 3225 | TP_ARGS(mp, keydev, agno, rmap)) |
| 3226 | DEFINE_FSMAP_EVENT(xfs_fsmap_low_key); |
| 3227 | DEFINE_FSMAP_EVENT(xfs_fsmap_high_key); |
| 3228 | DEFINE_FSMAP_EVENT(xfs_fsmap_mapping); |
| 3229 | |
| 3230 | DECLARE_EVENT_CLASS(xfs_getfsmap_class, |
| 3231 | TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), |
| 3232 | TP_ARGS(mp, fsmap), |
| 3233 | TP_STRUCT__entry( |
| 3234 | __field(dev_t, dev) |
| 3235 | __field(dev_t, keydev) |
| 3236 | __field(xfs_daddr_t, block) |
| 3237 | __field(xfs_daddr_t, len) |
Darrick J. Wong | c8ce540 | 2017-06-16 11:00:05 -0700 | [diff] [blame] | 3238 | __field(uint64_t, owner) |
| 3239 | __field(uint64_t, offset) |
| 3240 | __field(uint64_t, flags) |
Darrick J. Wong | e89c041 | 2017-03-28 14:56:37 -0700 | [diff] [blame] | 3241 | ), |
| 3242 | TP_fast_assign( |
| 3243 | __entry->dev = mp->m_super->s_dev; |
| 3244 | __entry->keydev = new_decode_dev(fsmap->fmr_device); |
| 3245 | __entry->block = fsmap->fmr_physical; |
| 3246 | __entry->len = fsmap->fmr_length; |
| 3247 | __entry->owner = fsmap->fmr_owner; |
| 3248 | __entry->offset = fsmap->fmr_offset; |
| 3249 | __entry->flags = fsmap->fmr_flags; |
| 3250 | ), |
Hou Tao | 42bf9db | 2017-04-14 11:43:27 -0700 | [diff] [blame] | 3251 | TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld offset %llu flags 0x%llx", |
Darrick J. Wong | e89c041 | 2017-03-28 14:56:37 -0700 | [diff] [blame] | 3252 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3253 | MAJOR(__entry->keydev), MINOR(__entry->keydev), |
| 3254 | __entry->block, |
| 3255 | __entry->len, |
| 3256 | __entry->owner, |
| 3257 | __entry->offset, |
| 3258 | __entry->flags) |
| 3259 | ) |
| 3260 | #define DEFINE_GETFSMAP_EVENT(name) \ |
| 3261 | DEFINE_EVENT(xfs_getfsmap_class, name, \ |
| 3262 | TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \ |
| 3263 | TP_ARGS(mp, fsmap)) |
| 3264 | DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key); |
| 3265 | DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key); |
| 3266 | DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping); |
| 3267 | |
Darrick J. Wong | b872af2 | 2018-01-08 10:51:26 -0800 | [diff] [blame] | 3268 | TRACE_EVENT(xfs_trans_resv_calc, |
| 3269 | TP_PROTO(struct xfs_mount *mp, unsigned int type, |
| 3270 | struct xfs_trans_res *res), |
| 3271 | TP_ARGS(mp, type, res), |
| 3272 | TP_STRUCT__entry( |
| 3273 | __field(dev_t, dev) |
| 3274 | __field(int, type) |
| 3275 | __field(uint, logres) |
| 3276 | __field(int, logcount) |
| 3277 | __field(int, logflags) |
| 3278 | ), |
| 3279 | TP_fast_assign( |
| 3280 | __entry->dev = mp->m_super->s_dev; |
| 3281 | __entry->type = type; |
| 3282 | __entry->logres = res->tr_logres; |
| 3283 | __entry->logcount = res->tr_logcount; |
| 3284 | __entry->logflags = res->tr_logflags; |
| 3285 | ), |
| 3286 | TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x", |
| 3287 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3288 | __entry->type, |
| 3289 | __entry->logres, |
| 3290 | __entry->logcount, |
| 3291 | __entry->logflags) |
| 3292 | ); |
| 3293 | |
Dave Chinner | ba18781 | 2018-05-09 07:47:57 -0700 | [diff] [blame] | 3294 | DECLARE_EVENT_CLASS(xfs_trans_class, |
| 3295 | TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), |
| 3296 | TP_ARGS(tp, caller_ip), |
| 3297 | TP_STRUCT__entry( |
| 3298 | __field(dev_t, dev) |
| 3299 | __field(uint32_t, tid) |
| 3300 | __field(uint32_t, flags) |
| 3301 | __field(unsigned long, caller_ip) |
| 3302 | ), |
| 3303 | TP_fast_assign( |
| 3304 | __entry->dev = tp->t_mountp->m_super->s_dev; |
| 3305 | __entry->tid = 0; |
| 3306 | if (tp->t_ticket) |
| 3307 | __entry->tid = tp->t_ticket->t_tid; |
| 3308 | __entry->flags = tp->t_flags; |
| 3309 | __entry->caller_ip = caller_ip; |
| 3310 | ), |
| 3311 | TP_printk("dev %d:%d trans %x flags 0x%x caller %pS", |
| 3312 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3313 | __entry->tid, |
| 3314 | __entry->flags, |
| 3315 | (char *)__entry->caller_ip) |
| 3316 | ) |
| 3317 | |
| 3318 | #define DEFINE_TRANS_EVENT(name) \ |
| 3319 | DEFINE_EVENT(xfs_trans_class, name, \ |
| 3320 | TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \ |
| 3321 | TP_ARGS(tp, caller_ip)) |
| 3322 | DEFINE_TRANS_EVENT(xfs_trans_alloc); |
| 3323 | DEFINE_TRANS_EVENT(xfs_trans_cancel); |
| 3324 | DEFINE_TRANS_EVENT(xfs_trans_commit); |
| 3325 | DEFINE_TRANS_EVENT(xfs_trans_dup); |
| 3326 | DEFINE_TRANS_EVENT(xfs_trans_free); |
| 3327 | DEFINE_TRANS_EVENT(xfs_trans_roll); |
| 3328 | DEFINE_TRANS_EVENT(xfs_trans_add_item); |
Christoph Hellwig | 195cd83 | 2019-06-28 19:27:31 -0700 | [diff] [blame] | 3329 | DEFINE_TRANS_EVENT(xfs_trans_commit_items); |
Dave Chinner | ba18781 | 2018-05-09 07:47:57 -0700 | [diff] [blame] | 3330 | DEFINE_TRANS_EVENT(xfs_trans_free_items); |
| 3331 | |
Darrick J. Wong | 9a4a511 | 2019-02-07 10:37:14 -0800 | [diff] [blame] | 3332 | TRACE_EVENT(xfs_iunlink_update_bucket, |
| 3333 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket, |
| 3334 | xfs_agino_t old_ptr, xfs_agino_t new_ptr), |
| 3335 | TP_ARGS(mp, agno, bucket, old_ptr, new_ptr), |
| 3336 | TP_STRUCT__entry( |
| 3337 | __field(dev_t, dev) |
| 3338 | __field(xfs_agnumber_t, agno) |
| 3339 | __field(unsigned int, bucket) |
| 3340 | __field(xfs_agino_t, old_ptr) |
| 3341 | __field(xfs_agino_t, new_ptr) |
| 3342 | ), |
| 3343 | TP_fast_assign( |
| 3344 | __entry->dev = mp->m_super->s_dev; |
| 3345 | __entry->agno = agno; |
| 3346 | __entry->bucket = bucket; |
| 3347 | __entry->old_ptr = old_ptr; |
| 3348 | __entry->new_ptr = new_ptr; |
| 3349 | ), |
| 3350 | TP_printk("dev %d:%d agno %u bucket %u old 0x%x new 0x%x", |
| 3351 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3352 | __entry->agno, |
| 3353 | __entry->bucket, |
| 3354 | __entry->old_ptr, |
| 3355 | __entry->new_ptr) |
| 3356 | ); |
| 3357 | |
Darrick J. Wong | f2fc16a | 2019-02-07 10:37:15 -0800 | [diff] [blame] | 3358 | TRACE_EVENT(xfs_iunlink_update_dinode, |
| 3359 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino, |
| 3360 | xfs_agino_t old_ptr, xfs_agino_t new_ptr), |
| 3361 | TP_ARGS(mp, agno, agino, old_ptr, new_ptr), |
| 3362 | TP_STRUCT__entry( |
| 3363 | __field(dev_t, dev) |
| 3364 | __field(xfs_agnumber_t, agno) |
| 3365 | __field(xfs_agino_t, agino) |
| 3366 | __field(xfs_agino_t, old_ptr) |
| 3367 | __field(xfs_agino_t, new_ptr) |
| 3368 | ), |
| 3369 | TP_fast_assign( |
| 3370 | __entry->dev = mp->m_super->s_dev; |
| 3371 | __entry->agno = agno; |
| 3372 | __entry->agino = agino; |
| 3373 | __entry->old_ptr = old_ptr; |
| 3374 | __entry->new_ptr = new_ptr; |
| 3375 | ), |
| 3376 | TP_printk("dev %d:%d agno %u agino 0x%x old 0x%x new 0x%x", |
| 3377 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3378 | __entry->agno, |
| 3379 | __entry->agino, |
| 3380 | __entry->old_ptr, |
| 3381 | __entry->new_ptr) |
| 3382 | ); |
| 3383 | |
Darrick J. Wong | 4664c66 | 2019-02-07 10:37:16 -0800 | [diff] [blame] | 3384 | DECLARE_EVENT_CLASS(xfs_ag_inode_class, |
| 3385 | TP_PROTO(struct xfs_inode *ip), |
| 3386 | TP_ARGS(ip), |
| 3387 | TP_STRUCT__entry( |
| 3388 | __field(dev_t, dev) |
| 3389 | __field(xfs_agnumber_t, agno) |
| 3390 | __field(xfs_agino_t, agino) |
| 3391 | ), |
| 3392 | TP_fast_assign( |
| 3393 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 3394 | __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino); |
| 3395 | __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino); |
| 3396 | ), |
| 3397 | TP_printk("dev %d:%d agno %u agino %u", |
| 3398 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3399 | __entry->agno, __entry->agino) |
| 3400 | ) |
| 3401 | |
| 3402 | #define DEFINE_AGINODE_EVENT(name) \ |
| 3403 | DEFINE_EVENT(xfs_ag_inode_class, name, \ |
| 3404 | TP_PROTO(struct xfs_inode *ip), \ |
| 3405 | TP_ARGS(ip)) |
| 3406 | DEFINE_AGINODE_EVENT(xfs_iunlink); |
| 3407 | DEFINE_AGINODE_EVENT(xfs_iunlink_remove); |
Darrick J. Wong | 9b24717 | 2019-02-07 10:37:16 -0800 | [diff] [blame] | 3408 | DEFINE_AG_EVENT(xfs_iunlink_map_prev_fallback); |
Darrick J. Wong | 4664c66 | 2019-02-07 10:37:16 -0800 | [diff] [blame] | 3409 | |
Darrick J. Wong | 6772c1f | 2019-04-12 07:40:25 -0700 | [diff] [blame] | 3410 | DECLARE_EVENT_CLASS(xfs_fs_corrupt_class, |
| 3411 | TP_PROTO(struct xfs_mount *mp, unsigned int flags), |
| 3412 | TP_ARGS(mp, flags), |
| 3413 | TP_STRUCT__entry( |
| 3414 | __field(dev_t, dev) |
| 3415 | __field(unsigned int, flags) |
| 3416 | ), |
| 3417 | TP_fast_assign( |
| 3418 | __entry->dev = mp->m_super->s_dev; |
| 3419 | __entry->flags = flags; |
| 3420 | ), |
| 3421 | TP_printk("dev %d:%d flags 0x%x", |
| 3422 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3423 | __entry->flags) |
| 3424 | ); |
| 3425 | #define DEFINE_FS_CORRUPT_EVENT(name) \ |
| 3426 | DEFINE_EVENT(xfs_fs_corrupt_class, name, \ |
| 3427 | TP_PROTO(struct xfs_mount *mp, unsigned int flags), \ |
| 3428 | TP_ARGS(mp, flags)) |
| 3429 | DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick); |
| 3430 | DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy); |
Darrick J. Wong | 519841c | 2019-04-12 07:41:16 -0700 | [diff] [blame] | 3431 | DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption); |
Darrick J. Wong | 6772c1f | 2019-04-12 07:40:25 -0700 | [diff] [blame] | 3432 | DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick); |
| 3433 | DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy); |
Darrick J. Wong | 519841c | 2019-04-12 07:41:16 -0700 | [diff] [blame] | 3434 | DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption); |
Darrick J. Wong | 6772c1f | 2019-04-12 07:40:25 -0700 | [diff] [blame] | 3435 | |
| 3436 | DECLARE_EVENT_CLASS(xfs_ag_corrupt_class, |
| 3437 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags), |
| 3438 | TP_ARGS(mp, agno, flags), |
| 3439 | TP_STRUCT__entry( |
| 3440 | __field(dev_t, dev) |
| 3441 | __field(xfs_agnumber_t, agno) |
| 3442 | __field(unsigned int, flags) |
| 3443 | ), |
| 3444 | TP_fast_assign( |
| 3445 | __entry->dev = mp->m_super->s_dev; |
| 3446 | __entry->agno = agno; |
| 3447 | __entry->flags = flags; |
| 3448 | ), |
| 3449 | TP_printk("dev %d:%d agno %u flags 0x%x", |
| 3450 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3451 | __entry->agno, __entry->flags) |
| 3452 | ); |
| 3453 | #define DEFINE_AG_CORRUPT_EVENT(name) \ |
| 3454 | DEFINE_EVENT(xfs_ag_corrupt_class, name, \ |
| 3455 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 3456 | unsigned int flags), \ |
| 3457 | TP_ARGS(mp, agno, flags)) |
| 3458 | DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick); |
| 3459 | DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy); |
Darrick J. Wong | 519841c | 2019-04-12 07:41:16 -0700 | [diff] [blame] | 3460 | DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption); |
Darrick J. Wong | 6772c1f | 2019-04-12 07:40:25 -0700 | [diff] [blame] | 3461 | |
| 3462 | DECLARE_EVENT_CLASS(xfs_inode_corrupt_class, |
| 3463 | TP_PROTO(struct xfs_inode *ip, unsigned int flags), |
| 3464 | TP_ARGS(ip, flags), |
| 3465 | TP_STRUCT__entry( |
| 3466 | __field(dev_t, dev) |
| 3467 | __field(xfs_ino_t, ino) |
| 3468 | __field(unsigned int, flags) |
| 3469 | ), |
| 3470 | TP_fast_assign( |
| 3471 | __entry->dev = ip->i_mount->m_super->s_dev; |
| 3472 | __entry->ino = ip->i_ino; |
| 3473 | __entry->flags = flags; |
| 3474 | ), |
| 3475 | TP_printk("dev %d:%d ino 0x%llx flags 0x%x", |
| 3476 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3477 | __entry->ino, __entry->flags) |
| 3478 | ); |
| 3479 | #define DEFINE_INODE_CORRUPT_EVENT(name) \ |
| 3480 | DEFINE_EVENT(xfs_inode_corrupt_class, name, \ |
| 3481 | TP_PROTO(struct xfs_inode *ip, unsigned int flags), \ |
| 3482 | TP_ARGS(ip, flags)) |
| 3483 | DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick); |
| 3484 | DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy); |
| 3485 | |
Darrick J. Wong | a211432 | 2019-07-02 09:39:38 -0700 | [diff] [blame] | 3486 | TRACE_EVENT(xfs_iwalk_ag, |
| 3487 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 3488 | xfs_agino_t startino), |
| 3489 | TP_ARGS(mp, agno, startino), |
| 3490 | TP_STRUCT__entry( |
| 3491 | __field(dev_t, dev) |
| 3492 | __field(xfs_agnumber_t, agno) |
| 3493 | __field(xfs_agino_t, startino) |
| 3494 | ), |
| 3495 | TP_fast_assign( |
| 3496 | __entry->dev = mp->m_super->s_dev; |
| 3497 | __entry->agno = agno; |
| 3498 | __entry->startino = startino; |
| 3499 | ), |
| 3500 | TP_printk("dev %d:%d agno %d startino %u", |
| 3501 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, |
| 3502 | __entry->startino) |
| 3503 | ) |
| 3504 | |
| 3505 | TRACE_EVENT(xfs_iwalk_ag_rec, |
| 3506 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 3507 | struct xfs_inobt_rec_incore *irec), |
| 3508 | TP_ARGS(mp, agno, irec), |
| 3509 | TP_STRUCT__entry( |
| 3510 | __field(dev_t, dev) |
| 3511 | __field(xfs_agnumber_t, agno) |
| 3512 | __field(xfs_agino_t, startino) |
| 3513 | __field(uint64_t, freemask) |
| 3514 | ), |
| 3515 | TP_fast_assign( |
| 3516 | __entry->dev = mp->m_super->s_dev; |
| 3517 | __entry->agno = agno; |
| 3518 | __entry->startino = irec->ir_startino; |
| 3519 | __entry->freemask = irec->ir_free; |
| 3520 | ), |
| 3521 | TP_printk("dev %d:%d agno %d startino %u freemask 0x%llx", |
| 3522 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno, |
| 3523 | __entry->startino, __entry->freemask) |
| 3524 | ) |
| 3525 | |
Darrick J. Wong | 4078671 | 2019-07-03 07:33:26 -0700 | [diff] [blame] | 3526 | TRACE_EVENT(xfs_pwork_init, |
| 3527 | TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid), |
| 3528 | TP_ARGS(mp, nr_threads, pid), |
| 3529 | TP_STRUCT__entry( |
| 3530 | __field(dev_t, dev) |
| 3531 | __field(unsigned int, nr_threads) |
| 3532 | __field(pid_t, pid) |
| 3533 | ), |
| 3534 | TP_fast_assign( |
| 3535 | __entry->dev = mp->m_super->s_dev; |
| 3536 | __entry->nr_threads = nr_threads; |
| 3537 | __entry->pid = pid; |
| 3538 | ), |
| 3539 | TP_printk("dev %d:%d nr_threads %u pid %u", |
| 3540 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 3541 | __entry->nr_threads, __entry->pid) |
| 3542 | ) |
| 3543 | |
Dave Chinner | 0ad9568 | 2019-08-26 12:08:10 -0700 | [diff] [blame] | 3544 | DECLARE_EVENT_CLASS(xfs_kmem_class, |
| 3545 | TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), |
| 3546 | TP_ARGS(size, flags, caller_ip), |
| 3547 | TP_STRUCT__entry( |
| 3548 | __field(ssize_t, size) |
| 3549 | __field(int, flags) |
| 3550 | __field(unsigned long, caller_ip) |
| 3551 | ), |
| 3552 | TP_fast_assign( |
| 3553 | __entry->size = size; |
| 3554 | __entry->flags = flags; |
| 3555 | __entry->caller_ip = caller_ip; |
| 3556 | ), |
| 3557 | TP_printk("size %zd flags 0x%x caller %pS", |
| 3558 | __entry->size, |
| 3559 | __entry->flags, |
| 3560 | (char *)__entry->caller_ip) |
| 3561 | ) |
| 3562 | |
| 3563 | #define DEFINE_KMEM_EVENT(name) \ |
| 3564 | DEFINE_EVENT(xfs_kmem_class, name, \ |
| 3565 | TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \ |
| 3566 | TP_ARGS(size, flags, caller_ip)) |
| 3567 | DEFINE_KMEM_EVENT(kmem_alloc); |
Dave Chinner | f8f9ee4 | 2019-08-26 12:08:39 -0700 | [diff] [blame] | 3568 | DEFINE_KMEM_EVENT(kmem_alloc_io); |
Dave Chinner | 0ad9568 | 2019-08-26 12:08:10 -0700 | [diff] [blame] | 3569 | DEFINE_KMEM_EVENT(kmem_alloc_large); |
| 3570 | DEFINE_KMEM_EVENT(kmem_realloc); |
| 3571 | DEFINE_KMEM_EVENT(kmem_zone_alloc); |
| 3572 | |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 3573 | #endif /* _TRACE_XFS_H */ |
| 3574 | |
| 3575 | #undef TRACE_INCLUDE_PATH |
| 3576 | #define TRACE_INCLUDE_PATH . |
| 3577 | #define TRACE_INCLUDE_FILE xfs_trace |
| 3578 | #include <trace/define_trace.h> |