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