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