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; |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 41 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 42 | DECLARE_EVENT_CLASS(xfs_attr_list_class, |
| 43 | TP_PROTO(struct xfs_attr_list_context *ctx), |
| 44 | TP_ARGS(ctx), |
| 45 | TP_STRUCT__entry( |
| 46 | __field(dev_t, dev) |
| 47 | __field(xfs_ino_t, ino) |
| 48 | __field(u32, hashval) |
| 49 | __field(u32, blkno) |
| 50 | __field(u32, offset) |
| 51 | __field(void *, alist) |
| 52 | __field(int, bufsize) |
| 53 | __field(int, count) |
| 54 | __field(int, firstu) |
| 55 | __field(int, dupcnt) |
| 56 | __field(int, flags) |
| 57 | ), |
| 58 | TP_fast_assign( |
| 59 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; |
| 60 | __entry->ino = ctx->dp->i_ino; |
| 61 | __entry->hashval = ctx->cursor->hashval; |
| 62 | __entry->blkno = ctx->cursor->blkno; |
| 63 | __entry->offset = ctx->cursor->offset; |
| 64 | __entry->alist = ctx->alist; |
| 65 | __entry->bufsize = ctx->bufsize; |
| 66 | __entry->count = ctx->count; |
| 67 | __entry->firstu = ctx->firstu; |
| 68 | __entry->flags = ctx->flags; |
| 69 | ), |
| 70 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " |
| 71 | "alist 0x%p size %u count %u firstu %u flags %d %s", |
| 72 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 73 | __entry->ino, |
| 74 | __entry->hashval, |
| 75 | __entry->blkno, |
| 76 | __entry->offset, |
| 77 | __entry->dupcnt, |
| 78 | __entry->alist, |
| 79 | __entry->bufsize, |
| 80 | __entry->count, |
| 81 | __entry->firstu, |
| 82 | __entry->flags, |
| 83 | __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS) |
| 84 | ) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 85 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 86 | |
| 87 | #define DEFINE_ATTR_LIST_EVENT(name) \ |
| 88 | DEFINE_EVENT(xfs_attr_list_class, name, \ |
| 89 | TP_PROTO(struct xfs_attr_list_context *ctx), \ |
| 90 | TP_ARGS(ctx)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 91 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf); |
| 92 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all); |
| 93 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf); |
| 94 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end); |
| 95 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full); |
| 96 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add); |
| 97 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk); |
| 98 | DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 99 | DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list); |
| 100 | DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 101 | |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 102 | DECLARE_EVENT_CLASS(xfs_perag_class, |
| 103 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, |
| 104 | unsigned long caller_ip), |
| 105 | TP_ARGS(mp, agno, refcount, caller_ip), |
| 106 | TP_STRUCT__entry( |
| 107 | __field(dev_t, dev) |
| 108 | __field(xfs_agnumber_t, agno) |
| 109 | __field(int, refcount) |
| 110 | __field(unsigned long, caller_ip) |
| 111 | ), |
| 112 | TP_fast_assign( |
| 113 | __entry->dev = mp->m_super->s_dev; |
| 114 | __entry->agno = agno; |
| 115 | __entry->refcount = refcount; |
| 116 | __entry->caller_ip = caller_ip; |
| 117 | ), |
| 118 | TP_printk("dev %d:%d agno %u refcount %d caller %pf", |
| 119 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 120 | __entry->agno, |
| 121 | __entry->refcount, |
| 122 | (char *)__entry->caller_ip) |
| 123 | ); |
| 124 | |
| 125 | #define DEFINE_PERAG_REF_EVENT(name) \ |
| 126 | DEFINE_EVENT(xfs_perag_class, name, \ |
| 127 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \ |
| 128 | unsigned long caller_ip), \ |
| 129 | TP_ARGS(mp, agno, refcount, caller_ip)) |
| 130 | DEFINE_PERAG_REF_EVENT(xfs_perag_get); |
Dave Chinner | 65d0f20 | 2010-09-24 18:40:15 +1000 | [diff] [blame] | 131 | DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag); |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 132 | DEFINE_PERAG_REF_EVENT(xfs_perag_put); |
Dave Chinner | 16fd536 | 2010-07-20 09:43:39 +1000 | [diff] [blame] | 133 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim); |
| 134 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim); |
Brian Foster | 27b5286 | 2012-11-06 09:50:38 -0500 | [diff] [blame] | 135 | DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks); |
| 136 | DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks); |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 137 | |
Dave Chinner | d123031 | 2013-11-01 15:27:19 +1100 | [diff] [blame] | 138 | DECLARE_EVENT_CLASS(xfs_ag_class, |
| 139 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), |
| 140 | TP_ARGS(mp, agno), |
| 141 | TP_STRUCT__entry( |
| 142 | __field(dev_t, dev) |
| 143 | __field(xfs_agnumber_t, agno) |
| 144 | ), |
| 145 | TP_fast_assign( |
| 146 | __entry->dev = mp->m_super->s_dev; |
| 147 | __entry->agno = agno; |
| 148 | ), |
| 149 | TP_printk("dev %d:%d agno %u", |
| 150 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 151 | __entry->agno) |
| 152 | ); |
| 153 | #define DEFINE_AG_EVENT(name) \ |
| 154 | DEFINE_EVENT(xfs_ag_class, name, \ |
| 155 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \ |
| 156 | TP_ARGS(mp, agno)) |
| 157 | |
| 158 | DEFINE_AG_EVENT(xfs_read_agf); |
| 159 | DEFINE_AG_EVENT(xfs_alloc_read_agf); |
| 160 | DEFINE_AG_EVENT(xfs_read_agi); |
| 161 | DEFINE_AG_EVENT(xfs_ialloc_read_agi); |
| 162 | |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 163 | TRACE_EVENT(xfs_attr_list_node_descend, |
| 164 | TP_PROTO(struct xfs_attr_list_context *ctx, |
| 165 | struct xfs_da_node_entry *btree), |
| 166 | TP_ARGS(ctx, btree), |
| 167 | TP_STRUCT__entry( |
| 168 | __field(dev_t, dev) |
| 169 | __field(xfs_ino_t, ino) |
| 170 | __field(u32, hashval) |
| 171 | __field(u32, blkno) |
| 172 | __field(u32, offset) |
| 173 | __field(void *, alist) |
| 174 | __field(int, bufsize) |
| 175 | __field(int, count) |
| 176 | __field(int, firstu) |
| 177 | __field(int, dupcnt) |
| 178 | __field(int, flags) |
| 179 | __field(u32, bt_hashval) |
| 180 | __field(u32, bt_before) |
| 181 | ), |
| 182 | TP_fast_assign( |
| 183 | __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; |
| 184 | __entry->ino = ctx->dp->i_ino; |
| 185 | __entry->hashval = ctx->cursor->hashval; |
| 186 | __entry->blkno = ctx->cursor->blkno; |
| 187 | __entry->offset = ctx->cursor->offset; |
| 188 | __entry->alist = ctx->alist; |
| 189 | __entry->bufsize = ctx->bufsize; |
| 190 | __entry->count = ctx->count; |
| 191 | __entry->firstu = ctx->firstu; |
| 192 | __entry->flags = ctx->flags; |
| 193 | __entry->bt_hashval = be32_to_cpu(btree->hashval); |
| 194 | __entry->bt_before = be32_to_cpu(btree->before); |
| 195 | ), |
| 196 | TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u " |
| 197 | "alist 0x%p size %u count %u firstu %u flags %d %s " |
| 198 | "node hashval %u, node before %u", |
| 199 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 200 | __entry->ino, |
| 201 | __entry->hashval, |
| 202 | __entry->blkno, |
| 203 | __entry->offset, |
| 204 | __entry->dupcnt, |
| 205 | __entry->alist, |
| 206 | __entry->bufsize, |
| 207 | __entry->count, |
| 208 | __entry->firstu, |
| 209 | __entry->flags, |
| 210 | __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS), |
| 211 | __entry->bt_hashval, |
| 212 | __entry->bt_before) |
| 213 | ); |
| 214 | |
| 215 | TRACE_EVENT(xfs_iext_insert, |
| 216 | TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, |
| 217 | struct xfs_bmbt_irec *r, int state, unsigned long caller_ip), |
| 218 | TP_ARGS(ip, idx, r, state, caller_ip), |
| 219 | TP_STRUCT__entry( |
| 220 | __field(dev_t, dev) |
| 221 | __field(xfs_ino_t, ino) |
| 222 | __field(xfs_extnum_t, idx) |
| 223 | __field(xfs_fileoff_t, startoff) |
| 224 | __field(xfs_fsblock_t, startblock) |
| 225 | __field(xfs_filblks_t, blockcount) |
| 226 | __field(xfs_exntst_t, state) |
| 227 | __field(int, bmap_state) |
| 228 | __field(unsigned long, caller_ip) |
| 229 | ), |
| 230 | TP_fast_assign( |
| 231 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 232 | __entry->ino = ip->i_ino; |
| 233 | __entry->idx = idx; |
| 234 | __entry->startoff = r->br_startoff; |
| 235 | __entry->startblock = r->br_startblock; |
| 236 | __entry->blockcount = r->br_blockcount; |
| 237 | __entry->state = r->br_state; |
| 238 | __entry->bmap_state = state; |
| 239 | __entry->caller_ip = caller_ip; |
| 240 | ), |
| 241 | TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " |
Christoph Hellwig | f7008d0 | 2010-02-15 22:02:19 +0000 | [diff] [blame] | 242 | "offset %lld block %lld count %lld flag %d caller %pf", |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 243 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 244 | __entry->ino, |
| 245 | __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), |
| 246 | (long)__entry->idx, |
| 247 | __entry->startoff, |
Christoph Hellwig | f7008d0 | 2010-02-15 22:02:19 +0000 | [diff] [blame] | 248 | (__int64_t)__entry->startblock, |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 249 | __entry->blockcount, |
| 250 | __entry->state, |
| 251 | (char *)__entry->caller_ip) |
| 252 | ); |
| 253 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 254 | DECLARE_EVENT_CLASS(xfs_bmap_class, |
| 255 | TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, |
| 256 | unsigned long caller_ip), |
| 257 | TP_ARGS(ip, idx, state, caller_ip), |
| 258 | TP_STRUCT__entry( |
| 259 | __field(dev_t, dev) |
| 260 | __field(xfs_ino_t, ino) |
| 261 | __field(xfs_extnum_t, idx) |
| 262 | __field(xfs_fileoff_t, startoff) |
| 263 | __field(xfs_fsblock_t, startblock) |
| 264 | __field(xfs_filblks_t, blockcount) |
| 265 | __field(xfs_exntst_t, state) |
| 266 | __field(int, bmap_state) |
| 267 | __field(unsigned long, caller_ip) |
| 268 | ), |
| 269 | TP_fast_assign( |
| 270 | struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ? |
| 271 | ip->i_afp : &ip->i_df; |
| 272 | struct xfs_bmbt_irec r; |
| 273 | |
| 274 | xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r); |
| 275 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 276 | __entry->ino = ip->i_ino; |
| 277 | __entry->idx = idx; |
| 278 | __entry->startoff = r.br_startoff; |
| 279 | __entry->startblock = r.br_startblock; |
| 280 | __entry->blockcount = r.br_blockcount; |
| 281 | __entry->state = r.br_state; |
| 282 | __entry->bmap_state = state; |
| 283 | __entry->caller_ip = caller_ip; |
| 284 | ), |
| 285 | TP_printk("dev %d:%d ino 0x%llx state %s idx %ld " |
Christoph Hellwig | f7008d0 | 2010-02-15 22:02:19 +0000 | [diff] [blame] | 286 | "offset %lld block %lld count %lld flag %d caller %pf", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 287 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 288 | __entry->ino, |
| 289 | __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS), |
| 290 | (long)__entry->idx, |
| 291 | __entry->startoff, |
Christoph Hellwig | f7008d0 | 2010-02-15 22:02:19 +0000 | [diff] [blame] | 292 | (__int64_t)__entry->startblock, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 293 | __entry->blockcount, |
| 294 | __entry->state, |
| 295 | (char *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 296 | ) |
| 297 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 298 | #define DEFINE_BMAP_EVENT(name) \ |
| 299 | DEFINE_EVENT(xfs_bmap_class, name, \ |
| 300 | TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \ |
| 301 | unsigned long caller_ip), \ |
| 302 | TP_ARGS(ip, idx, state, caller_ip)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 303 | DEFINE_BMAP_EVENT(xfs_iext_remove); |
| 304 | DEFINE_BMAP_EVENT(xfs_bmap_pre_update); |
| 305 | DEFINE_BMAP_EVENT(xfs_bmap_post_update); |
| 306 | DEFINE_BMAP_EVENT(xfs_extlist); |
| 307 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 308 | DECLARE_EVENT_CLASS(xfs_buf_class, |
| 309 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), |
| 310 | TP_ARGS(bp, caller_ip), |
| 311 | TP_STRUCT__entry( |
| 312 | __field(dev_t, dev) |
| 313 | __field(xfs_daddr_t, bno) |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 314 | __field(int, nblks) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 315 | __field(int, hold) |
| 316 | __field(int, pincount) |
| 317 | __field(unsigned, lockval) |
| 318 | __field(unsigned, flags) |
| 319 | __field(unsigned long, caller_ip) |
| 320 | ), |
| 321 | TP_fast_assign( |
| 322 | __entry->dev = bp->b_target->bt_dev; |
| 323 | __entry->bno = bp->b_bn; |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 324 | __entry->nblks = bp->b_length; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 325 | __entry->hold = atomic_read(&bp->b_hold); |
| 326 | __entry->pincount = atomic_read(&bp->b_pin_count); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 327 | __entry->lockval = bp->b_sema.count; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 328 | __entry->flags = bp->b_flags; |
| 329 | __entry->caller_ip = caller_ip; |
| 330 | ), |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 331 | TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d " |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 332 | "lock %d flags %s caller %pf", |
| 333 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 334 | (unsigned long long)__entry->bno, |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 335 | __entry->nblks, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 336 | __entry->hold, |
| 337 | __entry->pincount, |
| 338 | __entry->lockval, |
| 339 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), |
| 340 | (void *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 341 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 342 | |
| 343 | #define DEFINE_BUF_EVENT(name) \ |
| 344 | DEFINE_EVENT(xfs_buf_class, name, \ |
| 345 | TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \ |
| 346 | TP_ARGS(bp, caller_ip)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 347 | DEFINE_BUF_EVENT(xfs_buf_init); |
| 348 | DEFINE_BUF_EVENT(xfs_buf_free); |
| 349 | DEFINE_BUF_EVENT(xfs_buf_hold); |
| 350 | DEFINE_BUF_EVENT(xfs_buf_rele); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 351 | DEFINE_BUF_EVENT(xfs_buf_iodone); |
| 352 | DEFINE_BUF_EVENT(xfs_buf_iorequest); |
| 353 | DEFINE_BUF_EVENT(xfs_buf_bawrite); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 354 | DEFINE_BUF_EVENT(xfs_buf_lock); |
| 355 | DEFINE_BUF_EVENT(xfs_buf_lock_done); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 356 | DEFINE_BUF_EVENT(xfs_buf_trylock); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 357 | DEFINE_BUF_EVENT(xfs_buf_unlock); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 358 | DEFINE_BUF_EVENT(xfs_buf_iowait); |
| 359 | DEFINE_BUF_EVENT(xfs_buf_iowait_done); |
| 360 | DEFINE_BUF_EVENT(xfs_buf_delwri_queue); |
Christoph Hellwig | 43ff212 | 2012-04-23 15:58:39 +1000 | [diff] [blame] | 361 | DEFINE_BUF_EVENT(xfs_buf_delwri_queued); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 362 | DEFINE_BUF_EVENT(xfs_buf_delwri_split); |
Dave Chinner | 686865f | 2010-09-24 20:07:47 +1000 | [diff] [blame] | 363 | DEFINE_BUF_EVENT(xfs_buf_get_uncached); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 364 | DEFINE_BUF_EVENT(xfs_bdstrat_shut); |
| 365 | DEFINE_BUF_EVENT(xfs_buf_item_relse); |
| 366 | DEFINE_BUF_EVENT(xfs_buf_item_iodone); |
| 367 | DEFINE_BUF_EVENT(xfs_buf_item_iodone_async); |
| 368 | DEFINE_BUF_EVENT(xfs_buf_error_relse); |
Dave Chinner | 9f87832 | 2013-01-21 23:53:55 +1100 | [diff] [blame] | 369 | DEFINE_BUF_EVENT(xfs_buf_wait_buftarg); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 370 | DEFINE_BUF_EVENT(xfs_trans_read_buf_io); |
| 371 | DEFINE_BUF_EVENT(xfs_trans_read_buf_shut); |
| 372 | |
| 373 | /* not really buffer traces, but the buf provides useful information */ |
| 374 | DEFINE_BUF_EVENT(xfs_btree_corrupt); |
| 375 | DEFINE_BUF_EVENT(xfs_da_btree_corrupt); |
| 376 | DEFINE_BUF_EVENT(xfs_reset_dqcounts); |
| 377 | DEFINE_BUF_EVENT(xfs_inode_item_push); |
| 378 | |
| 379 | /* pass flags explicitly */ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 380 | DECLARE_EVENT_CLASS(xfs_buf_flags_class, |
| 381 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), |
| 382 | TP_ARGS(bp, flags, caller_ip), |
| 383 | TP_STRUCT__entry( |
| 384 | __field(dev_t, dev) |
| 385 | __field(xfs_daddr_t, bno) |
| 386 | __field(size_t, buffer_length) |
| 387 | __field(int, hold) |
| 388 | __field(int, pincount) |
| 389 | __field(unsigned, lockval) |
| 390 | __field(unsigned, flags) |
| 391 | __field(unsigned long, caller_ip) |
| 392 | ), |
| 393 | TP_fast_assign( |
| 394 | __entry->dev = bp->b_target->bt_dev; |
| 395 | __entry->bno = bp->b_bn; |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 396 | __entry->buffer_length = BBTOB(bp->b_length); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 397 | __entry->flags = flags; |
| 398 | __entry->hold = atomic_read(&bp->b_hold); |
| 399 | __entry->pincount = atomic_read(&bp->b_pin_count); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 400 | __entry->lockval = bp->b_sema.count; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 401 | __entry->caller_ip = caller_ip; |
| 402 | ), |
| 403 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " |
| 404 | "lock %d flags %s caller %pf", |
| 405 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 406 | (unsigned long long)__entry->bno, |
| 407 | __entry->buffer_length, |
| 408 | __entry->hold, |
| 409 | __entry->pincount, |
| 410 | __entry->lockval, |
| 411 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), |
| 412 | (void *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 413 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 414 | |
| 415 | #define DEFINE_BUF_FLAGS_EVENT(name) \ |
| 416 | DEFINE_EVENT(xfs_buf_flags_class, name, \ |
| 417 | TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \ |
| 418 | TP_ARGS(bp, flags, caller_ip)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 419 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_find); |
| 420 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_get); |
| 421 | DEFINE_BUF_FLAGS_EVENT(xfs_buf_read); |
| 422 | |
| 423 | TRACE_EVENT(xfs_buf_ioerror, |
| 424 | TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip), |
| 425 | TP_ARGS(bp, error, caller_ip), |
| 426 | TP_STRUCT__entry( |
| 427 | __field(dev_t, dev) |
| 428 | __field(xfs_daddr_t, bno) |
| 429 | __field(size_t, buffer_length) |
| 430 | __field(unsigned, flags) |
| 431 | __field(int, hold) |
| 432 | __field(int, pincount) |
| 433 | __field(unsigned, lockval) |
| 434 | __field(int, error) |
| 435 | __field(unsigned long, caller_ip) |
| 436 | ), |
| 437 | TP_fast_assign( |
| 438 | __entry->dev = bp->b_target->bt_dev; |
| 439 | __entry->bno = bp->b_bn; |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 440 | __entry->buffer_length = BBTOB(bp->b_length); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 441 | __entry->hold = atomic_read(&bp->b_hold); |
| 442 | __entry->pincount = atomic_read(&bp->b_pin_count); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 443 | __entry->lockval = bp->b_sema.count; |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 444 | __entry->error = error; |
| 445 | __entry->flags = bp->b_flags; |
| 446 | __entry->caller_ip = caller_ip; |
| 447 | ), |
| 448 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " |
| 449 | "lock %d error %d flags %s caller %pf", |
| 450 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 451 | (unsigned long long)__entry->bno, |
| 452 | __entry->buffer_length, |
| 453 | __entry->hold, |
| 454 | __entry->pincount, |
| 455 | __entry->lockval, |
| 456 | __entry->error, |
| 457 | __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), |
| 458 | (void *)__entry->caller_ip) |
| 459 | ); |
| 460 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 461 | DECLARE_EVENT_CLASS(xfs_buf_item_class, |
| 462 | TP_PROTO(struct xfs_buf_log_item *bip), |
| 463 | TP_ARGS(bip), |
| 464 | TP_STRUCT__entry( |
| 465 | __field(dev_t, dev) |
| 466 | __field(xfs_daddr_t, buf_bno) |
| 467 | __field(size_t, buf_len) |
| 468 | __field(int, buf_hold) |
| 469 | __field(int, buf_pincount) |
| 470 | __field(int, buf_lockval) |
| 471 | __field(unsigned, buf_flags) |
| 472 | __field(unsigned, bli_recur) |
| 473 | __field(int, bli_refcount) |
| 474 | __field(unsigned, bli_flags) |
| 475 | __field(void *, li_desc) |
| 476 | __field(unsigned, li_flags) |
| 477 | ), |
| 478 | TP_fast_assign( |
| 479 | __entry->dev = bip->bli_buf->b_target->bt_dev; |
| 480 | __entry->bli_flags = bip->bli_flags; |
| 481 | __entry->bli_recur = bip->bli_recur; |
| 482 | __entry->bli_refcount = atomic_read(&bip->bli_refcount); |
| 483 | __entry->buf_bno = bip->bli_buf->b_bn; |
Dave Chinner | 4e94b71 | 2012-04-23 15:58:51 +1000 | [diff] [blame] | 484 | __entry->buf_len = BBTOB(bip->bli_buf->b_length); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 485 | __entry->buf_flags = bip->bli_buf->b_flags; |
| 486 | __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold); |
| 487 | __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count); |
Christoph Hellwig | 0c842ad | 2011-07-08 14:36:19 +0200 | [diff] [blame] | 488 | __entry->buf_lockval = bip->bli_buf->b_sema.count; |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 489 | __entry->li_desc = bip->bli_item.li_desc; |
| 490 | __entry->li_flags = bip->bli_item.li_flags; |
| 491 | ), |
| 492 | TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d " |
| 493 | "lock %d flags %s recur %d refcount %d bliflags %s " |
| 494 | "lidesc 0x%p liflags %s", |
| 495 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 496 | (unsigned long long)__entry->buf_bno, |
| 497 | __entry->buf_len, |
| 498 | __entry->buf_hold, |
| 499 | __entry->buf_pincount, |
| 500 | __entry->buf_lockval, |
| 501 | __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS), |
| 502 | __entry->bli_recur, |
| 503 | __entry->bli_refcount, |
| 504 | __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS), |
| 505 | __entry->li_desc, |
| 506 | __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 507 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 508 | |
| 509 | #define DEFINE_BUF_ITEM_EVENT(name) \ |
| 510 | DEFINE_EVENT(xfs_buf_item_class, name, \ |
| 511 | TP_PROTO(struct xfs_buf_log_item *bip), \ |
| 512 | TP_ARGS(bip)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 513 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size); |
Dave Chinner | 5f6bed7 | 2013-06-27 16:04:52 +1000 | [diff] [blame] | 514 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 515 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale); |
| 516 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format); |
Dave Chinner | 5f6bed7 | 2013-06-27 16:04:52 +1000 | [diff] [blame] | 517 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 518 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale); |
Dave Chinner | 5f6bed7 | 2013-06-27 16:04:52 +1000 | [diff] [blame] | 519 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 520 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin); |
| 521 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin); |
| 522 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 523 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock); |
| 524 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale); |
| 525 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed); |
| 526 | DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push); |
| 527 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf); |
| 528 | DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur); |
| 529 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb); |
| 530 | DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur); |
| 531 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf); |
| 532 | DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur); |
| 533 | DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf); |
| 534 | DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse); |
| 535 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin); |
| 536 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold); |
| 537 | DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release); |
| 538 | DEFINE_BUF_ITEM_EVENT(xfs_trans_binval); |
Dave Chinner | 5f6bed7 | 2013-06-27 16:04:52 +1000 | [diff] [blame] | 539 | DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 540 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 541 | DECLARE_EVENT_CLASS(xfs_lock_class, |
| 542 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, |
| 543 | unsigned long caller_ip), |
| 544 | TP_ARGS(ip, lock_flags, caller_ip), |
| 545 | TP_STRUCT__entry( |
| 546 | __field(dev_t, dev) |
| 547 | __field(xfs_ino_t, ino) |
| 548 | __field(int, lock_flags) |
| 549 | __field(unsigned long, caller_ip) |
| 550 | ), |
| 551 | TP_fast_assign( |
| 552 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 553 | __entry->ino = ip->i_ino; |
| 554 | __entry->lock_flags = lock_flags; |
| 555 | __entry->caller_ip = caller_ip; |
| 556 | ), |
| 557 | TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf", |
| 558 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 559 | __entry->ino, |
| 560 | __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS), |
| 561 | (void *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 562 | ) |
| 563 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 564 | #define DEFINE_LOCK_EVENT(name) \ |
| 565 | DEFINE_EVENT(xfs_lock_class, name, \ |
| 566 | TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \ |
| 567 | unsigned long caller_ip), \ |
| 568 | TP_ARGS(ip, lock_flags, caller_ip)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 569 | DEFINE_LOCK_EVENT(xfs_ilock); |
| 570 | DEFINE_LOCK_EVENT(xfs_ilock_nowait); |
| 571 | DEFINE_LOCK_EVENT(xfs_ilock_demote); |
| 572 | DEFINE_LOCK_EVENT(xfs_iunlock); |
| 573 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 574 | DECLARE_EVENT_CLASS(xfs_inode_class, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 575 | TP_PROTO(struct xfs_inode *ip), |
| 576 | TP_ARGS(ip), |
| 577 | TP_STRUCT__entry( |
| 578 | __field(dev_t, dev) |
| 579 | __field(xfs_ino_t, ino) |
| 580 | ), |
| 581 | TP_fast_assign( |
| 582 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 583 | __entry->ino = ip->i_ino; |
| 584 | ), |
| 585 | TP_printk("dev %d:%d ino 0x%llx", |
| 586 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 587 | __entry->ino) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 588 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 589 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 590 | #define DEFINE_INODE_EVENT(name) \ |
| 591 | DEFINE_EVENT(xfs_inode_class, name, \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 592 | TP_PROTO(struct xfs_inode *ip), \ |
| 593 | TP_ARGS(ip)) |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 594 | DEFINE_INODE_EVENT(xfs_iget_skip); |
| 595 | DEFINE_INODE_EVENT(xfs_iget_reclaim); |
| 596 | DEFINE_INODE_EVENT(xfs_iget_reclaim_fail); |
| 597 | DEFINE_INODE_EVENT(xfs_iget_hit); |
| 598 | DEFINE_INODE_EVENT(xfs_iget_miss); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 599 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 600 | DEFINE_INODE_EVENT(xfs_getattr); |
| 601 | DEFINE_INODE_EVENT(xfs_setattr); |
| 602 | DEFINE_INODE_EVENT(xfs_readlink); |
Mark Tinguely | 725eb1e | 2013-06-17 15:35:57 -0500 | [diff] [blame] | 603 | DEFINE_INODE_EVENT(xfs_inactive_symlink); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 604 | DEFINE_INODE_EVENT(xfs_alloc_file_space); |
| 605 | DEFINE_INODE_EVENT(xfs_free_file_space); |
Dave Chinner | 897b73b | 2014-04-14 18:15:11 +1000 | [diff] [blame] | 606 | DEFINE_INODE_EVENT(xfs_zero_file_space); |
Namjae Jeon | e1d8fb8 | 2014-02-24 10:58:19 +1100 | [diff] [blame] | 607 | DEFINE_INODE_EVENT(xfs_collapse_file_space); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 608 | DEFINE_INODE_EVENT(xfs_readdir); |
Tony Luck | 0f1a932 | 2010-07-20 17:54:41 +1000 | [diff] [blame] | 609 | #ifdef CONFIG_XFS_POSIX_ACL |
Christoph Hellwig | 4e34e71 | 2011-07-23 17:37:31 +0200 | [diff] [blame] | 610 | DEFINE_INODE_EVENT(xfs_get_acl); |
Tony Luck | 0f1a932 | 2010-07-20 17:54:41 +1000 | [diff] [blame] | 611 | #endif |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 612 | DEFINE_INODE_EVENT(xfs_vm_bmap); |
| 613 | DEFINE_INODE_EVENT(xfs_file_ioctl); |
| 614 | DEFINE_INODE_EVENT(xfs_file_compat_ioctl); |
| 615 | DEFINE_INODE_EVENT(xfs_ioctl_setattr); |
Christoph Hellwig | 1da2f2d | 2011-10-02 14:25:16 +0000 | [diff] [blame] | 616 | DEFINE_INODE_EVENT(xfs_dir_fsync); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 617 | DEFINE_INODE_EVENT(xfs_file_fsync); |
| 618 | DEFINE_INODE_EVENT(xfs_destroy_inode); |
Al Viro | b57922d | 2010-06-07 14:34:48 -0400 | [diff] [blame] | 619 | DEFINE_INODE_EVENT(xfs_evict_inode); |
Christoph Hellwig | 69ff282 | 2012-06-06 17:01:28 -0400 | [diff] [blame] | 620 | DEFINE_INODE_EVENT(xfs_update_time); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 621 | |
| 622 | DEFINE_INODE_EVENT(xfs_dquot_dqalloc); |
| 623 | DEFINE_INODE_EVENT(xfs_dquot_dqdetach); |
| 624 | |
Brian Foster | 27b5286 | 2012-11-06 09:50:38 -0500 | [diff] [blame] | 625 | DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag); |
| 626 | DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag); |
Brian Foster | 41176a6 | 2012-11-06 09:50:42 -0500 | [diff] [blame] | 627 | DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid); |
Brian Foster | 27b5286 | 2012-11-06 09:50:38 -0500 | [diff] [blame] | 628 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 629 | DECLARE_EVENT_CLASS(xfs_iref_class, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 630 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), |
| 631 | TP_ARGS(ip, caller_ip), |
| 632 | TP_STRUCT__entry( |
| 633 | __field(dev_t, dev) |
| 634 | __field(xfs_ino_t, ino) |
| 635 | __field(int, count) |
Dave Chinner | 4aaf15d | 2010-03-08 11:24:07 +1100 | [diff] [blame] | 636 | __field(int, pincount) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 637 | __field(unsigned long, caller_ip) |
| 638 | ), |
| 639 | TP_fast_assign( |
| 640 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 641 | __entry->ino = ip->i_ino; |
| 642 | __entry->count = atomic_read(&VFS_I(ip)->i_count); |
Dave Chinner | 4aaf15d | 2010-03-08 11:24:07 +1100 | [diff] [blame] | 643 | __entry->pincount = atomic_read(&ip->i_pincount); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 644 | __entry->caller_ip = caller_ip; |
| 645 | ), |
Dave Chinner | 4aaf15d | 2010-03-08 11:24:07 +1100 | [diff] [blame] | 646 | TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pf", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 647 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 648 | __entry->ino, |
| 649 | __entry->count, |
Dave Chinner | 4aaf15d | 2010-03-08 11:24:07 +1100 | [diff] [blame] | 650 | __entry->pincount, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 651 | (char *)__entry->caller_ip) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 652 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 653 | |
Brian Foster | 19cb7e3 | 2013-03-18 10:51:48 -0400 | [diff] [blame] | 654 | TRACE_EVENT(xfs_iomap_prealloc_size, |
| 655 | TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift, |
| 656 | unsigned int writeio_blocks), |
| 657 | TP_ARGS(ip, blocks, shift, writeio_blocks), |
| 658 | TP_STRUCT__entry( |
| 659 | __field(dev_t, dev) |
| 660 | __field(xfs_ino_t, ino) |
| 661 | __field(xfs_fsblock_t, blocks) |
| 662 | __field(int, shift) |
| 663 | __field(unsigned int, writeio_blocks) |
| 664 | ), |
| 665 | TP_fast_assign( |
| 666 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 667 | __entry->ino = ip->i_ino; |
| 668 | __entry->blocks = blocks; |
| 669 | __entry->shift = shift; |
| 670 | __entry->writeio_blocks = writeio_blocks; |
| 671 | ), |
| 672 | TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d " |
| 673 | "m_writeio_blocks %u", |
| 674 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, |
| 675 | __entry->blocks, __entry->shift, __entry->writeio_blocks) |
| 676 | ) |
| 677 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 678 | #define DEFINE_IREF_EVENT(name) \ |
| 679 | DEFINE_EVENT(xfs_iref_class, name, \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 680 | TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \ |
| 681 | TP_ARGS(ip, caller_ip)) |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 682 | DEFINE_IREF_EVENT(xfs_ihold); |
| 683 | DEFINE_IREF_EVENT(xfs_irele); |
| 684 | DEFINE_IREF_EVENT(xfs_inode_pin); |
| 685 | DEFINE_IREF_EVENT(xfs_inode_unpin); |
| 686 | DEFINE_IREF_EVENT(xfs_inode_unpin_nowait); |
Dave Chinner | 4aaf15d | 2010-03-08 11:24:07 +1100 | [diff] [blame] | 687 | |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 688 | DECLARE_EVENT_CLASS(xfs_namespace_class, |
| 689 | TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), |
| 690 | TP_ARGS(dp, name), |
| 691 | TP_STRUCT__entry( |
| 692 | __field(dev_t, dev) |
| 693 | __field(xfs_ino_t, dp_ino) |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 694 | __field(int, namelen) |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 695 | __dynamic_array(char, name, name->len) |
| 696 | ), |
| 697 | TP_fast_assign( |
| 698 | __entry->dev = VFS_I(dp)->i_sb->s_dev; |
| 699 | __entry->dp_ino = dp->i_ino; |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 700 | __entry->namelen = name->len; |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 701 | memcpy(__get_str(name), name->name, name->len); |
| 702 | ), |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 703 | TP_printk("dev %d:%d dp ino 0x%llx name %.*s", |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 704 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 705 | __entry->dp_ino, |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 706 | __entry->namelen, |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 707 | __get_str(name)) |
| 708 | ) |
| 709 | |
| 710 | #define DEFINE_NAMESPACE_EVENT(name) \ |
| 711 | DEFINE_EVENT(xfs_namespace_class, name, \ |
| 712 | TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \ |
| 713 | TP_ARGS(dp, name)) |
| 714 | DEFINE_NAMESPACE_EVENT(xfs_remove); |
| 715 | DEFINE_NAMESPACE_EVENT(xfs_link); |
| 716 | DEFINE_NAMESPACE_EVENT(xfs_lookup); |
| 717 | DEFINE_NAMESPACE_EVENT(xfs_create); |
| 718 | DEFINE_NAMESPACE_EVENT(xfs_symlink); |
| 719 | |
| 720 | TRACE_EVENT(xfs_rename, |
| 721 | TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp, |
| 722 | struct xfs_name *src_name, struct xfs_name *target_name), |
| 723 | TP_ARGS(src_dp, target_dp, src_name, target_name), |
| 724 | TP_STRUCT__entry( |
| 725 | __field(dev_t, dev) |
| 726 | __field(xfs_ino_t, src_dp_ino) |
| 727 | __field(xfs_ino_t, target_dp_ino) |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 728 | __field(int, src_namelen) |
| 729 | __field(int, target_namelen) |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 730 | __dynamic_array(char, src_name, src_name->len) |
| 731 | __dynamic_array(char, target_name, target_name->len) |
| 732 | ), |
| 733 | TP_fast_assign( |
| 734 | __entry->dev = VFS_I(src_dp)->i_sb->s_dev; |
| 735 | __entry->src_dp_ino = src_dp->i_ino; |
| 736 | __entry->target_dp_ino = target_dp->i_ino; |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 737 | __entry->src_namelen = src_name->len; |
| 738 | __entry->target_namelen = target_name->len; |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 739 | memcpy(__get_str(src_name), src_name->name, src_name->len); |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 740 | memcpy(__get_str(target_name), target_name->name, |
| 741 | target_name->len); |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 742 | ), |
| 743 | 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] | 744 | " src name %.*s target name %.*s", |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 745 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 746 | __entry->src_dp_ino, |
| 747 | __entry->target_dp_ino, |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 748 | __entry->src_namelen, |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 749 | __get_str(src_name), |
Christoph Hellwig | f616137 | 2012-02-28 11:01:40 +0000 | [diff] [blame] | 750 | __entry->target_namelen, |
Christoph Hellwig | cca28fb | 2010-06-24 11:57:09 +1000 | [diff] [blame] | 751 | __get_str(target_name)) |
| 752 | ) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 753 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 754 | DECLARE_EVENT_CLASS(xfs_dquot_class, |
| 755 | TP_PROTO(struct xfs_dquot *dqp), |
| 756 | TP_ARGS(dqp), |
| 757 | TP_STRUCT__entry( |
| 758 | __field(dev_t, dev) |
Christoph Hellwig | b262e5d | 2010-02-14 22:01:45 +0000 | [diff] [blame] | 759 | __field(u32, id) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 760 | __field(unsigned, flags) |
| 761 | __field(unsigned, nrefs) |
| 762 | __field(unsigned long long, res_bcount) |
| 763 | __field(unsigned long long, bcount) |
| 764 | __field(unsigned long long, icount) |
| 765 | __field(unsigned long long, blk_hardlimit) |
| 766 | __field(unsigned long long, blk_softlimit) |
| 767 | __field(unsigned long long, ino_hardlimit) |
| 768 | __field(unsigned long long, ino_softlimit) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 769 | ), \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 770 | TP_fast_assign( |
| 771 | __entry->dev = dqp->q_mount->m_super->s_dev; |
Christoph Hellwig | b262e5d | 2010-02-14 22:01:45 +0000 | [diff] [blame] | 772 | __entry->id = be32_to_cpu(dqp->q_core.d_id); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 773 | __entry->flags = dqp->dq_flags; |
| 774 | __entry->nrefs = dqp->q_nrefs; |
| 775 | __entry->res_bcount = dqp->q_res_bcount; |
| 776 | __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount); |
| 777 | __entry->icount = be64_to_cpu(dqp->q_core.d_icount); |
| 778 | __entry->blk_hardlimit = |
| 779 | be64_to_cpu(dqp->q_core.d_blk_hardlimit); |
| 780 | __entry->blk_softlimit = |
| 781 | be64_to_cpu(dqp->q_core.d_blk_softlimit); |
| 782 | __entry->ino_hardlimit = |
| 783 | be64_to_cpu(dqp->q_core.d_ino_hardlimit); |
| 784 | __entry->ino_softlimit = |
| 785 | be64_to_cpu(dqp->q_core.d_ino_softlimit); |
| 786 | ), |
| 787 | 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] | 788 | "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx " |
| 789 | "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 790 | MAJOR(__entry->dev), MINOR(__entry->dev), |
Christoph Hellwig | b262e5d | 2010-02-14 22:01:45 +0000 | [diff] [blame] | 791 | __entry->id, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 792 | __print_flags(__entry->flags, "|", XFS_DQ_FLAGS), |
| 793 | __entry->nrefs, |
| 794 | __entry->res_bcount, |
| 795 | __entry->bcount, |
| 796 | __entry->blk_hardlimit, |
| 797 | __entry->blk_softlimit, |
| 798 | __entry->icount, |
| 799 | __entry->ino_hardlimit, |
| 800 | __entry->ino_softlimit) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 801 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 802 | |
| 803 | #define DEFINE_DQUOT_EVENT(name) \ |
| 804 | DEFINE_EVENT(xfs_dquot_class, name, \ |
| 805 | TP_PROTO(struct xfs_dquot *dqp), \ |
| 806 | TP_ARGS(dqp)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 807 | DEFINE_DQUOT_EVENT(xfs_dqadjust); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 808 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_want); |
| 809 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty); |
Christoph Hellwig | 92b2e5b | 2012-02-01 13:57:20 +0000 | [diff] [blame] | 810 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy); |
| 811 | DEFINE_DQUOT_EVENT(xfs_dqreclaim_done); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 812 | DEFINE_DQUOT_EVENT(xfs_dqattach_found); |
| 813 | DEFINE_DQUOT_EVENT(xfs_dqattach_get); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 814 | DEFINE_DQUOT_EVENT(xfs_dqalloc); |
| 815 | DEFINE_DQUOT_EVENT(xfs_dqtobp_read); |
| 816 | DEFINE_DQUOT_EVENT(xfs_dqread); |
| 817 | DEFINE_DQUOT_EVENT(xfs_dqread_fail); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 818 | DEFINE_DQUOT_EVENT(xfs_dqget_hit); |
| 819 | DEFINE_DQUOT_EVENT(xfs_dqget_miss); |
Christoph Hellwig | 9f920f1 | 2012-03-13 08:52:35 +0000 | [diff] [blame] | 820 | DEFINE_DQUOT_EVENT(xfs_dqget_freeing); |
| 821 | DEFINE_DQUOT_EVENT(xfs_dqget_dup); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 822 | DEFINE_DQUOT_EVENT(xfs_dqput); |
| 823 | DEFINE_DQUOT_EVENT(xfs_dqput_wait); |
| 824 | DEFINE_DQUOT_EVENT(xfs_dqput_free); |
| 825 | DEFINE_DQUOT_EVENT(xfs_dqrele); |
| 826 | DEFINE_DQUOT_EVENT(xfs_dqflush); |
| 827 | DEFINE_DQUOT_EVENT(xfs_dqflush_force); |
| 828 | DEFINE_DQUOT_EVENT(xfs_dqflush_done); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 829 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 830 | DECLARE_EVENT_CLASS(xfs_loggrant_class, |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 831 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 832 | TP_ARGS(log, tic), |
| 833 | TP_STRUCT__entry( |
| 834 | __field(dev_t, dev) |
| 835 | __field(unsigned, trans_type) |
| 836 | __field(char, ocnt) |
| 837 | __field(char, cnt) |
| 838 | __field(int, curr_res) |
| 839 | __field(int, unit_res) |
| 840 | __field(unsigned int, flags) |
Dave Chinner | 1054794 | 2010-12-21 12:02:25 +1100 | [diff] [blame] | 841 | __field(int, reserveq) |
| 842 | __field(int, writeq) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 843 | __field(int, grant_reserve_cycle) |
| 844 | __field(int, grant_reserve_bytes) |
| 845 | __field(int, grant_write_cycle) |
| 846 | __field(int, grant_write_bytes) |
| 847 | __field(int, curr_cycle) |
| 848 | __field(int, curr_block) |
| 849 | __field(xfs_lsn_t, tail_lsn) |
| 850 | ), |
| 851 | TP_fast_assign( |
| 852 | __entry->dev = log->l_mp->m_super->s_dev; |
| 853 | __entry->trans_type = tic->t_trans_type; |
| 854 | __entry->ocnt = tic->t_ocnt; |
| 855 | __entry->cnt = tic->t_cnt; |
| 856 | __entry->curr_res = tic->t_curr_res; |
| 857 | __entry->unit_res = tic->t_unit_res; |
| 858 | __entry->flags = tic->t_flags; |
Christoph Hellwig | 2849696 | 2012-02-20 02:31:25 +0000 | [diff] [blame] | 859 | __entry->reserveq = list_empty(&log->l_reserve_head.waiters); |
| 860 | __entry->writeq = list_empty(&log->l_write_head.waiters); |
| 861 | xlog_crack_grant_head(&log->l_reserve_head.grant, |
Dave Chinner | a69ed03 | 2010-12-21 12:08:20 +1100 | [diff] [blame] | 862 | &__entry->grant_reserve_cycle, |
| 863 | &__entry->grant_reserve_bytes); |
Christoph Hellwig | 2849696 | 2012-02-20 02:31:25 +0000 | [diff] [blame] | 864 | xlog_crack_grant_head(&log->l_write_head.grant, |
Dave Chinner | a69ed03 | 2010-12-21 12:08:20 +1100 | [diff] [blame] | 865 | &__entry->grant_write_cycle, |
| 866 | &__entry->grant_write_bytes); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 867 | __entry->curr_cycle = log->l_curr_cycle; |
| 868 | __entry->curr_block = log->l_curr_block; |
Dave Chinner | 1c3cb9e | 2010-12-21 12:28:39 +1100 | [diff] [blame] | 869 | __entry->tail_lsn = atomic64_read(&log->l_tail_lsn); |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 870 | ), |
| 871 | TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u " |
Dave Chinner | 1054794 | 2010-12-21 12:02:25 +1100 | [diff] [blame] | 872 | "t_unit_res %u t_flags %s reserveq %s " |
| 873 | "writeq %s grant_reserve_cycle %d " |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 874 | "grant_reserve_bytes %d grant_write_cycle %d " |
| 875 | "grant_write_bytes %d curr_cycle %d curr_block %d " |
| 876 | "tail_cycle %d tail_block %d", |
| 877 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 878 | __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES), |
| 879 | __entry->ocnt, |
| 880 | __entry->cnt, |
| 881 | __entry->curr_res, |
| 882 | __entry->unit_res, |
| 883 | __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS), |
Dave Chinner | 1054794 | 2010-12-21 12:02:25 +1100 | [diff] [blame] | 884 | __entry->reserveq ? "empty" : "active", |
| 885 | __entry->writeq ? "empty" : "active", |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 886 | __entry->grant_reserve_cycle, |
| 887 | __entry->grant_reserve_bytes, |
| 888 | __entry->grant_write_cycle, |
| 889 | __entry->grant_write_bytes, |
| 890 | __entry->curr_cycle, |
| 891 | __entry->curr_block, |
| 892 | CYCLE_LSN(__entry->tail_lsn), |
| 893 | BLOCK_LSN(__entry->tail_lsn) |
| 894 | ) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 895 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 896 | |
| 897 | #define DEFINE_LOGGRANT_EVENT(name) \ |
| 898 | DEFINE_EVENT(xfs_loggrant_class, name, \ |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 899 | TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 900 | TP_ARGS(log, tic)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 901 | DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm); |
| 902 | DEFINE_LOGGRANT_EVENT(xfs_log_done_perm); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 903 | DEFINE_LOGGRANT_EVENT(xfs_log_umount_write); |
Christoph Hellwig | 9f9c19e | 2011-11-28 08:17:36 +0000 | [diff] [blame] | 904 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep); |
| 905 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake); |
Dave Chinner | 3f16b98 | 2010-12-21 12:29:01 +1100 | [diff] [blame] | 906 | DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up); |
Christoph Hellwig | 9006fb9 | 2012-02-20 02:31:31 +0000 | [diff] [blame] | 907 | DEFINE_LOGGRANT_EVENT(xfs_log_reserve); |
| 908 | DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit); |
| 909 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant); |
| 910 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 911 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter); |
| 912 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit); |
| 913 | DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub); |
| 914 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter); |
| 915 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit); |
| 916 | DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub); |
| 917 | |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 918 | DECLARE_EVENT_CLASS(xfs_log_item_class, |
| 919 | TP_PROTO(struct xfs_log_item *lip), |
| 920 | TP_ARGS(lip), |
| 921 | TP_STRUCT__entry( |
| 922 | __field(dev_t, dev) |
| 923 | __field(void *, lip) |
| 924 | __field(uint, type) |
| 925 | __field(uint, flags) |
| 926 | __field(xfs_lsn_t, lsn) |
| 927 | ), |
| 928 | TP_fast_assign( |
| 929 | __entry->dev = lip->li_mountp->m_super->s_dev; |
| 930 | __entry->lip = lip; |
| 931 | __entry->type = lip->li_type; |
| 932 | __entry->flags = lip->li_flags; |
| 933 | __entry->lsn = lip->li_lsn; |
| 934 | ), |
| 935 | TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s", |
| 936 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 937 | __entry->lip, |
| 938 | CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn), |
| 939 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), |
| 940 | __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) |
| 941 | ) |
| 942 | |
Dave Chinner | 14c26c6 | 2012-04-24 16:33:31 +1000 | [diff] [blame] | 943 | TRACE_EVENT(xfs_log_force, |
| 944 | TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn), |
| 945 | TP_ARGS(mp, lsn), |
| 946 | TP_STRUCT__entry( |
| 947 | __field(dev_t, dev) |
| 948 | __field(xfs_lsn_t, lsn) |
| 949 | ), |
| 950 | TP_fast_assign( |
| 951 | __entry->dev = mp->m_super->s_dev; |
| 952 | __entry->lsn = lsn; |
| 953 | ), |
| 954 | TP_printk("dev %d:%d lsn 0x%llx", |
| 955 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 956 | __entry->lsn) |
| 957 | ) |
| 958 | |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 959 | #define DEFINE_LOG_ITEM_EVENT(name) \ |
| 960 | DEFINE_EVENT(xfs_log_item_class, name, \ |
| 961 | TP_PROTO(struct xfs_log_item *lip), \ |
| 962 | TP_ARGS(lip)) |
| 963 | DEFINE_LOG_ITEM_EVENT(xfs_ail_push); |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 964 | DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned); |
| 965 | DEFINE_LOG_ITEM_EVENT(xfs_ail_locked); |
Christoph Hellwig | 43ff212 | 2012-04-23 15:58:39 +1000 | [diff] [blame] | 966 | DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing); |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 967 | |
Dave Chinner | 750b9c9 | 2013-11-01 15:27:18 +1100 | [diff] [blame] | 968 | DECLARE_EVENT_CLASS(xfs_ail_class, |
| 969 | TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), |
| 970 | TP_ARGS(lip, old_lsn, new_lsn), |
| 971 | TP_STRUCT__entry( |
| 972 | __field(dev_t, dev) |
| 973 | __field(void *, lip) |
| 974 | __field(uint, type) |
| 975 | __field(uint, flags) |
| 976 | __field(xfs_lsn_t, old_lsn) |
| 977 | __field(xfs_lsn_t, new_lsn) |
| 978 | ), |
| 979 | TP_fast_assign( |
| 980 | __entry->dev = lip->li_mountp->m_super->s_dev; |
| 981 | __entry->lip = lip; |
| 982 | __entry->type = lip->li_type; |
| 983 | __entry->flags = lip->li_flags; |
| 984 | __entry->old_lsn = old_lsn; |
| 985 | __entry->new_lsn = new_lsn; |
| 986 | ), |
| 987 | TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s", |
| 988 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 989 | __entry->lip, |
| 990 | CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), |
| 991 | CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), |
| 992 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), |
| 993 | __print_flags(__entry->flags, "|", XFS_LI_FLAGS)) |
| 994 | ) |
| 995 | |
| 996 | #define DEFINE_AIL_EVENT(name) \ |
| 997 | DEFINE_EVENT(xfs_ail_class, name, \ |
| 998 | TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \ |
| 999 | TP_ARGS(lip, old_lsn, new_lsn)) |
| 1000 | DEFINE_AIL_EVENT(xfs_ail_insert); |
| 1001 | DEFINE_AIL_EVENT(xfs_ail_move); |
| 1002 | DEFINE_AIL_EVENT(xfs_ail_delete); |
| 1003 | |
| 1004 | TRACE_EVENT(xfs_log_assign_tail_lsn, |
| 1005 | TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn), |
| 1006 | TP_ARGS(log, new_lsn), |
| 1007 | TP_STRUCT__entry( |
| 1008 | __field(dev_t, dev) |
| 1009 | __field(xfs_lsn_t, new_lsn) |
| 1010 | __field(xfs_lsn_t, old_lsn) |
| 1011 | __field(xfs_lsn_t, last_sync_lsn) |
| 1012 | ), |
| 1013 | TP_fast_assign( |
| 1014 | __entry->dev = log->l_mp->m_super->s_dev; |
| 1015 | __entry->new_lsn = new_lsn; |
| 1016 | __entry->old_lsn = atomic64_read(&log->l_tail_lsn); |
| 1017 | __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn); |
| 1018 | ), |
| 1019 | TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d", |
| 1020 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1021 | CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn), |
| 1022 | CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn), |
| 1023 | CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn)) |
| 1024 | ) |
Christoph Hellwig | 9e4c109 | 2011-10-11 15:14:11 +0000 | [diff] [blame] | 1025 | |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1026 | DECLARE_EVENT_CLASS(xfs_file_class, |
| 1027 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), |
| 1028 | TP_ARGS(ip, count, offset, flags), |
| 1029 | TP_STRUCT__entry( |
| 1030 | __field(dev_t, dev) |
| 1031 | __field(xfs_ino_t, ino) |
| 1032 | __field(xfs_fsize_t, size) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1033 | __field(loff_t, offset) |
| 1034 | __field(size_t, count) |
| 1035 | __field(int, flags) |
| 1036 | ), |
| 1037 | TP_fast_assign( |
| 1038 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1039 | __entry->ino = ip->i_ino; |
| 1040 | __entry->size = ip->i_d.di_size; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1041 | __entry->offset = offset; |
| 1042 | __entry->count = count; |
| 1043 | __entry->flags = flags; |
| 1044 | ), |
Christoph Hellwig | 2813d68 | 2011-12-18 20:00:12 +0000 | [diff] [blame] | 1045 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx " |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1046 | "offset 0x%llx count 0x%zx ioflags %s", |
| 1047 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1048 | __entry->ino, |
| 1049 | __entry->size, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1050 | __entry->offset, |
| 1051 | __entry->count, |
| 1052 | __print_flags(__entry->flags, "|", XFS_IO_FLAGS)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1053 | ) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1054 | |
| 1055 | #define DEFINE_RW_EVENT(name) \ |
| 1056 | DEFINE_EVENT(xfs_file_class, name, \ |
| 1057 | TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \ |
| 1058 | TP_ARGS(ip, count, offset, flags)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1059 | DEFINE_RW_EVENT(xfs_file_read); |
| 1060 | DEFINE_RW_EVENT(xfs_file_buffered_write); |
| 1061 | DEFINE_RW_EVENT(xfs_file_direct_write); |
| 1062 | DEFINE_RW_EVENT(xfs_file_splice_read); |
| 1063 | DEFINE_RW_EVENT(xfs_file_splice_write); |
| 1064 | |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1065 | DECLARE_EVENT_CLASS(xfs_page_class, |
Lukas Czerner | 34097df | 2013-05-21 23:58:01 -0400 | [diff] [blame] | 1066 | TP_PROTO(struct inode *inode, struct page *page, unsigned long off, |
| 1067 | unsigned int len), |
| 1068 | TP_ARGS(inode, page, off, len), |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1069 | TP_STRUCT__entry( |
| 1070 | __field(dev_t, dev) |
| 1071 | __field(xfs_ino_t, ino) |
| 1072 | __field(pgoff_t, pgoff) |
| 1073 | __field(loff_t, size) |
| 1074 | __field(unsigned long, offset) |
Lukas Czerner | 34097df | 2013-05-21 23:58:01 -0400 | [diff] [blame] | 1075 | __field(unsigned int, length) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1076 | __field(int, delalloc) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1077 | __field(int, unwritten) |
| 1078 | ), |
| 1079 | TP_fast_assign( |
Christoph Hellwig | 20cb52e | 2010-06-24 09:46:01 +1000 | [diff] [blame] | 1080 | int delalloc = -1, unwritten = -1; |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1081 | |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1082 | if (page_has_buffers(page)) |
Christoph Hellwig | 20cb52e | 2010-06-24 09:46:01 +1000 | [diff] [blame] | 1083 | xfs_count_page_state(page, &delalloc, &unwritten); |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1084 | __entry->dev = inode->i_sb->s_dev; |
| 1085 | __entry->ino = XFS_I(inode)->i_ino; |
| 1086 | __entry->pgoff = page_offset(page); |
| 1087 | __entry->size = i_size_read(inode); |
| 1088 | __entry->offset = off; |
Lukas Czerner | 34097df | 2013-05-21 23:58:01 -0400 | [diff] [blame] | 1089 | __entry->length = len; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1090 | __entry->delalloc = delalloc; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1091 | __entry->unwritten = unwritten; |
| 1092 | ), |
| 1093 | 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] | 1094 | "length %x delalloc %d unwritten %d", |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1095 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1096 | __entry->ino, |
| 1097 | __entry->pgoff, |
| 1098 | __entry->size, |
| 1099 | __entry->offset, |
Lukas Czerner | 34097df | 2013-05-21 23:58:01 -0400 | [diff] [blame] | 1100 | __entry->length, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1101 | __entry->delalloc, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1102 | __entry->unwritten) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1103 | ) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1104 | |
| 1105 | #define DEFINE_PAGE_EVENT(name) \ |
| 1106 | DEFINE_EVENT(xfs_page_class, name, \ |
Lukas Czerner | 34097df | 2013-05-21 23:58:01 -0400 | [diff] [blame] | 1107 | TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \ |
| 1108 | unsigned int len), \ |
| 1109 | TP_ARGS(inode, page, off, len)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1110 | DEFINE_PAGE_EVENT(xfs_writepage); |
| 1111 | DEFINE_PAGE_EVENT(xfs_releasepage); |
| 1112 | DEFINE_PAGE_EVENT(xfs_invalidatepage); |
| 1113 | |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 1114 | DECLARE_EVENT_CLASS(xfs_imap_class, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1115 | 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] | 1116 | int type, struct xfs_bmbt_irec *irec), |
| 1117 | TP_ARGS(ip, offset, count, type, irec), |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1118 | TP_STRUCT__entry( |
| 1119 | __field(dev_t, dev) |
| 1120 | __field(xfs_ino_t, ino) |
| 1121 | __field(loff_t, size) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1122 | __field(loff_t, offset) |
| 1123 | __field(size_t, count) |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 1124 | __field(int, type) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1125 | __field(xfs_fileoff_t, startoff) |
| 1126 | __field(xfs_fsblock_t, startblock) |
| 1127 | __field(xfs_filblks_t, blockcount) |
| 1128 | ), |
| 1129 | TP_fast_assign( |
| 1130 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1131 | __entry->ino = ip->i_ino; |
| 1132 | __entry->size = ip->i_d.di_size; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1133 | __entry->offset = offset; |
| 1134 | __entry->count = count; |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 1135 | __entry->type = type; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1136 | __entry->startoff = irec ? irec->br_startoff : 0; |
| 1137 | __entry->startblock = irec ? irec->br_startblock : 0; |
| 1138 | __entry->blockcount = irec ? irec->br_blockcount : 0; |
| 1139 | ), |
Christoph Hellwig | 2813d68 | 2011-12-18 20:00:12 +0000 | [diff] [blame] | 1140 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd " |
| 1141 | "type %s startoff 0x%llx startblock %lld blockcount 0x%llx", |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1142 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1143 | __entry->ino, |
| 1144 | __entry->size, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1145 | __entry->offset, |
| 1146 | __entry->count, |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 1147 | __print_symbolic(__entry->type, XFS_IO_TYPES), |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1148 | __entry->startoff, |
| 1149 | (__int64_t)__entry->startblock, |
| 1150 | __entry->blockcount) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1151 | ) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1152 | |
| 1153 | #define DEFINE_IOMAP_EVENT(name) \ |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 1154 | DEFINE_EVENT(xfs_imap_class, name, \ |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1155 | 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] | 1156 | int type, struct xfs_bmbt_irec *irec), \ |
| 1157 | TP_ARGS(ip, offset, count, type, irec)) |
| 1158 | DEFINE_IOMAP_EVENT(xfs_map_blocks_found); |
| 1159 | DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc); |
| 1160 | DEFINE_IOMAP_EVENT(xfs_get_blocks_found); |
| 1161 | DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc); |
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 | DECLARE_EVENT_CLASS(xfs_simple_io_class, |
| 1164 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), |
| 1165 | TP_ARGS(ip, offset, count), |
| 1166 | TP_STRUCT__entry( |
| 1167 | __field(dev_t, dev) |
| 1168 | __field(xfs_ino_t, ino) |
Dave Chinner | 55fb25d5 | 2011-07-18 03:40:19 +0000 | [diff] [blame] | 1169 | __field(loff_t, isize) |
| 1170 | __field(loff_t, disize) |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1171 | __field(loff_t, offset) |
| 1172 | __field(size_t, count) |
| 1173 | ), |
| 1174 | TP_fast_assign( |
| 1175 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1176 | __entry->ino = ip->i_ino; |
Christoph Hellwig | ce7ae151 | 2011-12-18 20:00:11 +0000 | [diff] [blame] | 1177 | __entry->isize = VFS_I(ip)->i_size; |
Dave Chinner | 55fb25d5 | 2011-07-18 03:40:19 +0000 | [diff] [blame] | 1178 | __entry->disize = ip->i_d.di_size; |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1179 | __entry->offset = offset; |
| 1180 | __entry->count = count; |
| 1181 | ), |
Christoph Hellwig | 2813d68 | 2011-12-18 20:00:12 +0000 | [diff] [blame] | 1182 | 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] | 1183 | "offset 0x%llx count %zd", |
| 1184 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1185 | __entry->ino, |
Dave Chinner | 55fb25d5 | 2011-07-18 03:40:19 +0000 | [diff] [blame] | 1186 | __entry->isize, |
| 1187 | __entry->disize, |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1188 | __entry->offset, |
| 1189 | __entry->count) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1190 | ); |
Li Zefan | f8adb4d | 2010-05-24 08:25:57 +0000 | [diff] [blame] | 1191 | |
| 1192 | #define DEFINE_SIMPLE_IO_EVENT(name) \ |
| 1193 | DEFINE_EVENT(xfs_simple_io_class, name, \ |
| 1194 | TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \ |
| 1195 | TP_ARGS(ip, offset, count)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1196 | DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc); |
| 1197 | DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert); |
Christoph Hellwig | a206c81 | 2010-12-10 08:42:20 +0000 | [diff] [blame] | 1198 | DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound); |
Dave Chinner | 55fb25d5 | 2011-07-18 03:40:19 +0000 | [diff] [blame] | 1199 | DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1200 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1201 | DECLARE_EVENT_CLASS(xfs_itrunc_class, |
| 1202 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), |
| 1203 | TP_ARGS(ip, new_size), |
| 1204 | TP_STRUCT__entry( |
| 1205 | __field(dev_t, dev) |
| 1206 | __field(xfs_ino_t, ino) |
| 1207 | __field(xfs_fsize_t, size) |
| 1208 | __field(xfs_fsize_t, new_size) |
| 1209 | ), |
| 1210 | TP_fast_assign( |
| 1211 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1212 | __entry->ino = ip->i_ino; |
| 1213 | __entry->size = ip->i_d.di_size; |
| 1214 | __entry->new_size = new_size; |
| 1215 | ), |
| 1216 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx", |
| 1217 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1218 | __entry->ino, |
| 1219 | __entry->size, |
| 1220 | __entry->new_size) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1221 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1222 | |
| 1223 | #define DEFINE_ITRUNC_EVENT(name) \ |
| 1224 | DEFINE_EVENT(xfs_itrunc_class, name, \ |
| 1225 | TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \ |
| 1226 | TP_ARGS(ip, new_size)) |
Christoph Hellwig | 673e8e5 | 2011-12-18 20:00:04 +0000 | [diff] [blame] | 1227 | DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start); |
| 1228 | DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1229 | |
| 1230 | TRACE_EVENT(xfs_pagecache_inval, |
| 1231 | TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish), |
| 1232 | TP_ARGS(ip, start, finish), |
| 1233 | TP_STRUCT__entry( |
| 1234 | __field(dev_t, dev) |
| 1235 | __field(xfs_ino_t, ino) |
| 1236 | __field(xfs_fsize_t, size) |
| 1237 | __field(xfs_off_t, start) |
| 1238 | __field(xfs_off_t, finish) |
| 1239 | ), |
| 1240 | TP_fast_assign( |
| 1241 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1242 | __entry->ino = ip->i_ino; |
| 1243 | __entry->size = ip->i_d.di_size; |
| 1244 | __entry->start = start; |
| 1245 | __entry->finish = finish; |
| 1246 | ), |
| 1247 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx", |
| 1248 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1249 | __entry->ino, |
| 1250 | __entry->size, |
| 1251 | __entry->start, |
| 1252 | __entry->finish) |
| 1253 | ); |
| 1254 | |
| 1255 | TRACE_EVENT(xfs_bunmap, |
| 1256 | TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len, |
| 1257 | int flags, unsigned long caller_ip), |
| 1258 | TP_ARGS(ip, bno, len, flags, caller_ip), |
| 1259 | TP_STRUCT__entry( |
| 1260 | __field(dev_t, dev) |
| 1261 | __field(xfs_ino_t, ino) |
| 1262 | __field(xfs_fsize_t, size) |
| 1263 | __field(xfs_fileoff_t, bno) |
| 1264 | __field(xfs_filblks_t, len) |
| 1265 | __field(unsigned long, caller_ip) |
| 1266 | __field(int, flags) |
| 1267 | ), |
| 1268 | TP_fast_assign( |
| 1269 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1270 | __entry->ino = ip->i_ino; |
| 1271 | __entry->size = ip->i_d.di_size; |
| 1272 | __entry->bno = bno; |
| 1273 | __entry->len = len; |
| 1274 | __entry->caller_ip = caller_ip; |
| 1275 | __entry->flags = flags; |
| 1276 | ), |
| 1277 | TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx" |
| 1278 | "flags %s caller %pf", |
| 1279 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1280 | __entry->ino, |
| 1281 | __entry->size, |
| 1282 | __entry->bno, |
| 1283 | __entry->len, |
| 1284 | __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS), |
| 1285 | (void *)__entry->caller_ip) |
| 1286 | |
| 1287 | ); |
| 1288 | |
Dave Chinner | 4ecbfe6 | 2012-04-29 10:41:10 +0000 | [diff] [blame] | 1289 | DECLARE_EVENT_CLASS(xfs_extent_busy_class, |
Dave Chinner | ed3b4d6 | 2010-05-21 12:07:08 +1000 | [diff] [blame] | 1290 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 1291 | xfs_agblock_t agbno, xfs_extlen_t len), |
| 1292 | TP_ARGS(mp, agno, agbno, len), |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1293 | TP_STRUCT__entry( |
| 1294 | __field(dev_t, dev) |
| 1295 | __field(xfs_agnumber_t, agno) |
| 1296 | __field(xfs_agblock_t, agbno) |
| 1297 | __field(xfs_extlen_t, len) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1298 | ), |
| 1299 | TP_fast_assign( |
| 1300 | __entry->dev = mp->m_super->s_dev; |
| 1301 | __entry->agno = agno; |
| 1302 | __entry->agbno = agbno; |
| 1303 | __entry->len = len; |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1304 | ), |
Dave Chinner | ed3b4d6 | 2010-05-21 12:07:08 +1000 | [diff] [blame] | 1305 | TP_printk("dev %d:%d agno %u agbno %u len %u", |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1306 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1307 | __entry->agno, |
| 1308 | __entry->agbno, |
Dave Chinner | ed3b4d6 | 2010-05-21 12:07:08 +1000 | [diff] [blame] | 1309 | __entry->len) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1310 | ); |
Christoph Hellwig | 97d3ac7 | 2011-04-24 19:06:16 +0000 | [diff] [blame] | 1311 | #define DEFINE_BUSY_EVENT(name) \ |
Dave Chinner | 4ecbfe6 | 2012-04-29 10:41:10 +0000 | [diff] [blame] | 1312 | DEFINE_EVENT(xfs_extent_busy_class, name, \ |
Christoph Hellwig | 97d3ac7 | 2011-04-24 19:06:16 +0000 | [diff] [blame] | 1313 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 1314 | xfs_agblock_t agbno, xfs_extlen_t len), \ |
| 1315 | TP_ARGS(mp, agno, agbno, len)) |
Dave Chinner | 4ecbfe6 | 2012-04-29 10:41:10 +0000 | [diff] [blame] | 1316 | DEFINE_BUSY_EVENT(xfs_extent_busy); |
| 1317 | DEFINE_BUSY_EVENT(xfs_extent_busy_enomem); |
| 1318 | DEFINE_BUSY_EVENT(xfs_extent_busy_force); |
| 1319 | DEFINE_BUSY_EVENT(xfs_extent_busy_reuse); |
| 1320 | DEFINE_BUSY_EVENT(xfs_extent_busy_clear); |
Dave Chinner | ed3b4d6 | 2010-05-21 12:07:08 +1000 | [diff] [blame] | 1321 | |
Dave Chinner | 4ecbfe6 | 2012-04-29 10:41:10 +0000 | [diff] [blame] | 1322 | TRACE_EVENT(xfs_extent_busy_trim, |
Christoph Hellwig | e26f050 | 2011-04-24 19:06:15 +0000 | [diff] [blame] | 1323 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 1324 | xfs_agblock_t agbno, xfs_extlen_t len, |
| 1325 | xfs_agblock_t tbno, xfs_extlen_t tlen), |
| 1326 | TP_ARGS(mp, agno, agbno, len, tbno, tlen), |
| 1327 | TP_STRUCT__entry( |
| 1328 | __field(dev_t, dev) |
| 1329 | __field(xfs_agnumber_t, agno) |
| 1330 | __field(xfs_agblock_t, agbno) |
| 1331 | __field(xfs_extlen_t, len) |
| 1332 | __field(xfs_agblock_t, tbno) |
| 1333 | __field(xfs_extlen_t, tlen) |
| 1334 | ), |
| 1335 | TP_fast_assign( |
| 1336 | __entry->dev = mp->m_super->s_dev; |
| 1337 | __entry->agno = agno; |
| 1338 | __entry->agbno = agbno; |
| 1339 | __entry->len = len; |
| 1340 | __entry->tbno = tbno; |
| 1341 | __entry->tlen = tlen; |
| 1342 | ), |
| 1343 | TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u", |
| 1344 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1345 | __entry->agno, |
| 1346 | __entry->agbno, |
| 1347 | __entry->len, |
| 1348 | __entry->tbno, |
| 1349 | __entry->tlen) |
| 1350 | ); |
| 1351 | |
Dave Chinner | ed3b4d6 | 2010-05-21 12:07:08 +1000 | [diff] [blame] | 1352 | TRACE_EVENT(xfs_trans_commit_lsn, |
| 1353 | TP_PROTO(struct xfs_trans *trans), |
| 1354 | TP_ARGS(trans), |
| 1355 | TP_STRUCT__entry( |
| 1356 | __field(dev_t, dev) |
| 1357 | __field(struct xfs_trans *, tp) |
| 1358 | __field(xfs_lsn_t, lsn) |
| 1359 | ), |
| 1360 | TP_fast_assign( |
| 1361 | __entry->dev = trans->t_mountp->m_super->s_dev; |
| 1362 | __entry->tp = trans; |
| 1363 | __entry->lsn = trans->t_commit_lsn; |
| 1364 | ), |
| 1365 | TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx", |
| 1366 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1367 | __entry->tp, |
Dave Chinner | fd45e478 | 2010-01-02 02:38:56 +0000 | [diff] [blame] | 1368 | __entry->lsn) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1369 | ); |
| 1370 | |
| 1371 | TRACE_EVENT(xfs_agf, |
| 1372 | TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, |
| 1373 | unsigned long caller_ip), |
| 1374 | TP_ARGS(mp, agf, flags, caller_ip), |
| 1375 | TP_STRUCT__entry( |
| 1376 | __field(dev_t, dev) |
| 1377 | __field(xfs_agnumber_t, agno) |
| 1378 | __field(int, flags) |
| 1379 | __field(__u32, length) |
| 1380 | __field(__u32, bno_root) |
| 1381 | __field(__u32, cnt_root) |
| 1382 | __field(__u32, bno_level) |
| 1383 | __field(__u32, cnt_level) |
| 1384 | __field(__u32, flfirst) |
| 1385 | __field(__u32, fllast) |
| 1386 | __field(__u32, flcount) |
| 1387 | __field(__u32, freeblks) |
| 1388 | __field(__u32, longest) |
| 1389 | __field(unsigned long, caller_ip) |
| 1390 | ), |
| 1391 | TP_fast_assign( |
| 1392 | __entry->dev = mp->m_super->s_dev; |
| 1393 | __entry->agno = be32_to_cpu(agf->agf_seqno), |
| 1394 | __entry->flags = flags; |
| 1395 | __entry->length = be32_to_cpu(agf->agf_length), |
| 1396 | __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]), |
| 1397 | __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]), |
| 1398 | __entry->bno_level = |
| 1399 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]), |
| 1400 | __entry->cnt_level = |
| 1401 | be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]), |
| 1402 | __entry->flfirst = be32_to_cpu(agf->agf_flfirst), |
| 1403 | __entry->fllast = be32_to_cpu(agf->agf_fllast), |
| 1404 | __entry->flcount = be32_to_cpu(agf->agf_flcount), |
| 1405 | __entry->freeblks = be32_to_cpu(agf->agf_freeblks), |
| 1406 | __entry->longest = be32_to_cpu(agf->agf_longest); |
| 1407 | __entry->caller_ip = caller_ip; |
| 1408 | ), |
| 1409 | TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u " |
| 1410 | "levels b %u c %u flfirst %u fllast %u flcount %u " |
| 1411 | "freeblks %u longest %u caller %pf", |
| 1412 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1413 | __entry->agno, |
| 1414 | __print_flags(__entry->flags, "|", XFS_AGF_FLAGS), |
| 1415 | __entry->length, |
| 1416 | __entry->bno_root, |
| 1417 | __entry->cnt_root, |
| 1418 | __entry->bno_level, |
| 1419 | __entry->cnt_level, |
| 1420 | __entry->flfirst, |
| 1421 | __entry->fllast, |
| 1422 | __entry->flcount, |
| 1423 | __entry->freeblks, |
| 1424 | __entry->longest, |
| 1425 | (void *)__entry->caller_ip) |
| 1426 | ); |
| 1427 | |
| 1428 | TRACE_EVENT(xfs_free_extent, |
| 1429 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno, |
| 1430 | xfs_extlen_t len, bool isfl, int haveleft, int haveright), |
| 1431 | TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright), |
| 1432 | TP_STRUCT__entry( |
| 1433 | __field(dev_t, dev) |
| 1434 | __field(xfs_agnumber_t, agno) |
| 1435 | __field(xfs_agblock_t, agbno) |
| 1436 | __field(xfs_extlen_t, len) |
| 1437 | __field(int, isfl) |
| 1438 | __field(int, haveleft) |
| 1439 | __field(int, haveright) |
| 1440 | ), |
| 1441 | TP_fast_assign( |
| 1442 | __entry->dev = mp->m_super->s_dev; |
| 1443 | __entry->agno = agno; |
| 1444 | __entry->agbno = agbno; |
| 1445 | __entry->len = len; |
| 1446 | __entry->isfl = isfl; |
| 1447 | __entry->haveleft = haveleft; |
| 1448 | __entry->haveright = haveright; |
| 1449 | ), |
| 1450 | TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s", |
| 1451 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1452 | __entry->agno, |
| 1453 | __entry->agbno, |
| 1454 | __entry->len, |
| 1455 | __entry->isfl, |
| 1456 | __entry->haveleft ? |
| 1457 | (__entry->haveright ? "both" : "left") : |
| 1458 | (__entry->haveright ? "right" : "none")) |
| 1459 | |
| 1460 | ); |
| 1461 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1462 | DECLARE_EVENT_CLASS(xfs_alloc_class, |
| 1463 | TP_PROTO(struct xfs_alloc_arg *args), |
| 1464 | TP_ARGS(args), |
| 1465 | TP_STRUCT__entry( |
| 1466 | __field(dev_t, dev) |
| 1467 | __field(xfs_agnumber_t, agno) |
| 1468 | __field(xfs_agblock_t, agbno) |
| 1469 | __field(xfs_extlen_t, minlen) |
| 1470 | __field(xfs_extlen_t, maxlen) |
| 1471 | __field(xfs_extlen_t, mod) |
| 1472 | __field(xfs_extlen_t, prod) |
| 1473 | __field(xfs_extlen_t, minleft) |
| 1474 | __field(xfs_extlen_t, total) |
| 1475 | __field(xfs_extlen_t, alignment) |
| 1476 | __field(xfs_extlen_t, minalignslop) |
| 1477 | __field(xfs_extlen_t, len) |
| 1478 | __field(short, type) |
| 1479 | __field(short, otype) |
| 1480 | __field(char, wasdel) |
| 1481 | __field(char, wasfromfl) |
| 1482 | __field(char, isfl) |
| 1483 | __field(char, userdata) |
| 1484 | __field(xfs_fsblock_t, firstblock) |
| 1485 | ), |
| 1486 | TP_fast_assign( |
| 1487 | __entry->dev = args->mp->m_super->s_dev; |
| 1488 | __entry->agno = args->agno; |
| 1489 | __entry->agbno = args->agbno; |
| 1490 | __entry->minlen = args->minlen; |
| 1491 | __entry->maxlen = args->maxlen; |
| 1492 | __entry->mod = args->mod; |
| 1493 | __entry->prod = args->prod; |
| 1494 | __entry->minleft = args->minleft; |
| 1495 | __entry->total = args->total; |
| 1496 | __entry->alignment = args->alignment; |
| 1497 | __entry->minalignslop = args->minalignslop; |
| 1498 | __entry->len = args->len; |
| 1499 | __entry->type = args->type; |
| 1500 | __entry->otype = args->otype; |
| 1501 | __entry->wasdel = args->wasdel; |
| 1502 | __entry->wasfromfl = args->wasfromfl; |
| 1503 | __entry->isfl = args->isfl; |
| 1504 | __entry->userdata = args->userdata; |
| 1505 | __entry->firstblock = args->firstblock; |
| 1506 | ), |
| 1507 | TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u " |
| 1508 | "prod %u minleft %u total %u alignment %u minalignslop %u " |
| 1509 | "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d " |
| 1510 | "userdata %d firstblock 0x%llx", |
| 1511 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1512 | __entry->agno, |
| 1513 | __entry->agbno, |
| 1514 | __entry->minlen, |
| 1515 | __entry->maxlen, |
| 1516 | __entry->mod, |
| 1517 | __entry->prod, |
| 1518 | __entry->minleft, |
| 1519 | __entry->total, |
| 1520 | __entry->alignment, |
| 1521 | __entry->minalignslop, |
| 1522 | __entry->len, |
| 1523 | __print_symbolic(__entry->type, XFS_ALLOC_TYPES), |
| 1524 | __print_symbolic(__entry->otype, XFS_ALLOC_TYPES), |
| 1525 | __entry->wasdel, |
| 1526 | __entry->wasfromfl, |
| 1527 | __entry->isfl, |
| 1528 | __entry->userdata, |
Christoph Hellwig | 1a18a29 | 2011-04-24 19:02:58 +0000 | [diff] [blame] | 1529 | (unsigned long long)__entry->firstblock) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1530 | ) |
| 1531 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1532 | #define DEFINE_ALLOC_EVENT(name) \ |
| 1533 | DEFINE_EVENT(xfs_alloc_class, name, \ |
| 1534 | TP_PROTO(struct xfs_alloc_arg *args), \ |
| 1535 | TP_ARGS(args)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1536 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_done); |
Christoph Hellwig | 9f9baab | 2010-12-10 15:03:57 +0000 | [diff] [blame] | 1537 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1538 | DEFINE_ALLOC_EVENT(xfs_alloc_exact_error); |
| 1539 | DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft); |
| 1540 | DEFINE_ALLOC_EVENT(xfs_alloc_near_first); |
| 1541 | DEFINE_ALLOC_EVENT(xfs_alloc_near_greater); |
| 1542 | DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser); |
| 1543 | DEFINE_ALLOC_EVENT(xfs_alloc_near_error); |
Christoph Hellwig | e26f050 | 2011-04-24 19:06:15 +0000 | [diff] [blame] | 1544 | DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry); |
| 1545 | DEFINE_ALLOC_EVENT(xfs_alloc_near_busy); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1546 | DEFINE_ALLOC_EVENT(xfs_alloc_size_neither); |
| 1547 | DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry); |
| 1548 | DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft); |
| 1549 | DEFINE_ALLOC_EVENT(xfs_alloc_size_done); |
| 1550 | DEFINE_ALLOC_EVENT(xfs_alloc_size_error); |
Christoph Hellwig | e26f050 | 2011-04-24 19:06:15 +0000 | [diff] [blame] | 1551 | DEFINE_ALLOC_EVENT(xfs_alloc_size_busy); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1552 | DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist); |
| 1553 | DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough); |
| 1554 | DEFINE_ALLOC_EVENT(xfs_alloc_small_done); |
| 1555 | DEFINE_ALLOC_EVENT(xfs_alloc_small_error); |
| 1556 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs); |
| 1557 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix); |
| 1558 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp); |
| 1559 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed); |
| 1560 | DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed); |
| 1561 | |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1562 | DECLARE_EVENT_CLASS(xfs_da_class, |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1563 | TP_PROTO(struct xfs_da_args *args), |
| 1564 | TP_ARGS(args), |
| 1565 | TP_STRUCT__entry( |
| 1566 | __field(dev_t, dev) |
| 1567 | __field(xfs_ino_t, ino) |
| 1568 | __dynamic_array(char, name, args->namelen) |
| 1569 | __field(int, namelen) |
| 1570 | __field(xfs_dahash_t, hashval) |
| 1571 | __field(xfs_ino_t, inumber) |
| 1572 | __field(int, op_flags) |
| 1573 | ), |
| 1574 | TP_fast_assign( |
| 1575 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; |
| 1576 | __entry->ino = args->dp->i_ino; |
| 1577 | if (args->namelen) |
| 1578 | memcpy(__get_str(name), args->name, args->namelen); |
| 1579 | __entry->namelen = args->namelen; |
| 1580 | __entry->hashval = args->hashval; |
| 1581 | __entry->inumber = args->inumber; |
| 1582 | __entry->op_flags = args->op_flags; |
| 1583 | ), |
| 1584 | TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x " |
| 1585 | "inumber 0x%llx op_flags %s", |
| 1586 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1587 | __entry->ino, |
| 1588 | __entry->namelen, |
| 1589 | __entry->namelen ? __get_str(name) : NULL, |
| 1590 | __entry->namelen, |
| 1591 | __entry->hashval, |
| 1592 | __entry->inumber, |
| 1593 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1594 | ) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1595 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1596 | #define DEFINE_DIR2_EVENT(name) \ |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1597 | DEFINE_EVENT(xfs_da_class, name, \ |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1598 | TP_PROTO(struct xfs_da_args *args), \ |
| 1599 | TP_ARGS(args)) |
| 1600 | DEFINE_DIR2_EVENT(xfs_dir2_sf_addname); |
| 1601 | DEFINE_DIR2_EVENT(xfs_dir2_sf_create); |
| 1602 | DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup); |
| 1603 | DEFINE_DIR2_EVENT(xfs_dir2_sf_replace); |
| 1604 | DEFINE_DIR2_EVENT(xfs_dir2_sf_removename); |
| 1605 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4); |
| 1606 | DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8); |
| 1607 | DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block); |
| 1608 | DEFINE_DIR2_EVENT(xfs_dir2_block_addname); |
| 1609 | DEFINE_DIR2_EVENT(xfs_dir2_block_lookup); |
| 1610 | DEFINE_DIR2_EVENT(xfs_dir2_block_replace); |
| 1611 | DEFINE_DIR2_EVENT(xfs_dir2_block_removename); |
| 1612 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf); |
| 1613 | DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf); |
| 1614 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname); |
| 1615 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup); |
| 1616 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace); |
| 1617 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename); |
| 1618 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block); |
| 1619 | DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node); |
| 1620 | DEFINE_DIR2_EVENT(xfs_dir2_node_addname); |
| 1621 | DEFINE_DIR2_EVENT(xfs_dir2_node_lookup); |
| 1622 | DEFINE_DIR2_EVENT(xfs_dir2_node_replace); |
| 1623 | DEFINE_DIR2_EVENT(xfs_dir2_node_removename); |
| 1624 | DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf); |
| 1625 | |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1626 | DECLARE_EVENT_CLASS(xfs_attr_class, |
| 1627 | TP_PROTO(struct xfs_da_args *args), |
| 1628 | TP_ARGS(args), |
| 1629 | TP_STRUCT__entry( |
| 1630 | __field(dev_t, dev) |
| 1631 | __field(xfs_ino_t, ino) |
| 1632 | __dynamic_array(char, name, args->namelen) |
| 1633 | __field(int, namelen) |
| 1634 | __field(int, valuelen) |
| 1635 | __field(xfs_dahash_t, hashval) |
| 1636 | __field(int, op_flags) |
| 1637 | ), |
| 1638 | TP_fast_assign( |
| 1639 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; |
| 1640 | __entry->ino = args->dp->i_ino; |
| 1641 | if (args->namelen) |
| 1642 | memcpy(__get_str(name), args->name, args->namelen); |
| 1643 | __entry->namelen = args->namelen; |
| 1644 | __entry->valuelen = args->valuelen; |
| 1645 | __entry->hashval = args->hashval; |
| 1646 | __entry->op_flags = args->op_flags; |
| 1647 | ), |
| 1648 | TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d " |
| 1649 | "hashval 0x%x op_flags %s", |
| 1650 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1651 | __entry->ino, |
| 1652 | __entry->namelen, |
| 1653 | __entry->namelen ? __get_str(name) : NULL, |
| 1654 | __entry->namelen, |
| 1655 | __entry->valuelen, |
| 1656 | __entry->hashval, |
| 1657 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS)) |
| 1658 | ) |
| 1659 | |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1660 | #define DEFINE_ATTR_EVENT(name) \ |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1661 | DEFINE_EVENT(xfs_attr_class, name, \ |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1662 | TP_PROTO(struct xfs_da_args *args), \ |
| 1663 | TP_ARGS(args)) |
| 1664 | DEFINE_ATTR_EVENT(xfs_attr_sf_add); |
| 1665 | DEFINE_ATTR_EVENT(xfs_attr_sf_addname); |
| 1666 | DEFINE_ATTR_EVENT(xfs_attr_sf_create); |
| 1667 | DEFINE_ATTR_EVENT(xfs_attr_sf_lookup); |
| 1668 | DEFINE_ATTR_EVENT(xfs_attr_sf_remove); |
| 1669 | DEFINE_ATTR_EVENT(xfs_attr_sf_removename); |
| 1670 | DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf); |
| 1671 | |
| 1672 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add); |
| 1673 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old); |
| 1674 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1675 | DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1676 | DEFINE_ATTR_EVENT(xfs_attr_leaf_addname); |
| 1677 | DEFINE_ATTR_EVENT(xfs_attr_leaf_create); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1678 | DEFINE_ATTR_EVENT(xfs_attr_leaf_compact); |
| 1679 | DEFINE_ATTR_EVENT(xfs_attr_leaf_get); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1680 | DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup); |
| 1681 | DEFINE_ATTR_EVENT(xfs_attr_leaf_replace); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1682 | DEFINE_ATTR_EVENT(xfs_attr_leaf_remove); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1683 | DEFINE_ATTR_EVENT(xfs_attr_leaf_removename); |
| 1684 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split); |
| 1685 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before); |
| 1686 | DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after); |
| 1687 | DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag); |
| 1688 | DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag); |
| 1689 | DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags); |
| 1690 | DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf); |
| 1691 | DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node); |
| 1692 | DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance); |
| 1693 | DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1694 | DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1695 | |
| 1696 | DEFINE_ATTR_EVENT(xfs_attr_node_addname); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1697 | DEFINE_ATTR_EVENT(xfs_attr_node_get); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1698 | DEFINE_ATTR_EVENT(xfs_attr_node_lookup); |
| 1699 | DEFINE_ATTR_EVENT(xfs_attr_node_replace); |
| 1700 | DEFINE_ATTR_EVENT(xfs_attr_node_removename); |
| 1701 | |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1702 | DEFINE_ATTR_EVENT(xfs_attr_fillstate); |
| 1703 | DEFINE_ATTR_EVENT(xfs_attr_refillstate); |
| 1704 | |
| 1705 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_get); |
| 1706 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_set); |
| 1707 | DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove); |
| 1708 | |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1709 | #define DEFINE_DA_EVENT(name) \ |
| 1710 | DEFINE_EVENT(xfs_da_class, name, \ |
| 1711 | TP_PROTO(struct xfs_da_args *args), \ |
| 1712 | TP_ARGS(args)) |
| 1713 | DEFINE_DA_EVENT(xfs_da_split); |
| 1714 | DEFINE_DA_EVENT(xfs_da_join); |
| 1715 | DEFINE_DA_EVENT(xfs_da_link_before); |
| 1716 | DEFINE_DA_EVENT(xfs_da_link_after); |
| 1717 | DEFINE_DA_EVENT(xfs_da_unlink_back); |
| 1718 | DEFINE_DA_EVENT(xfs_da_unlink_forward); |
| 1719 | DEFINE_DA_EVENT(xfs_da_root_split); |
| 1720 | DEFINE_DA_EVENT(xfs_da_root_join); |
| 1721 | DEFINE_DA_EVENT(xfs_da_node_add); |
| 1722 | DEFINE_DA_EVENT(xfs_da_node_create); |
| 1723 | DEFINE_DA_EVENT(xfs_da_node_split); |
| 1724 | DEFINE_DA_EVENT(xfs_da_node_remove); |
| 1725 | DEFINE_DA_EVENT(xfs_da_node_rebalance); |
| 1726 | DEFINE_DA_EVENT(xfs_da_node_unbalance); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1727 | DEFINE_DA_EVENT(xfs_da_node_toosmall); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1728 | DEFINE_DA_EVENT(xfs_da_swap_lastblock); |
| 1729 | DEFINE_DA_EVENT(xfs_da_grow_inode); |
| 1730 | DEFINE_DA_EVENT(xfs_da_shrink_inode); |
Dave Chinner | ee73259 | 2012-11-12 22:53:53 +1100 | [diff] [blame] | 1731 | DEFINE_DA_EVENT(xfs_da_fixhashpath); |
| 1732 | DEFINE_DA_EVENT(xfs_da_path_shift); |
Dave Chinner | 5a5881c | 2012-03-22 05:15:13 +0000 | [diff] [blame] | 1733 | |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1734 | DECLARE_EVENT_CLASS(xfs_dir2_space_class, |
| 1735 | TP_PROTO(struct xfs_da_args *args, int idx), |
| 1736 | TP_ARGS(args, idx), |
| 1737 | TP_STRUCT__entry( |
| 1738 | __field(dev_t, dev) |
| 1739 | __field(xfs_ino_t, ino) |
| 1740 | __field(int, op_flags) |
| 1741 | __field(int, idx) |
| 1742 | ), |
| 1743 | TP_fast_assign( |
| 1744 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; |
| 1745 | __entry->ino = args->dp->i_ino; |
| 1746 | __entry->op_flags = args->op_flags; |
| 1747 | __entry->idx = idx; |
| 1748 | ), |
| 1749 | TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d", |
| 1750 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1751 | __entry->ino, |
| 1752 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), |
| 1753 | __entry->idx) |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1754 | ) |
Christoph Hellwig | ea9a488 | 2009-12-21 14:03:03 +0000 | [diff] [blame] | 1755 | |
| 1756 | #define DEFINE_DIR2_SPACE_EVENT(name) \ |
| 1757 | DEFINE_EVENT(xfs_dir2_space_class, name, \ |
| 1758 | TP_PROTO(struct xfs_da_args *args, int idx), \ |
| 1759 | TP_ARGS(args, idx)) |
| 1760 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add); |
| 1761 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove); |
| 1762 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode); |
| 1763 | DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode); |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 1764 | |
| 1765 | TRACE_EVENT(xfs_dir2_leafn_moveents, |
| 1766 | TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count), |
| 1767 | TP_ARGS(args, src_idx, dst_idx, count), |
| 1768 | TP_STRUCT__entry( |
| 1769 | __field(dev_t, dev) |
| 1770 | __field(xfs_ino_t, ino) |
| 1771 | __field(int, op_flags) |
| 1772 | __field(int, src_idx) |
| 1773 | __field(int, dst_idx) |
| 1774 | __field(int, count) |
| 1775 | ), |
| 1776 | TP_fast_assign( |
| 1777 | __entry->dev = VFS_I(args->dp)->i_sb->s_dev; |
| 1778 | __entry->ino = args->dp->i_ino; |
| 1779 | __entry->op_flags = args->op_flags; |
| 1780 | __entry->src_idx = src_idx; |
| 1781 | __entry->dst_idx = dst_idx; |
| 1782 | __entry->count = count; |
| 1783 | ), |
| 1784 | TP_printk("dev %d:%d ino 0x%llx op_flags %s " |
| 1785 | "src_idx %d dst_idx %d count %d", |
| 1786 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1787 | __entry->ino, |
| 1788 | __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS), |
| 1789 | __entry->src_idx, |
| 1790 | __entry->dst_idx, |
| 1791 | __entry->count) |
| 1792 | ); |
| 1793 | |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1794 | #define XFS_SWAPEXT_INODES \ |
| 1795 | { 0, "target" }, \ |
| 1796 | { 1, "temp" } |
| 1797 | |
| 1798 | #define XFS_INODE_FORMAT_STR \ |
| 1799 | { 0, "invalid" }, \ |
| 1800 | { 1, "local" }, \ |
| 1801 | { 2, "extent" }, \ |
| 1802 | { 3, "btree" } |
| 1803 | |
| 1804 | DECLARE_EVENT_CLASS(xfs_swap_extent_class, |
| 1805 | TP_PROTO(struct xfs_inode *ip, int which), |
| 1806 | TP_ARGS(ip, which), |
| 1807 | TP_STRUCT__entry( |
| 1808 | __field(dev_t, dev) |
| 1809 | __field(int, which) |
| 1810 | __field(xfs_ino_t, ino) |
| 1811 | __field(int, format) |
| 1812 | __field(int, nex) |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1813 | __field(int, broot_size) |
| 1814 | __field(int, fork_off) |
| 1815 | ), |
| 1816 | TP_fast_assign( |
| 1817 | __entry->dev = VFS_I(ip)->i_sb->s_dev; |
| 1818 | __entry->which = which; |
| 1819 | __entry->ino = ip->i_ino; |
| 1820 | __entry->format = ip->i_d.di_format; |
| 1821 | __entry->nex = ip->i_d.di_nextents; |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1822 | __entry->broot_size = ip->i_df.if_broot_bytes; |
| 1823 | __entry->fork_off = XFS_IFORK_BOFF(ip); |
| 1824 | ), |
| 1825 | 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] | 1826 | "broot size %d, fork offset %d", |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1827 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1828 | __entry->ino, |
| 1829 | __print_symbolic(__entry->which, XFS_SWAPEXT_INODES), |
| 1830 | __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR), |
| 1831 | __entry->nex, |
Dave Chinner | 3a85cd9 | 2010-01-14 01:33:55 +0000 | [diff] [blame] | 1832 | __entry->broot_size, |
| 1833 | __entry->fork_off) |
| 1834 | ) |
| 1835 | |
| 1836 | #define DEFINE_SWAPEXT_EVENT(name) \ |
| 1837 | DEFINE_EVENT(xfs_swap_extent_class, name, \ |
| 1838 | TP_PROTO(struct xfs_inode *ip, int which), \ |
| 1839 | TP_ARGS(ip, which)) |
| 1840 | |
| 1841 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before); |
| 1842 | DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after); |
| 1843 | |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1844 | DECLARE_EVENT_CLASS(xfs_log_recover_item_class, |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 1845 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1846 | struct xlog_recover_item *item, int pass), |
| 1847 | TP_ARGS(log, trans, item, pass), |
| 1848 | TP_STRUCT__entry( |
| 1849 | __field(dev_t, dev) |
| 1850 | __field(unsigned long, item) |
| 1851 | __field(xlog_tid_t, tid) |
| 1852 | __field(int, type) |
| 1853 | __field(int, pass) |
| 1854 | __field(int, count) |
| 1855 | __field(int, total) |
| 1856 | ), |
| 1857 | TP_fast_assign( |
| 1858 | __entry->dev = log->l_mp->m_super->s_dev; |
| 1859 | __entry->item = (unsigned long)item; |
| 1860 | __entry->tid = trans->r_log_tid; |
| 1861 | __entry->type = ITEM_TYPE(item); |
| 1862 | __entry->pass = pass; |
| 1863 | __entry->count = item->ri_cnt; |
| 1864 | __entry->total = item->ri_total; |
| 1865 | ), |
| 1866 | TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s " |
| 1867 | "item region count/total %d/%d", |
| 1868 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1869 | __entry->tid, |
| 1870 | __entry->pass, |
| 1871 | (void *)__entry->item, |
| 1872 | __print_symbolic(__entry->type, XFS_LI_TYPE_DESC), |
| 1873 | __entry->count, |
| 1874 | __entry->total) |
| 1875 | ) |
| 1876 | |
| 1877 | #define DEFINE_LOG_RECOVER_ITEM(name) \ |
| 1878 | DEFINE_EVENT(xfs_log_recover_item_class, name, \ |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 1879 | TP_PROTO(struct xlog *log, struct xlog_recover *trans, \ |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1880 | struct xlog_recover_item *item, int pass), \ |
| 1881 | TP_ARGS(log, trans, item, pass)) |
| 1882 | |
| 1883 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add); |
| 1884 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont); |
| 1885 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head); |
| 1886 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail); |
| 1887 | DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover); |
| 1888 | |
| 1889 | DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class, |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 1890 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1891 | TP_ARGS(log, buf_f), |
| 1892 | TP_STRUCT__entry( |
| 1893 | __field(dev_t, dev) |
| 1894 | __field(__int64_t, blkno) |
| 1895 | __field(unsigned short, len) |
| 1896 | __field(unsigned short, flags) |
| 1897 | __field(unsigned short, size) |
| 1898 | __field(unsigned int, map_size) |
| 1899 | ), |
| 1900 | TP_fast_assign( |
| 1901 | __entry->dev = log->l_mp->m_super->s_dev; |
| 1902 | __entry->blkno = buf_f->blf_blkno; |
| 1903 | __entry->len = buf_f->blf_len; |
| 1904 | __entry->flags = buf_f->blf_flags; |
| 1905 | __entry->size = buf_f->blf_size; |
| 1906 | __entry->map_size = buf_f->blf_map_size; |
| 1907 | ), |
| 1908 | TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, " |
| 1909 | "map_size %d", |
| 1910 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1911 | __entry->blkno, |
| 1912 | __entry->len, |
| 1913 | __entry->flags, |
| 1914 | __entry->size, |
| 1915 | __entry->map_size) |
| 1916 | ) |
| 1917 | |
| 1918 | #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \ |
| 1919 | DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \ |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 1920 | TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \ |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1921 | TP_ARGS(log, buf_f)) |
| 1922 | |
| 1923 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel); |
| 1924 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel); |
| 1925 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add); |
| 1926 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc); |
| 1927 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover); |
| 1928 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf); |
| 1929 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf); |
| 1930 | DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf); |
| 1931 | |
| 1932 | DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class, |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 1933 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1934 | TP_ARGS(log, in_f), |
| 1935 | TP_STRUCT__entry( |
| 1936 | __field(dev_t, dev) |
| 1937 | __field(xfs_ino_t, ino) |
| 1938 | __field(unsigned short, size) |
| 1939 | __field(int, fields) |
| 1940 | __field(unsigned short, asize) |
| 1941 | __field(unsigned short, dsize) |
| 1942 | __field(__int64_t, blkno) |
| 1943 | __field(int, len) |
| 1944 | __field(int, boffset) |
| 1945 | ), |
| 1946 | TP_fast_assign( |
| 1947 | __entry->dev = log->l_mp->m_super->s_dev; |
| 1948 | __entry->ino = in_f->ilf_ino; |
| 1949 | __entry->size = in_f->ilf_size; |
| 1950 | __entry->fields = in_f->ilf_fields; |
| 1951 | __entry->asize = in_f->ilf_asize; |
| 1952 | __entry->dsize = in_f->ilf_dsize; |
| 1953 | __entry->blkno = in_f->ilf_blkno; |
| 1954 | __entry->len = in_f->ilf_len; |
| 1955 | __entry->boffset = in_f->ilf_boffset; |
| 1956 | ), |
| 1957 | TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, " |
| 1958 | "dsize %d, blkno 0x%llx, len %d, boffset %d", |
| 1959 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1960 | __entry->ino, |
| 1961 | __entry->size, |
| 1962 | __entry->fields, |
| 1963 | __entry->asize, |
| 1964 | __entry->dsize, |
| 1965 | __entry->blkno, |
| 1966 | __entry->len, |
| 1967 | __entry->boffset) |
| 1968 | ) |
| 1969 | #define DEFINE_LOG_RECOVER_INO_ITEM(name) \ |
| 1970 | DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \ |
Mark Tinguely | ad223e6 | 2012-06-14 09:22:15 -0500 | [diff] [blame] | 1971 | TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \ |
Dave Chinner | 9abbc53 | 2010-04-13 15:06:46 +1000 | [diff] [blame] | 1972 | TP_ARGS(log, in_f)) |
| 1973 | |
| 1974 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover); |
| 1975 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel); |
| 1976 | DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip); |
| 1977 | |
Christoph Hellwig | a46db60 | 2011-01-07 13:02:04 +0000 | [diff] [blame] | 1978 | DECLARE_EVENT_CLASS(xfs_discard_class, |
| 1979 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, |
| 1980 | xfs_agblock_t agbno, xfs_extlen_t len), |
| 1981 | TP_ARGS(mp, agno, agbno, len), |
| 1982 | TP_STRUCT__entry( |
| 1983 | __field(dev_t, dev) |
| 1984 | __field(xfs_agnumber_t, agno) |
| 1985 | __field(xfs_agblock_t, agbno) |
| 1986 | __field(xfs_extlen_t, len) |
| 1987 | ), |
| 1988 | TP_fast_assign( |
| 1989 | __entry->dev = mp->m_super->s_dev; |
| 1990 | __entry->agno = agno; |
| 1991 | __entry->agbno = agbno; |
| 1992 | __entry->len = len; |
| 1993 | ), |
| 1994 | TP_printk("dev %d:%d agno %u agbno %u len %u\n", |
| 1995 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 1996 | __entry->agno, |
| 1997 | __entry->agbno, |
| 1998 | __entry->len) |
| 1999 | ) |
| 2000 | |
| 2001 | #define DEFINE_DISCARD_EVENT(name) \ |
| 2002 | DEFINE_EVENT(xfs_discard_class, name, \ |
| 2003 | TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \ |
| 2004 | xfs_agblock_t agbno, xfs_extlen_t len), \ |
| 2005 | TP_ARGS(mp, agno, agbno, len)) |
| 2006 | DEFINE_DISCARD_EVENT(xfs_discard_extent); |
| 2007 | DEFINE_DISCARD_EVENT(xfs_discard_toosmall); |
| 2008 | DEFINE_DISCARD_EVENT(xfs_discard_exclude); |
| 2009 | DEFINE_DISCARD_EVENT(xfs_discard_busy); |
| 2010 | |
Christoph Hellwig | 0b1b213 | 2009-12-14 23:14:59 +0000 | [diff] [blame] | 2011 | #endif /* _TRACE_XFS_H */ |
| 2012 | |
| 2013 | #undef TRACE_INCLUDE_PATH |
| 2014 | #define TRACE_INCLUDE_PATH . |
| 2015 | #define TRACE_INCLUDE_FILE xfs_trace |
| 2016 | #include <trace/define_trace.h> |