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