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