blob: 4a8076ef8cb4c4e0db5db3091bd6082721ab8228 [file] [log] [blame]
Dave Chinner0b61f8a2018-06-05 19:42:14 -07001// SPDX-License-Identifier: GPL-2.0
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002/*
3 * Copyright (c) 2009, Christoph Hellwig
4 * All Rights Reserved.
Darrick J. Wonge5f2e542021-08-18 20:04:44 -07005 *
6 * NOTE: none of these tracepoints shall be considered a stable kernel ABI
7 * as they can change at any time.
8 *
9 * Current conventions for printing numbers measuring specific units:
10 *
11 * agno: allocation group number
12 *
13 * agino: per-AG inode number
14 * ino: filesystem inode number
15 *
16 * agbno: per-AG block number in fs blocks
17 * startblock: physical block number for file mappings. This is either a
18 * segmented fsblock for data device mappings, or a rfsblock
19 * for realtime device mappings
20 * fsbcount: number of blocks in an extent, in fs blocks
21 *
22 * daddr: physical block number in 512b blocks
23 * bbcount: number of blocks in a physical extent, in 512b blocks
24 *
25 * owner: reverse-mapping owner, usually inodes
26 *
27 * fileoff: file offset, in fs blocks
28 * pos: file offset, in bytes
29 * bytecount: number of bytes
30 *
31 * disize: ondisk file size, in bytes
32 * isize: incore file size, in bytes
33 *
34 * forkoff: inode fork offset, in bytes
35 *
36 * ireccount: number of inode records
37 *
38 * Numbers describing space allocations (blocks, extents, inodes) should be
39 * formatted in hexadecimal.
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000040 */
41#undef TRACE_SYSTEM
42#define TRACE_SYSTEM xfs
43
44#if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
45#define _TRACE_XFS_H
46
47#include <linux/tracepoint.h>
48
49struct xfs_agf;
50struct xfs_alloc_arg;
51struct xfs_attr_list_context;
52struct xfs_buf_log_item;
53struct xfs_da_args;
54struct xfs_da_node_entry;
55struct xfs_dquot;
Christoph Hellwig9e4c1092011-10-11 15:14:11 +000056struct xfs_log_item;
Mark Tinguelyad223e62012-06-14 09:22:15 -050057struct xlog;
Dave Chinner750b9c92013-11-01 15:27:18 +110058struct xlog_ticket;
Dave Chinner9abbc532010-04-13 15:06:46 +100059struct xlog_recover;
60struct xlog_recover_item;
Dave Chinner0ad95682019-08-26 12:08:10 -070061struct xlog_rec_header;
Dave Chinner956f6da2021-06-18 11:57:05 -070062struct xlog_in_core;
Dave Chinner9abbc532010-04-13 15:06:46 +100063struct xfs_buf_log_format;
64struct xfs_inode_log_format;
Alex Elder1ed845d2012-08-01 09:56:49 -050065struct xfs_bmbt_irec;
Darrick J. Wong2c813ad2016-08-03 11:08:36 +100066struct xfs_btree_cur;
Darrick J. Wong1946b912016-10-03 09:11:18 -070067struct xfs_refcount_irec;
Darrick J. Wonge89c0412017-03-28 14:56:37 -070068struct xfs_fsmap;
69struct xfs_rmap_irec;
Dave Chinner0ad95682019-08-26 12:08:10 -070070struct xfs_icreate_log;
71struct xfs_owner_info;
72struct xfs_trans_res;
73struct xfs_inobt_rec_incore;
Darrick J. Wong60e3d702020-03-11 10:51:50 -070074union xfs_btree_ptr;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -070075struct xfs_dqtrx;
Darrick J. Wongb26b2bf2021-06-07 09:34:51 -070076struct xfs_icwalk;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000077
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080078#define XFS_ATTR_FILTER_FLAGS \
79 { XFS_ATTR_ROOT, "ROOT" }, \
Christoph Hellwig254f8002020-02-26 17:30:43 -080080 { XFS_ATTR_SECURE, "SECURE" }, \
81 { XFS_ATTR_INCOMPLETE, "INCOMPLETE" }
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080082
Christoph Hellwigea9a4882009-12-21 14:03:03 +000083DECLARE_EVENT_CLASS(xfs_attr_list_class,
84 TP_PROTO(struct xfs_attr_list_context *ctx),
85 TP_ARGS(ctx),
86 TP_STRUCT__entry(
87 __field(dev_t, dev)
88 __field(xfs_ino_t, ino)
89 __field(u32, hashval)
90 __field(u32, blkno)
91 __field(u32, offset)
Christoph Hellwiga9c8c692020-02-26 17:30:37 -080092 __field(void *, buffer)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000093 __field(int, bufsize)
94 __field(int, count)
95 __field(int, firstu)
96 __field(int, dupcnt)
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080097 __field(unsigned int, attr_filter)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000098 ),
99 TP_fast_assign(
100 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
101 __entry->ino = ctx->dp->i_ino;
Christoph Hellwige3a19cd2020-02-26 17:30:43 -0800102 __entry->hashval = ctx->cursor.hashval;
103 __entry->blkno = ctx->cursor.blkno;
104 __entry->offset = ctx->cursor.offset;
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800105 __entry->buffer = ctx->buffer;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000106 __entry->bufsize = ctx->bufsize;
107 __entry->count = ctx->count;
108 __entry->firstu = ctx->firstu;
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800109 __entry->attr_filter = ctx->attr_filter;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000110 ),
111 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800112 "buffer %p size %u count %u firstu %u filter %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000113 MAJOR(__entry->dev), MINOR(__entry->dev),
114 __entry->ino,
115 __entry->hashval,
116 __entry->blkno,
117 __entry->offset,
118 __entry->dupcnt,
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800119 __entry->buffer,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000120 __entry->bufsize,
121 __entry->count,
122 __entry->firstu,
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800123 __print_flags(__entry->attr_filter, "|",
124 XFS_ATTR_FILTER_FLAGS)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000125 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000126)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000127
128#define DEFINE_ATTR_LIST_EVENT(name) \
129DEFINE_EVENT(xfs_attr_list_class, name, \
130 TP_PROTO(struct xfs_attr_list_context *ctx), \
131 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000132DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
133DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
134DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
135DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
136DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
137DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
138DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
139DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +1100140DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
141DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000142
Darrick J. Wong63370322020-11-29 16:33:39 -0800143TRACE_EVENT(xlog_intent_recovery_failed,
144 TP_PROTO(struct xfs_mount *mp, int error, void *function),
145 TP_ARGS(mp, error, function),
146 TP_STRUCT__entry(
147 __field(dev_t, dev)
148 __field(int, error)
149 __field(void *, function)
150 ),
151 TP_fast_assign(
152 __entry->dev = mp->m_super->s_dev;
153 __entry->error = error;
154 __entry->function = function;
155 ),
156 TP_printk("dev %d:%d error %d function %pS",
157 MAJOR(__entry->dev), MINOR(__entry->dev),
158 __entry->error, __entry->function)
159);
160
Li Zefanf8adb4d2010-05-24 08:25:57 +0000161DECLARE_EVENT_CLASS(xfs_perag_class,
162 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
163 unsigned long caller_ip),
164 TP_ARGS(mp, agno, refcount, caller_ip),
165 TP_STRUCT__entry(
166 __field(dev_t, dev)
167 __field(xfs_agnumber_t, agno)
168 __field(int, refcount)
169 __field(unsigned long, caller_ip)
170 ),
171 TP_fast_assign(
172 __entry->dev = mp->m_super->s_dev;
173 __entry->agno = agno;
174 __entry->refcount = refcount;
175 __entry->caller_ip = caller_ip;
176 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -0700177 TP_printk("dev %d:%d agno 0x%x refcount %d caller %pS",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000178 MAJOR(__entry->dev), MINOR(__entry->dev),
179 __entry->agno,
180 __entry->refcount,
181 (char *)__entry->caller_ip)
182);
183
184#define DEFINE_PERAG_REF_EVENT(name) \
185DEFINE_EVENT(xfs_perag_class, name, \
186 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
187 unsigned long caller_ip), \
188 TP_ARGS(mp, agno, refcount, caller_ip))
189DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000190DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000191DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Darrick J. Wongc076ae72021-05-31 11:32:02 -0700192DEFINE_PERAG_REF_EVENT(xfs_perag_set_inode_tag);
193DEFINE_PERAG_REF_EVENT(xfs_perag_clear_inode_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000194
Darrick J. Wong40b1de0072021-08-06 11:05:43 -0700195TRACE_EVENT(xfs_inodegc_worker,
196 TP_PROTO(struct xfs_mount *mp, unsigned int shrinker_hits),
197 TP_ARGS(mp, shrinker_hits),
198 TP_STRUCT__entry(
199 __field(dev_t, dev)
200 __field(unsigned int, shrinker_hits)
201 ),
202 TP_fast_assign(
203 __entry->dev = mp->m_super->s_dev;
204 __entry->shrinker_hits = shrinker_hits;
205 ),
206 TP_printk("dev %d:%d shrinker_hits %u",
207 MAJOR(__entry->dev), MINOR(__entry->dev),
208 __entry->shrinker_hits)
209);
210
Dave Chinnerab23a772021-08-06 11:05:39 -0700211DECLARE_EVENT_CLASS(xfs_fs_class,
212 TP_PROTO(struct xfs_mount *mp, void *caller_ip),
213 TP_ARGS(mp, caller_ip),
214 TP_STRUCT__entry(
215 __field(dev_t, dev)
216 __field(unsigned long long, mflags)
217 __field(unsigned long, opstate)
218 __field(unsigned long, sbflags)
219 __field(void *, caller_ip)
220 ),
221 TP_fast_assign(
222 if (mp) {
223 __entry->dev = mp->m_super->s_dev;
Dave Chinner2e973b22021-08-18 18:46:52 -0700224 __entry->mflags = mp->m_features;
Dave Chinnerab23a772021-08-06 11:05:39 -0700225 __entry->opstate = mp->m_opstate;
226 __entry->sbflags = mp->m_super->s_flags;
227 }
228 __entry->caller_ip = caller_ip;
229 ),
Dave Chinner2e973b22021-08-18 18:46:52 -0700230 TP_printk("dev %d:%d m_features 0x%llx opstate (%s) s_flags 0x%lx caller %pS",
Dave Chinnerab23a772021-08-06 11:05:39 -0700231 MAJOR(__entry->dev), MINOR(__entry->dev),
232 __entry->mflags,
233 __print_flags(__entry->opstate, "|", XFS_OPSTATE_STRINGS),
234 __entry->sbflags,
235 __entry->caller_ip)
236);
237
238#define DEFINE_FS_EVENT(name) \
239DEFINE_EVENT(xfs_fs_class, name, \
240 TP_PROTO(struct xfs_mount *mp, void *caller_ip), \
241 TP_ARGS(mp, caller_ip))
242DEFINE_FS_EVENT(xfs_inodegc_flush);
243DEFINE_FS_EVENT(xfs_inodegc_start);
244DEFINE_FS_EVENT(xfs_inodegc_stop);
Dave Chinnerab23a772021-08-06 11:05:39 -0700245DEFINE_FS_EVENT(xfs_inodegc_queue);
246DEFINE_FS_EVENT(xfs_inodegc_throttle);
247DEFINE_FS_EVENT(xfs_fs_sync_fs);
Darrick J. Wong6f649092021-08-06 11:05:42 -0700248DEFINE_FS_EVENT(xfs_blockgc_start);
249DEFINE_FS_EVENT(xfs_blockgc_stop);
250DEFINE_FS_EVENT(xfs_blockgc_worker);
Darrick J. Wonge8d04c22021-08-06 11:05:42 -0700251DEFINE_FS_EVENT(xfs_blockgc_flush_all);
Dave Chinnerab23a772021-08-06 11:05:39 -0700252
Darrick J. Wong40b1de0072021-08-06 11:05:43 -0700253TRACE_EVENT(xfs_inodegc_shrinker_scan,
254 TP_PROTO(struct xfs_mount *mp, struct shrink_control *sc,
255 void *caller_ip),
256 TP_ARGS(mp, sc, caller_ip),
257 TP_STRUCT__entry(
258 __field(dev_t, dev)
259 __field(unsigned long, nr_to_scan)
260 __field(void *, caller_ip)
261 ),
262 TP_fast_assign(
263 __entry->dev = mp->m_super->s_dev;
264 __entry->nr_to_scan = sc->nr_to_scan;
265 __entry->caller_ip = caller_ip;
266 ),
267 TP_printk("dev %d:%d nr_to_scan %lu caller %pS",
268 MAJOR(__entry->dev), MINOR(__entry->dev),
269 __entry->nr_to_scan,
270 __entry->caller_ip)
271);
272
Dave Chinnerd1230312013-11-01 15:27:19 +1100273DECLARE_EVENT_CLASS(xfs_ag_class,
274 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
275 TP_ARGS(mp, agno),
276 TP_STRUCT__entry(
277 __field(dev_t, dev)
278 __field(xfs_agnumber_t, agno)
279 ),
280 TP_fast_assign(
281 __entry->dev = mp->m_super->s_dev;
282 __entry->agno = agno;
283 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -0700284 TP_printk("dev %d:%d agno 0x%x",
Dave Chinnerd1230312013-11-01 15:27:19 +1100285 MAJOR(__entry->dev), MINOR(__entry->dev),
286 __entry->agno)
287);
288#define DEFINE_AG_EVENT(name) \
289DEFINE_EVENT(xfs_ag_class, name, \
290 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
291 TP_ARGS(mp, agno))
292
293DEFINE_AG_EVENT(xfs_read_agf);
294DEFINE_AG_EVENT(xfs_alloc_read_agf);
295DEFINE_AG_EVENT(xfs_read_agi);
296DEFINE_AG_EVENT(xfs_ialloc_read_agi);
297
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000298TRACE_EVENT(xfs_attr_list_node_descend,
299 TP_PROTO(struct xfs_attr_list_context *ctx,
300 struct xfs_da_node_entry *btree),
301 TP_ARGS(ctx, btree),
302 TP_STRUCT__entry(
303 __field(dev_t, dev)
304 __field(xfs_ino_t, ino)
305 __field(u32, hashval)
306 __field(u32, blkno)
307 __field(u32, offset)
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800308 __field(void *, buffer)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000309 __field(int, bufsize)
310 __field(int, count)
311 __field(int, firstu)
312 __field(int, dupcnt)
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800313 __field(unsigned int, attr_filter)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000314 __field(u32, bt_hashval)
315 __field(u32, bt_before)
316 ),
317 TP_fast_assign(
318 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
319 __entry->ino = ctx->dp->i_ino;
Christoph Hellwige3a19cd2020-02-26 17:30:43 -0800320 __entry->hashval = ctx->cursor.hashval;
321 __entry->blkno = ctx->cursor.blkno;
322 __entry->offset = ctx->cursor.offset;
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800323 __entry->buffer = ctx->buffer;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000324 __entry->bufsize = ctx->bufsize;
325 __entry->count = ctx->count;
326 __entry->firstu = ctx->firstu;
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800327 __entry->attr_filter = ctx->attr_filter;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000328 __entry->bt_hashval = be32_to_cpu(btree->hashval);
329 __entry->bt_before = be32_to_cpu(btree->before);
330 ),
331 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800332 "buffer %p size %u count %u firstu %u filter %s "
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000333 "node hashval %u, node before %u",
334 MAJOR(__entry->dev), MINOR(__entry->dev),
335 __entry->ino,
336 __entry->hashval,
337 __entry->blkno,
338 __entry->offset,
339 __entry->dupcnt,
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800340 __entry->buffer,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000341 __entry->bufsize,
342 __entry->count,
343 __entry->firstu,
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800344 __print_flags(__entry->attr_filter, "|",
345 XFS_ATTR_FILTER_FLAGS),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000346 __entry->bt_hashval,
347 __entry->bt_before)
348);
349
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000350DECLARE_EVENT_CLASS(xfs_bmap_class,
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700351 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000352 unsigned long caller_ip),
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700353 TP_ARGS(ip, cur, state, caller_ip),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000354 TP_STRUCT__entry(
355 __field(dev_t, dev)
356 __field(xfs_ino_t, ino)
Peter Zijlstra04ae87a2019-10-24 22:26:59 +0200357 __field(void *, leaf)
358 __field(int, pos)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000359 __field(xfs_fileoff_t, startoff)
360 __field(xfs_fsblock_t, startblock)
361 __field(xfs_filblks_t, blockcount)
362 __field(xfs_exntst_t, state)
363 __field(int, bmap_state)
364 __field(unsigned long, caller_ip)
365 ),
366 TP_fast_assign(
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700367 struct xfs_ifork *ifp;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000368 struct xfs_bmbt_irec r;
369
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700370 ifp = xfs_iext_state_to_fork(ip, state);
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700371 xfs_iext_get_extent(ifp, cur, &r);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000372 __entry->dev = VFS_I(ip)->i_sb->s_dev;
373 __entry->ino = ip->i_ino;
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700374 __entry->leaf = cur->leaf;
375 __entry->pos = cur->pos;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000376 __entry->startoff = r.br_startoff;
377 __entry->startblock = r.br_startblock;
378 __entry->blockcount = r.br_blockcount;
379 __entry->state = r.br_state;
380 __entry->bmap_state = state;
381 __entry->caller_ip = caller_ip;
382 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -0800383 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
Darrick J. Wongd538cf22021-08-17 13:00:13 -0700384 "fileoff 0x%llx startblock 0x%llx fsbcount 0x%llx flag %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000385 MAJOR(__entry->dev), MINOR(__entry->dev),
386 __entry->ino,
387 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700388 __entry->leaf,
389 __entry->pos,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000390 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -0700391 (int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000392 __entry->blockcount,
393 __entry->state,
394 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000395)
396
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000397#define DEFINE_BMAP_EVENT(name) \
398DEFINE_EVENT(xfs_bmap_class, name, \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700399 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000400 unsigned long caller_ip), \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700401 TP_ARGS(ip, cur, state, caller_ip))
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700402DEFINE_BMAP_EVENT(xfs_iext_insert);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000403DEFINE_BMAP_EVENT(xfs_iext_remove);
404DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
405DEFINE_BMAP_EVENT(xfs_bmap_post_update);
Christoph Hellwige8e0e172017-10-19 11:06:29 -0700406DEFINE_BMAP_EVENT(xfs_read_extent);
407DEFINE_BMAP_EVENT(xfs_write_extent);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000408
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000409DECLARE_EVENT_CLASS(xfs_buf_class,
410 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
411 TP_ARGS(bp, caller_ip),
412 TP_STRUCT__entry(
413 __field(dev_t, dev)
414 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000415 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000416 __field(int, hold)
417 __field(int, pincount)
418 __field(unsigned, lockval)
419 __field(unsigned, flags)
420 __field(unsigned long, caller_ip)
421 ),
422 TP_fast_assign(
423 __entry->dev = bp->b_target->bt_dev;
Dave Chinner9343ee72021-08-18 18:47:05 -0700424 __entry->bno = xfs_buf_daddr(bp);
Dave Chinner4e94b712012-04-23 15:58:51 +1000425 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000426 __entry->hold = atomic_read(&bp->b_hold);
427 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200428 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000429 __entry->flags = bp->b_flags;
430 __entry->caller_ip = caller_ip;
431 ),
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700432 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800433 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000434 MAJOR(__entry->dev), MINOR(__entry->dev),
435 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000436 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000437 __entry->hold,
438 __entry->pincount,
439 __entry->lockval,
440 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
441 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000442)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000443
444#define DEFINE_BUF_EVENT(name) \
445DEFINE_EVENT(xfs_buf_class, name, \
446 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
447 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000448DEFINE_BUF_EVENT(xfs_buf_init);
449DEFINE_BUF_EVENT(xfs_buf_free);
450DEFINE_BUF_EVENT(xfs_buf_hold);
451DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000452DEFINE_BUF_EVENT(xfs_buf_iodone);
Dave Chinner595bff72014-10-02 09:05:14 +1000453DEFINE_BUF_EVENT(xfs_buf_submit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000454DEFINE_BUF_EVENT(xfs_buf_lock);
455DEFINE_BUF_EVENT(xfs_buf_lock_done);
Darrick J. Wong479c6412016-06-21 11:53:28 +1000456DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200457DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000458DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000459DEFINE_BUF_EVENT(xfs_buf_iowait);
460DEFINE_BUF_EVENT(xfs_buf_iowait_done);
461DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000462DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000463DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Brian Foster7912e7f2017-06-14 21:21:45 -0700464DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
Dave Chinner686865f2010-09-24 20:07:47 +1000465DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000466DEFINE_BUF_EVENT(xfs_buf_item_relse);
Christoph Hellwig664ffb82020-09-01 10:55:29 -0700467DEFINE_BUF_EVENT(xfs_buf_iodone_async);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000468DEFINE_BUF_EVENT(xfs_buf_error_relse);
Brian Foster10fb9ac2021-01-22 16:48:19 -0800469DEFINE_BUF_EVENT(xfs_buf_drain_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000470DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
471
472/* not really buffer traces, but the buf provides useful information */
473DEFINE_BUF_EVENT(xfs_btree_corrupt);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000474DEFINE_BUF_EVENT(xfs_reset_dqcounts);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000475
476/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000477DECLARE_EVENT_CLASS(xfs_buf_flags_class,
478 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
479 TP_ARGS(bp, flags, caller_ip),
480 TP_STRUCT__entry(
481 __field(dev_t, dev)
482 __field(xfs_daddr_t, bno)
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700483 __field(unsigned int, length)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000484 __field(int, hold)
485 __field(int, pincount)
486 __field(unsigned, lockval)
487 __field(unsigned, flags)
488 __field(unsigned long, caller_ip)
489 ),
490 TP_fast_assign(
491 __entry->dev = bp->b_target->bt_dev;
Dave Chinner9343ee72021-08-18 18:47:05 -0700492 __entry->bno = xfs_buf_daddr(bp);
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700493 __entry->length = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000494 __entry->flags = flags;
495 __entry->hold = atomic_read(&bp->b_hold);
496 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200497 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000498 __entry->caller_ip = caller_ip;
499 ),
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700500 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800501 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000502 MAJOR(__entry->dev), MINOR(__entry->dev),
503 (unsigned long long)__entry->bno,
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700504 __entry->length,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000505 __entry->hold,
506 __entry->pincount,
507 __entry->lockval,
508 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
509 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000510)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000511
512#define DEFINE_BUF_FLAGS_EVENT(name) \
513DEFINE_EVENT(xfs_buf_flags_class, name, \
514 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
515 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000516DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
517DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
518DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
519
520TRACE_EVENT(xfs_buf_ioerror,
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800521 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000522 TP_ARGS(bp, error, caller_ip),
523 TP_STRUCT__entry(
524 __field(dev_t, dev)
525 __field(xfs_daddr_t, bno)
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700526 __field(unsigned int, length)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000527 __field(unsigned, flags)
528 __field(int, hold)
529 __field(int, pincount)
530 __field(unsigned, lockval)
531 __field(int, error)
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800532 __field(xfs_failaddr_t, caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000533 ),
534 TP_fast_assign(
535 __entry->dev = bp->b_target->bt_dev;
Dave Chinner9343ee72021-08-18 18:47:05 -0700536 __entry->bno = xfs_buf_daddr(bp);
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700537 __entry->length = bp->b_length;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000538 __entry->hold = atomic_read(&bp->b_hold);
539 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200540 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000541 __entry->error = error;
542 __entry->flags = bp->b_flags;
543 __entry->caller_ip = caller_ip;
544 ),
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700545 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800546 "lock %d error %d flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000547 MAJOR(__entry->dev), MINOR(__entry->dev),
548 (unsigned long long)__entry->bno,
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700549 __entry->length,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000550 __entry->hold,
551 __entry->pincount,
552 __entry->lockval,
553 __entry->error,
554 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
555 (void *)__entry->caller_ip)
556);
557
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000558DECLARE_EVENT_CLASS(xfs_buf_item_class,
559 TP_PROTO(struct xfs_buf_log_item *bip),
560 TP_ARGS(bip),
561 TP_STRUCT__entry(
562 __field(dev_t, dev)
563 __field(xfs_daddr_t, buf_bno)
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700564 __field(unsigned int, buf_len)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000565 __field(int, buf_hold)
566 __field(int, buf_pincount)
567 __field(int, buf_lockval)
568 __field(unsigned, buf_flags)
569 __field(unsigned, bli_recur)
570 __field(int, bli_refcount)
571 __field(unsigned, bli_flags)
Dave Chinner22525c12018-05-09 07:47:34 -0700572 __field(unsigned long, li_flags)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000573 ),
574 TP_fast_assign(
575 __entry->dev = bip->bli_buf->b_target->bt_dev;
576 __entry->bli_flags = bip->bli_flags;
577 __entry->bli_recur = bip->bli_recur;
578 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
Dave Chinner9343ee72021-08-18 18:47:05 -0700579 __entry->buf_bno = xfs_buf_daddr(bip->bli_buf);
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700580 __entry->buf_len = bip->bli_buf->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000581 __entry->buf_flags = bip->bli_buf->b_flags;
582 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
583 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200584 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000585 __entry->li_flags = bip->bli_item.li_flags;
586 ),
Darrick J. Wong7eac3022021-08-17 13:15:53 -0700587 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000588 "lock %d flags %s recur %d refcount %d bliflags %s "
Dave Chinnere6631f82018-05-09 07:49:37 -0700589 "liflags %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000590 MAJOR(__entry->dev), MINOR(__entry->dev),
591 (unsigned long long)__entry->buf_bno,
592 __entry->buf_len,
593 __entry->buf_hold,
594 __entry->buf_pincount,
595 __entry->buf_lockval,
596 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
597 __entry->bli_recur,
598 __entry->bli_refcount,
599 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000600 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000601)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000602
603#define DEFINE_BUF_ITEM_EVENT(name) \
604DEFINE_EVENT(xfs_buf_item_class, name, \
605 TP_PROTO(struct xfs_buf_log_item *bip), \
606 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000607DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000608DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000609DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
610DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
611DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000612DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000613DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
614DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
615DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwigddf92052019-06-28 19:27:32 -0700616DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000617DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
618DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
619DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
620DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
621DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
622DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
623DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
624DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
625DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
626DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
627DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
628DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
629DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
630DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
631
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000632DECLARE_EVENT_CLASS(xfs_filestream_class,
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700633 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno),
634 TP_ARGS(mp, ino, agno),
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000635 TP_STRUCT__entry(
636 __field(dev_t, dev)
637 __field(xfs_ino_t, ino)
638 __field(xfs_agnumber_t, agno)
639 __field(int, streams)
640 ),
641 TP_fast_assign(
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700642 __entry->dev = mp->m_super->s_dev;
643 __entry->ino = ino;
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000644 __entry->agno = agno;
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700645 __entry->streams = xfs_filestream_peek_ag(mp, agno);
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000646 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -0700647 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d",
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000648 MAJOR(__entry->dev), MINOR(__entry->dev),
649 __entry->ino,
650 __entry->agno,
651 __entry->streams)
652)
653#define DEFINE_FILESTREAM_EVENT(name) \
654DEFINE_EVENT(xfs_filestream_class, name, \
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700655 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \
656 TP_ARGS(mp, ino, agno))
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000657DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
658DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
659DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
660
661TRACE_EVENT(xfs_filestream_pick,
662 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
663 xfs_extlen_t free, int nscan),
664 TP_ARGS(ip, agno, free, nscan),
665 TP_STRUCT__entry(
666 __field(dev_t, dev)
667 __field(xfs_ino_t, ino)
668 __field(xfs_agnumber_t, agno)
669 __field(int, streams)
670 __field(xfs_extlen_t, free)
671 __field(int, nscan)
672 ),
673 TP_fast_assign(
674 __entry->dev = VFS_I(ip)->i_sb->s_dev;
675 __entry->ino = ip->i_ino;
676 __entry->agno = agno;
677 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
678 __entry->free = free;
679 __entry->nscan = nscan;
680 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -0700681 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d nscan %d",
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000682 MAJOR(__entry->dev), MINOR(__entry->dev),
683 __entry->ino,
684 __entry->agno,
685 __entry->streams,
686 __entry->free,
687 __entry->nscan)
688);
689
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000690DECLARE_EVENT_CLASS(xfs_lock_class,
691 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
692 unsigned long caller_ip),
693 TP_ARGS(ip, lock_flags, caller_ip),
694 TP_STRUCT__entry(
695 __field(dev_t, dev)
696 __field(xfs_ino_t, ino)
697 __field(int, lock_flags)
698 __field(unsigned long, caller_ip)
699 ),
700 TP_fast_assign(
701 __entry->dev = VFS_I(ip)->i_sb->s_dev;
702 __entry->ino = ip->i_ino;
703 __entry->lock_flags = lock_flags;
704 __entry->caller_ip = caller_ip;
705 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800706 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000707 MAJOR(__entry->dev), MINOR(__entry->dev),
708 __entry->ino,
709 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
710 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000711)
712
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000713#define DEFINE_LOCK_EVENT(name) \
714DEFINE_EVENT(xfs_lock_class, name, \
715 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
716 unsigned long caller_ip), \
717 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000718DEFINE_LOCK_EVENT(xfs_ilock);
719DEFINE_LOCK_EVENT(xfs_ilock_nowait);
720DEFINE_LOCK_EVENT(xfs_ilock_demote);
721DEFINE_LOCK_EVENT(xfs_iunlock);
722
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000723DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000724 TP_PROTO(struct xfs_inode *ip),
725 TP_ARGS(ip),
726 TP_STRUCT__entry(
727 __field(dev_t, dev)
728 __field(xfs_ino_t, ino)
Dave Chinnerab23a772021-08-06 11:05:39 -0700729 __field(unsigned long, iflags)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000730 ),
731 TP_fast_assign(
732 __entry->dev = VFS_I(ip)->i_sb->s_dev;
733 __entry->ino = ip->i_ino;
Dave Chinnerab23a772021-08-06 11:05:39 -0700734 __entry->iflags = ip->i_flags;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000735 ),
Dave Chinnerab23a772021-08-06 11:05:39 -0700736 TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000737 MAJOR(__entry->dev), MINOR(__entry->dev),
Dave Chinnerab23a772021-08-06 11:05:39 -0700738 __entry->ino,
739 __entry->iflags)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000740)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000741
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000742#define DEFINE_INODE_EVENT(name) \
743DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000744 TP_PROTO(struct xfs_inode *ip), \
745 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000746DEFINE_INODE_EVENT(xfs_iget_skip);
Darrick J. Wongff7bebe2021-06-18 11:57:05 -0700747DEFINE_INODE_EVENT(xfs_iget_recycle);
748DEFINE_INODE_EVENT(xfs_iget_recycle_fail);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000749DEFINE_INODE_EVENT(xfs_iget_hit);
750DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000751
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000752DEFINE_INODE_EVENT(xfs_getattr);
753DEFINE_INODE_EVENT(xfs_setattr);
754DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500755DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000756DEFINE_INODE_EVENT(xfs_alloc_file_space);
757DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000758DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100759DEFINE_INODE_EVENT(xfs_collapse_file_space);
Namjae Jeona904b1c2015-03-25 15:08:56 +1100760DEFINE_INODE_EVENT(xfs_insert_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000761DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000762#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200763DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000764#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000765DEFINE_INODE_EVENT(xfs_vm_bmap);
766DEFINE_INODE_EVENT(xfs_file_ioctl);
767DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
768DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000769DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000770DEFINE_INODE_EVENT(xfs_file_fsync);
771DEFINE_INODE_EVENT(xfs_destroy_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400772DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000773
774DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
775DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
776
Brian Foster27b52862012-11-06 09:50:38 -0500777DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
778DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500779DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700780DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
781DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
782DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
Dave Chinnerab23a772021-08-06 11:05:39 -0700783DEFINE_INODE_EVENT(xfs_inode_set_reclaimable);
784DEFINE_INODE_EVENT(xfs_inode_reclaiming);
785DEFINE_INODE_EVENT(xfs_inode_set_need_inactive);
786DEFINE_INODE_EVENT(xfs_inode_inactivating);
Brian Foster27b52862012-11-06 09:50:38 -0500787
Darrick J. Wong85f8dff2018-12-18 14:32:29 -0800788/*
789 * ftrace's __print_symbolic requires that all enum values be wrapped in the
790 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
791 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
792 * code.
793 */
794TRACE_DEFINE_ENUM(PE_SIZE_PTE);
795TRACE_DEFINE_ENUM(PE_SIZE_PMD);
796TRACE_DEFINE_ENUM(PE_SIZE_PUD);
797
Christoph Hellwigd522d562017-08-29 10:08:41 -0700798TRACE_EVENT(xfs_filemap_fault,
799 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
800 bool write_fault),
801 TP_ARGS(ip, pe_size, write_fault),
802 TP_STRUCT__entry(
803 __field(dev_t, dev)
804 __field(xfs_ino_t, ino)
805 __field(enum page_entry_size, pe_size)
806 __field(bool, write_fault)
807 ),
808 TP_fast_assign(
809 __entry->dev = VFS_I(ip)->i_sb->s_dev;
810 __entry->ino = ip->i_ino;
811 __entry->pe_size = pe_size;
812 __entry->write_fault = write_fault;
813 ),
814 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
815 MAJOR(__entry->dev), MINOR(__entry->dev),
816 __entry->ino,
817 __print_symbolic(__entry->pe_size,
818 { PE_SIZE_PTE, "PTE" },
819 { PE_SIZE_PMD, "PMD" },
820 { PE_SIZE_PUD, "PUD" }),
821 __entry->write_fault)
822)
823
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000824DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000825 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
826 TP_ARGS(ip, caller_ip),
827 TP_STRUCT__entry(
828 __field(dev_t, dev)
829 __field(xfs_ino_t, ino)
830 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100831 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000832 __field(unsigned long, caller_ip)
833 ),
834 TP_fast_assign(
835 __entry->dev = VFS_I(ip)->i_sb->s_dev;
836 __entry->ino = ip->i_ino;
837 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100838 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000839 __entry->caller_ip = caller_ip;
840 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800841 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000842 MAJOR(__entry->dev), MINOR(__entry->dev),
843 __entry->ino,
844 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100845 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000846 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000847)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000848
Brian Foster19cb7e32013-03-18 10:51:48 -0400849TRACE_EVENT(xfs_iomap_prealloc_size,
850 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
851 unsigned int writeio_blocks),
852 TP_ARGS(ip, blocks, shift, writeio_blocks),
853 TP_STRUCT__entry(
854 __field(dev_t, dev)
855 __field(xfs_ino_t, ino)
856 __field(xfs_fsblock_t, blocks)
857 __field(int, shift)
858 __field(unsigned int, writeio_blocks)
859 ),
860 TP_fast_assign(
861 __entry->dev = VFS_I(ip)->i_sb->s_dev;
862 __entry->ino = ip->i_ino;
863 __entry->blocks = blocks;
864 __entry->shift = shift;
865 __entry->writeio_blocks = writeio_blocks;
866 ),
867 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
Christoph Hellwig5da8a072019-10-28 08:41:44 -0700868 "m_allocsize_blocks %u",
Brian Foster19cb7e32013-03-18 10:51:48 -0400869 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
870 __entry->blocks, __entry->shift, __entry->writeio_blocks)
871)
872
Brian Foster56d11152015-05-29 09:18:32 +1000873TRACE_EVENT(xfs_irec_merge_pre,
874 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
875 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
876 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
877 TP_STRUCT__entry(
878 __field(dev_t, dev)
879 __field(xfs_agnumber_t, agno)
880 __field(xfs_agino_t, agino)
881 __field(uint16_t, holemask)
882 __field(xfs_agino_t, nagino)
883 __field(uint16_t, nholemask)
884 ),
885 TP_fast_assign(
886 __entry->dev = mp->m_super->s_dev;
887 __entry->agno = agno;
888 __entry->agino = agino;
889 __entry->holemask = holemask;
890 __entry->nagino = nagino;
891 __entry->nholemask = holemask;
892 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -0700893 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x",
Darrick J. Wongaf6265a2021-08-17 09:20:27 -0700894 MAJOR(__entry->dev), MINOR(__entry->dev),
895 __entry->agno,
896 __entry->agino,
897 __entry->holemask,
898 __entry->nagino,
Brian Foster56d11152015-05-29 09:18:32 +1000899 __entry->nholemask)
900)
901
902TRACE_EVENT(xfs_irec_merge_post,
903 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
904 uint16_t holemask),
905 TP_ARGS(mp, agno, agino, holemask),
906 TP_STRUCT__entry(
907 __field(dev_t, dev)
908 __field(xfs_agnumber_t, agno)
909 __field(xfs_agino_t, agino)
910 __field(uint16_t, holemask)
911 ),
912 TP_fast_assign(
913 __entry->dev = mp->m_super->s_dev;
914 __entry->agno = agno;
915 __entry->agino = agino;
916 __entry->holemask = holemask;
917 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -0700918 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x",
Darrick J. Wongaf6265a2021-08-17 09:20:27 -0700919 MAJOR(__entry->dev),
920 MINOR(__entry->dev),
921 __entry->agno,
922 __entry->agino,
Brian Foster56d11152015-05-29 09:18:32 +1000923 __entry->holemask)
924)
925
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000926#define DEFINE_IREF_EVENT(name) \
927DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000928 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
929 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000930DEFINE_IREF_EVENT(xfs_irele);
931DEFINE_IREF_EVENT(xfs_inode_pin);
932DEFINE_IREF_EVENT(xfs_inode_unpin);
933DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100934
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000935DECLARE_EVENT_CLASS(xfs_namespace_class,
936 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
937 TP_ARGS(dp, name),
938 TP_STRUCT__entry(
939 __field(dev_t, dev)
940 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000941 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000942 __dynamic_array(char, name, name->len)
943 ),
944 TP_fast_assign(
945 __entry->dev = VFS_I(dp)->i_sb->s_dev;
946 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000947 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000948 memcpy(__get_str(name), name->name, name->len);
949 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000950 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000951 MAJOR(__entry->dev), MINOR(__entry->dev),
952 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000953 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000954 __get_str(name))
955)
956
957#define DEFINE_NAMESPACE_EVENT(name) \
958DEFINE_EVENT(xfs_namespace_class, name, \
959 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
960 TP_ARGS(dp, name))
961DEFINE_NAMESPACE_EVENT(xfs_remove);
962DEFINE_NAMESPACE_EVENT(xfs_link);
963DEFINE_NAMESPACE_EVENT(xfs_lookup);
964DEFINE_NAMESPACE_EVENT(xfs_create);
965DEFINE_NAMESPACE_EVENT(xfs_symlink);
966
967TRACE_EVENT(xfs_rename,
968 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
969 struct xfs_name *src_name, struct xfs_name *target_name),
970 TP_ARGS(src_dp, target_dp, src_name, target_name),
971 TP_STRUCT__entry(
972 __field(dev_t, dev)
973 __field(xfs_ino_t, src_dp_ino)
974 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000975 __field(int, src_namelen)
976 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000977 __dynamic_array(char, src_name, src_name->len)
978 __dynamic_array(char, target_name, target_name->len)
979 ),
980 TP_fast_assign(
981 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
982 __entry->src_dp_ino = src_dp->i_ino;
983 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000984 __entry->src_namelen = src_name->len;
985 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000986 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000987 memcpy(__get_str(target_name), target_name->name,
988 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000989 ),
990 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000991 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000992 MAJOR(__entry->dev), MINOR(__entry->dev),
993 __entry->src_dp_ino,
994 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000995 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000996 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000997 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000998 __get_str(target_name))
999)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001000
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001001DECLARE_EVENT_CLASS(xfs_dquot_class,
1002 TP_PROTO(struct xfs_dquot *dqp),
1003 TP_ARGS(dqp),
1004 TP_STRUCT__entry(
1005 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +00001006 __field(u32, id)
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001007 __field(xfs_dqtype_t, type)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001008 __field(unsigned, flags)
1009 __field(unsigned, nrefs)
1010 __field(unsigned long long, res_bcount)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001011 __field(unsigned long long, res_rtbcount)
1012 __field(unsigned long long, res_icount)
1013
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001014 __field(unsigned long long, bcount)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001015 __field(unsigned long long, rtbcount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001016 __field(unsigned long long, icount)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001017
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001018 __field(unsigned long long, blk_hardlimit)
1019 __field(unsigned long long, blk_softlimit)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001020 __field(unsigned long long, rtb_hardlimit)
1021 __field(unsigned long long, rtb_softlimit)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001022 __field(unsigned long long, ino_hardlimit)
1023 __field(unsigned long long, ino_softlimit)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001024 ),
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001025 TP_fast_assign(
1026 __entry->dev = dqp->q_mount->m_super->s_dev;
Darrick J. Wongc51df732020-07-14 10:37:30 -07001027 __entry->id = dqp->q_id;
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001028 __entry->type = dqp->q_type;
1029 __entry->flags = dqp->q_flags;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001030 __entry->nrefs = dqp->q_nrefs;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001031
Darrick J. Wong784e80f2020-07-14 10:37:30 -07001032 __entry->res_bcount = dqp->q_blk.reserved;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001033 __entry->res_rtbcount = dqp->q_rtb.reserved;
1034 __entry->res_icount = dqp->q_ino.reserved;
1035
Darrick J. Wongbe37d402020-07-14 10:37:31 -07001036 __entry->bcount = dqp->q_blk.count;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001037 __entry->rtbcount = dqp->q_rtb.count;
Darrick J. Wongbe37d402020-07-14 10:37:31 -07001038 __entry->icount = dqp->q_ino.count;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001039
Darrick J. Wongd3537cf2020-07-14 10:37:31 -07001040 __entry->blk_hardlimit = dqp->q_blk.hardlimit;
1041 __entry->blk_softlimit = dqp->q_blk.softlimit;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001042 __entry->rtb_hardlimit = dqp->q_rtb.hardlimit;
1043 __entry->rtb_softlimit = dqp->q_rtb.softlimit;
Darrick J. Wongd3537cf2020-07-14 10:37:31 -07001044 __entry->ino_hardlimit = dqp->q_ino.hardlimit;
1045 __entry->ino_softlimit = dqp->q_ino.softlimit;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001046 ),
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001047 TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u "
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001048 "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +00001049 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001050 "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +00001051 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001052 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +00001053 __entry->id,
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001054 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
Darrick J. Wong985a78f2020-07-14 10:37:13 -07001055 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001056 __entry->nrefs,
1057 __entry->res_bcount,
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001058 __entry->res_rtbcount,
1059 __entry->res_icount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001060 __entry->bcount,
1061 __entry->blk_hardlimit,
1062 __entry->blk_softlimit,
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001063 __entry->rtbcount,
1064 __entry->rtb_hardlimit,
1065 __entry->rtb_softlimit,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001066 __entry->icount,
1067 __entry->ino_hardlimit,
1068 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001069)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001070
1071#define DEFINE_DQUOT_EVENT(name) \
1072DEFINE_EVENT(xfs_dquot_class, name, \
1073 TP_PROTO(struct xfs_dquot *dqp), \
1074 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001075DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001076DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
1077DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +00001078DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
1079DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001080DEFINE_DQUOT_EVENT(xfs_dqattach_found);
1081DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001082DEFINE_DQUOT_EVENT(xfs_dqalloc);
1083DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
1084DEFINE_DQUOT_EVENT(xfs_dqread);
1085DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001086DEFINE_DQUOT_EVENT(xfs_dqget_hit);
1087DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +00001088DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
1089DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001090DEFINE_DQUOT_EVENT(xfs_dqput);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001091DEFINE_DQUOT_EVENT(xfs_dqput_free);
1092DEFINE_DQUOT_EVENT(xfs_dqrele);
1093DEFINE_DQUOT_EVENT(xfs_dqflush);
1094DEFINE_DQUOT_EVENT(xfs_dqflush_force);
1095DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001096DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
1097DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
1098
1099#define XFS_QMOPT_FLAGS \
1100 { XFS_QMOPT_UQUOTA, "UQUOTA" }, \
1101 { XFS_QMOPT_PQUOTA, "PQUOTA" }, \
1102 { XFS_QMOPT_FORCE_RES, "FORCE_RES" }, \
1103 { XFS_QMOPT_SBVERSION, "SBVERSION" }, \
1104 { XFS_QMOPT_GQUOTA, "GQUOTA" }, \
1105 { XFS_QMOPT_INHERIT, "INHERIT" }, \
1106 { XFS_QMOPT_RES_REGBLKS, "RES_REGBLKS" }, \
1107 { XFS_QMOPT_RES_RTBLKS, "RES_RTBLKS" }, \
1108 { XFS_QMOPT_BCOUNT, "BCOUNT" }, \
1109 { XFS_QMOPT_ICOUNT, "ICOUNT" }, \
1110 { XFS_QMOPT_RTBCOUNT, "RTBCOUNT" }, \
1111 { XFS_QMOPT_DELBCOUNT, "DELBCOUNT" }, \
1112 { XFS_QMOPT_DELRTBCOUNT, "DELRTBCOUNT" }, \
1113 { XFS_QMOPT_RES_INOS, "RES_INOS" }
1114
1115TRACE_EVENT(xfs_trans_mod_dquot,
1116 TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
1117 unsigned int field, int64_t delta),
1118 TP_ARGS(tp, dqp, field, delta),
1119 TP_STRUCT__entry(
1120 __field(dev_t, dev)
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001121 __field(xfs_dqtype_t, type)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001122 __field(unsigned int, flags)
1123 __field(unsigned int, dqid)
1124 __field(unsigned int, field)
1125 __field(int64_t, delta)
1126 ),
1127 TP_fast_assign(
1128 __entry->dev = tp->t_mountp->m_super->s_dev;
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001129 __entry->type = dqp->q_type;
1130 __entry->flags = dqp->q_flags;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001131 __entry->dqid = dqp->q_id;
1132 __entry->field = field;
1133 __entry->delta = delta;
1134 ),
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001135 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s field %s delta %lld",
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001136 MAJOR(__entry->dev), MINOR(__entry->dev),
1137 __entry->dqid,
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001138 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001139 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1140 __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS),
1141 __entry->delta)
1142);
1143
1144DECLARE_EVENT_CLASS(xfs_dqtrx_class,
1145 TP_PROTO(struct xfs_dqtrx *qtrx),
1146 TP_ARGS(qtrx),
1147 TP_STRUCT__entry(
1148 __field(dev_t, dev)
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001149 __field(xfs_dqtype_t, type)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001150 __field(unsigned int, flags)
1151 __field(u32, dqid)
1152
1153 __field(uint64_t, blk_res)
1154 __field(int64_t, bcount_delta)
1155 __field(int64_t, delbcnt_delta)
1156
1157 __field(uint64_t, rtblk_res)
1158 __field(uint64_t, rtblk_res_used)
1159 __field(int64_t, rtbcount_delta)
1160 __field(int64_t, delrtb_delta)
1161
1162 __field(uint64_t, ino_res)
1163 __field(uint64_t, ino_res_used)
1164 __field(int64_t, icount_delta)
1165 ),
1166 TP_fast_assign(
1167 __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev;
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001168 __entry->type = qtrx->qt_dquot->q_type;
1169 __entry->flags = qtrx->qt_dquot->q_flags;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001170 __entry->dqid = qtrx->qt_dquot->q_id;
1171
1172 __entry->blk_res = qtrx->qt_blk_res;
1173 __entry->bcount_delta = qtrx->qt_bcount_delta;
1174 __entry->delbcnt_delta = qtrx->qt_delbcnt_delta;
1175
1176 __entry->rtblk_res = qtrx->qt_rtblk_res;
1177 __entry->rtblk_res_used = qtrx->qt_rtblk_res_used;
1178 __entry->rtbcount_delta = qtrx->qt_rtbcount_delta;
1179 __entry->delrtb_delta = qtrx->qt_delrtb_delta;
1180
1181 __entry->ino_res = qtrx->qt_ino_res;
1182 __entry->ino_res_used = qtrx->qt_ino_res_used;
1183 __entry->icount_delta = qtrx->qt_icount_delta;
1184 ),
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001185 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s"
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001186 "blk_res %llu bcount_delta %lld delbcnt_delta %lld "
1187 "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld "
1188 "ino_res %llu ino_res_used %llu icount_delta %lld",
1189 MAJOR(__entry->dev), MINOR(__entry->dev),
1190 __entry->dqid,
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001191 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001192 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1193
1194 __entry->blk_res,
1195 __entry->bcount_delta,
1196 __entry->delbcnt_delta,
1197
1198 __entry->rtblk_res,
1199 __entry->rtblk_res_used,
1200 __entry->rtbcount_delta,
1201 __entry->delrtb_delta,
1202
1203 __entry->ino_res,
1204 __entry->ino_res_used,
1205 __entry->icount_delta)
1206)
1207
1208#define DEFINE_DQTRX_EVENT(name) \
1209DEFINE_EVENT(xfs_dqtrx_class, name, \
1210 TP_PROTO(struct xfs_dqtrx *qtrx), \
1211 TP_ARGS(qtrx))
1212DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas);
1213DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before);
1214DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001215
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001216DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001217 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001218 TP_ARGS(log, tic),
1219 TP_STRUCT__entry(
1220 __field(dev_t, dev)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001221 __field(char, ocnt)
1222 __field(char, cnt)
1223 __field(int, curr_res)
1224 __field(int, unit_res)
1225 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +11001226 __field(int, reserveq)
1227 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001228 __field(int, grant_reserve_cycle)
1229 __field(int, grant_reserve_bytes)
1230 __field(int, grant_write_cycle)
1231 __field(int, grant_write_bytes)
1232 __field(int, curr_cycle)
1233 __field(int, curr_block)
1234 __field(xfs_lsn_t, tail_lsn)
1235 ),
1236 TP_fast_assign(
1237 __entry->dev = log->l_mp->m_super->s_dev;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001238 __entry->ocnt = tic->t_ocnt;
1239 __entry->cnt = tic->t_cnt;
1240 __entry->curr_res = tic->t_curr_res;
1241 __entry->unit_res = tic->t_unit_res;
1242 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +00001243 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
1244 __entry->writeq = list_empty(&log->l_write_head.waiters);
1245 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +11001246 &__entry->grant_reserve_cycle,
1247 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +00001248 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +11001249 &__entry->grant_write_cycle,
1250 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001251 __entry->curr_cycle = log->l_curr_cycle;
1252 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +11001253 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001254 ),
Christoph Hellwig710b1e22016-04-06 09:20:36 +10001255 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +11001256 "t_unit_res %u t_flags %s reserveq %s "
1257 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001258 "grant_reserve_bytes %d grant_write_cycle %d "
1259 "grant_write_bytes %d curr_cycle %d curr_block %d "
1260 "tail_cycle %d tail_block %d",
1261 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001262 __entry->ocnt,
1263 __entry->cnt,
1264 __entry->curr_res,
1265 __entry->unit_res,
1266 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +11001267 __entry->reserveq ? "empty" : "active",
1268 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001269 __entry->grant_reserve_cycle,
1270 __entry->grant_reserve_bytes,
1271 __entry->grant_write_cycle,
1272 __entry->grant_write_bytes,
1273 __entry->curr_cycle,
1274 __entry->curr_block,
1275 CYCLE_LSN(__entry->tail_lsn),
1276 BLOCK_LSN(__entry->tail_lsn)
1277 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001278)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001279
1280#define DEFINE_LOGGRANT_EVENT(name) \
1281DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001282 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001283 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001284DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +00001285DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1286DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +11001287DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +00001288DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1289DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1290DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1291DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig8b41e3f2020-03-25 18:18:23 -07001292DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant);
1293DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit);
1294DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub);
1295DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant);
1296DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub);
1297DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit);
Dave Chinner0e7ab7e2020-03-24 20:10:27 -07001298DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001299
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001300DECLARE_EVENT_CLASS(xfs_log_item_class,
1301 TP_PROTO(struct xfs_log_item *lip),
1302 TP_ARGS(lip),
1303 TP_STRUCT__entry(
1304 __field(dev_t, dev)
1305 __field(void *, lip)
1306 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001307 __field(unsigned long, flags)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001308 __field(xfs_lsn_t, lsn)
1309 ),
1310 TP_fast_assign(
1311 __entry->dev = lip->li_mountp->m_super->s_dev;
1312 __entry->lip = lip;
1313 __entry->type = lip->li_type;
1314 __entry->flags = lip->li_flags;
1315 __entry->lsn = lip->li_lsn;
1316 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001317 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001318 MAJOR(__entry->dev), MINOR(__entry->dev),
1319 __entry->lip,
1320 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1321 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1322 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1323)
1324
Dave Chinner14c26c62012-04-24 16:33:31 +10001325TRACE_EVENT(xfs_log_force,
Carlos Maiolino9f278892016-04-06 09:46:30 +10001326 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1327 TP_ARGS(mp, lsn, caller_ip),
Dave Chinner14c26c62012-04-24 16:33:31 +10001328 TP_STRUCT__entry(
1329 __field(dev_t, dev)
1330 __field(xfs_lsn_t, lsn)
Carlos Maiolino9f278892016-04-06 09:46:30 +10001331 __field(unsigned long, caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001332 ),
1333 TP_fast_assign(
1334 __entry->dev = mp->m_super->s_dev;
1335 __entry->lsn = lsn;
Carlos Maiolino9f278892016-04-06 09:46:30 +10001336 __entry->caller_ip = caller_ip;
Dave Chinner14c26c62012-04-24 16:33:31 +10001337 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001338 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
Dave Chinner14c26c62012-04-24 16:33:31 +10001339 MAJOR(__entry->dev), MINOR(__entry->dev),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001340 __entry->lsn, (void *)__entry->caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001341)
1342
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001343#define DEFINE_LOG_ITEM_EVENT(name) \
1344DEFINE_EVENT(xfs_log_item_class, name, \
1345 TP_PROTO(struct xfs_log_item *lip), \
1346 TP_ARGS(lip))
1347DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001348DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1349DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001350DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001351
Dave Chinner750b9c92013-11-01 15:27:18 +11001352DECLARE_EVENT_CLASS(xfs_ail_class,
1353 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1354 TP_ARGS(lip, old_lsn, new_lsn),
1355 TP_STRUCT__entry(
1356 __field(dev_t, dev)
1357 __field(void *, lip)
1358 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001359 __field(unsigned long, flags)
Dave Chinner750b9c92013-11-01 15:27:18 +11001360 __field(xfs_lsn_t, old_lsn)
1361 __field(xfs_lsn_t, new_lsn)
1362 ),
1363 TP_fast_assign(
1364 __entry->dev = lip->li_mountp->m_super->s_dev;
1365 __entry->lip = lip;
1366 __entry->type = lip->li_type;
1367 __entry->flags = lip->li_flags;
1368 __entry->old_lsn = old_lsn;
1369 __entry->new_lsn = new_lsn;
1370 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001371 TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s",
Dave Chinner750b9c92013-11-01 15:27:18 +11001372 MAJOR(__entry->dev), MINOR(__entry->dev),
1373 __entry->lip,
1374 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1375 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1376 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1377 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1378)
1379
1380#define DEFINE_AIL_EVENT(name) \
1381DEFINE_EVENT(xfs_ail_class, name, \
1382 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1383 TP_ARGS(lip, old_lsn, new_lsn))
1384DEFINE_AIL_EVENT(xfs_ail_insert);
1385DEFINE_AIL_EVENT(xfs_ail_move);
1386DEFINE_AIL_EVENT(xfs_ail_delete);
1387
1388TRACE_EVENT(xfs_log_assign_tail_lsn,
1389 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1390 TP_ARGS(log, new_lsn),
1391 TP_STRUCT__entry(
1392 __field(dev_t, dev)
1393 __field(xfs_lsn_t, new_lsn)
1394 __field(xfs_lsn_t, old_lsn)
1395 __field(xfs_lsn_t, last_sync_lsn)
1396 ),
1397 TP_fast_assign(
1398 __entry->dev = log->l_mp->m_super->s_dev;
1399 __entry->new_lsn = new_lsn;
1400 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1401 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1402 ),
1403 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1404 MAJOR(__entry->dev), MINOR(__entry->dev),
1405 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1406 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1407 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1408)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001409
Li Zefanf8adb4d2010-05-24 08:25:57 +00001410DECLARE_EVENT_CLASS(xfs_file_class,
Christoph Hellwig3e40b132021-01-23 10:06:29 -08001411 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter),
1412 TP_ARGS(iocb, iter),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001413 TP_STRUCT__entry(
1414 __field(dev_t, dev)
1415 __field(xfs_ino_t, ino)
1416 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001417 __field(loff_t, offset)
1418 __field(size_t, count)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001419 ),
1420 TP_fast_assign(
Christoph Hellwig3e40b132021-01-23 10:06:29 -08001421 __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
1422 __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
Christoph Hellwig13d2c102021-03-29 11:11:40 -07001423 __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size;
Christoph Hellwig3e40b132021-01-23 10:06:29 -08001424 __entry->offset = iocb->ki_pos;
1425 __entry->count = iov_iter_count(iter);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001426 ),
Darrick J. Wongc23460e2021-08-17 13:03:19 -07001427 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001428 MAJOR(__entry->dev), MINOR(__entry->dev),
1429 __entry->ino,
1430 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001431 __entry->offset,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001432 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001433)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001434
1435#define DEFINE_RW_EVENT(name) \
1436DEFINE_EVENT(xfs_file_class, name, \
Christoph Hellwig3e40b132021-01-23 10:06:29 -08001437 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), \
1438 TP_ARGS(iocb, iter))
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001439DEFINE_RW_EVENT(xfs_file_buffered_read);
1440DEFINE_RW_EVENT(xfs_file_direct_read);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001441DEFINE_RW_EVENT(xfs_file_dax_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001442DEFINE_RW_EVENT(xfs_file_buffered_write);
1443DEFINE_RW_EVENT(xfs_file_direct_write);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001444DEFINE_RW_EVENT(xfs_file_dax_write);
Christoph Hellwig896f72d2021-01-23 10:06:30 -08001445DEFINE_RW_EVENT(xfs_reflink_bounce_dio_write);
1446
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001447
Christoph Hellwiga206c812010-12-10 08:42:20 +00001448DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001449 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001450 int whichfork, struct xfs_bmbt_irec *irec),
1451 TP_ARGS(ip, offset, count, whichfork, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001452 TP_STRUCT__entry(
1453 __field(dev_t, dev)
1454 __field(xfs_ino_t, ino)
1455 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001456 __field(loff_t, offset)
1457 __field(size_t, count)
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001458 __field(int, whichfork)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001459 __field(xfs_fileoff_t, startoff)
1460 __field(xfs_fsblock_t, startblock)
1461 __field(xfs_filblks_t, blockcount)
1462 ),
1463 TP_fast_assign(
1464 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1465 __entry->ino = ip->i_ino;
Christoph Hellwig13d2c102021-03-29 11:11:40 -07001466 __entry->size = ip->i_disk_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001467 __entry->offset = offset;
1468 __entry->count = count;
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001469 __entry->whichfork = whichfork;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001470 __entry->startoff = irec ? irec->br_startoff : 0;
1471 __entry->startblock = irec ? irec->br_startblock : 0;
1472 __entry->blockcount = irec ? irec->br_blockcount : 0;
1473 ),
Darrick J. Wongc23460e2021-08-17 13:03:19 -07001474 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx "
Darrick J. Wong7989acc2021-08-17 12:45:59 -07001475 "fork %s startoff 0x%llx startblock 0x%llx fsbcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001476 MAJOR(__entry->dev), MINOR(__entry->dev),
1477 __entry->ino,
1478 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001479 __entry->offset,
1480 __entry->count,
Darrick J. Wongf93f85f2021-08-17 13:09:26 -07001481 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001482 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07001483 (int64_t)__entry->startblock,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001484 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001485)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001486
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001487#define DEFINE_IMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001488DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001489 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001490 int whichfork, struct xfs_bmbt_irec *irec), \
1491 TP_ARGS(ip, offset, count, whichfork, irec))
1492DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1493DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1494DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1495DEFINE_IMAP_EVENT(xfs_iomap_found);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001496
Li Zefanf8adb4d2010-05-24 08:25:57 +00001497DECLARE_EVENT_CLASS(xfs_simple_io_class,
1498 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1499 TP_ARGS(ip, offset, count),
1500 TP_STRUCT__entry(
1501 __field(dev_t, dev)
1502 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001503 __field(loff_t, isize)
1504 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001505 __field(loff_t, offset)
1506 __field(size_t, count)
1507 ),
1508 TP_fast_assign(
1509 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1510 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001511 __entry->isize = VFS_I(ip)->i_size;
Christoph Hellwig13d2c102021-03-29 11:11:40 -07001512 __entry->disize = ip->i_disk_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001513 __entry->offset = offset;
1514 __entry->count = count;
1515 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001516 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Darrick J. Wongd538cf22021-08-17 13:00:13 -07001517 "pos 0x%llx bytecount 0x%zx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001518 MAJOR(__entry->dev), MINOR(__entry->dev),
1519 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001520 __entry->isize,
1521 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001522 __entry->offset,
1523 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001524);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001525
1526#define DEFINE_SIMPLE_IO_EVENT(name) \
1527DEFINE_EVENT(xfs_simple_io_class, name, \
1528 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1529 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001530DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1531DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001532DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Brian Foster0a50f162015-10-12 16:02:08 +11001533DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001534DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1535DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1536DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001537
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001538DECLARE_EVENT_CLASS(xfs_itrunc_class,
1539 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1540 TP_ARGS(ip, new_size),
1541 TP_STRUCT__entry(
1542 __field(dev_t, dev)
1543 __field(xfs_ino_t, ino)
1544 __field(xfs_fsize_t, size)
1545 __field(xfs_fsize_t, new_size)
1546 ),
1547 TP_fast_assign(
1548 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1549 __entry->ino = ip->i_ino;
Christoph Hellwig13d2c102021-03-29 11:11:40 -07001550 __entry->size = ip->i_disk_size;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001551 __entry->new_size = new_size;
1552 ),
Darrick J. Wongc23460e2021-08-17 13:03:19 -07001553 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx new_size 0x%llx",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001554 MAJOR(__entry->dev), MINOR(__entry->dev),
1555 __entry->ino,
1556 __entry->size,
1557 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001558)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001559
1560#define DEFINE_ITRUNC_EVENT(name) \
1561DEFINE_EVENT(xfs_itrunc_class, name, \
1562 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1563 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001564DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1565DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001566
1567TRACE_EVENT(xfs_pagecache_inval,
1568 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1569 TP_ARGS(ip, start, finish),
1570 TP_STRUCT__entry(
1571 __field(dev_t, dev)
1572 __field(xfs_ino_t, ino)
1573 __field(xfs_fsize_t, size)
1574 __field(xfs_off_t, start)
1575 __field(xfs_off_t, finish)
1576 ),
1577 TP_fast_assign(
1578 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1579 __entry->ino = ip->i_ino;
Christoph Hellwig13d2c102021-03-29 11:11:40 -07001580 __entry->size = ip->i_disk_size;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001581 __entry->start = start;
1582 __entry->finish = finish;
1583 ),
Darrick J. Wongc23460e2021-08-17 13:03:19 -07001584 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx start 0x%llx finish 0x%llx",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001585 MAJOR(__entry->dev), MINOR(__entry->dev),
1586 __entry->ino,
1587 __entry->size,
1588 __entry->start,
1589 __entry->finish)
1590);
1591
1592TRACE_EVENT(xfs_bunmap,
Darrick J. Wong6f25b212021-08-17 10:03:45 -07001593 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t fileoff, xfs_filblks_t len,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001594 int flags, unsigned long caller_ip),
Darrick J. Wong6f25b212021-08-17 10:03:45 -07001595 TP_ARGS(ip, fileoff, len, flags, caller_ip),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001596 TP_STRUCT__entry(
1597 __field(dev_t, dev)
1598 __field(xfs_ino_t, ino)
1599 __field(xfs_fsize_t, size)
Darrick J. Wong6f25b212021-08-17 10:03:45 -07001600 __field(xfs_fileoff_t, fileoff)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001601 __field(xfs_filblks_t, len)
1602 __field(unsigned long, caller_ip)
1603 __field(int, flags)
1604 ),
1605 TP_fast_assign(
1606 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1607 __entry->ino = ip->i_ino;
Christoph Hellwig13d2c102021-03-29 11:11:40 -07001608 __entry->size = ip->i_disk_size;
Darrick J. Wong6f25b212021-08-17 10:03:45 -07001609 __entry->fileoff = fileoff;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001610 __entry->len = len;
1611 __entry->caller_ip = caller_ip;
1612 __entry->flags = flags;
1613 ),
Darrick J. Wongc23460e2021-08-17 13:03:19 -07001614 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx fileoff 0x%llx fsbcount 0x%llx"
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001615 "flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001616 MAJOR(__entry->dev), MINOR(__entry->dev),
1617 __entry->ino,
1618 __entry->size,
Darrick J. Wong6f25b212021-08-17 10:03:45 -07001619 __entry->fileoff,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001620 __entry->len,
1621 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1622 (void *)__entry->caller_ip)
1623
1624);
1625
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001626DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001627 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1628 xfs_agblock_t agbno, xfs_extlen_t len),
1629 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001630 TP_STRUCT__entry(
1631 __field(dev_t, dev)
1632 __field(xfs_agnumber_t, agno)
1633 __field(xfs_agblock_t, agbno)
1634 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001635 ),
1636 TP_fast_assign(
1637 __entry->dev = mp->m_super->s_dev;
1638 __entry->agno = agno;
1639 __entry->agbno = agbno;
1640 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001641 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07001642 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001643 MAJOR(__entry->dev), MINOR(__entry->dev),
1644 __entry->agno,
1645 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001646 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001647);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001648#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001649DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001650 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1651 xfs_agblock_t agbno, xfs_extlen_t len), \
1652 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001653DEFINE_BUSY_EVENT(xfs_extent_busy);
1654DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1655DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1656DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1657DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001658
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001659TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001660 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1661 xfs_agblock_t agbno, xfs_extlen_t len,
1662 xfs_agblock_t tbno, xfs_extlen_t tlen),
1663 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1664 TP_STRUCT__entry(
1665 __field(dev_t, dev)
1666 __field(xfs_agnumber_t, agno)
1667 __field(xfs_agblock_t, agbno)
1668 __field(xfs_extlen_t, len)
1669 __field(xfs_agblock_t, tbno)
1670 __field(xfs_extlen_t, tlen)
1671 ),
1672 TP_fast_assign(
1673 __entry->dev = mp->m_super->s_dev;
1674 __entry->agno = agno;
1675 __entry->agbno = agbno;
1676 __entry->len = len;
1677 __entry->tbno = tbno;
1678 __entry->tlen = tlen;
1679 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07001680 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
Christoph Hellwige26f0502011-04-24 19:06:15 +00001681 MAJOR(__entry->dev), MINOR(__entry->dev),
1682 __entry->agno,
1683 __entry->agbno,
1684 __entry->len,
1685 __entry->tbno,
1686 __entry->tlen)
1687);
1688
Brian Fostera27ba262018-03-15 10:51:58 -07001689DECLARE_EVENT_CLASS(xfs_agf_class,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001690 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1691 unsigned long caller_ip),
1692 TP_ARGS(mp, agf, flags, caller_ip),
1693 TP_STRUCT__entry(
1694 __field(dev_t, dev)
1695 __field(xfs_agnumber_t, agno)
1696 __field(int, flags)
1697 __field(__u32, length)
1698 __field(__u32, bno_root)
1699 __field(__u32, cnt_root)
1700 __field(__u32, bno_level)
1701 __field(__u32, cnt_level)
1702 __field(__u32, flfirst)
1703 __field(__u32, fllast)
1704 __field(__u32, flcount)
1705 __field(__u32, freeblks)
1706 __field(__u32, longest)
1707 __field(unsigned long, caller_ip)
1708 ),
1709 TP_fast_assign(
1710 __entry->dev = mp->m_super->s_dev;
1711 __entry->agno = be32_to_cpu(agf->agf_seqno),
1712 __entry->flags = flags;
1713 __entry->length = be32_to_cpu(agf->agf_length),
1714 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1715 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1716 __entry->bno_level =
1717 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1718 __entry->cnt_level =
1719 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1720 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1721 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1722 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1723 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1724 __entry->longest = be32_to_cpu(agf->agf_longest);
1725 __entry->caller_ip = caller_ip;
1726 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07001727 TP_printk("dev %d:%d agno 0x%x flags %s length %u roots b %u c %u "
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001728 "levels b %u c %u flfirst %u fllast %u flcount %u "
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001729 "freeblks %u longest %u caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001730 MAJOR(__entry->dev), MINOR(__entry->dev),
1731 __entry->agno,
1732 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1733 __entry->length,
1734 __entry->bno_root,
1735 __entry->cnt_root,
1736 __entry->bno_level,
1737 __entry->cnt_level,
1738 __entry->flfirst,
1739 __entry->fllast,
1740 __entry->flcount,
1741 __entry->freeblks,
1742 __entry->longest,
1743 (void *)__entry->caller_ip)
1744);
Brian Fostera27ba262018-03-15 10:51:58 -07001745#define DEFINE_AGF_EVENT(name) \
1746DEFINE_EVENT(xfs_agf_class, name, \
1747 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1748 unsigned long caller_ip), \
1749 TP_ARGS(mp, agf, flags, caller_ip))
1750DEFINE_AGF_EVENT(xfs_agf);
1751DEFINE_AGF_EVENT(xfs_agfl_reset);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001752
1753TRACE_EVENT(xfs_free_extent,
1754 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001755 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1756 int haveright),
1757 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001758 TP_STRUCT__entry(
1759 __field(dev_t, dev)
1760 __field(xfs_agnumber_t, agno)
1761 __field(xfs_agblock_t, agbno)
1762 __field(xfs_extlen_t, len)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001763 __field(int, resv)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001764 __field(int, haveleft)
1765 __field(int, haveright)
1766 ),
1767 TP_fast_assign(
1768 __entry->dev = mp->m_super->s_dev;
1769 __entry->agno = agno;
1770 __entry->agbno = agbno;
1771 __entry->len = len;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001772 __entry->resv = resv;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001773 __entry->haveleft = haveleft;
1774 __entry->haveright = haveright;
1775 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07001776 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x resv %d %s",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001777 MAJOR(__entry->dev), MINOR(__entry->dev),
1778 __entry->agno,
1779 __entry->agbno,
1780 __entry->len,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001781 __entry->resv,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001782 __entry->haveleft ?
1783 (__entry->haveright ? "both" : "left") :
1784 (__entry->haveright ? "right" : "none"))
1785
1786);
1787
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001788DECLARE_EVENT_CLASS(xfs_alloc_class,
1789 TP_PROTO(struct xfs_alloc_arg *args),
1790 TP_ARGS(args),
1791 TP_STRUCT__entry(
1792 __field(dev_t, dev)
1793 __field(xfs_agnumber_t, agno)
1794 __field(xfs_agblock_t, agbno)
1795 __field(xfs_extlen_t, minlen)
1796 __field(xfs_extlen_t, maxlen)
1797 __field(xfs_extlen_t, mod)
1798 __field(xfs_extlen_t, prod)
1799 __field(xfs_extlen_t, minleft)
1800 __field(xfs_extlen_t, total)
1801 __field(xfs_extlen_t, alignment)
1802 __field(xfs_extlen_t, minalignslop)
1803 __field(xfs_extlen_t, len)
1804 __field(short, type)
1805 __field(short, otype)
1806 __field(char, wasdel)
1807 __field(char, wasfromfl)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001808 __field(int, resv)
Dave Chinner292378e2016-09-26 08:21:28 +10001809 __field(int, datatype)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001810 __field(xfs_fsblock_t, firstblock)
1811 ),
1812 TP_fast_assign(
1813 __entry->dev = args->mp->m_super->s_dev;
1814 __entry->agno = args->agno;
1815 __entry->agbno = args->agbno;
1816 __entry->minlen = args->minlen;
1817 __entry->maxlen = args->maxlen;
1818 __entry->mod = args->mod;
1819 __entry->prod = args->prod;
1820 __entry->minleft = args->minleft;
1821 __entry->total = args->total;
1822 __entry->alignment = args->alignment;
1823 __entry->minalignslop = args->minalignslop;
1824 __entry->len = args->len;
1825 __entry->type = args->type;
1826 __entry->otype = args->otype;
1827 __entry->wasdel = args->wasdel;
1828 __entry->wasfromfl = args->wasfromfl;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001829 __entry->resv = args->resv;
Dave Chinner292378e2016-09-26 08:21:28 +10001830 __entry->datatype = args->datatype;
Brian Foster64396ff2018-07-11 22:26:30 -07001831 __entry->firstblock = args->tp->t_firstblock;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001832 ),
Darrick J. Wongf7b08162021-08-17 09:28:53 -07001833 TP_printk("dev %d:%d agno 0x%x agbno 0x%x minlen %u maxlen %u mod %u "
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001834 "prod %u minleft %u total %u alignment %u minalignslop %u "
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001835 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
Dave Chinner292378e2016-09-26 08:21:28 +10001836 "datatype 0x%x firstblock 0x%llx",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001837 MAJOR(__entry->dev), MINOR(__entry->dev),
1838 __entry->agno,
1839 __entry->agbno,
1840 __entry->minlen,
1841 __entry->maxlen,
1842 __entry->mod,
1843 __entry->prod,
1844 __entry->minleft,
1845 __entry->total,
1846 __entry->alignment,
1847 __entry->minalignslop,
1848 __entry->len,
1849 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1850 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1851 __entry->wasdel,
1852 __entry->wasfromfl,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001853 __entry->resv,
Dave Chinner292378e2016-09-26 08:21:28 +10001854 __entry->datatype,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001855 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001856)
1857
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001858#define DEFINE_ALLOC_EVENT(name) \
1859DEFINE_EVENT(xfs_alloc_class, name, \
1860 TP_PROTO(struct xfs_alloc_arg *args), \
1861 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001862DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001863DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001864DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1865DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1866DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
Brian Fosterd2968822019-10-13 17:10:35 -07001867DEFINE_ALLOC_EVENT(xfs_alloc_cur);
Brian Fosterfec0afd2019-10-13 17:10:33 -07001868DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
1869DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
Brian Fosterdc8e69b2019-10-13 17:10:36 -07001870DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
1871DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001872DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001873DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1874DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001875DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1876DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1877DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1878DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1879DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001880DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001881DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1882DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1883DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1884DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1885DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1886DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1887DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1888DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1889DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1890
Brian Foster396bbf32019-10-13 17:10:33 -07001891TRACE_EVENT(xfs_alloc_cur_check,
1892 TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
1893 xfs_extlen_t len, xfs_extlen_t diff, bool new),
1894 TP_ARGS(mp, btnum, bno, len, diff, new),
1895 TP_STRUCT__entry(
1896 __field(dev_t, dev)
1897 __field(xfs_btnum_t, btnum)
1898 __field(xfs_agblock_t, bno)
1899 __field(xfs_extlen_t, len)
1900 __field(xfs_extlen_t, diff)
1901 __field(bool, new)
1902 ),
1903 TP_fast_assign(
1904 __entry->dev = mp->m_super->s_dev;
1905 __entry->btnum = btnum;
1906 __entry->bno = bno;
1907 __entry->len = len;
1908 __entry->diff = diff;
1909 __entry->new = new;
1910 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07001911 TP_printk("dev %d:%d btree %s agbno 0x%x fsbcount 0x%x diff 0x%x new %d",
Brian Foster396bbf32019-10-13 17:10:33 -07001912 MAJOR(__entry->dev), MINOR(__entry->dev),
1913 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
1914 __entry->bno, __entry->len, __entry->diff, __entry->new)
1915)
1916
Dave Chinner5a5881c2012-03-22 05:15:13 +00001917DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001918 TP_PROTO(struct xfs_da_args *args),
1919 TP_ARGS(args),
1920 TP_STRUCT__entry(
1921 __field(dev_t, dev)
1922 __field(xfs_ino_t, ino)
1923 __dynamic_array(char, name, args->namelen)
1924 __field(int, namelen)
1925 __field(xfs_dahash_t, hashval)
1926 __field(xfs_ino_t, inumber)
1927 __field(int, op_flags)
1928 ),
1929 TP_fast_assign(
1930 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1931 __entry->ino = args->dp->i_ino;
1932 if (args->namelen)
1933 memcpy(__get_str(name), args->name, args->namelen);
1934 __entry->namelen = args->namelen;
1935 __entry->hashval = args->hashval;
1936 __entry->inumber = args->inumber;
1937 __entry->op_flags = args->op_flags;
1938 ),
1939 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1940 "inumber 0x%llx op_flags %s",
1941 MAJOR(__entry->dev), MINOR(__entry->dev),
1942 __entry->ino,
1943 __entry->namelen,
1944 __entry->namelen ? __get_str(name) : NULL,
1945 __entry->namelen,
1946 __entry->hashval,
1947 __entry->inumber,
1948 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001949)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001950
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001951#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001952DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001953 TP_PROTO(struct xfs_da_args *args), \
1954 TP_ARGS(args))
1955DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1956DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1957DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1958DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1959DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1960DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1961DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1962DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1963DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1964DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1965DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1966DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1967DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1968DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1969DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1970DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1971DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1972DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1973DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1974DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1975DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1976DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1977DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1978DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1979DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1980
Dave Chinneree732592012-11-12 22:53:53 +11001981DECLARE_EVENT_CLASS(xfs_attr_class,
1982 TP_PROTO(struct xfs_da_args *args),
1983 TP_ARGS(args),
1984 TP_STRUCT__entry(
1985 __field(dev_t, dev)
1986 __field(xfs_ino_t, ino)
1987 __dynamic_array(char, name, args->namelen)
1988 __field(int, namelen)
1989 __field(int, valuelen)
1990 __field(xfs_dahash_t, hashval)
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08001991 __field(unsigned int, attr_filter)
1992 __field(unsigned int, attr_flags)
Dave Chinneree732592012-11-12 22:53:53 +11001993 __field(int, op_flags)
1994 ),
1995 TP_fast_assign(
1996 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1997 __entry->ino = args->dp->i_ino;
1998 if (args->namelen)
1999 memcpy(__get_str(name), args->name, args->namelen);
2000 __entry->namelen = args->namelen;
2001 __entry->valuelen = args->valuelen;
2002 __entry->hashval = args->hashval;
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08002003 __entry->attr_filter = args->attr_filter;
2004 __entry->attr_flags = args->attr_flags;
Dave Chinneree732592012-11-12 22:53:53 +11002005 __entry->op_flags = args->op_flags;
2006 ),
2007 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08002008 "hashval 0x%x filter %s flags %s op_flags %s",
Dave Chinneree732592012-11-12 22:53:53 +11002009 MAJOR(__entry->dev), MINOR(__entry->dev),
2010 __entry->ino,
2011 __entry->namelen,
2012 __entry->namelen ? __get_str(name) : NULL,
2013 __entry->namelen,
2014 __entry->valuelen,
2015 __entry->hashval,
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08002016 __print_flags(__entry->attr_filter, "|",
2017 XFS_ATTR_FILTER_FLAGS),
2018 __print_flags(__entry->attr_flags, "|",
2019 { XATTR_CREATE, "CREATE" },
2020 { XATTR_REPLACE, "REPLACE" }),
Dave Chinneree732592012-11-12 22:53:53 +11002021 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
2022)
2023
Dave Chinner5a5881c2012-03-22 05:15:13 +00002024#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11002025DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00002026 TP_PROTO(struct xfs_da_args *args), \
2027 TP_ARGS(args))
2028DEFINE_ATTR_EVENT(xfs_attr_sf_add);
2029DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
2030DEFINE_ATTR_EVENT(xfs_attr_sf_create);
2031DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
2032DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00002033DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
2034
2035DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
2036DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
2037DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11002038DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00002039DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11002040DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
2041DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00002042DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
2043DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11002044DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00002045DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
2046DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
2047DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
2048DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
2049DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
2050DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
2051DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
2052DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
2053DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
2054DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
2055DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11002056DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00002057
2058DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11002059DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00002060DEFINE_ATTR_EVENT(xfs_attr_node_replace);
2061DEFINE_ATTR_EVENT(xfs_attr_node_removename);
2062
Dave Chinneree732592012-11-12 22:53:53 +11002063DEFINE_ATTR_EVENT(xfs_attr_fillstate);
2064DEFINE_ATTR_EVENT(xfs_attr_refillstate);
2065
2066DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
2067DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
Dave Chinneree732592012-11-12 22:53:53 +11002068
Dave Chinner5a5881c2012-03-22 05:15:13 +00002069#define DEFINE_DA_EVENT(name) \
2070DEFINE_EVENT(xfs_da_class, name, \
2071 TP_PROTO(struct xfs_da_args *args), \
2072 TP_ARGS(args))
2073DEFINE_DA_EVENT(xfs_da_split);
2074DEFINE_DA_EVENT(xfs_da_join);
2075DEFINE_DA_EVENT(xfs_da_link_before);
2076DEFINE_DA_EVENT(xfs_da_link_after);
2077DEFINE_DA_EVENT(xfs_da_unlink_back);
2078DEFINE_DA_EVENT(xfs_da_unlink_forward);
2079DEFINE_DA_EVENT(xfs_da_root_split);
2080DEFINE_DA_EVENT(xfs_da_root_join);
2081DEFINE_DA_EVENT(xfs_da_node_add);
2082DEFINE_DA_EVENT(xfs_da_node_create);
2083DEFINE_DA_EVENT(xfs_da_node_split);
2084DEFINE_DA_EVENT(xfs_da_node_remove);
2085DEFINE_DA_EVENT(xfs_da_node_rebalance);
2086DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11002087DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00002088DEFINE_DA_EVENT(xfs_da_swap_lastblock);
2089DEFINE_DA_EVENT(xfs_da_grow_inode);
2090DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11002091DEFINE_DA_EVENT(xfs_da_fixhashpath);
2092DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00002093
Christoph Hellwigea9a4882009-12-21 14:03:03 +00002094DECLARE_EVENT_CLASS(xfs_dir2_space_class,
2095 TP_PROTO(struct xfs_da_args *args, int idx),
2096 TP_ARGS(args, idx),
2097 TP_STRUCT__entry(
2098 __field(dev_t, dev)
2099 __field(xfs_ino_t, ino)
2100 __field(int, op_flags)
2101 __field(int, idx)
2102 ),
2103 TP_fast_assign(
2104 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2105 __entry->ino = args->dp->i_ino;
2106 __entry->op_flags = args->op_flags;
2107 __entry->idx = idx;
2108 ),
2109 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
2110 MAJOR(__entry->dev), MINOR(__entry->dev),
2111 __entry->ino,
2112 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2113 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002114)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00002115
2116#define DEFINE_DIR2_SPACE_EVENT(name) \
2117DEFINE_EVENT(xfs_dir2_space_class, name, \
2118 TP_PROTO(struct xfs_da_args *args, int idx), \
2119 TP_ARGS(args, idx))
2120DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
2121DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
2122DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
2123DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002124
2125TRACE_EVENT(xfs_dir2_leafn_moveents,
2126 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
2127 TP_ARGS(args, src_idx, dst_idx, count),
2128 TP_STRUCT__entry(
2129 __field(dev_t, dev)
2130 __field(xfs_ino_t, ino)
2131 __field(int, op_flags)
2132 __field(int, src_idx)
2133 __field(int, dst_idx)
2134 __field(int, count)
2135 ),
2136 TP_fast_assign(
2137 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2138 __entry->ino = args->dp->i_ino;
2139 __entry->op_flags = args->op_flags;
2140 __entry->src_idx = src_idx;
2141 __entry->dst_idx = dst_idx;
2142 __entry->count = count;
2143 ),
2144 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
2145 "src_idx %d dst_idx %d count %d",
2146 MAJOR(__entry->dev), MINOR(__entry->dev),
2147 __entry->ino,
2148 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2149 __entry->src_idx,
2150 __entry->dst_idx,
2151 __entry->count)
2152);
2153
Dave Chinner3a85cd92010-01-14 01:33:55 +00002154#define XFS_SWAPEXT_INODES \
2155 { 0, "target" }, \
2156 { 1, "temp" }
2157
Darrick J. Wong0357d212018-12-18 14:32:30 -08002158TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
2159TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
2160TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
2161TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
2162TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
Dave Chinner3a85cd92010-01-14 01:33:55 +00002163
2164DECLARE_EVENT_CLASS(xfs_swap_extent_class,
2165 TP_PROTO(struct xfs_inode *ip, int which),
2166 TP_ARGS(ip, which),
2167 TP_STRUCT__entry(
2168 __field(dev_t, dev)
2169 __field(int, which)
2170 __field(xfs_ino_t, ino)
2171 __field(int, format)
2172 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00002173 __field(int, broot_size)
2174 __field(int, fork_off)
2175 ),
2176 TP_fast_assign(
2177 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2178 __entry->which = which;
2179 __entry->ino = ip->i_ino;
Christoph Hellwigf7e67b22020-05-18 10:28:05 -07002180 __entry->format = ip->i_df.if_format;
Christoph Hellwigdaf83962020-05-18 10:27:22 -07002181 __entry->nex = ip->i_df.if_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00002182 __entry->broot_size = ip->i_df.if_broot_bytes;
2183 __entry->fork_off = XFS_IFORK_BOFF(ip);
2184 ),
2185 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Darrick J. Wong49e68c92021-08-17 10:09:12 -07002186 "broot size %d, forkoff 0x%x",
Dave Chinner3a85cd92010-01-14 01:33:55 +00002187 MAJOR(__entry->dev), MINOR(__entry->dev),
2188 __entry->ino,
2189 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
2190 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
2191 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00002192 __entry->broot_size,
2193 __entry->fork_off)
2194)
2195
2196#define DEFINE_SWAPEXT_EVENT(name) \
2197DEFINE_EVENT(xfs_swap_extent_class, name, \
2198 TP_PROTO(struct xfs_inode *ip, int which), \
2199 TP_ARGS(ip, which))
2200
2201DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
2202DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
2203
Brian Fostere67d3d42017-08-08 18:21:53 -07002204TRACE_EVENT(xfs_log_recover,
2205 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
2206 TP_ARGS(log, headblk, tailblk),
2207 TP_STRUCT__entry(
2208 __field(dev_t, dev)
2209 __field(xfs_daddr_t, headblk)
2210 __field(xfs_daddr_t, tailblk)
2211 ),
2212 TP_fast_assign(
2213 __entry->dev = log->l_mp->m_super->s_dev;
2214 __entry->headblk = headblk;
2215 __entry->tailblk = tailblk;
2216 ),
2217 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2218 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2219 __entry->tailblk)
2220)
2221
Brian Foster5cd9cee2016-09-26 08:34:52 +10002222TRACE_EVENT(xfs_log_recover_record,
2223 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2224 TP_ARGS(log, rhead, pass),
2225 TP_STRUCT__entry(
2226 __field(dev_t, dev)
2227 __field(xfs_lsn_t, lsn)
2228 __field(int, len)
2229 __field(int, num_logops)
2230 __field(int, pass)
2231 ),
2232 TP_fast_assign(
2233 __entry->dev = log->l_mp->m_super->s_dev;
2234 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2235 __entry->len = be32_to_cpu(rhead->h_len);
2236 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2237 __entry->pass = pass;
2238 ),
2239 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2240 MAJOR(__entry->dev), MINOR(__entry->dev),
2241 __entry->lsn, __entry->len, __entry->num_logops,
2242 __entry->pass)
2243)
2244
Dave Chinner9abbc532010-04-13 15:06:46 +10002245DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002246 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10002247 struct xlog_recover_item *item, int pass),
2248 TP_ARGS(log, trans, item, pass),
2249 TP_STRUCT__entry(
2250 __field(dev_t, dev)
2251 __field(unsigned long, item)
2252 __field(xlog_tid_t, tid)
Brian Foster5cd9cee2016-09-26 08:34:52 +10002253 __field(xfs_lsn_t, lsn)
Dave Chinner9abbc532010-04-13 15:06:46 +10002254 __field(int, type)
2255 __field(int, pass)
2256 __field(int, count)
2257 __field(int, total)
2258 ),
2259 TP_fast_assign(
2260 __entry->dev = log->l_mp->m_super->s_dev;
2261 __entry->item = (unsigned long)item;
2262 __entry->tid = trans->r_log_tid;
Brian Foster5cd9cee2016-09-26 08:34:52 +10002263 __entry->lsn = trans->r_lsn;
Dave Chinner9abbc532010-04-13 15:06:46 +10002264 __entry->type = ITEM_TYPE(item);
2265 __entry->pass = pass;
2266 __entry->count = item->ri_cnt;
2267 __entry->total = item->ri_total;
2268 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08002269 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
Brian Foster5cd9cee2016-09-26 08:34:52 +10002270 "item type %s item region count/total %d/%d",
Dave Chinner9abbc532010-04-13 15:06:46 +10002271 MAJOR(__entry->dev), MINOR(__entry->dev),
2272 __entry->tid,
Brian Foster5cd9cee2016-09-26 08:34:52 +10002273 __entry->lsn,
Dave Chinner9abbc532010-04-13 15:06:46 +10002274 __entry->pass,
2275 (void *)__entry->item,
2276 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2277 __entry->count,
2278 __entry->total)
2279)
2280
2281#define DEFINE_LOG_RECOVER_ITEM(name) \
2282DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002283 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10002284 struct xlog_recover_item *item, int pass), \
2285 TP_ARGS(log, trans, item, pass))
2286
2287DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2288DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2289DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2290DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2291DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2292
2293DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002294 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002295 TP_ARGS(log, buf_f),
2296 TP_STRUCT__entry(
2297 __field(dev_t, dev)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002298 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002299 __field(unsigned short, len)
2300 __field(unsigned short, flags)
2301 __field(unsigned short, size)
2302 __field(unsigned int, map_size)
2303 ),
2304 TP_fast_assign(
2305 __entry->dev = log->l_mp->m_super->s_dev;
2306 __entry->blkno = buf_f->blf_blkno;
2307 __entry->len = buf_f->blf_len;
2308 __entry->flags = buf_f->blf_flags;
2309 __entry->size = buf_f->blf_size;
2310 __entry->map_size = buf_f->blf_map_size;
2311 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002312 TP_printk("dev %d:%d daddr 0x%llx, bbcount 0x%x, flags 0x%x, size %d, "
Dave Chinner9abbc532010-04-13 15:06:46 +10002313 "map_size %d",
2314 MAJOR(__entry->dev), MINOR(__entry->dev),
2315 __entry->blkno,
2316 __entry->len,
2317 __entry->flags,
2318 __entry->size,
2319 __entry->map_size)
2320)
2321
2322#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2323DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002324 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002325 TP_ARGS(log, buf_f))
2326
2327DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2328DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2329DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2330DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2331DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
Brian Foster5cd9cee2016-09-26 08:34:52 +10002332DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
Dave Chinner9abbc532010-04-13 15:06:46 +10002333DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2334DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2335DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2336
2337DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002338 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002339 TP_ARGS(log, in_f),
2340 TP_STRUCT__entry(
2341 __field(dev_t, dev)
2342 __field(xfs_ino_t, ino)
2343 __field(unsigned short, size)
2344 __field(int, fields)
2345 __field(unsigned short, asize)
2346 __field(unsigned short, dsize)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002347 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002348 __field(int, len)
2349 __field(int, boffset)
2350 ),
2351 TP_fast_assign(
2352 __entry->dev = log->l_mp->m_super->s_dev;
2353 __entry->ino = in_f->ilf_ino;
2354 __entry->size = in_f->ilf_size;
2355 __entry->fields = in_f->ilf_fields;
2356 __entry->asize = in_f->ilf_asize;
2357 __entry->dsize = in_f->ilf_dsize;
2358 __entry->blkno = in_f->ilf_blkno;
2359 __entry->len = in_f->ilf_len;
2360 __entry->boffset = in_f->ilf_boffset;
2361 ),
2362 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002363 "dsize %d, daddr 0x%llx, bbcount 0x%x, boffset %d",
Dave Chinner9abbc532010-04-13 15:06:46 +10002364 MAJOR(__entry->dev), MINOR(__entry->dev),
2365 __entry->ino,
2366 __entry->size,
2367 __entry->fields,
2368 __entry->asize,
2369 __entry->dsize,
2370 __entry->blkno,
2371 __entry->len,
2372 __entry->boffset)
2373)
2374#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2375DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002376 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002377 TP_ARGS(log, in_f))
2378
2379DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2380DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2381DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2382
Brian Foster78d57e42015-08-19 09:58:48 +10002383DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2384 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2385 TP_ARGS(log, in_f),
2386 TP_STRUCT__entry(
2387 __field(dev_t, dev)
2388 __field(xfs_agnumber_t, agno)
2389 __field(xfs_agblock_t, agbno)
2390 __field(unsigned int, count)
2391 __field(unsigned int, isize)
2392 __field(xfs_agblock_t, length)
2393 __field(unsigned int, gen)
2394 ),
2395 TP_fast_assign(
2396 __entry->dev = log->l_mp->m_super->s_dev;
2397 __entry->agno = be32_to_cpu(in_f->icl_ag);
2398 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2399 __entry->count = be32_to_cpu(in_f->icl_count);
2400 __entry->isize = be32_to_cpu(in_f->icl_isize);
2401 __entry->length = be32_to_cpu(in_f->icl_length);
2402 __entry->gen = be32_to_cpu(in_f->icl_gen);
2403 ),
Darrick J. Wongb6418512021-08-17 15:45:25 -07002404 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x ireccount %u isize %u gen 0x%x",
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002405 MAJOR(__entry->dev), MINOR(__entry->dev),
2406 __entry->agno,
2407 __entry->agbno,
2408 __entry->length,
2409 __entry->count,
2410 __entry->isize,
2411 __entry->gen)
Brian Foster78d57e42015-08-19 09:58:48 +10002412)
2413#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2414DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2415 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2416 TP_ARGS(log, in_f))
2417
2418DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2419DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2420
Christoph Hellwiga46db602011-01-07 13:02:04 +00002421DECLARE_EVENT_CLASS(xfs_discard_class,
2422 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2423 xfs_agblock_t agbno, xfs_extlen_t len),
2424 TP_ARGS(mp, agno, agbno, len),
2425 TP_STRUCT__entry(
2426 __field(dev_t, dev)
2427 __field(xfs_agnumber_t, agno)
2428 __field(xfs_agblock_t, agbno)
2429 __field(xfs_extlen_t, len)
2430 ),
2431 TP_fast_assign(
2432 __entry->dev = mp->m_super->s_dev;
2433 __entry->agno = agno;
2434 __entry->agbno = agbno;
2435 __entry->len = len;
2436 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002437 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
Christoph Hellwiga46db602011-01-07 13:02:04 +00002438 MAJOR(__entry->dev), MINOR(__entry->dev),
2439 __entry->agno,
2440 __entry->agbno,
2441 __entry->len)
2442)
2443
2444#define DEFINE_DISCARD_EVENT(name) \
2445DEFINE_EVENT(xfs_discard_class, name, \
2446 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2447 xfs_agblock_t agbno, xfs_extlen_t len), \
2448 TP_ARGS(mp, agno, agbno, len))
2449DEFINE_DISCARD_EVENT(xfs_discard_extent);
2450DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2451DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2452DEFINE_DISCARD_EVENT(xfs_discard_busy);
2453
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002454/* btree cursor events */
Darrick J. Wongc4942132018-12-18 14:32:31 -08002455TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2456TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2457TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2458TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2459TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2460TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2461TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2462
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002463DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2464 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2465 TP_ARGS(cur, level, bp),
2466 TP_STRUCT__entry(
2467 __field(dev_t, dev)
2468 __field(xfs_btnum_t, btnum)
2469 __field(int, level)
2470 __field(int, nlevels)
2471 __field(int, ptr)
2472 __field(xfs_daddr_t, daddr)
2473 ),
2474 TP_fast_assign(
2475 __entry->dev = cur->bc_mp->m_super->s_dev;
2476 __entry->btnum = cur->bc_btnum;
2477 __entry->level = level;
2478 __entry->nlevels = cur->bc_nlevels;
Darrick J. Wong6ca444cf2021-09-16 12:24:04 -07002479 __entry->ptr = cur->bc_levels[level].ptr;
Dave Chinner9343ee72021-08-18 18:47:05 -07002480 __entry->daddr = bp ? xfs_buf_daddr(bp) : -1;
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002481 ),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002482 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002483 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002484 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002485 __entry->level,
2486 __entry->nlevels,
2487 __entry->ptr,
2488 (unsigned long long)__entry->daddr)
2489)
2490
2491#define DEFINE_BTREE_CUR_EVENT(name) \
2492DEFINE_EVENT(xfs_btree_cur_class, name, \
2493 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2494 TP_ARGS(cur, level, bp))
2495DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
Darrick J. Wong105f7d82016-08-03 11:10:21 +10002496DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002497
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002498/* deferred ops */
2499struct xfs_defer_pending;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002500
2501DECLARE_EVENT_CLASS(xfs_defer_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002502 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2503 TP_ARGS(tp, caller_ip),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002504 TP_STRUCT__entry(
2505 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002506 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002507 __field(char, committed)
Dave Chinnere632a562018-05-09 07:48:52 -07002508 __field(unsigned long, caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002509 ),
2510 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002511 __entry->dev = tp->t_mountp->m_super->s_dev;
2512 __entry->tp = tp;
Dave Chinnere632a562018-05-09 07:48:52 -07002513 __entry->caller_ip = caller_ip;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002514 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002515 TP_printk("dev %d:%d tp %p caller %pS",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002516 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002517 __entry->tp,
Dave Chinnere632a562018-05-09 07:48:52 -07002518 (char *)__entry->caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002519)
2520#define DEFINE_DEFER_EVENT(name) \
2521DEFINE_EVENT(xfs_defer_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002522 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2523 TP_ARGS(tp, caller_ip))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002524
2525DECLARE_EVENT_CLASS(xfs_defer_error_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002526 TP_PROTO(struct xfs_trans *tp, int error),
2527 TP_ARGS(tp, error),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002528 TP_STRUCT__entry(
2529 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002530 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002531 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002532 __field(int, error)
2533 ),
2534 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002535 __entry->dev = tp->t_mountp->m_super->s_dev;
2536 __entry->tp = tp;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002537 __entry->error = error;
2538 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002539 TP_printk("dev %d:%d tp %p err %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002540 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002541 __entry->tp,
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002542 __entry->error)
2543)
2544#define DEFINE_DEFER_ERROR_EVENT(name) \
2545DEFINE_EVENT(xfs_defer_error_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002546 TP_PROTO(struct xfs_trans *tp, int error), \
2547 TP_ARGS(tp, error))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002548
2549DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2550 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2551 TP_ARGS(mp, dfp),
2552 TP_STRUCT__entry(
2553 __field(dev_t, dev)
2554 __field(int, type)
2555 __field(void *, intent)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002556 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002557 __field(int, nr)
2558 ),
2559 TP_fast_assign(
2560 __entry->dev = mp ? mp->m_super->s_dev : 0;
Darrick J. Wong02b100f2018-12-12 08:46:22 -08002561 __entry->type = dfp->dfp_type;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002562 __entry->intent = dfp->dfp_intent;
Darrick J. Wongea78d802016-08-30 13:51:39 +10002563 __entry->committed = dfp->dfp_done != NULL;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002564 __entry->nr = dfp->dfp_count;
2565 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002566 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002567 MAJOR(__entry->dev), MINOR(__entry->dev),
2568 __entry->type,
2569 __entry->intent,
2570 __entry->committed,
2571 __entry->nr)
2572)
2573#define DEFINE_DEFER_PENDING_EVENT(name) \
2574DEFINE_EVENT(xfs_defer_pending_class, name, \
2575 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2576 TP_ARGS(mp, dfp))
2577
2578DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2579 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2580 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2581 TP_ARGS(mp, agno, type, agbno, len),
2582 TP_STRUCT__entry(
2583 __field(dev_t, dev)
2584 __field(xfs_agnumber_t, agno)
2585 __field(int, type)
2586 __field(xfs_agblock_t, agbno)
2587 __field(xfs_extlen_t, len)
2588 ),
2589 TP_fast_assign(
2590 __entry->dev = mp->m_super->s_dev;
2591 __entry->agno = agno;
2592 __entry->type = type;
2593 __entry->agbno = agbno;
2594 __entry->len = len;
2595 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002596 TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x fsbcount 0x%x",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002597 MAJOR(__entry->dev), MINOR(__entry->dev),
2598 __entry->type,
2599 __entry->agno,
2600 __entry->agbno,
2601 __entry->len)
2602);
2603#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2604DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2605 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2606 int type, \
2607 xfs_agblock_t bno, \
2608 xfs_extlen_t len), \
2609 TP_ARGS(mp, agno, type, bno, len))
2610
2611DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2612 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2613 int op,
2614 xfs_agblock_t agbno,
2615 xfs_ino_t ino,
2616 int whichfork,
2617 xfs_fileoff_t offset,
2618 xfs_filblks_t len,
2619 xfs_exntst_t state),
2620 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2621 TP_STRUCT__entry(
2622 __field(dev_t, dev)
2623 __field(xfs_agnumber_t, agno)
2624 __field(xfs_ino_t, ino)
2625 __field(xfs_agblock_t, agbno)
2626 __field(int, whichfork)
2627 __field(xfs_fileoff_t, l_loff)
2628 __field(xfs_filblks_t, l_len)
2629 __field(xfs_exntst_t, l_state)
2630 __field(int, op)
2631 ),
2632 TP_fast_assign(
2633 __entry->dev = mp->m_super->s_dev;
2634 __entry->agno = agno;
2635 __entry->ino = ino;
2636 __entry->agbno = agbno;
2637 __entry->whichfork = whichfork;
2638 __entry->l_loff = offset;
2639 __entry->l_len = len;
2640 __entry->l_state = state;
2641 __entry->op = op;
2642 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002643 TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x owner 0x%llx %s fileoff 0x%llx fsbcount 0x%llx state %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002644 MAJOR(__entry->dev), MINOR(__entry->dev),
2645 __entry->op,
2646 __entry->agno,
2647 __entry->agbno,
2648 __entry->ino,
Darrick J. Wongf93f85f2021-08-17 13:09:26 -07002649 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002650 __entry->l_loff,
2651 __entry->l_len,
2652 __entry->l_state)
2653);
2654#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2655DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2656 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2657 int op, \
2658 xfs_agblock_t agbno, \
2659 xfs_ino_t ino, \
2660 int whichfork, \
2661 xfs_fileoff_t offset, \
2662 xfs_filblks_t len, \
2663 xfs_exntst_t state), \
2664 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2665
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002666DEFINE_DEFER_EVENT(xfs_defer_cancel);
2667DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2668DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2669DEFINE_DEFER_EVENT(xfs_defer_finish);
2670DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2671
2672DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2673DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002674
Brian Foster1ae093cb2018-08-01 07:20:34 -07002675DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2676DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002677DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2678DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
Darrick J. Wong4e919af2020-09-27 16:18:13 -07002679DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002680
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002681#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2682DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2683DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
Brian Fosterf8f28352018-05-07 17:38:47 -07002684DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2685DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002686
Darrick J. Wong673930c2016-08-03 11:33:43 +10002687/* rmap tracepoints */
2688DECLARE_EVENT_CLASS(xfs_rmap_class,
2689 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2690 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
Darrick J. Wong66e32372018-12-12 08:46:23 -08002691 const struct xfs_owner_info *oinfo),
Darrick J. Wong673930c2016-08-03 11:33:43 +10002692 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2693 TP_STRUCT__entry(
2694 __field(dev_t, dev)
2695 __field(xfs_agnumber_t, agno)
2696 __field(xfs_agblock_t, agbno)
2697 __field(xfs_extlen_t, len)
2698 __field(uint64_t, owner)
2699 __field(uint64_t, offset)
2700 __field(unsigned long, flags)
2701 ),
2702 TP_fast_assign(
2703 __entry->dev = mp->m_super->s_dev;
2704 __entry->agno = agno;
2705 __entry->agbno = agbno;
2706 __entry->len = len;
2707 __entry->owner = oinfo->oi_owner;
2708 __entry->offset = oinfo->oi_offset;
2709 __entry->flags = oinfo->oi_flags;
Darrick J. Wong035e00a2016-08-03 11:36:07 +10002710 if (unwritten)
2711 __entry->flags |= XFS_RMAP_UNWRITTEN;
Darrick J. Wong673930c2016-08-03 11:33:43 +10002712 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002713 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%lx",
Darrick J. Wong673930c2016-08-03 11:33:43 +10002714 MAJOR(__entry->dev), MINOR(__entry->dev),
2715 __entry->agno,
2716 __entry->agbno,
2717 __entry->len,
2718 __entry->owner,
2719 __entry->offset,
2720 __entry->flags)
2721);
2722#define DEFINE_RMAP_EVENT(name) \
2723DEFINE_EVENT(xfs_rmap_class, name, \
2724 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2725 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
Darrick J. Wong66e32372018-12-12 08:46:23 -08002726 const struct xfs_owner_info *oinfo), \
Darrick J. Wong673930c2016-08-03 11:33:43 +10002727 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2728
2729/* simple AG-based error/%ip tracepoint class */
2730DECLARE_EVENT_CLASS(xfs_ag_error_class,
2731 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2732 unsigned long caller_ip),
2733 TP_ARGS(mp, agno, error, caller_ip),
2734 TP_STRUCT__entry(
2735 __field(dev_t, dev)
2736 __field(xfs_agnumber_t, agno)
2737 __field(int, error)
2738 __field(unsigned long, caller_ip)
2739 ),
2740 TP_fast_assign(
2741 __entry->dev = mp->m_super->s_dev;
2742 __entry->agno = agno;
2743 __entry->error = error;
2744 __entry->caller_ip = caller_ip;
2745 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07002746 TP_printk("dev %d:%d agno 0x%x error %d caller %pS",
Darrick J. Wong673930c2016-08-03 11:33:43 +10002747 MAJOR(__entry->dev), MINOR(__entry->dev),
2748 __entry->agno,
2749 __entry->error,
2750 (char *)__entry->caller_ip)
2751);
2752
2753#define DEFINE_AG_ERROR_EVENT(name) \
2754DEFINE_EVENT(xfs_ag_error_class, name, \
2755 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2756 unsigned long caller_ip), \
2757 TP_ARGS(mp, agno, error, caller_ip))
2758
2759DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2760DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2761DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2762DEFINE_RMAP_EVENT(xfs_rmap_map);
2763DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2764DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002765DEFINE_RMAP_EVENT(xfs_rmap_convert);
2766DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2767DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2768DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
Darrick J. Wong673930c2016-08-03 11:33:43 +10002769
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002770DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2771 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2772 xfs_agblock_t agbno, xfs_extlen_t len,
2773 uint64_t owner, uint64_t offset, unsigned int flags),
2774 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2775 TP_STRUCT__entry(
2776 __field(dev_t, dev)
2777 __field(xfs_agnumber_t, agno)
2778 __field(xfs_agblock_t, agbno)
2779 __field(xfs_extlen_t, len)
2780 __field(uint64_t, owner)
2781 __field(uint64_t, offset)
2782 __field(unsigned int, flags)
2783 ),
2784 TP_fast_assign(
2785 __entry->dev = mp->m_super->s_dev;
2786 __entry->agno = agno;
2787 __entry->agbno = agbno;
2788 __entry->len = len;
2789 __entry->owner = owner;
2790 __entry->offset = offset;
2791 __entry->flags = flags;
2792 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002793 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002794 MAJOR(__entry->dev), MINOR(__entry->dev),
2795 __entry->agno,
2796 __entry->agbno,
2797 __entry->len,
2798 __entry->owner,
2799 __entry->offset,
2800 __entry->flags)
2801);
2802#define DEFINE_RMAPBT_EVENT(name) \
2803DEFINE_EVENT(xfs_rmapbt_class, name, \
2804 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2805 xfs_agblock_t agbno, xfs_extlen_t len, \
2806 uint64_t owner, uint64_t offset, unsigned int flags), \
2807 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2808
2809#define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2810DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2811DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2812
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002813DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2814DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002815DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2816DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2817DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2818DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2819DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2820DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
Darrick J. Wongceeb9c82016-10-03 09:11:48 -07002821
2822DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2823DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2824DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2825DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
Darrick J. Wong0a1b0b32016-08-03 11:44:21 +10002826DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2827DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002828DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002829
Darrick J. Wong9f3afb52016-10-03 09:11:28 -07002830/* deferred bmbt updates */
2831#define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2832DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2833DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2834
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002835/* per-AG reservation */
2836DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2837 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2838 xfs_extlen_t len),
2839 TP_ARGS(pag, resv, len),
2840 TP_STRUCT__entry(
2841 __field(dev_t, dev)
2842 __field(xfs_agnumber_t, agno)
2843 __field(int, resv)
2844 __field(xfs_extlen_t, freeblks)
2845 __field(xfs_extlen_t, flcount)
2846 __field(xfs_extlen_t, reserved)
2847 __field(xfs_extlen_t, asked)
2848 __field(xfs_extlen_t, len)
2849 ),
2850 TP_fast_assign(
2851 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2852
2853 __entry->dev = pag->pag_mount->m_super->s_dev;
2854 __entry->agno = pag->pag_agno;
2855 __entry->resv = resv;
2856 __entry->freeblks = pag->pagf_freeblks;
2857 __entry->flcount = pag->pagf_flcount;
2858 __entry->reserved = r ? r->ar_reserved : 0;
2859 __entry->asked = r ? r->ar_asked : 0;
2860 __entry->len = len;
2861 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07002862 TP_printk("dev %d:%d agno 0x%x resv %d freeblks %u flcount %u "
Hou Tao42bf9db2017-04-14 11:43:27 -07002863 "resv %u ask %u len %u",
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002864 MAJOR(__entry->dev), MINOR(__entry->dev),
2865 __entry->agno,
2866 __entry->resv,
2867 __entry->freeblks,
2868 __entry->flcount,
2869 __entry->reserved,
2870 __entry->asked,
2871 __entry->len)
2872)
2873#define DEFINE_AG_RESV_EVENT(name) \
2874DEFINE_EVENT(xfs_ag_resv_class, name, \
2875 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2876 xfs_extlen_t len), \
2877 TP_ARGS(pag, type, len))
2878
2879/* per-AG reservation tracepoints */
2880DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2881DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2882DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2883DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2884DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2885DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2886
2887DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2888DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2889
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002890/* refcount tracepoint classes */
2891
2892/* reuse the discard trace class for agbno/aglen-based traces */
2893#define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2894
2895/* ag btree lookup tracepoint class */
Darrick J. Wong85f8dff2018-12-18 14:32:29 -08002896TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2897TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2898TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002899DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2900 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2901 xfs_agblock_t agbno, xfs_lookup_t dir),
2902 TP_ARGS(mp, agno, agbno, dir),
2903 TP_STRUCT__entry(
2904 __field(dev_t, dev)
2905 __field(xfs_agnumber_t, agno)
2906 __field(xfs_agblock_t, agbno)
2907 __field(xfs_lookup_t, dir)
2908 ),
2909 TP_fast_assign(
2910 __entry->dev = mp->m_super->s_dev;
2911 __entry->agno = agno;
2912 __entry->agbno = agbno;
2913 __entry->dir = dir;
2914 ),
Darrick J. Wongf7b08162021-08-17 09:28:53 -07002915 TP_printk("dev %d:%d agno 0x%x agbno 0x%x cmp %s(%d)",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002916 MAJOR(__entry->dev), MINOR(__entry->dev),
2917 __entry->agno,
2918 __entry->agbno,
2919 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2920 __entry->dir)
2921)
2922
2923#define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2924DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2925 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2926 xfs_agblock_t agbno, xfs_lookup_t dir), \
2927 TP_ARGS(mp, agno, agbno, dir))
2928
2929/* single-rcext tracepoint class */
2930DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2931 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2932 struct xfs_refcount_irec *irec),
2933 TP_ARGS(mp, agno, irec),
2934 TP_STRUCT__entry(
2935 __field(dev_t, dev)
2936 __field(xfs_agnumber_t, agno)
2937 __field(xfs_agblock_t, startblock)
2938 __field(xfs_extlen_t, blockcount)
2939 __field(xfs_nlink_t, refcount)
2940 ),
2941 TP_fast_assign(
2942 __entry->dev = mp->m_super->s_dev;
2943 __entry->agno = agno;
2944 __entry->startblock = irec->rc_startblock;
2945 __entry->blockcount = irec->rc_blockcount;
2946 __entry->refcount = irec->rc_refcount;
2947 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002948 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002949 MAJOR(__entry->dev), MINOR(__entry->dev),
2950 __entry->agno,
2951 __entry->startblock,
2952 __entry->blockcount,
2953 __entry->refcount)
2954)
2955
2956#define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2957DEFINE_EVENT(xfs_refcount_extent_class, name, \
2958 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2959 struct xfs_refcount_irec *irec), \
2960 TP_ARGS(mp, agno, irec))
2961
2962/* single-rcext and an agbno tracepoint class */
2963DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2964 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2965 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2966 TP_ARGS(mp, agno, irec, agbno),
2967 TP_STRUCT__entry(
2968 __field(dev_t, dev)
2969 __field(xfs_agnumber_t, agno)
2970 __field(xfs_agblock_t, startblock)
2971 __field(xfs_extlen_t, blockcount)
2972 __field(xfs_nlink_t, refcount)
2973 __field(xfs_agblock_t, agbno)
2974 ),
2975 TP_fast_assign(
2976 __entry->dev = mp->m_super->s_dev;
2977 __entry->agno = agno;
2978 __entry->startblock = irec->rc_startblock;
2979 __entry->blockcount = irec->rc_blockcount;
2980 __entry->refcount = irec->rc_refcount;
2981 __entry->agbno = agbno;
2982 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07002983 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002984 MAJOR(__entry->dev), MINOR(__entry->dev),
2985 __entry->agno,
2986 __entry->startblock,
2987 __entry->blockcount,
2988 __entry->refcount,
2989 __entry->agbno)
2990)
2991
2992#define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2993DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2994 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2995 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2996 TP_ARGS(mp, agno, irec, agbno))
2997
2998/* double-rcext tracepoint class */
2999DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
3000 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3001 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
3002 TP_ARGS(mp, agno, i1, i2),
3003 TP_STRUCT__entry(
3004 __field(dev_t, dev)
3005 __field(xfs_agnumber_t, agno)
3006 __field(xfs_agblock_t, i1_startblock)
3007 __field(xfs_extlen_t, i1_blockcount)
3008 __field(xfs_nlink_t, i1_refcount)
3009 __field(xfs_agblock_t, i2_startblock)
3010 __field(xfs_extlen_t, i2_blockcount)
3011 __field(xfs_nlink_t, i2_refcount)
3012 ),
3013 TP_fast_assign(
3014 __entry->dev = mp->m_super->s_dev;
3015 __entry->agno = agno;
3016 __entry->i1_startblock = i1->rc_startblock;
3017 __entry->i1_blockcount = i1->rc_blockcount;
3018 __entry->i1_refcount = i1->rc_refcount;
3019 __entry->i2_startblock = i2->rc_startblock;
3020 __entry->i2_blockcount = i2->rc_blockcount;
3021 __entry->i2_refcount = i2->rc_refcount;
3022 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07003023 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- "
3024 "agbno 0x%x fsbcount 0x%x refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003025 MAJOR(__entry->dev), MINOR(__entry->dev),
3026 __entry->agno,
3027 __entry->i1_startblock,
3028 __entry->i1_blockcount,
3029 __entry->i1_refcount,
3030 __entry->i2_startblock,
3031 __entry->i2_blockcount,
3032 __entry->i2_refcount)
3033)
3034
3035#define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
3036DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
3037 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3038 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
3039 TP_ARGS(mp, agno, i1, i2))
3040
3041/* double-rcext and an agbno tracepoint class */
3042DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
3043 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3044 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3045 xfs_agblock_t agbno),
3046 TP_ARGS(mp, agno, i1, i2, agbno),
3047 TP_STRUCT__entry(
3048 __field(dev_t, dev)
3049 __field(xfs_agnumber_t, agno)
3050 __field(xfs_agblock_t, i1_startblock)
3051 __field(xfs_extlen_t, i1_blockcount)
3052 __field(xfs_nlink_t, i1_refcount)
3053 __field(xfs_agblock_t, i2_startblock)
3054 __field(xfs_extlen_t, i2_blockcount)
3055 __field(xfs_nlink_t, i2_refcount)
3056 __field(xfs_agblock_t, agbno)
3057 ),
3058 TP_fast_assign(
3059 __entry->dev = mp->m_super->s_dev;
3060 __entry->agno = agno;
3061 __entry->i1_startblock = i1->rc_startblock;
3062 __entry->i1_blockcount = i1->rc_blockcount;
3063 __entry->i1_refcount = i1->rc_refcount;
3064 __entry->i2_startblock = i2->rc_startblock;
3065 __entry->i2_blockcount = i2->rc_blockcount;
3066 __entry->i2_refcount = i2->rc_refcount;
3067 __entry->agbno = agbno;
3068 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07003069 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- "
3070 "agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003071 MAJOR(__entry->dev), MINOR(__entry->dev),
3072 __entry->agno,
3073 __entry->i1_startblock,
3074 __entry->i1_blockcount,
3075 __entry->i1_refcount,
3076 __entry->i2_startblock,
3077 __entry->i2_blockcount,
3078 __entry->i2_refcount,
3079 __entry->agbno)
3080)
3081
3082#define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
3083DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
3084 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3085 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3086 xfs_agblock_t agbno), \
3087 TP_ARGS(mp, agno, i1, i2, agbno))
3088
3089/* triple-rcext tracepoint class */
3090DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
3091 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3092 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3093 struct xfs_refcount_irec *i3),
3094 TP_ARGS(mp, agno, i1, i2, i3),
3095 TP_STRUCT__entry(
3096 __field(dev_t, dev)
3097 __field(xfs_agnumber_t, agno)
3098 __field(xfs_agblock_t, i1_startblock)
3099 __field(xfs_extlen_t, i1_blockcount)
3100 __field(xfs_nlink_t, i1_refcount)
3101 __field(xfs_agblock_t, i2_startblock)
3102 __field(xfs_extlen_t, i2_blockcount)
3103 __field(xfs_nlink_t, i2_refcount)
3104 __field(xfs_agblock_t, i3_startblock)
3105 __field(xfs_extlen_t, i3_blockcount)
3106 __field(xfs_nlink_t, i3_refcount)
3107 ),
3108 TP_fast_assign(
3109 __entry->dev = mp->m_super->s_dev;
3110 __entry->agno = agno;
3111 __entry->i1_startblock = i1->rc_startblock;
3112 __entry->i1_blockcount = i1->rc_blockcount;
3113 __entry->i1_refcount = i1->rc_refcount;
3114 __entry->i2_startblock = i2->rc_startblock;
3115 __entry->i2_blockcount = i2->rc_blockcount;
3116 __entry->i2_refcount = i2->rc_refcount;
3117 __entry->i3_startblock = i3->rc_startblock;
3118 __entry->i3_blockcount = i3->rc_blockcount;
3119 __entry->i3_refcount = i3->rc_refcount;
3120 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07003121 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- "
3122 "agbno 0x%x fsbcount 0x%x refcount %u -- "
3123 "agbno 0x%x fsbcount 0x%x refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003124 MAJOR(__entry->dev), MINOR(__entry->dev),
3125 __entry->agno,
3126 __entry->i1_startblock,
3127 __entry->i1_blockcount,
3128 __entry->i1_refcount,
3129 __entry->i2_startblock,
3130 __entry->i2_blockcount,
3131 __entry->i2_refcount,
3132 __entry->i3_startblock,
3133 __entry->i3_blockcount,
3134 __entry->i3_refcount)
3135);
3136
3137#define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
3138DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
3139 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3140 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3141 struct xfs_refcount_irec *i3), \
3142 TP_ARGS(mp, agno, i1, i2, i3))
3143
3144/* refcount btree tracepoints */
3145DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
3146DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
3147DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
3148DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
3149DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
3150DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
3151DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
3152DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
3153DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
3154DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
3155
3156/* refcount adjustment tracepoints */
3157DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
3158DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
Darrick J. Wong174edb02016-10-03 09:11:39 -07003159DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
3160DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003161DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
3162DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
Darrick J. Wong174edb02016-10-03 09:11:39 -07003163DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003164DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
3165DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
3166DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
3167DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
3168DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
3169DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
Darrick J. Wong174edb02016-10-03 09:11:39 -07003170DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003171DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
3172DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
3173DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
3174DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
3175DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
3176DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
3177DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
3178
3179/* reflink helpers */
3180DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
3181DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
3182DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
Darrick J. Wong33ba61292016-10-03 09:11:22 -07003183#define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
3184DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
3185DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003186
Darrick J. Wongf997ee22016-10-03 09:11:21 -07003187TRACE_EVENT(xfs_refcount_finish_one_leftover,
3188 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3189 int type, xfs_agblock_t agbno, xfs_extlen_t len,
3190 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
3191 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
3192 TP_STRUCT__entry(
3193 __field(dev_t, dev)
3194 __field(xfs_agnumber_t, agno)
3195 __field(int, type)
3196 __field(xfs_agblock_t, agbno)
3197 __field(xfs_extlen_t, len)
3198 __field(xfs_agblock_t, new_agbno)
3199 __field(xfs_extlen_t, new_len)
3200 ),
3201 TP_fast_assign(
3202 __entry->dev = mp->m_super->s_dev;
3203 __entry->agno = agno;
3204 __entry->type = type;
3205 __entry->agbno = agbno;
3206 __entry->len = len;
3207 __entry->new_agbno = new_agbno;
3208 __entry->new_len = new_len;
3209 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07003210 TP_printk("dev %d:%d type %d agno 0x%x agbno 0x%x fsbcount 0x%x new_agbno 0x%x new_fsbcount 0x%x",
Darrick J. Wongf997ee22016-10-03 09:11:21 -07003211 MAJOR(__entry->dev), MINOR(__entry->dev),
3212 __entry->type,
3213 __entry->agno,
3214 __entry->agbno,
3215 __entry->len,
3216 __entry->new_agbno,
3217 __entry->new_len)
3218);
3219
Darrick J. Wongf65306e2016-10-03 09:11:27 -07003220/* simple inode-based error/%ip tracepoint class */
3221DECLARE_EVENT_CLASS(xfs_inode_error_class,
3222 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3223 TP_ARGS(ip, error, caller_ip),
3224 TP_STRUCT__entry(
3225 __field(dev_t, dev)
3226 __field(xfs_ino_t, ino)
3227 __field(int, error)
3228 __field(unsigned long, caller_ip)
3229 ),
3230 TP_fast_assign(
3231 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3232 __entry->ino = ip->i_ino;
3233 __entry->error = error;
3234 __entry->caller_ip = caller_ip;
3235 ),
Darrick J. Wongaf6265a2021-08-17 09:20:27 -07003236 TP_printk("dev %d:%d ino 0x%llx error %d caller %pS",
Darrick J. Wongf65306e2016-10-03 09:11:27 -07003237 MAJOR(__entry->dev), MINOR(__entry->dev),
3238 __entry->ino,
3239 __entry->error,
3240 (char *)__entry->caller_ip)
3241);
3242
3243#define DEFINE_INODE_ERROR_EVENT(name) \
3244DEFINE_EVENT(xfs_inode_error_class, name, \
3245 TP_PROTO(struct xfs_inode *ip, int error, \
3246 unsigned long caller_ip), \
3247 TP_ARGS(ip, error, caller_ip))
3248
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003249/* reflink tracepoint classes */
3250
3251/* two-file io tracepoint class */
3252DECLARE_EVENT_CLASS(xfs_double_io_class,
3253 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3254 struct xfs_inode *dest, xfs_off_t doffset),
3255 TP_ARGS(src, soffset, len, dest, doffset),
3256 TP_STRUCT__entry(
3257 __field(dev_t, dev)
3258 __field(xfs_ino_t, src_ino)
3259 __field(loff_t, src_isize)
3260 __field(loff_t, src_disize)
3261 __field(loff_t, src_offset)
Darrick J. Wongd538cf22021-08-17 13:00:13 -07003262 __field(long long, len)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003263 __field(xfs_ino_t, dest_ino)
3264 __field(loff_t, dest_isize)
3265 __field(loff_t, dest_disize)
3266 __field(loff_t, dest_offset)
3267 ),
3268 TP_fast_assign(
3269 __entry->dev = VFS_I(src)->i_sb->s_dev;
3270 __entry->src_ino = src->i_ino;
3271 __entry->src_isize = VFS_I(src)->i_size;
Christoph Hellwig13d2c102021-03-29 11:11:40 -07003272 __entry->src_disize = src->i_disk_size;
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003273 __entry->src_offset = soffset;
3274 __entry->len = len;
3275 __entry->dest_ino = dest->i_ino;
3276 __entry->dest_isize = VFS_I(dest)->i_size;
Christoph Hellwig13d2c102021-03-29 11:11:40 -07003277 __entry->dest_disize = dest->i_disk_size;
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003278 __entry->dest_offset = doffset;
3279 ),
Darrick J. Wongd538cf22021-08-17 13:00:13 -07003280 TP_printk("dev %d:%d bytecount 0x%llx "
Darrick J. Wong49e68c92021-08-17 10:09:12 -07003281 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx -> "
3282 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx",
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003283 MAJOR(__entry->dev), MINOR(__entry->dev),
3284 __entry->len,
3285 __entry->src_ino,
3286 __entry->src_isize,
3287 __entry->src_disize,
3288 __entry->src_offset,
3289 __entry->dest_ino,
3290 __entry->dest_isize,
3291 __entry->dest_disize,
3292 __entry->dest_offset)
3293)
3294
3295#define DEFINE_DOUBLE_IO_EVENT(name) \
3296DEFINE_EVENT(xfs_double_io_class, name, \
3297 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3298 struct xfs_inode *dest, xfs_off_t doffset), \
3299 TP_ARGS(src, soffset, len, dest, doffset))
3300
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003301/* inode/irec events */
3302DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3303 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3304 TP_ARGS(ip, irec),
3305 TP_STRUCT__entry(
3306 __field(dev_t, dev)
3307 __field(xfs_ino_t, ino)
3308 __field(xfs_fileoff_t, lblk)
3309 __field(xfs_extlen_t, len)
3310 __field(xfs_fsblock_t, pblk)
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003311 __field(int, state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003312 ),
3313 TP_fast_assign(
3314 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3315 __entry->ino = ip->i_ino;
3316 __entry->lblk = irec->br_startoff;
3317 __entry->len = irec->br_blockcount;
3318 __entry->pblk = irec->br_startblock;
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003319 __entry->state = irec->br_state;
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003320 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07003321 TP_printk("dev %d:%d ino 0x%llx fileoff 0x%llx fsbcount 0x%x startblock 0x%llx st %d",
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003322 MAJOR(__entry->dev), MINOR(__entry->dev),
3323 __entry->ino,
3324 __entry->lblk,
3325 __entry->len,
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003326 __entry->pblk,
3327 __entry->state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003328);
3329#define DEFINE_INODE_IREC_EVENT(name) \
3330DEFINE_EVENT(xfs_inode_irec_class, name, \
3331 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3332 TP_ARGS(ip, irec))
3333
3334/* refcount/reflink tracepoint definitions */
3335
3336/* reflink tracepoints */
3337DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3338DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3339DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
Darrick J. Wong00fd1d52020-06-29 14:47:18 -07003340TRACE_EVENT(xfs_reflink_remap_blocks,
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003341 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3342 xfs_filblks_t len, struct xfs_inode *dest,
3343 xfs_fileoff_t doffset),
3344 TP_ARGS(src, soffset, len, dest, doffset),
3345 TP_STRUCT__entry(
3346 __field(dev_t, dev)
3347 __field(xfs_ino_t, src_ino)
3348 __field(xfs_fileoff_t, src_lblk)
3349 __field(xfs_filblks_t, len)
3350 __field(xfs_ino_t, dest_ino)
3351 __field(xfs_fileoff_t, dest_lblk)
3352 ),
3353 TP_fast_assign(
3354 __entry->dev = VFS_I(src)->i_sb->s_dev;
3355 __entry->src_ino = src->i_ino;
3356 __entry->src_lblk = soffset;
3357 __entry->len = len;
3358 __entry->dest_ino = dest->i_ino;
3359 __entry->dest_lblk = doffset;
3360 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07003361 TP_printk("dev %d:%d fsbcount 0x%llx "
Darrick J. Wong49e68c92021-08-17 10:09:12 -07003362 "ino 0x%llx fileoff 0x%llx -> ino 0x%llx fileoff 0x%llx",
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003363 MAJOR(__entry->dev), MINOR(__entry->dev),
3364 __entry->len,
3365 __entry->src_ino,
3366 __entry->src_lblk,
3367 __entry->dest_ino,
3368 __entry->dest_lblk)
3369);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003370DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3371DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3372DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3373DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003374DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3375DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
Darrick J. Wong00fd1d52020-06-29 14:47:18 -07003376DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
3377DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003378
3379/* dedupe tracepoints */
3380DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3381DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3382
3383/* ioctl tracepoints */
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003384TRACE_EVENT(xfs_ioctl_clone,
3385 TP_PROTO(struct inode *src, struct inode *dest),
3386 TP_ARGS(src, dest),
3387 TP_STRUCT__entry(
3388 __field(dev_t, dev)
3389 __field(unsigned long, src_ino)
3390 __field(loff_t, src_isize)
3391 __field(unsigned long, dest_ino)
3392 __field(loff_t, dest_isize)
3393 ),
3394 TP_fast_assign(
3395 __entry->dev = src->i_sb->s_dev;
3396 __entry->src_ino = src->i_ino;
3397 __entry->src_isize = i_size_read(src);
3398 __entry->dest_ino = dest->i_ino;
3399 __entry->dest_isize = i_size_read(dest);
3400 ),
Darrick J. Wongc23460e2021-08-17 13:03:19 -07003401 TP_printk("dev %d:%d ino 0x%lx isize 0x%llx -> ino 0x%lx isize 0x%llx",
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003402 MAJOR(__entry->dev), MINOR(__entry->dev),
3403 __entry->src_ino,
3404 __entry->src_isize,
3405 __entry->dest_ino,
3406 __entry->dest_isize)
3407);
3408
3409/* unshare tracepoints */
3410DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003411DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003412
3413/* copy on write */
3414DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
Darrick J. Wongbe51f812016-10-03 09:11:32 -07003415DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3416DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003417DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003418
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003419DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3420DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3421DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003422
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003423DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3424DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3425
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003426
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003427DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003428
Darrick J. Wong1f08af52016-10-03 09:11:53 -07003429/* rmap swapext tracepoints */
3430DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3431DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3432DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3433
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003434/* fsmap traces */
3435DECLARE_EVENT_CLASS(xfs_fsmap_class,
3436 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
Darrick J. Wong159eb692021-08-10 17:02:16 -07003437 const struct xfs_rmap_irec *rmap),
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003438 TP_ARGS(mp, keydev, agno, rmap),
3439 TP_STRUCT__entry(
3440 __field(dev_t, dev)
3441 __field(dev_t, keydev)
3442 __field(xfs_agnumber_t, agno)
3443 __field(xfs_fsblock_t, bno)
3444 __field(xfs_filblks_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003445 __field(uint64_t, owner)
3446 __field(uint64_t, offset)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003447 __field(unsigned int, flags)
3448 ),
3449 TP_fast_assign(
3450 __entry->dev = mp->m_super->s_dev;
3451 __entry->keydev = new_decode_dev(keydev);
3452 __entry->agno = agno;
3453 __entry->bno = rmap->rm_startblock;
3454 __entry->len = rmap->rm_blockcount;
3455 __entry->owner = rmap->rm_owner;
3456 __entry->offset = rmap->rm_offset;
3457 __entry->flags = rmap->rm_flags;
3458 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07003459 TP_printk("dev %d:%d keydev %d:%d agno 0x%x startblock 0x%llx fsbcount 0x%llx owner 0x%llx fileoff 0x%llx flags 0x%x",
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003460 MAJOR(__entry->dev), MINOR(__entry->dev),
3461 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3462 __entry->agno,
3463 __entry->bno,
3464 __entry->len,
3465 __entry->owner,
3466 __entry->offset,
3467 __entry->flags)
3468)
3469#define DEFINE_FSMAP_EVENT(name) \
3470DEFINE_EVENT(xfs_fsmap_class, name, \
3471 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
Darrick J. Wong159eb692021-08-10 17:02:16 -07003472 const struct xfs_rmap_irec *rmap), \
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003473 TP_ARGS(mp, keydev, agno, rmap))
3474DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3475DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3476DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3477
3478DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3479 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3480 TP_ARGS(mp, fsmap),
3481 TP_STRUCT__entry(
3482 __field(dev_t, dev)
3483 __field(dev_t, keydev)
3484 __field(xfs_daddr_t, block)
3485 __field(xfs_daddr_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003486 __field(uint64_t, owner)
3487 __field(uint64_t, offset)
3488 __field(uint64_t, flags)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003489 ),
3490 TP_fast_assign(
3491 __entry->dev = mp->m_super->s_dev;
3492 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3493 __entry->block = fsmap->fmr_physical;
3494 __entry->len = fsmap->fmr_length;
3495 __entry->owner = fsmap->fmr_owner;
3496 __entry->offset = fsmap->fmr_offset;
3497 __entry->flags = fsmap->fmr_flags;
3498 ),
Darrick J. Wong7989acc2021-08-17 12:45:59 -07003499 TP_printk("dev %d:%d keydev %d:%d daddr 0x%llx bbcount 0x%llx owner 0x%llx fileoff_daddr 0x%llx flags 0x%llx",
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003500 MAJOR(__entry->dev), MINOR(__entry->dev),
3501 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3502 __entry->block,
3503 __entry->len,
3504 __entry->owner,
3505 __entry->offset,
3506 __entry->flags)
3507)
3508#define DEFINE_GETFSMAP_EVENT(name) \
3509DEFINE_EVENT(xfs_getfsmap_class, name, \
3510 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3511 TP_ARGS(mp, fsmap))
3512DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3513DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3514DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3515
Darrick J. Wongb872af22018-01-08 10:51:26 -08003516TRACE_EVENT(xfs_trans_resv_calc,
3517 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3518 struct xfs_trans_res *res),
3519 TP_ARGS(mp, type, res),
3520 TP_STRUCT__entry(
3521 __field(dev_t, dev)
3522 __field(int, type)
3523 __field(uint, logres)
3524 __field(int, logcount)
3525 __field(int, logflags)
3526 ),
3527 TP_fast_assign(
3528 __entry->dev = mp->m_super->s_dev;
3529 __entry->type = type;
3530 __entry->logres = res->tr_logres;
3531 __entry->logcount = res->tr_logcount;
3532 __entry->logflags = res->tr_logflags;
3533 ),
3534 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3535 MAJOR(__entry->dev), MINOR(__entry->dev),
3536 __entry->type,
3537 __entry->logres,
3538 __entry->logcount,
3539 __entry->logflags)
3540);
3541
Dave Chinnerba187812018-05-09 07:47:57 -07003542DECLARE_EVENT_CLASS(xfs_trans_class,
3543 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3544 TP_ARGS(tp, caller_ip),
3545 TP_STRUCT__entry(
3546 __field(dev_t, dev)
3547 __field(uint32_t, tid)
3548 __field(uint32_t, flags)
3549 __field(unsigned long, caller_ip)
3550 ),
3551 TP_fast_assign(
3552 __entry->dev = tp->t_mountp->m_super->s_dev;
3553 __entry->tid = 0;
3554 if (tp->t_ticket)
3555 __entry->tid = tp->t_ticket->t_tid;
3556 __entry->flags = tp->t_flags;
3557 __entry->caller_ip = caller_ip;
3558 ),
3559 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3560 MAJOR(__entry->dev), MINOR(__entry->dev),
3561 __entry->tid,
3562 __entry->flags,
3563 (char *)__entry->caller_ip)
3564)
3565
3566#define DEFINE_TRANS_EVENT(name) \
3567DEFINE_EVENT(xfs_trans_class, name, \
3568 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3569 TP_ARGS(tp, caller_ip))
3570DEFINE_TRANS_EVENT(xfs_trans_alloc);
3571DEFINE_TRANS_EVENT(xfs_trans_cancel);
3572DEFINE_TRANS_EVENT(xfs_trans_commit);
3573DEFINE_TRANS_EVENT(xfs_trans_dup);
3574DEFINE_TRANS_EVENT(xfs_trans_free);
3575DEFINE_TRANS_EVENT(xfs_trans_roll);
3576DEFINE_TRANS_EVENT(xfs_trans_add_item);
Christoph Hellwig195cd832019-06-28 19:27:31 -07003577DEFINE_TRANS_EVENT(xfs_trans_commit_items);
Dave Chinnerba187812018-05-09 07:47:57 -07003578DEFINE_TRANS_EVENT(xfs_trans_free_items);
3579
Darrick J. Wong9a4a5112019-02-07 10:37:14 -08003580TRACE_EVENT(xfs_iunlink_update_bucket,
3581 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3582 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3583 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3584 TP_STRUCT__entry(
3585 __field(dev_t, dev)
3586 __field(xfs_agnumber_t, agno)
3587 __field(unsigned int, bucket)
3588 __field(xfs_agino_t, old_ptr)
3589 __field(xfs_agino_t, new_ptr)
3590 ),
3591 TP_fast_assign(
3592 __entry->dev = mp->m_super->s_dev;
3593 __entry->agno = agno;
3594 __entry->bucket = bucket;
3595 __entry->old_ptr = old_ptr;
3596 __entry->new_ptr = new_ptr;
3597 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07003598 TP_printk("dev %d:%d agno 0x%x bucket %u old 0x%x new 0x%x",
Darrick J. Wong9a4a5112019-02-07 10:37:14 -08003599 MAJOR(__entry->dev), MINOR(__entry->dev),
3600 __entry->agno,
3601 __entry->bucket,
3602 __entry->old_ptr,
3603 __entry->new_ptr)
3604);
3605
Darrick J. Wongf2fc16a2019-02-07 10:37:15 -08003606TRACE_EVENT(xfs_iunlink_update_dinode,
3607 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3608 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3609 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3610 TP_STRUCT__entry(
3611 __field(dev_t, dev)
3612 __field(xfs_agnumber_t, agno)
3613 __field(xfs_agino_t, agino)
3614 __field(xfs_agino_t, old_ptr)
3615 __field(xfs_agino_t, new_ptr)
3616 ),
3617 TP_fast_assign(
3618 __entry->dev = mp->m_super->s_dev;
3619 __entry->agno = agno;
3620 __entry->agino = agino;
3621 __entry->old_ptr = old_ptr;
3622 __entry->new_ptr = new_ptr;
3623 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07003624 TP_printk("dev %d:%d agno 0x%x agino 0x%x old 0x%x new 0x%x",
Darrick J. Wongf2fc16a2019-02-07 10:37:15 -08003625 MAJOR(__entry->dev), MINOR(__entry->dev),
3626 __entry->agno,
3627 __entry->agino,
3628 __entry->old_ptr,
3629 __entry->new_ptr)
3630);
3631
Darrick J. Wong4664c662019-02-07 10:37:16 -08003632DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3633 TP_PROTO(struct xfs_inode *ip),
3634 TP_ARGS(ip),
3635 TP_STRUCT__entry(
3636 __field(dev_t, dev)
3637 __field(xfs_agnumber_t, agno)
3638 __field(xfs_agino_t, agino)
3639 ),
3640 TP_fast_assign(
3641 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3642 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3643 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3644 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07003645 TP_printk("dev %d:%d agno 0x%x agino 0x%x",
Darrick J. Wong4664c662019-02-07 10:37:16 -08003646 MAJOR(__entry->dev), MINOR(__entry->dev),
3647 __entry->agno, __entry->agino)
3648)
3649
3650#define DEFINE_AGINODE_EVENT(name) \
3651DEFINE_EVENT(xfs_ag_inode_class, name, \
3652 TP_PROTO(struct xfs_inode *ip), \
3653 TP_ARGS(ip))
3654DEFINE_AGINODE_EVENT(xfs_iunlink);
3655DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
Darrick J. Wong9b247172019-02-07 10:37:16 -08003656DEFINE_AG_EVENT(xfs_iunlink_map_prev_fallback);
Darrick J. Wong4664c662019-02-07 10:37:16 -08003657
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003658DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3659 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3660 TP_ARGS(mp, flags),
3661 TP_STRUCT__entry(
3662 __field(dev_t, dev)
3663 __field(unsigned int, flags)
3664 ),
3665 TP_fast_assign(
3666 __entry->dev = mp->m_super->s_dev;
3667 __entry->flags = flags;
3668 ),
3669 TP_printk("dev %d:%d flags 0x%x",
3670 MAJOR(__entry->dev), MINOR(__entry->dev),
3671 __entry->flags)
3672);
3673#define DEFINE_FS_CORRUPT_EVENT(name) \
3674DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3675 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3676 TP_ARGS(mp, flags))
3677DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3678DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003679DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003680DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3681DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003682DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003683
3684DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3685 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3686 TP_ARGS(mp, agno, flags),
3687 TP_STRUCT__entry(
3688 __field(dev_t, dev)
3689 __field(xfs_agnumber_t, agno)
3690 __field(unsigned int, flags)
3691 ),
3692 TP_fast_assign(
3693 __entry->dev = mp->m_super->s_dev;
3694 __entry->agno = agno;
3695 __entry->flags = flags;
3696 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07003697 TP_printk("dev %d:%d agno 0x%x flags 0x%x",
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003698 MAJOR(__entry->dev), MINOR(__entry->dev),
3699 __entry->agno, __entry->flags)
3700);
3701#define DEFINE_AG_CORRUPT_EVENT(name) \
3702DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3703 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3704 unsigned int flags), \
3705 TP_ARGS(mp, agno, flags))
3706DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3707DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003708DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003709
3710DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3711 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3712 TP_ARGS(ip, flags),
3713 TP_STRUCT__entry(
3714 __field(dev_t, dev)
3715 __field(xfs_ino_t, ino)
3716 __field(unsigned int, flags)
3717 ),
3718 TP_fast_assign(
3719 __entry->dev = ip->i_mount->m_super->s_dev;
3720 __entry->ino = ip->i_ino;
3721 __entry->flags = flags;
3722 ),
3723 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3724 MAJOR(__entry->dev), MINOR(__entry->dev),
3725 __entry->ino, __entry->flags)
3726);
3727#define DEFINE_INODE_CORRUPT_EVENT(name) \
3728DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3729 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3730 TP_ARGS(ip, flags))
3731DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3732DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3733
Darrick J. Wonga2114322019-07-02 09:39:38 -07003734TRACE_EVENT(xfs_iwalk_ag,
3735 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3736 xfs_agino_t startino),
3737 TP_ARGS(mp, agno, startino),
3738 TP_STRUCT__entry(
3739 __field(dev_t, dev)
3740 __field(xfs_agnumber_t, agno)
3741 __field(xfs_agino_t, startino)
3742 ),
3743 TP_fast_assign(
3744 __entry->dev = mp->m_super->s_dev;
3745 __entry->agno = agno;
3746 __entry->startino = startino;
3747 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07003748 TP_printk("dev %d:%d agno 0x%x startino 0x%x",
Darrick J. Wonga2114322019-07-02 09:39:38 -07003749 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3750 __entry->startino)
3751)
3752
3753TRACE_EVENT(xfs_iwalk_ag_rec,
3754 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3755 struct xfs_inobt_rec_incore *irec),
3756 TP_ARGS(mp, agno, irec),
3757 TP_STRUCT__entry(
3758 __field(dev_t, dev)
3759 __field(xfs_agnumber_t, agno)
3760 __field(xfs_agino_t, startino)
3761 __field(uint64_t, freemask)
3762 ),
3763 TP_fast_assign(
3764 __entry->dev = mp->m_super->s_dev;
3765 __entry->agno = agno;
3766 __entry->startino = irec->ir_startino;
3767 __entry->freemask = irec->ir_free;
3768 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07003769 TP_printk("dev %d:%d agno 0x%x startino 0x%x freemask 0x%llx",
Darrick J. Wonga2114322019-07-02 09:39:38 -07003770 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3771 __entry->startino, __entry->freemask)
3772)
3773
Darrick J. Wong40786712019-07-03 07:33:26 -07003774TRACE_EVENT(xfs_pwork_init,
3775 TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
3776 TP_ARGS(mp, nr_threads, pid),
3777 TP_STRUCT__entry(
3778 __field(dev_t, dev)
3779 __field(unsigned int, nr_threads)
3780 __field(pid_t, pid)
3781 ),
3782 TP_fast_assign(
3783 __entry->dev = mp->m_super->s_dev;
3784 __entry->nr_threads = nr_threads;
3785 __entry->pid = pid;
3786 ),
3787 TP_printk("dev %d:%d nr_threads %u pid %u",
3788 MAJOR(__entry->dev), MINOR(__entry->dev),
3789 __entry->nr_threads, __entry->pid)
3790)
3791
Dave Chinner0ad95682019-08-26 12:08:10 -07003792DECLARE_EVENT_CLASS(xfs_kmem_class,
3793 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
3794 TP_ARGS(size, flags, caller_ip),
3795 TP_STRUCT__entry(
3796 __field(ssize_t, size)
3797 __field(int, flags)
3798 __field(unsigned long, caller_ip)
3799 ),
3800 TP_fast_assign(
3801 __entry->size = size;
3802 __entry->flags = flags;
3803 __entry->caller_ip = caller_ip;
3804 ),
3805 TP_printk("size %zd flags 0x%x caller %pS",
3806 __entry->size,
3807 __entry->flags,
3808 (char *)__entry->caller_ip)
3809)
3810
3811#define DEFINE_KMEM_EVENT(name) \
3812DEFINE_EVENT(xfs_kmem_class, name, \
3813 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
3814 TP_ARGS(size, flags, caller_ip))
3815DEFINE_KMEM_EVENT(kmem_alloc);
Dave Chinner0ad95682019-08-26 12:08:10 -07003816
Darrick J. Wong13eaec42019-12-11 13:19:06 -08003817TRACE_EVENT(xfs_check_new_dalign,
3818 TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
3819 TP_ARGS(mp, new_dalign, calc_rootino),
3820 TP_STRUCT__entry(
3821 __field(dev_t, dev)
3822 __field(int, new_dalign)
3823 __field(xfs_ino_t, sb_rootino)
3824 __field(xfs_ino_t, calc_rootino)
3825 ),
3826 TP_fast_assign(
3827 __entry->dev = mp->m_super->s_dev;
3828 __entry->new_dalign = new_dalign;
3829 __entry->sb_rootino = mp->m_sb.sb_rootino;
3830 __entry->calc_rootino = calc_rootino;
3831 ),
Darrick J. Wongaf6265a2021-08-17 09:20:27 -07003832 TP_printk("dev %d:%d new_dalign %d sb_rootino 0x%llx calc_rootino 0x%llx",
Darrick J. Wong13eaec42019-12-11 13:19:06 -08003833 MAJOR(__entry->dev), MINOR(__entry->dev),
3834 __entry->new_dalign, __entry->sb_rootino,
3835 __entry->calc_rootino)
3836)
3837
Darrick J. Wonge06536a2020-03-11 10:40:26 -07003838TRACE_EVENT(xfs_btree_commit_afakeroot,
3839 TP_PROTO(struct xfs_btree_cur *cur),
3840 TP_ARGS(cur),
3841 TP_STRUCT__entry(
3842 __field(dev_t, dev)
3843 __field(xfs_btnum_t, btnum)
3844 __field(xfs_agnumber_t, agno)
3845 __field(xfs_agblock_t, agbno)
3846 __field(unsigned int, levels)
3847 __field(unsigned int, blocks)
3848 ),
3849 TP_fast_assign(
3850 __entry->dev = cur->bc_mp->m_super->s_dev;
3851 __entry->btnum = cur->bc_btnum;
Dave Chinner50f02fe2021-06-02 10:48:24 +10003852 __entry->agno = cur->bc_ag.pag->pag_agno;
Darrick J. Wonge06536a2020-03-11 10:40:26 -07003853 __entry->agbno = cur->bc_ag.afake->af_root;
3854 __entry->levels = cur->bc_ag.afake->af_levels;
3855 __entry->blocks = cur->bc_ag.afake->af_blocks;
3856 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07003857 TP_printk("dev %d:%d btree %s agno 0x%x levels %u blocks %u root %u",
Darrick J. Wonge06536a2020-03-11 10:40:26 -07003858 MAJOR(__entry->dev), MINOR(__entry->dev),
3859 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3860 __entry->agno,
3861 __entry->levels,
3862 __entry->blocks,
3863 __entry->agbno)
3864)
3865
Darrick J. Wong349e1c02020-03-11 10:42:34 -07003866TRACE_EVENT(xfs_btree_commit_ifakeroot,
3867 TP_PROTO(struct xfs_btree_cur *cur),
3868 TP_ARGS(cur),
3869 TP_STRUCT__entry(
3870 __field(dev_t, dev)
3871 __field(xfs_btnum_t, btnum)
3872 __field(xfs_agnumber_t, agno)
3873 __field(xfs_agino_t, agino)
3874 __field(unsigned int, levels)
3875 __field(unsigned int, blocks)
3876 __field(int, whichfork)
3877 ),
3878 TP_fast_assign(
3879 __entry->dev = cur->bc_mp->m_super->s_dev;
3880 __entry->btnum = cur->bc_btnum;
3881 __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp,
3882 cur->bc_ino.ip->i_ino);
3883 __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp,
3884 cur->bc_ino.ip->i_ino);
3885 __entry->levels = cur->bc_ino.ifake->if_levels;
3886 __entry->blocks = cur->bc_ino.ifake->if_blocks;
3887 __entry->whichfork = cur->bc_ino.whichfork;
3888 ),
Darrick J. Wong9febf392021-08-17 09:24:26 -07003889 TP_printk("dev %d:%d btree %s agno 0x%x agino 0x%x whichfork %s levels %u blocks %u",
Darrick J. Wong349e1c02020-03-11 10:42:34 -07003890 MAJOR(__entry->dev), MINOR(__entry->dev),
3891 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3892 __entry->agno,
3893 __entry->agino,
Darrick J. Wongf93f85f2021-08-17 13:09:26 -07003894 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
Darrick J. Wong349e1c02020-03-11 10:42:34 -07003895 __entry->levels,
3896 __entry->blocks)
3897)
3898
Darrick J. Wong60e3d702020-03-11 10:51:50 -07003899TRACE_EVENT(xfs_btree_bload_level_geometry,
3900 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3901 uint64_t nr_this_level, unsigned int nr_per_block,
3902 unsigned int desired_npb, uint64_t blocks,
3903 uint64_t blocks_with_extra),
3904 TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks,
3905 blocks_with_extra),
3906 TP_STRUCT__entry(
3907 __field(dev_t, dev)
3908 __field(xfs_btnum_t, btnum)
3909 __field(unsigned int, level)
3910 __field(unsigned int, nlevels)
3911 __field(uint64_t, nr_this_level)
3912 __field(unsigned int, nr_per_block)
3913 __field(unsigned int, desired_npb)
3914 __field(unsigned long long, blocks)
3915 __field(unsigned long long, blocks_with_extra)
3916 ),
3917 TP_fast_assign(
3918 __entry->dev = cur->bc_mp->m_super->s_dev;
3919 __entry->btnum = cur->bc_btnum;
3920 __entry->level = level;
3921 __entry->nlevels = cur->bc_nlevels;
3922 __entry->nr_this_level = nr_this_level;
3923 __entry->nr_per_block = nr_per_block;
3924 __entry->desired_npb = desired_npb;
3925 __entry->blocks = blocks;
3926 __entry->blocks_with_extra = blocks_with_extra;
3927 ),
3928 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",
3929 MAJOR(__entry->dev), MINOR(__entry->dev),
3930 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3931 __entry->level,
3932 __entry->nlevels,
3933 __entry->nr_this_level,
3934 __entry->nr_per_block,
3935 __entry->desired_npb,
3936 __entry->blocks,
3937 __entry->blocks_with_extra)
3938)
3939
3940TRACE_EVENT(xfs_btree_bload_block,
3941 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3942 uint64_t block_idx, uint64_t nr_blocks,
3943 union xfs_btree_ptr *ptr, unsigned int nr_records),
3944 TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records),
3945 TP_STRUCT__entry(
3946 __field(dev_t, dev)
3947 __field(xfs_btnum_t, btnum)
3948 __field(unsigned int, level)
3949 __field(unsigned long long, block_idx)
3950 __field(unsigned long long, nr_blocks)
3951 __field(xfs_agnumber_t, agno)
3952 __field(xfs_agblock_t, agbno)
3953 __field(unsigned int, nr_records)
3954 ),
3955 TP_fast_assign(
3956 __entry->dev = cur->bc_mp->m_super->s_dev;
3957 __entry->btnum = cur->bc_btnum;
3958 __entry->level = level;
3959 __entry->block_idx = block_idx;
3960 __entry->nr_blocks = nr_blocks;
3961 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
3962 xfs_fsblock_t fsb = be64_to_cpu(ptr->l);
3963
3964 __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb);
3965 __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb);
3966 } else {
Dave Chinner50f02fe2021-06-02 10:48:24 +10003967 __entry->agno = cur->bc_ag.pag->pag_agno;
Darrick J. Wong60e3d702020-03-11 10:51:50 -07003968 __entry->agbno = be32_to_cpu(ptr->s);
3969 }
3970 __entry->nr_records = nr_records;
3971 ),
Darrick J. Wongf7b08162021-08-17 09:28:53 -07003972 TP_printk("dev %d:%d btree %s level %u block %llu/%llu agno 0x%x agbno 0x%x recs %u",
Darrick J. Wong60e3d702020-03-11 10:51:50 -07003973 MAJOR(__entry->dev), MINOR(__entry->dev),
3974 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3975 __entry->level,
3976 __entry->block_idx,
3977 __entry->nr_blocks,
3978 __entry->agno,
3979 __entry->agbno,
3980 __entry->nr_records)
3981)
3982
Darrick J. Wong06dbf822020-08-24 11:58:01 -07003983DECLARE_EVENT_CLASS(xfs_timestamp_range_class,
3984 TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max),
3985 TP_ARGS(mp, min, max),
3986 TP_STRUCT__entry(
3987 __field(dev_t, dev)
3988 __field(long long, min)
3989 __field(long long, max)
3990 ),
3991 TP_fast_assign(
3992 __entry->dev = mp->m_super->s_dev;
3993 __entry->min = min;
3994 __entry->max = max;
3995 ),
3996 TP_printk("dev %d:%d min %lld max %lld",
3997 MAJOR(__entry->dev), MINOR(__entry->dev),
3998 __entry->min,
3999 __entry->max)
4000)
4001
4002#define DEFINE_TIMESTAMP_RANGE_EVENT(name) \
4003DEFINE_EVENT(xfs_timestamp_range_class, name, \
4004 TP_PROTO(struct xfs_mount *mp, long long min, long long max), \
4005 TP_ARGS(mp, min, max))
4006DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range);
4007DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range);
4008
Darrick J. Wongb26b2bf2021-06-07 09:34:51 -07004009DECLARE_EVENT_CLASS(xfs_icwalk_class,
4010 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw,
Darrick J. Wong38899f82021-01-22 16:48:38 -08004011 unsigned long caller_ip),
Darrick J. Wongb26b2bf2021-06-07 09:34:51 -07004012 TP_ARGS(mp, icw, caller_ip),
Darrick J. Wong38899f82021-01-22 16:48:38 -08004013 TP_STRUCT__entry(
4014 __field(dev_t, dev)
4015 __field(__u32, flags)
4016 __field(uint32_t, uid)
4017 __field(uint32_t, gid)
4018 __field(prid_t, prid)
4019 __field(__u64, min_file_size)
Darrick J. Wong10be3502021-06-18 11:57:06 -07004020 __field(long, scan_limit)
Darrick J. Wong38899f82021-01-22 16:48:38 -08004021 __field(unsigned long, caller_ip)
4022 ),
4023 TP_fast_assign(
4024 __entry->dev = mp->m_super->s_dev;
Darrick J. Wongb26b2bf2021-06-07 09:34:51 -07004025 __entry->flags = icw ? icw->icw_flags : 0;
4026 __entry->uid = icw ? from_kuid(mp->m_super->s_user_ns,
4027 icw->icw_uid) : 0;
4028 __entry->gid = icw ? from_kgid(mp->m_super->s_user_ns,
4029 icw->icw_gid) : 0;
4030 __entry->prid = icw ? icw->icw_prid : 0;
4031 __entry->min_file_size = icw ? icw->icw_min_file_size : 0;
4032 __entry->scan_limit = icw ? icw->icw_scan_limit : 0;
Darrick J. Wong38899f82021-01-22 16:48:38 -08004033 __entry->caller_ip = caller_ip;
4034 ),
Darrick J. Wong10be3502021-06-18 11:57:06 -07004035 TP_printk("dev %d:%d flags 0x%x uid %u gid %u prid %u minsize %llu scan_limit %ld caller %pS",
Darrick J. Wong38899f82021-01-22 16:48:38 -08004036 MAJOR(__entry->dev), MINOR(__entry->dev),
4037 __entry->flags,
4038 __entry->uid,
4039 __entry->gid,
4040 __entry->prid,
4041 __entry->min_file_size,
Darrick J. Wongf1bc5c52021-05-31 11:32:02 -07004042 __entry->scan_limit,
Darrick J. Wong38899f82021-01-22 16:48:38 -08004043 (char *)__entry->caller_ip)
4044);
Darrick J. Wongb26b2bf2021-06-07 09:34:51 -07004045#define DEFINE_ICWALK_EVENT(name) \
4046DEFINE_EVENT(xfs_icwalk_class, name, \
4047 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw, \
Darrick J. Wong38899f82021-01-22 16:48:38 -08004048 unsigned long caller_ip), \
Darrick J. Wongb26b2bf2021-06-07 09:34:51 -07004049 TP_ARGS(mp, icw, caller_ip))
4050DEFINE_ICWALK_EVENT(xfs_ioc_free_eofblocks);
4051DEFINE_ICWALK_EVENT(xfs_blockgc_free_space);
Darrick J. Wong38899f82021-01-22 16:48:38 -08004052
Dave Chinner956f6da2021-06-18 11:57:05 -07004053TRACE_DEFINE_ENUM(XLOG_STATE_ACTIVE);
4054TRACE_DEFINE_ENUM(XLOG_STATE_WANT_SYNC);
4055TRACE_DEFINE_ENUM(XLOG_STATE_SYNCING);
4056TRACE_DEFINE_ENUM(XLOG_STATE_DONE_SYNC);
4057TRACE_DEFINE_ENUM(XLOG_STATE_CALLBACK);
4058TRACE_DEFINE_ENUM(XLOG_STATE_DIRTY);
Dave Chinner956f6da2021-06-18 11:57:05 -07004059
4060DECLARE_EVENT_CLASS(xlog_iclog_class,
4061 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip),
4062 TP_ARGS(iclog, caller_ip),
4063 TP_STRUCT__entry(
4064 __field(dev_t, dev)
4065 __field(uint32_t, state)
4066 __field(int32_t, refcount)
4067 __field(uint32_t, offset)
Dave Chinnerb2ae3a92021-07-27 16:23:50 -07004068 __field(uint32_t, flags)
Dave Chinner956f6da2021-06-18 11:57:05 -07004069 __field(unsigned long long, lsn)
4070 __field(unsigned long, caller_ip)
4071 ),
4072 TP_fast_assign(
4073 __entry->dev = iclog->ic_log->l_mp->m_super->s_dev;
4074 __entry->state = iclog->ic_state;
4075 __entry->refcount = atomic_read(&iclog->ic_refcnt);
4076 __entry->offset = iclog->ic_offset;
Dave Chinnerb2ae3a92021-07-27 16:23:50 -07004077 __entry->flags = iclog->ic_flags;
Dave Chinner956f6da2021-06-18 11:57:05 -07004078 __entry->lsn = be64_to_cpu(iclog->ic_header.h_lsn);
4079 __entry->caller_ip = caller_ip;
4080 ),
Dave Chinnerb2ae3a92021-07-27 16:23:50 -07004081 TP_printk("dev %d:%d state %s refcnt %d offset %u lsn 0x%llx flags %s caller %pS",
Dave Chinner956f6da2021-06-18 11:57:05 -07004082 MAJOR(__entry->dev), MINOR(__entry->dev),
4083 __print_symbolic(__entry->state, XLOG_STATE_STRINGS),
4084 __entry->refcount,
4085 __entry->offset,
4086 __entry->lsn,
Dave Chinnerb2ae3a92021-07-27 16:23:50 -07004087 __print_flags(__entry->flags, "|", XLOG_ICL_STRINGS),
Dave Chinner956f6da2021-06-18 11:57:05 -07004088 (char *)__entry->caller_ip)
4089
4090);
4091
4092#define DEFINE_ICLOG_EVENT(name) \
4093DEFINE_EVENT(xlog_iclog_class, name, \
4094 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip), \
4095 TP_ARGS(iclog, caller_ip))
4096
4097DEFINE_ICLOG_EVENT(xlog_iclog_activate);
4098DEFINE_ICLOG_EVENT(xlog_iclog_clean);
4099DEFINE_ICLOG_EVENT(xlog_iclog_callback);
4100DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_start);
4101DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_done);
4102DEFINE_ICLOG_EVENT(xlog_iclog_force);
4103DEFINE_ICLOG_EVENT(xlog_iclog_force_lsn);
4104DEFINE_ICLOG_EVENT(xlog_iclog_get_space);
4105DEFINE_ICLOG_EVENT(xlog_iclog_release);
4106DEFINE_ICLOG_EVENT(xlog_iclog_switch);
4107DEFINE_ICLOG_EVENT(xlog_iclog_sync);
4108DEFINE_ICLOG_EVENT(xlog_iclog_syncing);
4109DEFINE_ICLOG_EVENT(xlog_iclog_sync_done);
4110DEFINE_ICLOG_EVENT(xlog_iclog_want_sync);
4111DEFINE_ICLOG_EVENT(xlog_iclog_wait_on);
4112DEFINE_ICLOG_EVENT(xlog_iclog_write);
4113
Allison Hendersondf082632021-08-08 08:27:13 -07004114DECLARE_EVENT_CLASS(xfs_das_state_class,
4115 TP_PROTO(int das, struct xfs_inode *ip),
4116 TP_ARGS(das, ip),
4117 TP_STRUCT__entry(
4118 __field(int, das)
4119 __field(xfs_ino_t, ino)
4120 ),
4121 TP_fast_assign(
4122 __entry->das = das;
4123 __entry->ino = ip->i_ino;
4124 ),
4125 TP_printk("state change %d ino 0x%llx",
4126 __entry->das, __entry->ino)
4127)
4128
4129#define DEFINE_DAS_STATE_EVENT(name) \
4130DEFINE_EVENT(xfs_das_state_class, name, \
4131 TP_PROTO(int das, struct xfs_inode *ip), \
4132 TP_ARGS(das, ip))
4133DEFINE_DAS_STATE_EVENT(xfs_attr_sf_addname_return);
4134DEFINE_DAS_STATE_EVENT(xfs_attr_set_iter_return);
4135DEFINE_DAS_STATE_EVENT(xfs_attr_node_addname_return);
4136DEFINE_DAS_STATE_EVENT(xfs_attr_remove_iter_return);
4137DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_remove_return);
Darrick J. Wong7f89c832021-08-10 17:00:54 -07004138
4139TRACE_EVENT(xfs_force_shutdown,
4140 TP_PROTO(struct xfs_mount *mp, int ptag, int flags, const char *fname,
4141 int line_num),
4142 TP_ARGS(mp, ptag, flags, fname, line_num),
4143 TP_STRUCT__entry(
4144 __field(dev_t, dev)
4145 __field(int, ptag)
4146 __field(int, flags)
4147 __string(fname, fname)
4148 __field(int, line_num)
4149 ),
4150 TP_fast_assign(
4151 __entry->dev = mp->m_super->s_dev;
4152 __entry->ptag = ptag;
4153 __entry->flags = flags;
4154 __assign_str(fname, fname);
4155 __entry->line_num = line_num;
4156 ),
4157 TP_printk("dev %d:%d tag %s flags %s file %s line_num %d",
4158 MAJOR(__entry->dev), MINOR(__entry->dev),
4159 __print_flags(__entry->ptag, "|", XFS_PTAG_STRINGS),
4160 __print_flags(__entry->flags, "|", XFS_SHUTDOWN_STRINGS),
4161 __get_str(fname),
4162 __entry->line_num)
4163);
4164
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00004165#endif /* _TRACE_XFS_H */
4166
4167#undef TRACE_INCLUDE_PATH
4168#define TRACE_INCLUDE_PATH .
4169#define TRACE_INCLUDE_FILE xfs_trace
4170#include <trace/define_trace.h>