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