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