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