blob: e74bbb648f83db3144e99cb9596c2f64af485321 [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.
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00005 */
6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM xfs
8
9#if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
10#define _TRACE_XFS_H
11
12#include <linux/tracepoint.h>
13
14struct xfs_agf;
15struct xfs_alloc_arg;
16struct xfs_attr_list_context;
17struct xfs_buf_log_item;
18struct xfs_da_args;
19struct xfs_da_node_entry;
20struct xfs_dquot;
Christoph Hellwig9e4c1092011-10-11 15:14:11 +000021struct xfs_log_item;
Mark Tinguelyad223e62012-06-14 09:22:15 -050022struct xlog;
Dave Chinner750b9c92013-11-01 15:27:18 +110023struct xlog_ticket;
Dave Chinner9abbc532010-04-13 15:06:46 +100024struct xlog_recover;
25struct xlog_recover_item;
Dave Chinner0ad95682019-08-26 12:08:10 -070026struct xlog_rec_header;
Dave Chinner9abbc532010-04-13 15:06:46 +100027struct xfs_buf_log_format;
28struct xfs_inode_log_format;
Alex Elder1ed845d2012-08-01 09:56:49 -050029struct xfs_bmbt_irec;
Darrick J. Wong2c813ad2016-08-03 11:08:36 +100030struct xfs_btree_cur;
Darrick J. Wong1946b912016-10-03 09:11:18 -070031struct xfs_refcount_irec;
Darrick J. Wonge89c0412017-03-28 14:56:37 -070032struct xfs_fsmap;
33struct xfs_rmap_irec;
Dave Chinner0ad95682019-08-26 12:08:10 -070034struct xfs_icreate_log;
35struct xfs_owner_info;
36struct xfs_trans_res;
37struct xfs_inobt_rec_incore;
Darrick J. Wong60e3d702020-03-11 10:51:50 -070038union xfs_btree_ptr;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -070039struct xfs_dqtrx;
Darrick J. Wong38899f82021-01-22 16:48:38 -080040struct xfs_eofblocks;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000041
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080042#define XFS_ATTR_FILTER_FLAGS \
43 { XFS_ATTR_ROOT, "ROOT" }, \
Christoph Hellwig254f8002020-02-26 17:30:43 -080044 { XFS_ATTR_SECURE, "SECURE" }, \
45 { XFS_ATTR_INCOMPLETE, "INCOMPLETE" }
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080046
Christoph Hellwigea9a4882009-12-21 14:03:03 +000047DECLARE_EVENT_CLASS(xfs_attr_list_class,
48 TP_PROTO(struct xfs_attr_list_context *ctx),
49 TP_ARGS(ctx),
50 TP_STRUCT__entry(
51 __field(dev_t, dev)
52 __field(xfs_ino_t, ino)
53 __field(u32, hashval)
54 __field(u32, blkno)
55 __field(u32, offset)
Christoph Hellwiga9c8c692020-02-26 17:30:37 -080056 __field(void *, buffer)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000057 __field(int, bufsize)
58 __field(int, count)
59 __field(int, firstu)
60 __field(int, dupcnt)
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080061 __field(unsigned int, attr_filter)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000062 ),
63 TP_fast_assign(
64 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
65 __entry->ino = ctx->dp->i_ino;
Christoph Hellwige3a19cd2020-02-26 17:30:43 -080066 __entry->hashval = ctx->cursor.hashval;
67 __entry->blkno = ctx->cursor.blkno;
68 __entry->offset = ctx->cursor.offset;
Christoph Hellwiga9c8c692020-02-26 17:30:37 -080069 __entry->buffer = ctx->buffer;
Christoph Hellwigea9a4882009-12-21 14:03:03 +000070 __entry->bufsize = ctx->bufsize;
71 __entry->count = ctx->count;
72 __entry->firstu = ctx->firstu;
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080073 __entry->attr_filter = ctx->attr_filter;
Christoph Hellwigea9a4882009-12-21 14:03:03 +000074 ),
75 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 -080076 "buffer %p size %u count %u firstu %u filter %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +000077 MAJOR(__entry->dev), MINOR(__entry->dev),
78 __entry->ino,
79 __entry->hashval,
80 __entry->blkno,
81 __entry->offset,
82 __entry->dupcnt,
Christoph Hellwiga9c8c692020-02-26 17:30:37 -080083 __entry->buffer,
Christoph Hellwigea9a4882009-12-21 14:03:03 +000084 __entry->bufsize,
85 __entry->count,
86 __entry->firstu,
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080087 __print_flags(__entry->attr_filter, "|",
88 XFS_ATTR_FILTER_FLAGS)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000089 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000090)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000091
92#define DEFINE_ATTR_LIST_EVENT(name) \
93DEFINE_EVENT(xfs_attr_list_class, name, \
94 TP_PROTO(struct xfs_attr_list_context *ctx), \
95 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000096DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
98DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
99DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
100DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
101DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
102DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
103DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +1100104DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
105DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000106
Darrick J. Wong63370322020-11-29 16:33:39 -0800107TRACE_EVENT(xlog_intent_recovery_failed,
108 TP_PROTO(struct xfs_mount *mp, int error, void *function),
109 TP_ARGS(mp, error, function),
110 TP_STRUCT__entry(
111 __field(dev_t, dev)
112 __field(int, error)
113 __field(void *, function)
114 ),
115 TP_fast_assign(
116 __entry->dev = mp->m_super->s_dev;
117 __entry->error = error;
118 __entry->function = function;
119 ),
120 TP_printk("dev %d:%d error %d function %pS",
121 MAJOR(__entry->dev), MINOR(__entry->dev),
122 __entry->error, __entry->function)
123);
124
Li Zefanf8adb4d2010-05-24 08:25:57 +0000125DECLARE_EVENT_CLASS(xfs_perag_class,
126 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
127 unsigned long caller_ip),
128 TP_ARGS(mp, agno, refcount, caller_ip),
129 TP_STRUCT__entry(
130 __field(dev_t, dev)
131 __field(xfs_agnumber_t, agno)
132 __field(int, refcount)
133 __field(unsigned long, caller_ip)
134 ),
135 TP_fast_assign(
136 __entry->dev = mp->m_super->s_dev;
137 __entry->agno = agno;
138 __entry->refcount = refcount;
139 __entry->caller_ip = caller_ip;
140 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800141 TP_printk("dev %d:%d agno %u refcount %d caller %pS",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000142 MAJOR(__entry->dev), MINOR(__entry->dev),
143 __entry->agno,
144 __entry->refcount,
145 (char *)__entry->caller_ip)
146);
147
148#define DEFINE_PERAG_REF_EVENT(name) \
149DEFINE_EVENT(xfs_perag_class, name, \
150 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
151 unsigned long caller_ip), \
152 TP_ARGS(mp, agno, refcount, caller_ip))
153DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000154DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000155DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000156DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
157DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Darrick J. Wongce2d3bb2021-01-22 16:48:43 -0800158DEFINE_PERAG_REF_EVENT(xfs_perag_set_blockgc);
159DEFINE_PERAG_REF_EVENT(xfs_perag_clear_blockgc);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000160
Dave Chinnerd1230312013-11-01 15:27:19 +1100161DECLARE_EVENT_CLASS(xfs_ag_class,
162 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
163 TP_ARGS(mp, agno),
164 TP_STRUCT__entry(
165 __field(dev_t, dev)
166 __field(xfs_agnumber_t, agno)
167 ),
168 TP_fast_assign(
169 __entry->dev = mp->m_super->s_dev;
170 __entry->agno = agno;
171 ),
172 TP_printk("dev %d:%d agno %u",
173 MAJOR(__entry->dev), MINOR(__entry->dev),
174 __entry->agno)
175);
176#define DEFINE_AG_EVENT(name) \
177DEFINE_EVENT(xfs_ag_class, name, \
178 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
179 TP_ARGS(mp, agno))
180
181DEFINE_AG_EVENT(xfs_read_agf);
182DEFINE_AG_EVENT(xfs_alloc_read_agf);
183DEFINE_AG_EVENT(xfs_read_agi);
184DEFINE_AG_EVENT(xfs_ialloc_read_agi);
185
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000186TRACE_EVENT(xfs_attr_list_node_descend,
187 TP_PROTO(struct xfs_attr_list_context *ctx,
188 struct xfs_da_node_entry *btree),
189 TP_ARGS(ctx, btree),
190 TP_STRUCT__entry(
191 __field(dev_t, dev)
192 __field(xfs_ino_t, ino)
193 __field(u32, hashval)
194 __field(u32, blkno)
195 __field(u32, offset)
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800196 __field(void *, buffer)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000197 __field(int, bufsize)
198 __field(int, count)
199 __field(int, firstu)
200 __field(int, dupcnt)
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800201 __field(unsigned int, attr_filter)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000202 __field(u32, bt_hashval)
203 __field(u32, bt_before)
204 ),
205 TP_fast_assign(
206 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
207 __entry->ino = ctx->dp->i_ino;
Christoph Hellwige3a19cd2020-02-26 17:30:43 -0800208 __entry->hashval = ctx->cursor.hashval;
209 __entry->blkno = ctx->cursor.blkno;
210 __entry->offset = ctx->cursor.offset;
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800211 __entry->buffer = ctx->buffer;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000212 __entry->bufsize = ctx->bufsize;
213 __entry->count = ctx->count;
214 __entry->firstu = ctx->firstu;
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800215 __entry->attr_filter = ctx->attr_filter;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000216 __entry->bt_hashval = be32_to_cpu(btree->hashval);
217 __entry->bt_before = be32_to_cpu(btree->before);
218 ),
219 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 -0800220 "buffer %p size %u count %u firstu %u filter %s "
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000221 "node hashval %u, node before %u",
222 MAJOR(__entry->dev), MINOR(__entry->dev),
223 __entry->ino,
224 __entry->hashval,
225 __entry->blkno,
226 __entry->offset,
227 __entry->dupcnt,
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800228 __entry->buffer,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000229 __entry->bufsize,
230 __entry->count,
231 __entry->firstu,
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800232 __print_flags(__entry->attr_filter, "|",
233 XFS_ATTR_FILTER_FLAGS),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000234 __entry->bt_hashval,
235 __entry->bt_before)
236);
237
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000238DECLARE_EVENT_CLASS(xfs_bmap_class,
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700239 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000240 unsigned long caller_ip),
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700241 TP_ARGS(ip, cur, state, caller_ip),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000242 TP_STRUCT__entry(
243 __field(dev_t, dev)
244 __field(xfs_ino_t, ino)
Peter Zijlstra04ae87a2019-10-24 22:26:59 +0200245 __field(void *, leaf)
246 __field(int, pos)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000247 __field(xfs_fileoff_t, startoff)
248 __field(xfs_fsblock_t, startblock)
249 __field(xfs_filblks_t, blockcount)
250 __field(xfs_exntst_t, state)
251 __field(int, bmap_state)
252 __field(unsigned long, caller_ip)
253 ),
254 TP_fast_assign(
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700255 struct xfs_ifork *ifp;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000256 struct xfs_bmbt_irec r;
257
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700258 ifp = xfs_iext_state_to_fork(ip, state);
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700259 xfs_iext_get_extent(ifp, cur, &r);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000260 __entry->dev = VFS_I(ip)->i_sb->s_dev;
261 __entry->ino = ip->i_ino;
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700262 __entry->leaf = cur->leaf;
263 __entry->pos = cur->pos;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000264 __entry->startoff = r.br_startoff;
265 __entry->startblock = r.br_startblock;
266 __entry->blockcount = r.br_blockcount;
267 __entry->state = r.br_state;
268 __entry->bmap_state = state;
269 __entry->caller_ip = caller_ip;
270 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -0800271 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800272 "offset %lld block %lld count %lld flag %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000273 MAJOR(__entry->dev), MINOR(__entry->dev),
274 __entry->ino,
275 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700276 __entry->leaf,
277 __entry->pos,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000278 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -0700279 (int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000280 __entry->blockcount,
281 __entry->state,
282 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000283)
284
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000285#define DEFINE_BMAP_EVENT(name) \
286DEFINE_EVENT(xfs_bmap_class, name, \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700287 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000288 unsigned long caller_ip), \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700289 TP_ARGS(ip, cur, state, caller_ip))
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700290DEFINE_BMAP_EVENT(xfs_iext_insert);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000291DEFINE_BMAP_EVENT(xfs_iext_remove);
292DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
293DEFINE_BMAP_EVENT(xfs_bmap_post_update);
Christoph Hellwige8e0e172017-10-19 11:06:29 -0700294DEFINE_BMAP_EVENT(xfs_read_extent);
295DEFINE_BMAP_EVENT(xfs_write_extent);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000296
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000297DECLARE_EVENT_CLASS(xfs_buf_class,
298 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
299 TP_ARGS(bp, caller_ip),
300 TP_STRUCT__entry(
301 __field(dev_t, dev)
302 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000303 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000304 __field(int, hold)
305 __field(int, pincount)
306 __field(unsigned, lockval)
307 __field(unsigned, flags)
308 __field(unsigned long, caller_ip)
309 ),
310 TP_fast_assign(
311 __entry->dev = bp->b_target->bt_dev;
Dave Chinnerd61fa8c2018-11-19 13:31:07 -0800312 if (bp->b_bn == XFS_BUF_DADDR_NULL)
313 __entry->bno = bp->b_maps[0].bm_bn;
314 else
315 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000316 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000317 __entry->hold = atomic_read(&bp->b_hold);
318 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200319 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000320 __entry->flags = bp->b_flags;
321 __entry->caller_ip = caller_ip;
322 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000323 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800324 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000325 MAJOR(__entry->dev), MINOR(__entry->dev),
326 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000327 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000328 __entry->hold,
329 __entry->pincount,
330 __entry->lockval,
331 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
332 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000333)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000334
335#define DEFINE_BUF_EVENT(name) \
336DEFINE_EVENT(xfs_buf_class, name, \
337 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
338 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000339DEFINE_BUF_EVENT(xfs_buf_init);
340DEFINE_BUF_EVENT(xfs_buf_free);
341DEFINE_BUF_EVENT(xfs_buf_hold);
342DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000343DEFINE_BUF_EVENT(xfs_buf_iodone);
Dave Chinner595bff72014-10-02 09:05:14 +1000344DEFINE_BUF_EVENT(xfs_buf_submit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000345DEFINE_BUF_EVENT(xfs_buf_lock);
346DEFINE_BUF_EVENT(xfs_buf_lock_done);
Darrick J. Wong479c6412016-06-21 11:53:28 +1000347DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200348DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000349DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000350DEFINE_BUF_EVENT(xfs_buf_iowait);
351DEFINE_BUF_EVENT(xfs_buf_iowait_done);
352DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000353DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000354DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Brian Foster7912e7f2017-06-14 21:21:45 -0700355DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
Dave Chinner686865f2010-09-24 20:07:47 +1000356DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000357DEFINE_BUF_EVENT(xfs_buf_item_relse);
Christoph Hellwig664ffb82020-09-01 10:55:29 -0700358DEFINE_BUF_EVENT(xfs_buf_iodone_async);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000359DEFINE_BUF_EVENT(xfs_buf_error_relse);
Brian Foster10fb9ac2021-01-22 16:48:19 -0800360DEFINE_BUF_EVENT(xfs_buf_drain_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000361DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
362
363/* not really buffer traces, but the buf provides useful information */
364DEFINE_BUF_EVENT(xfs_btree_corrupt);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000365DEFINE_BUF_EVENT(xfs_reset_dqcounts);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000366
367/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000368DECLARE_EVENT_CLASS(xfs_buf_flags_class,
369 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
370 TP_ARGS(bp, flags, caller_ip),
371 TP_STRUCT__entry(
372 __field(dev_t, dev)
373 __field(xfs_daddr_t, bno)
374 __field(size_t, buffer_length)
375 __field(int, hold)
376 __field(int, pincount)
377 __field(unsigned, lockval)
378 __field(unsigned, flags)
379 __field(unsigned long, caller_ip)
380 ),
381 TP_fast_assign(
382 __entry->dev = bp->b_target->bt_dev;
383 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000384 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000385 __entry->flags = flags;
386 __entry->hold = atomic_read(&bp->b_hold);
387 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200388 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000389 __entry->caller_ip = caller_ip;
390 ),
391 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800392 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000393 MAJOR(__entry->dev), MINOR(__entry->dev),
394 (unsigned long long)__entry->bno,
395 __entry->buffer_length,
396 __entry->hold,
397 __entry->pincount,
398 __entry->lockval,
399 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
400 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000401)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000402
403#define DEFINE_BUF_FLAGS_EVENT(name) \
404DEFINE_EVENT(xfs_buf_flags_class, name, \
405 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
406 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000407DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
408DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
409DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
410
411TRACE_EVENT(xfs_buf_ioerror,
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800412 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000413 TP_ARGS(bp, error, caller_ip),
414 TP_STRUCT__entry(
415 __field(dev_t, dev)
416 __field(xfs_daddr_t, bno)
417 __field(size_t, buffer_length)
418 __field(unsigned, flags)
419 __field(int, hold)
420 __field(int, pincount)
421 __field(unsigned, lockval)
422 __field(int, error)
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800423 __field(xfs_failaddr_t, caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000424 ),
425 TP_fast_assign(
426 __entry->dev = bp->b_target->bt_dev;
427 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000428 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000429 __entry->hold = atomic_read(&bp->b_hold);
430 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200431 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000432 __entry->error = error;
433 __entry->flags = bp->b_flags;
434 __entry->caller_ip = caller_ip;
435 ),
436 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800437 "lock %d error %d flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000438 MAJOR(__entry->dev), MINOR(__entry->dev),
439 (unsigned long long)__entry->bno,
440 __entry->buffer_length,
441 __entry->hold,
442 __entry->pincount,
443 __entry->lockval,
444 __entry->error,
445 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
446 (void *)__entry->caller_ip)
447);
448
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000449DECLARE_EVENT_CLASS(xfs_buf_item_class,
450 TP_PROTO(struct xfs_buf_log_item *bip),
451 TP_ARGS(bip),
452 TP_STRUCT__entry(
453 __field(dev_t, dev)
454 __field(xfs_daddr_t, buf_bno)
455 __field(size_t, buf_len)
456 __field(int, buf_hold)
457 __field(int, buf_pincount)
458 __field(int, buf_lockval)
459 __field(unsigned, buf_flags)
460 __field(unsigned, bli_recur)
461 __field(int, bli_refcount)
462 __field(unsigned, bli_flags)
Dave Chinner22525c12018-05-09 07:47:34 -0700463 __field(unsigned long, li_flags)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000464 ),
465 TP_fast_assign(
466 __entry->dev = bip->bli_buf->b_target->bt_dev;
467 __entry->bli_flags = bip->bli_flags;
468 __entry->bli_recur = bip->bli_recur;
469 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
470 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000471 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000472 __entry->buf_flags = bip->bli_buf->b_flags;
473 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
474 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200475 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000476 __entry->li_flags = bip->bli_item.li_flags;
477 ),
478 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
479 "lock %d flags %s recur %d refcount %d bliflags %s "
Dave Chinnere6631f82018-05-09 07:49:37 -0700480 "liflags %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000481 MAJOR(__entry->dev), MINOR(__entry->dev),
482 (unsigned long long)__entry->buf_bno,
483 __entry->buf_len,
484 __entry->buf_hold,
485 __entry->buf_pincount,
486 __entry->buf_lockval,
487 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
488 __entry->bli_recur,
489 __entry->bli_refcount,
490 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000491 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000492)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000493
494#define DEFINE_BUF_ITEM_EVENT(name) \
495DEFINE_EVENT(xfs_buf_item_class, name, \
496 TP_PROTO(struct xfs_buf_log_item *bip), \
497 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000498DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000499DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000500DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
501DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
502DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000503DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000504DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
505DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
506DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwigddf92052019-06-28 19:27:32 -0700507DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000508DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
509DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
510DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
511DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
512DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
513DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
514DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
515DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
516DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
517DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
518DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
519DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
520DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
521DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
522
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000523DECLARE_EVENT_CLASS(xfs_filestream_class,
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700524 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno),
525 TP_ARGS(mp, ino, agno),
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000526 TP_STRUCT__entry(
527 __field(dev_t, dev)
528 __field(xfs_ino_t, ino)
529 __field(xfs_agnumber_t, agno)
530 __field(int, streams)
531 ),
532 TP_fast_assign(
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700533 __entry->dev = mp->m_super->s_dev;
534 __entry->ino = ino;
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000535 __entry->agno = agno;
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700536 __entry->streams = xfs_filestream_peek_ag(mp, agno);
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000537 ),
538 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
539 MAJOR(__entry->dev), MINOR(__entry->dev),
540 __entry->ino,
541 __entry->agno,
542 __entry->streams)
543)
544#define DEFINE_FILESTREAM_EVENT(name) \
545DEFINE_EVENT(xfs_filestream_class, name, \
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700546 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \
547 TP_ARGS(mp, ino, agno))
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000548DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
549DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
550DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
551
552TRACE_EVENT(xfs_filestream_pick,
553 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
554 xfs_extlen_t free, int nscan),
555 TP_ARGS(ip, agno, free, nscan),
556 TP_STRUCT__entry(
557 __field(dev_t, dev)
558 __field(xfs_ino_t, ino)
559 __field(xfs_agnumber_t, agno)
560 __field(int, streams)
561 __field(xfs_extlen_t, free)
562 __field(int, nscan)
563 ),
564 TP_fast_assign(
565 __entry->dev = VFS_I(ip)->i_sb->s_dev;
566 __entry->ino = ip->i_ino;
567 __entry->agno = agno;
568 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
569 __entry->free = free;
570 __entry->nscan = nscan;
571 ),
572 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
573 MAJOR(__entry->dev), MINOR(__entry->dev),
574 __entry->ino,
575 __entry->agno,
576 __entry->streams,
577 __entry->free,
578 __entry->nscan)
579);
580
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000581DECLARE_EVENT_CLASS(xfs_lock_class,
582 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
583 unsigned long caller_ip),
584 TP_ARGS(ip, lock_flags, caller_ip),
585 TP_STRUCT__entry(
586 __field(dev_t, dev)
587 __field(xfs_ino_t, ino)
588 __field(int, lock_flags)
589 __field(unsigned long, caller_ip)
590 ),
591 TP_fast_assign(
592 __entry->dev = VFS_I(ip)->i_sb->s_dev;
593 __entry->ino = ip->i_ino;
594 __entry->lock_flags = lock_flags;
595 __entry->caller_ip = caller_ip;
596 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800597 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000598 MAJOR(__entry->dev), MINOR(__entry->dev),
599 __entry->ino,
600 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
601 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000602)
603
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000604#define DEFINE_LOCK_EVENT(name) \
605DEFINE_EVENT(xfs_lock_class, name, \
606 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
607 unsigned long caller_ip), \
608 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000609DEFINE_LOCK_EVENT(xfs_ilock);
610DEFINE_LOCK_EVENT(xfs_ilock_nowait);
611DEFINE_LOCK_EVENT(xfs_ilock_demote);
612DEFINE_LOCK_EVENT(xfs_iunlock);
613
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000614DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000615 TP_PROTO(struct xfs_inode *ip),
616 TP_ARGS(ip),
617 TP_STRUCT__entry(
618 __field(dev_t, dev)
619 __field(xfs_ino_t, ino)
620 ),
621 TP_fast_assign(
622 __entry->dev = VFS_I(ip)->i_sb->s_dev;
623 __entry->ino = ip->i_ino;
624 ),
625 TP_printk("dev %d:%d ino 0x%llx",
626 MAJOR(__entry->dev), MINOR(__entry->dev),
627 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000628)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000629
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000630#define DEFINE_INODE_EVENT(name) \
631DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000632 TP_PROTO(struct xfs_inode *ip), \
633 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000634DEFINE_INODE_EVENT(xfs_iget_skip);
635DEFINE_INODE_EVENT(xfs_iget_reclaim);
636DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
637DEFINE_INODE_EVENT(xfs_iget_hit);
638DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000639
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000640DEFINE_INODE_EVENT(xfs_getattr);
641DEFINE_INODE_EVENT(xfs_setattr);
642DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500643DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000644DEFINE_INODE_EVENT(xfs_alloc_file_space);
645DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000646DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100647DEFINE_INODE_EVENT(xfs_collapse_file_space);
Namjae Jeona904b1c2015-03-25 15:08:56 +1100648DEFINE_INODE_EVENT(xfs_insert_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000649DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000650#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200651DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000652#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000653DEFINE_INODE_EVENT(xfs_vm_bmap);
654DEFINE_INODE_EVENT(xfs_file_ioctl);
655DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
656DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000657DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000658DEFINE_INODE_EVENT(xfs_file_fsync);
659DEFINE_INODE_EVENT(xfs_destroy_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400660DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000661
662DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
663DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
664
Brian Foster27b52862012-11-06 09:50:38 -0500665DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
666DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500667DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700668DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
669DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
670DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500671
Darrick J. Wong85f8dff2018-12-18 14:32:29 -0800672/*
673 * ftrace's __print_symbolic requires that all enum values be wrapped in the
674 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
675 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
676 * code.
677 */
678TRACE_DEFINE_ENUM(PE_SIZE_PTE);
679TRACE_DEFINE_ENUM(PE_SIZE_PMD);
680TRACE_DEFINE_ENUM(PE_SIZE_PUD);
681
Christoph Hellwigd522d562017-08-29 10:08:41 -0700682TRACE_EVENT(xfs_filemap_fault,
683 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
684 bool write_fault),
685 TP_ARGS(ip, pe_size, write_fault),
686 TP_STRUCT__entry(
687 __field(dev_t, dev)
688 __field(xfs_ino_t, ino)
689 __field(enum page_entry_size, pe_size)
690 __field(bool, write_fault)
691 ),
692 TP_fast_assign(
693 __entry->dev = VFS_I(ip)->i_sb->s_dev;
694 __entry->ino = ip->i_ino;
695 __entry->pe_size = pe_size;
696 __entry->write_fault = write_fault;
697 ),
698 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
699 MAJOR(__entry->dev), MINOR(__entry->dev),
700 __entry->ino,
701 __print_symbolic(__entry->pe_size,
702 { PE_SIZE_PTE, "PTE" },
703 { PE_SIZE_PMD, "PMD" },
704 { PE_SIZE_PUD, "PUD" }),
705 __entry->write_fault)
706)
707
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000708DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000709 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
710 TP_ARGS(ip, caller_ip),
711 TP_STRUCT__entry(
712 __field(dev_t, dev)
713 __field(xfs_ino_t, ino)
714 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100715 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000716 __field(unsigned long, caller_ip)
717 ),
718 TP_fast_assign(
719 __entry->dev = VFS_I(ip)->i_sb->s_dev;
720 __entry->ino = ip->i_ino;
721 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100722 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000723 __entry->caller_ip = caller_ip;
724 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800725 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000726 MAJOR(__entry->dev), MINOR(__entry->dev),
727 __entry->ino,
728 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100729 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000730 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000731)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000732
Brian Foster19cb7e32013-03-18 10:51:48 -0400733TRACE_EVENT(xfs_iomap_prealloc_size,
734 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
735 unsigned int writeio_blocks),
736 TP_ARGS(ip, blocks, shift, writeio_blocks),
737 TP_STRUCT__entry(
738 __field(dev_t, dev)
739 __field(xfs_ino_t, ino)
740 __field(xfs_fsblock_t, blocks)
741 __field(int, shift)
742 __field(unsigned int, writeio_blocks)
743 ),
744 TP_fast_assign(
745 __entry->dev = VFS_I(ip)->i_sb->s_dev;
746 __entry->ino = ip->i_ino;
747 __entry->blocks = blocks;
748 __entry->shift = shift;
749 __entry->writeio_blocks = writeio_blocks;
750 ),
751 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
Christoph Hellwig5da8a072019-10-28 08:41:44 -0700752 "m_allocsize_blocks %u",
Brian Foster19cb7e32013-03-18 10:51:48 -0400753 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
754 __entry->blocks, __entry->shift, __entry->writeio_blocks)
755)
756
Brian Foster56d11152015-05-29 09:18:32 +1000757TRACE_EVENT(xfs_irec_merge_pre,
758 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
759 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
760 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
761 TP_STRUCT__entry(
762 __field(dev_t, dev)
763 __field(xfs_agnumber_t, agno)
764 __field(xfs_agino_t, agino)
765 __field(uint16_t, holemask)
766 __field(xfs_agino_t, nagino)
767 __field(uint16_t, nholemask)
768 ),
769 TP_fast_assign(
770 __entry->dev = mp->m_super->s_dev;
771 __entry->agno = agno;
772 __entry->agino = agino;
773 __entry->holemask = holemask;
774 __entry->nagino = nagino;
775 __entry->nholemask = holemask;
776 ),
777 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
778 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
779 __entry->agino, __entry->holemask, __entry->nagino,
780 __entry->nholemask)
781)
782
783TRACE_EVENT(xfs_irec_merge_post,
784 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
785 uint16_t holemask),
786 TP_ARGS(mp, agno, agino, holemask),
787 TP_STRUCT__entry(
788 __field(dev_t, dev)
789 __field(xfs_agnumber_t, agno)
790 __field(xfs_agino_t, agino)
791 __field(uint16_t, holemask)
792 ),
793 TP_fast_assign(
794 __entry->dev = mp->m_super->s_dev;
795 __entry->agno = agno;
796 __entry->agino = agino;
797 __entry->holemask = holemask;
798 ),
799 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
800 MINOR(__entry->dev), __entry->agno, __entry->agino,
801 __entry->holemask)
802)
803
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000804#define DEFINE_IREF_EVENT(name) \
805DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000806 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
807 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000808DEFINE_IREF_EVENT(xfs_irele);
809DEFINE_IREF_EVENT(xfs_inode_pin);
810DEFINE_IREF_EVENT(xfs_inode_unpin);
811DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100812
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000813DECLARE_EVENT_CLASS(xfs_namespace_class,
814 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
815 TP_ARGS(dp, name),
816 TP_STRUCT__entry(
817 __field(dev_t, dev)
818 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000819 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000820 __dynamic_array(char, name, name->len)
821 ),
822 TP_fast_assign(
823 __entry->dev = VFS_I(dp)->i_sb->s_dev;
824 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000825 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000826 memcpy(__get_str(name), name->name, name->len);
827 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000828 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000829 MAJOR(__entry->dev), MINOR(__entry->dev),
830 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000831 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000832 __get_str(name))
833)
834
835#define DEFINE_NAMESPACE_EVENT(name) \
836DEFINE_EVENT(xfs_namespace_class, name, \
837 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
838 TP_ARGS(dp, name))
839DEFINE_NAMESPACE_EVENT(xfs_remove);
840DEFINE_NAMESPACE_EVENT(xfs_link);
841DEFINE_NAMESPACE_EVENT(xfs_lookup);
842DEFINE_NAMESPACE_EVENT(xfs_create);
843DEFINE_NAMESPACE_EVENT(xfs_symlink);
844
845TRACE_EVENT(xfs_rename,
846 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
847 struct xfs_name *src_name, struct xfs_name *target_name),
848 TP_ARGS(src_dp, target_dp, src_name, target_name),
849 TP_STRUCT__entry(
850 __field(dev_t, dev)
851 __field(xfs_ino_t, src_dp_ino)
852 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000853 __field(int, src_namelen)
854 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000855 __dynamic_array(char, src_name, src_name->len)
856 __dynamic_array(char, target_name, target_name->len)
857 ),
858 TP_fast_assign(
859 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
860 __entry->src_dp_ino = src_dp->i_ino;
861 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000862 __entry->src_namelen = src_name->len;
863 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000864 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000865 memcpy(__get_str(target_name), target_name->name,
866 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000867 ),
868 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000869 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000870 MAJOR(__entry->dev), MINOR(__entry->dev),
871 __entry->src_dp_ino,
872 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000873 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000874 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000875 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000876 __get_str(target_name))
877)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000878
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000879DECLARE_EVENT_CLASS(xfs_dquot_class,
880 TP_PROTO(struct xfs_dquot *dqp),
881 TP_ARGS(dqp),
882 TP_STRUCT__entry(
883 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000884 __field(u32, id)
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700885 __field(xfs_dqtype_t, type)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000886 __field(unsigned, flags)
887 __field(unsigned, nrefs)
888 __field(unsigned long long, res_bcount)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700889 __field(unsigned long long, res_rtbcount)
890 __field(unsigned long long, res_icount)
891
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000892 __field(unsigned long long, bcount)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700893 __field(unsigned long long, rtbcount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000894 __field(unsigned long long, icount)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700895
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000896 __field(unsigned long long, blk_hardlimit)
897 __field(unsigned long long, blk_softlimit)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700898 __field(unsigned long long, rtb_hardlimit)
899 __field(unsigned long long, rtb_softlimit)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000900 __field(unsigned long long, ino_hardlimit)
901 __field(unsigned long long, ino_softlimit)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700902 ),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000903 TP_fast_assign(
904 __entry->dev = dqp->q_mount->m_super->s_dev;
Darrick J. Wongc51df732020-07-14 10:37:30 -0700905 __entry->id = dqp->q_id;
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700906 __entry->type = dqp->q_type;
907 __entry->flags = dqp->q_flags;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000908 __entry->nrefs = dqp->q_nrefs;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700909
Darrick J. Wong784e80f2020-07-14 10:37:30 -0700910 __entry->res_bcount = dqp->q_blk.reserved;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700911 __entry->res_rtbcount = dqp->q_rtb.reserved;
912 __entry->res_icount = dqp->q_ino.reserved;
913
Darrick J. Wongbe37d402020-07-14 10:37:31 -0700914 __entry->bcount = dqp->q_blk.count;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700915 __entry->rtbcount = dqp->q_rtb.count;
Darrick J. Wongbe37d402020-07-14 10:37:31 -0700916 __entry->icount = dqp->q_ino.count;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700917
Darrick J. Wongd3537cf2020-07-14 10:37:31 -0700918 __entry->blk_hardlimit = dqp->q_blk.hardlimit;
919 __entry->blk_softlimit = dqp->q_blk.softlimit;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700920 __entry->rtb_hardlimit = dqp->q_rtb.hardlimit;
921 __entry->rtb_softlimit = dqp->q_rtb.softlimit;
Darrick J. Wongd3537cf2020-07-14 10:37:31 -0700922 __entry->ino_hardlimit = dqp->q_ino.hardlimit;
923 __entry->ino_softlimit = dqp->q_ino.softlimit;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000924 ),
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700925 TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u "
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700926 "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000927 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700928 "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000929 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000930 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000931 __entry->id,
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700932 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
Darrick J. Wong985a78f2020-07-14 10:37:13 -0700933 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000934 __entry->nrefs,
935 __entry->res_bcount,
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700936 __entry->res_rtbcount,
937 __entry->res_icount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000938 __entry->bcount,
939 __entry->blk_hardlimit,
940 __entry->blk_softlimit,
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700941 __entry->rtbcount,
942 __entry->rtb_hardlimit,
943 __entry->rtb_softlimit,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000944 __entry->icount,
945 __entry->ino_hardlimit,
946 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000947)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000948
949#define DEFINE_DQUOT_EVENT(name) \
950DEFINE_EVENT(xfs_dquot_class, name, \
951 TP_PROTO(struct xfs_dquot *dqp), \
952 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000953DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000954DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
955DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000956DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
957DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000958DEFINE_DQUOT_EVENT(xfs_dqattach_found);
959DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000960DEFINE_DQUOT_EVENT(xfs_dqalloc);
961DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
962DEFINE_DQUOT_EVENT(xfs_dqread);
963DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000964DEFINE_DQUOT_EVENT(xfs_dqget_hit);
965DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000966DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
967DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000968DEFINE_DQUOT_EVENT(xfs_dqput);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000969DEFINE_DQUOT_EVENT(xfs_dqput_free);
970DEFINE_DQUOT_EVENT(xfs_dqrele);
971DEFINE_DQUOT_EVENT(xfs_dqflush);
972DEFINE_DQUOT_EVENT(xfs_dqflush_force);
973DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700974DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
975DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
976
977#define XFS_QMOPT_FLAGS \
978 { XFS_QMOPT_UQUOTA, "UQUOTA" }, \
979 { XFS_QMOPT_PQUOTA, "PQUOTA" }, \
980 { XFS_QMOPT_FORCE_RES, "FORCE_RES" }, \
981 { XFS_QMOPT_SBVERSION, "SBVERSION" }, \
982 { XFS_QMOPT_GQUOTA, "GQUOTA" }, \
983 { XFS_QMOPT_INHERIT, "INHERIT" }, \
984 { XFS_QMOPT_RES_REGBLKS, "RES_REGBLKS" }, \
985 { XFS_QMOPT_RES_RTBLKS, "RES_RTBLKS" }, \
986 { XFS_QMOPT_BCOUNT, "BCOUNT" }, \
987 { XFS_QMOPT_ICOUNT, "ICOUNT" }, \
988 { XFS_QMOPT_RTBCOUNT, "RTBCOUNT" }, \
989 { XFS_QMOPT_DELBCOUNT, "DELBCOUNT" }, \
990 { XFS_QMOPT_DELRTBCOUNT, "DELRTBCOUNT" }, \
991 { XFS_QMOPT_RES_INOS, "RES_INOS" }
992
993TRACE_EVENT(xfs_trans_mod_dquot,
994 TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
995 unsigned int field, int64_t delta),
996 TP_ARGS(tp, dqp, field, delta),
997 TP_STRUCT__entry(
998 __field(dev_t, dev)
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700999 __field(xfs_dqtype_t, type)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001000 __field(unsigned int, flags)
1001 __field(unsigned int, dqid)
1002 __field(unsigned int, field)
1003 __field(int64_t, delta)
1004 ),
1005 TP_fast_assign(
1006 __entry->dev = tp->t_mountp->m_super->s_dev;
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001007 __entry->type = dqp->q_type;
1008 __entry->flags = dqp->q_flags;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001009 __entry->dqid = dqp->q_id;
1010 __entry->field = field;
1011 __entry->delta = delta;
1012 ),
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001013 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 -07001014 MAJOR(__entry->dev), MINOR(__entry->dev),
1015 __entry->dqid,
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001016 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001017 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1018 __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS),
1019 __entry->delta)
1020);
1021
1022DECLARE_EVENT_CLASS(xfs_dqtrx_class,
1023 TP_PROTO(struct xfs_dqtrx *qtrx),
1024 TP_ARGS(qtrx),
1025 TP_STRUCT__entry(
1026 __field(dev_t, dev)
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001027 __field(xfs_dqtype_t, type)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001028 __field(unsigned int, flags)
1029 __field(u32, dqid)
1030
1031 __field(uint64_t, blk_res)
1032 __field(int64_t, bcount_delta)
1033 __field(int64_t, delbcnt_delta)
1034
1035 __field(uint64_t, rtblk_res)
1036 __field(uint64_t, rtblk_res_used)
1037 __field(int64_t, rtbcount_delta)
1038 __field(int64_t, delrtb_delta)
1039
1040 __field(uint64_t, ino_res)
1041 __field(uint64_t, ino_res_used)
1042 __field(int64_t, icount_delta)
1043 ),
1044 TP_fast_assign(
1045 __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev;
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001046 __entry->type = qtrx->qt_dquot->q_type;
1047 __entry->flags = qtrx->qt_dquot->q_flags;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001048 __entry->dqid = qtrx->qt_dquot->q_id;
1049
1050 __entry->blk_res = qtrx->qt_blk_res;
1051 __entry->bcount_delta = qtrx->qt_bcount_delta;
1052 __entry->delbcnt_delta = qtrx->qt_delbcnt_delta;
1053
1054 __entry->rtblk_res = qtrx->qt_rtblk_res;
1055 __entry->rtblk_res_used = qtrx->qt_rtblk_res_used;
1056 __entry->rtbcount_delta = qtrx->qt_rtbcount_delta;
1057 __entry->delrtb_delta = qtrx->qt_delrtb_delta;
1058
1059 __entry->ino_res = qtrx->qt_ino_res;
1060 __entry->ino_res_used = qtrx->qt_ino_res_used;
1061 __entry->icount_delta = qtrx->qt_icount_delta;
1062 ),
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001063 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s"
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001064 "blk_res %llu bcount_delta %lld delbcnt_delta %lld "
1065 "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld "
1066 "ino_res %llu ino_res_used %llu icount_delta %lld",
1067 MAJOR(__entry->dev), MINOR(__entry->dev),
1068 __entry->dqid,
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001069 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001070 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1071
1072 __entry->blk_res,
1073 __entry->bcount_delta,
1074 __entry->delbcnt_delta,
1075
1076 __entry->rtblk_res,
1077 __entry->rtblk_res_used,
1078 __entry->rtbcount_delta,
1079 __entry->delrtb_delta,
1080
1081 __entry->ino_res,
1082 __entry->ino_res_used,
1083 __entry->icount_delta)
1084)
1085
1086#define DEFINE_DQTRX_EVENT(name) \
1087DEFINE_EVENT(xfs_dqtrx_class, name, \
1088 TP_PROTO(struct xfs_dqtrx *qtrx), \
1089 TP_ARGS(qtrx))
1090DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas);
1091DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before);
1092DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001093
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001094DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001095 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001096 TP_ARGS(log, tic),
1097 TP_STRUCT__entry(
1098 __field(dev_t, dev)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001099 __field(char, ocnt)
1100 __field(char, cnt)
1101 __field(int, curr_res)
1102 __field(int, unit_res)
1103 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +11001104 __field(int, reserveq)
1105 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001106 __field(int, grant_reserve_cycle)
1107 __field(int, grant_reserve_bytes)
1108 __field(int, grant_write_cycle)
1109 __field(int, grant_write_bytes)
1110 __field(int, curr_cycle)
1111 __field(int, curr_block)
1112 __field(xfs_lsn_t, tail_lsn)
1113 ),
1114 TP_fast_assign(
1115 __entry->dev = log->l_mp->m_super->s_dev;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001116 __entry->ocnt = tic->t_ocnt;
1117 __entry->cnt = tic->t_cnt;
1118 __entry->curr_res = tic->t_curr_res;
1119 __entry->unit_res = tic->t_unit_res;
1120 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +00001121 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
1122 __entry->writeq = list_empty(&log->l_write_head.waiters);
1123 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +11001124 &__entry->grant_reserve_cycle,
1125 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +00001126 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +11001127 &__entry->grant_write_cycle,
1128 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001129 __entry->curr_cycle = log->l_curr_cycle;
1130 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +11001131 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001132 ),
Christoph Hellwig710b1e22016-04-06 09:20:36 +10001133 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +11001134 "t_unit_res %u t_flags %s reserveq %s "
1135 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001136 "grant_reserve_bytes %d grant_write_cycle %d "
1137 "grant_write_bytes %d curr_cycle %d curr_block %d "
1138 "tail_cycle %d tail_block %d",
1139 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001140 __entry->ocnt,
1141 __entry->cnt,
1142 __entry->curr_res,
1143 __entry->unit_res,
1144 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +11001145 __entry->reserveq ? "empty" : "active",
1146 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001147 __entry->grant_reserve_cycle,
1148 __entry->grant_reserve_bytes,
1149 __entry->grant_write_cycle,
1150 __entry->grant_write_bytes,
1151 __entry->curr_cycle,
1152 __entry->curr_block,
1153 CYCLE_LSN(__entry->tail_lsn),
1154 BLOCK_LSN(__entry->tail_lsn)
1155 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001156)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001157
1158#define DEFINE_LOGGRANT_EVENT(name) \
1159DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001160 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001161 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001162DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +00001163DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1164DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +11001165DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +00001166DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1167DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1168DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1169DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig8b41e3f2020-03-25 18:18:23 -07001170DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant);
1171DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit);
1172DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub);
1173DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant);
1174DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub);
1175DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit);
Dave Chinner0e7ab7e2020-03-24 20:10:27 -07001176DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001177
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001178DECLARE_EVENT_CLASS(xfs_log_item_class,
1179 TP_PROTO(struct xfs_log_item *lip),
1180 TP_ARGS(lip),
1181 TP_STRUCT__entry(
1182 __field(dev_t, dev)
1183 __field(void *, lip)
1184 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001185 __field(unsigned long, flags)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001186 __field(xfs_lsn_t, lsn)
1187 ),
1188 TP_fast_assign(
1189 __entry->dev = lip->li_mountp->m_super->s_dev;
1190 __entry->lip = lip;
1191 __entry->type = lip->li_type;
1192 __entry->flags = lip->li_flags;
1193 __entry->lsn = lip->li_lsn;
1194 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001195 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001196 MAJOR(__entry->dev), MINOR(__entry->dev),
1197 __entry->lip,
1198 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1199 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1200 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1201)
1202
Dave Chinner14c26c62012-04-24 16:33:31 +10001203TRACE_EVENT(xfs_log_force,
Carlos Maiolino9f278892016-04-06 09:46:30 +10001204 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1205 TP_ARGS(mp, lsn, caller_ip),
Dave Chinner14c26c62012-04-24 16:33:31 +10001206 TP_STRUCT__entry(
1207 __field(dev_t, dev)
1208 __field(xfs_lsn_t, lsn)
Carlos Maiolino9f278892016-04-06 09:46:30 +10001209 __field(unsigned long, caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001210 ),
1211 TP_fast_assign(
1212 __entry->dev = mp->m_super->s_dev;
1213 __entry->lsn = lsn;
Carlos Maiolino9f278892016-04-06 09:46:30 +10001214 __entry->caller_ip = caller_ip;
Dave Chinner14c26c62012-04-24 16:33:31 +10001215 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001216 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
Dave Chinner14c26c62012-04-24 16:33:31 +10001217 MAJOR(__entry->dev), MINOR(__entry->dev),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001218 __entry->lsn, (void *)__entry->caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001219)
1220
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001221#define DEFINE_LOG_ITEM_EVENT(name) \
1222DEFINE_EVENT(xfs_log_item_class, name, \
1223 TP_PROTO(struct xfs_log_item *lip), \
1224 TP_ARGS(lip))
1225DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001226DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1227DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001228DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001229
Dave Chinner750b9c92013-11-01 15:27:18 +11001230DECLARE_EVENT_CLASS(xfs_ail_class,
1231 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1232 TP_ARGS(lip, old_lsn, new_lsn),
1233 TP_STRUCT__entry(
1234 __field(dev_t, dev)
1235 __field(void *, lip)
1236 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001237 __field(unsigned long, flags)
Dave Chinner750b9c92013-11-01 15:27:18 +11001238 __field(xfs_lsn_t, old_lsn)
1239 __field(xfs_lsn_t, new_lsn)
1240 ),
1241 TP_fast_assign(
1242 __entry->dev = lip->li_mountp->m_super->s_dev;
1243 __entry->lip = lip;
1244 __entry->type = lip->li_type;
1245 __entry->flags = lip->li_flags;
1246 __entry->old_lsn = old_lsn;
1247 __entry->new_lsn = new_lsn;
1248 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001249 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 +11001250 MAJOR(__entry->dev), MINOR(__entry->dev),
1251 __entry->lip,
1252 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1253 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1254 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1255 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1256)
1257
1258#define DEFINE_AIL_EVENT(name) \
1259DEFINE_EVENT(xfs_ail_class, name, \
1260 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1261 TP_ARGS(lip, old_lsn, new_lsn))
1262DEFINE_AIL_EVENT(xfs_ail_insert);
1263DEFINE_AIL_EVENT(xfs_ail_move);
1264DEFINE_AIL_EVENT(xfs_ail_delete);
1265
1266TRACE_EVENT(xfs_log_assign_tail_lsn,
1267 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1268 TP_ARGS(log, new_lsn),
1269 TP_STRUCT__entry(
1270 __field(dev_t, dev)
1271 __field(xfs_lsn_t, new_lsn)
1272 __field(xfs_lsn_t, old_lsn)
1273 __field(xfs_lsn_t, last_sync_lsn)
1274 ),
1275 TP_fast_assign(
1276 __entry->dev = log->l_mp->m_super->s_dev;
1277 __entry->new_lsn = new_lsn;
1278 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1279 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1280 ),
1281 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1282 MAJOR(__entry->dev), MINOR(__entry->dev),
1283 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1284 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1285 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1286)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001287
Li Zefanf8adb4d2010-05-24 08:25:57 +00001288DECLARE_EVENT_CLASS(xfs_file_class,
Christoph Hellwig3e40b132021-01-23 10:06:29 -08001289 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter),
1290 TP_ARGS(iocb, iter),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001291 TP_STRUCT__entry(
1292 __field(dev_t, dev)
1293 __field(xfs_ino_t, ino)
1294 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001295 __field(loff_t, offset)
1296 __field(size_t, count)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001297 ),
1298 TP_fast_assign(
Christoph Hellwig3e40b132021-01-23 10:06:29 -08001299 __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
1300 __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
1301 __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_d.di_size;
1302 __entry->offset = iocb->ki_pos;
1303 __entry->count = iov_iter_count(iter);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001304 ),
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001305 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001306 MAJOR(__entry->dev), MINOR(__entry->dev),
1307 __entry->ino,
1308 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001309 __entry->offset,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001310 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001311)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001312
1313#define DEFINE_RW_EVENT(name) \
1314DEFINE_EVENT(xfs_file_class, name, \
Christoph Hellwig3e40b132021-01-23 10:06:29 -08001315 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), \
1316 TP_ARGS(iocb, iter))
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001317DEFINE_RW_EVENT(xfs_file_buffered_read);
1318DEFINE_RW_EVENT(xfs_file_direct_read);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001319DEFINE_RW_EVENT(xfs_file_dax_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001320DEFINE_RW_EVENT(xfs_file_buffered_write);
1321DEFINE_RW_EVENT(xfs_file_direct_write);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001322DEFINE_RW_EVENT(xfs_file_dax_write);
Christoph Hellwig896f72d2021-01-23 10:06:30 -08001323DEFINE_RW_EVENT(xfs_reflink_bounce_dio_write);
1324
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001325
Christoph Hellwiga206c812010-12-10 08:42:20 +00001326DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001327 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001328 int whichfork, struct xfs_bmbt_irec *irec),
1329 TP_ARGS(ip, offset, count, whichfork, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001330 TP_STRUCT__entry(
1331 __field(dev_t, dev)
1332 __field(xfs_ino_t, ino)
1333 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001334 __field(loff_t, offset)
1335 __field(size_t, count)
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001336 __field(int, whichfork)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001337 __field(xfs_fileoff_t, startoff)
1338 __field(xfs_fsblock_t, startblock)
1339 __field(xfs_filblks_t, blockcount)
1340 ),
1341 TP_fast_assign(
1342 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1343 __entry->ino = ip->i_ino;
1344 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001345 __entry->offset = offset;
1346 __entry->count = count;
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001347 __entry->whichfork = whichfork;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001348 __entry->startoff = irec ? irec->br_startoff : 0;
1349 __entry->startblock = irec ? irec->br_startblock : 0;
1350 __entry->blockcount = irec ? irec->br_blockcount : 0;
1351 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001352 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001353 "fork %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001354 MAJOR(__entry->dev), MINOR(__entry->dev),
1355 __entry->ino,
1356 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001357 __entry->offset,
1358 __entry->count,
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001359 __entry->whichfork == XFS_COW_FORK ? "cow" : "data",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001360 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07001361 (int64_t)__entry->startblock,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001362 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001363)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001364
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001365#define DEFINE_IMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001366DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001367 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001368 int whichfork, struct xfs_bmbt_irec *irec), \
1369 TP_ARGS(ip, offset, count, whichfork, irec))
1370DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1371DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1372DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1373DEFINE_IMAP_EVENT(xfs_iomap_found);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001374
Li Zefanf8adb4d2010-05-24 08:25:57 +00001375DECLARE_EVENT_CLASS(xfs_simple_io_class,
1376 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1377 TP_ARGS(ip, offset, count),
1378 TP_STRUCT__entry(
1379 __field(dev_t, dev)
1380 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001381 __field(loff_t, isize)
1382 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001383 __field(loff_t, offset)
1384 __field(size_t, count)
1385 ),
1386 TP_fast_assign(
1387 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1388 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001389 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001390 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001391 __entry->offset = offset;
1392 __entry->count = count;
1393 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001394 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001395 "offset 0x%llx count %zd",
1396 MAJOR(__entry->dev), MINOR(__entry->dev),
1397 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001398 __entry->isize,
1399 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001400 __entry->offset,
1401 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001402);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001403
1404#define DEFINE_SIMPLE_IO_EVENT(name) \
1405DEFINE_EVENT(xfs_simple_io_class, name, \
1406 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1407 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001408DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1409DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001410DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Brian Foster0a50f162015-10-12 16:02:08 +11001411DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001412DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1413DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1414DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001415
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001416DECLARE_EVENT_CLASS(xfs_itrunc_class,
1417 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1418 TP_ARGS(ip, new_size),
1419 TP_STRUCT__entry(
1420 __field(dev_t, dev)
1421 __field(xfs_ino_t, ino)
1422 __field(xfs_fsize_t, size)
1423 __field(xfs_fsize_t, new_size)
1424 ),
1425 TP_fast_assign(
1426 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1427 __entry->ino = ip->i_ino;
1428 __entry->size = ip->i_d.di_size;
1429 __entry->new_size = new_size;
1430 ),
1431 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1432 MAJOR(__entry->dev), MINOR(__entry->dev),
1433 __entry->ino,
1434 __entry->size,
1435 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001436)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001437
1438#define DEFINE_ITRUNC_EVENT(name) \
1439DEFINE_EVENT(xfs_itrunc_class, name, \
1440 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1441 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001442DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1443DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001444
1445TRACE_EVENT(xfs_pagecache_inval,
1446 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1447 TP_ARGS(ip, start, finish),
1448 TP_STRUCT__entry(
1449 __field(dev_t, dev)
1450 __field(xfs_ino_t, ino)
1451 __field(xfs_fsize_t, size)
1452 __field(xfs_off_t, start)
1453 __field(xfs_off_t, finish)
1454 ),
1455 TP_fast_assign(
1456 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1457 __entry->ino = ip->i_ino;
1458 __entry->size = ip->i_d.di_size;
1459 __entry->start = start;
1460 __entry->finish = finish;
1461 ),
1462 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1463 MAJOR(__entry->dev), MINOR(__entry->dev),
1464 __entry->ino,
1465 __entry->size,
1466 __entry->start,
1467 __entry->finish)
1468);
1469
1470TRACE_EVENT(xfs_bunmap,
1471 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1472 int flags, unsigned long caller_ip),
1473 TP_ARGS(ip, bno, len, flags, caller_ip),
1474 TP_STRUCT__entry(
1475 __field(dev_t, dev)
1476 __field(xfs_ino_t, ino)
1477 __field(xfs_fsize_t, size)
1478 __field(xfs_fileoff_t, bno)
1479 __field(xfs_filblks_t, len)
1480 __field(unsigned long, caller_ip)
1481 __field(int, flags)
1482 ),
1483 TP_fast_assign(
1484 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1485 __entry->ino = ip->i_ino;
1486 __entry->size = ip->i_d.di_size;
1487 __entry->bno = bno;
1488 __entry->len = len;
1489 __entry->caller_ip = caller_ip;
1490 __entry->flags = flags;
1491 ),
1492 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001493 "flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001494 MAJOR(__entry->dev), MINOR(__entry->dev),
1495 __entry->ino,
1496 __entry->size,
1497 __entry->bno,
1498 __entry->len,
1499 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1500 (void *)__entry->caller_ip)
1501
1502);
1503
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001504DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001505 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1506 xfs_agblock_t agbno, xfs_extlen_t len),
1507 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001508 TP_STRUCT__entry(
1509 __field(dev_t, dev)
1510 __field(xfs_agnumber_t, agno)
1511 __field(xfs_agblock_t, agbno)
1512 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001513 ),
1514 TP_fast_assign(
1515 __entry->dev = mp->m_super->s_dev;
1516 __entry->agno = agno;
1517 __entry->agbno = agbno;
1518 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001519 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001520 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001521 MAJOR(__entry->dev), MINOR(__entry->dev),
1522 __entry->agno,
1523 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001524 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001525);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001526#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001527DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001528 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1529 xfs_agblock_t agbno, xfs_extlen_t len), \
1530 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001531DEFINE_BUSY_EVENT(xfs_extent_busy);
1532DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1533DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1534DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1535DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001536
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001537TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001538 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1539 xfs_agblock_t agbno, xfs_extlen_t len,
1540 xfs_agblock_t tbno, xfs_extlen_t tlen),
1541 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1542 TP_STRUCT__entry(
1543 __field(dev_t, dev)
1544 __field(xfs_agnumber_t, agno)
1545 __field(xfs_agblock_t, agbno)
1546 __field(xfs_extlen_t, len)
1547 __field(xfs_agblock_t, tbno)
1548 __field(xfs_extlen_t, tlen)
1549 ),
1550 TP_fast_assign(
1551 __entry->dev = mp->m_super->s_dev;
1552 __entry->agno = agno;
1553 __entry->agbno = agbno;
1554 __entry->len = len;
1555 __entry->tbno = tbno;
1556 __entry->tlen = tlen;
1557 ),
1558 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1559 MAJOR(__entry->dev), MINOR(__entry->dev),
1560 __entry->agno,
1561 __entry->agbno,
1562 __entry->len,
1563 __entry->tbno,
1564 __entry->tlen)
1565);
1566
Brian Fostera27ba262018-03-15 10:51:58 -07001567DECLARE_EVENT_CLASS(xfs_agf_class,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001568 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1569 unsigned long caller_ip),
1570 TP_ARGS(mp, agf, flags, caller_ip),
1571 TP_STRUCT__entry(
1572 __field(dev_t, dev)
1573 __field(xfs_agnumber_t, agno)
1574 __field(int, flags)
1575 __field(__u32, length)
1576 __field(__u32, bno_root)
1577 __field(__u32, cnt_root)
1578 __field(__u32, bno_level)
1579 __field(__u32, cnt_level)
1580 __field(__u32, flfirst)
1581 __field(__u32, fllast)
1582 __field(__u32, flcount)
1583 __field(__u32, freeblks)
1584 __field(__u32, longest)
1585 __field(unsigned long, caller_ip)
1586 ),
1587 TP_fast_assign(
1588 __entry->dev = mp->m_super->s_dev;
1589 __entry->agno = be32_to_cpu(agf->agf_seqno),
1590 __entry->flags = flags;
1591 __entry->length = be32_to_cpu(agf->agf_length),
1592 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1593 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1594 __entry->bno_level =
1595 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1596 __entry->cnt_level =
1597 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1598 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1599 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1600 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1601 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1602 __entry->longest = be32_to_cpu(agf->agf_longest);
1603 __entry->caller_ip = caller_ip;
1604 ),
1605 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1606 "levels b %u c %u flfirst %u fllast %u flcount %u "
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001607 "freeblks %u longest %u caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001608 MAJOR(__entry->dev), MINOR(__entry->dev),
1609 __entry->agno,
1610 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1611 __entry->length,
1612 __entry->bno_root,
1613 __entry->cnt_root,
1614 __entry->bno_level,
1615 __entry->cnt_level,
1616 __entry->flfirst,
1617 __entry->fllast,
1618 __entry->flcount,
1619 __entry->freeblks,
1620 __entry->longest,
1621 (void *)__entry->caller_ip)
1622);
Brian Fostera27ba262018-03-15 10:51:58 -07001623#define DEFINE_AGF_EVENT(name) \
1624DEFINE_EVENT(xfs_agf_class, name, \
1625 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1626 unsigned long caller_ip), \
1627 TP_ARGS(mp, agf, flags, caller_ip))
1628DEFINE_AGF_EVENT(xfs_agf);
1629DEFINE_AGF_EVENT(xfs_agfl_reset);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001630
1631TRACE_EVENT(xfs_free_extent,
1632 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001633 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1634 int haveright),
1635 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001636 TP_STRUCT__entry(
1637 __field(dev_t, dev)
1638 __field(xfs_agnumber_t, agno)
1639 __field(xfs_agblock_t, agbno)
1640 __field(xfs_extlen_t, len)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001641 __field(int, resv)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001642 __field(int, haveleft)
1643 __field(int, haveright)
1644 ),
1645 TP_fast_assign(
1646 __entry->dev = mp->m_super->s_dev;
1647 __entry->agno = agno;
1648 __entry->agbno = agbno;
1649 __entry->len = len;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001650 __entry->resv = resv;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001651 __entry->haveleft = haveleft;
1652 __entry->haveright = haveright;
1653 ),
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001654 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001655 MAJOR(__entry->dev), MINOR(__entry->dev),
1656 __entry->agno,
1657 __entry->agbno,
1658 __entry->len,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001659 __entry->resv,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001660 __entry->haveleft ?
1661 (__entry->haveright ? "both" : "left") :
1662 (__entry->haveright ? "right" : "none"))
1663
1664);
1665
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001666DECLARE_EVENT_CLASS(xfs_alloc_class,
1667 TP_PROTO(struct xfs_alloc_arg *args),
1668 TP_ARGS(args),
1669 TP_STRUCT__entry(
1670 __field(dev_t, dev)
1671 __field(xfs_agnumber_t, agno)
1672 __field(xfs_agblock_t, agbno)
1673 __field(xfs_extlen_t, minlen)
1674 __field(xfs_extlen_t, maxlen)
1675 __field(xfs_extlen_t, mod)
1676 __field(xfs_extlen_t, prod)
1677 __field(xfs_extlen_t, minleft)
1678 __field(xfs_extlen_t, total)
1679 __field(xfs_extlen_t, alignment)
1680 __field(xfs_extlen_t, minalignslop)
1681 __field(xfs_extlen_t, len)
1682 __field(short, type)
1683 __field(short, otype)
1684 __field(char, wasdel)
1685 __field(char, wasfromfl)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001686 __field(int, resv)
Dave Chinner292378e2016-09-26 08:21:28 +10001687 __field(int, datatype)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001688 __field(xfs_fsblock_t, firstblock)
1689 ),
1690 TP_fast_assign(
1691 __entry->dev = args->mp->m_super->s_dev;
1692 __entry->agno = args->agno;
1693 __entry->agbno = args->agbno;
1694 __entry->minlen = args->minlen;
1695 __entry->maxlen = args->maxlen;
1696 __entry->mod = args->mod;
1697 __entry->prod = args->prod;
1698 __entry->minleft = args->minleft;
1699 __entry->total = args->total;
1700 __entry->alignment = args->alignment;
1701 __entry->minalignslop = args->minalignslop;
1702 __entry->len = args->len;
1703 __entry->type = args->type;
1704 __entry->otype = args->otype;
1705 __entry->wasdel = args->wasdel;
1706 __entry->wasfromfl = args->wasfromfl;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001707 __entry->resv = args->resv;
Dave Chinner292378e2016-09-26 08:21:28 +10001708 __entry->datatype = args->datatype;
Brian Foster64396ff2018-07-11 22:26:30 -07001709 __entry->firstblock = args->tp->t_firstblock;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001710 ),
1711 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1712 "prod %u minleft %u total %u alignment %u minalignslop %u "
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001713 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
Dave Chinner292378e2016-09-26 08:21:28 +10001714 "datatype 0x%x firstblock 0x%llx",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001715 MAJOR(__entry->dev), MINOR(__entry->dev),
1716 __entry->agno,
1717 __entry->agbno,
1718 __entry->minlen,
1719 __entry->maxlen,
1720 __entry->mod,
1721 __entry->prod,
1722 __entry->minleft,
1723 __entry->total,
1724 __entry->alignment,
1725 __entry->minalignslop,
1726 __entry->len,
1727 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1728 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1729 __entry->wasdel,
1730 __entry->wasfromfl,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001731 __entry->resv,
Dave Chinner292378e2016-09-26 08:21:28 +10001732 __entry->datatype,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001733 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001734)
1735
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001736#define DEFINE_ALLOC_EVENT(name) \
1737DEFINE_EVENT(xfs_alloc_class, name, \
1738 TP_PROTO(struct xfs_alloc_arg *args), \
1739 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001740DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001741DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001742DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1743DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1744DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
Brian Fosterd2968822019-10-13 17:10:35 -07001745DEFINE_ALLOC_EVENT(xfs_alloc_cur);
Brian Fosterfec0afd2019-10-13 17:10:33 -07001746DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
1747DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
Brian Fosterdc8e69b2019-10-13 17:10:36 -07001748DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
1749DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001750DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001751DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1752DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001753DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1754DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1755DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1756DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1757DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001758DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001759DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1760DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1761DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1762DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1763DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1764DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1765DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1766DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1767DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1768
Brian Foster396bbf32019-10-13 17:10:33 -07001769TRACE_EVENT(xfs_alloc_cur_check,
1770 TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
1771 xfs_extlen_t len, xfs_extlen_t diff, bool new),
1772 TP_ARGS(mp, btnum, bno, len, diff, new),
1773 TP_STRUCT__entry(
1774 __field(dev_t, dev)
1775 __field(xfs_btnum_t, btnum)
1776 __field(xfs_agblock_t, bno)
1777 __field(xfs_extlen_t, len)
1778 __field(xfs_extlen_t, diff)
1779 __field(bool, new)
1780 ),
1781 TP_fast_assign(
1782 __entry->dev = mp->m_super->s_dev;
1783 __entry->btnum = btnum;
1784 __entry->bno = bno;
1785 __entry->len = len;
1786 __entry->diff = diff;
1787 __entry->new = new;
1788 ),
1789 TP_printk("dev %d:%d btree %s bno 0x%x len 0x%x diff 0x%x new %d",
1790 MAJOR(__entry->dev), MINOR(__entry->dev),
1791 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
1792 __entry->bno, __entry->len, __entry->diff, __entry->new)
1793)
1794
Dave Chinner5a5881c2012-03-22 05:15:13 +00001795DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001796 TP_PROTO(struct xfs_da_args *args),
1797 TP_ARGS(args),
1798 TP_STRUCT__entry(
1799 __field(dev_t, dev)
1800 __field(xfs_ino_t, ino)
1801 __dynamic_array(char, name, args->namelen)
1802 __field(int, namelen)
1803 __field(xfs_dahash_t, hashval)
1804 __field(xfs_ino_t, inumber)
1805 __field(int, op_flags)
1806 ),
1807 TP_fast_assign(
1808 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1809 __entry->ino = args->dp->i_ino;
1810 if (args->namelen)
1811 memcpy(__get_str(name), args->name, args->namelen);
1812 __entry->namelen = args->namelen;
1813 __entry->hashval = args->hashval;
1814 __entry->inumber = args->inumber;
1815 __entry->op_flags = args->op_flags;
1816 ),
1817 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1818 "inumber 0x%llx op_flags %s",
1819 MAJOR(__entry->dev), MINOR(__entry->dev),
1820 __entry->ino,
1821 __entry->namelen,
1822 __entry->namelen ? __get_str(name) : NULL,
1823 __entry->namelen,
1824 __entry->hashval,
1825 __entry->inumber,
1826 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001827)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001828
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001829#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001830DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001831 TP_PROTO(struct xfs_da_args *args), \
1832 TP_ARGS(args))
1833DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1834DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1835DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1836DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1837DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1838DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1839DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1840DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1841DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1842DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1843DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1844DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1845DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1846DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1847DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1848DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1849DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1850DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1851DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1852DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1853DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1854DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1855DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1856DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1857DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1858
Dave Chinneree732592012-11-12 22:53:53 +11001859DECLARE_EVENT_CLASS(xfs_attr_class,
1860 TP_PROTO(struct xfs_da_args *args),
1861 TP_ARGS(args),
1862 TP_STRUCT__entry(
1863 __field(dev_t, dev)
1864 __field(xfs_ino_t, ino)
1865 __dynamic_array(char, name, args->namelen)
1866 __field(int, namelen)
1867 __field(int, valuelen)
1868 __field(xfs_dahash_t, hashval)
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08001869 __field(unsigned int, attr_filter)
1870 __field(unsigned int, attr_flags)
Dave Chinneree732592012-11-12 22:53:53 +11001871 __field(int, op_flags)
1872 ),
1873 TP_fast_assign(
1874 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1875 __entry->ino = args->dp->i_ino;
1876 if (args->namelen)
1877 memcpy(__get_str(name), args->name, args->namelen);
1878 __entry->namelen = args->namelen;
1879 __entry->valuelen = args->valuelen;
1880 __entry->hashval = args->hashval;
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08001881 __entry->attr_filter = args->attr_filter;
1882 __entry->attr_flags = args->attr_flags;
Dave Chinneree732592012-11-12 22:53:53 +11001883 __entry->op_flags = args->op_flags;
1884 ),
1885 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08001886 "hashval 0x%x filter %s flags %s op_flags %s",
Dave Chinneree732592012-11-12 22:53:53 +11001887 MAJOR(__entry->dev), MINOR(__entry->dev),
1888 __entry->ino,
1889 __entry->namelen,
1890 __entry->namelen ? __get_str(name) : NULL,
1891 __entry->namelen,
1892 __entry->valuelen,
1893 __entry->hashval,
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08001894 __print_flags(__entry->attr_filter, "|",
1895 XFS_ATTR_FILTER_FLAGS),
1896 __print_flags(__entry->attr_flags, "|",
1897 { XATTR_CREATE, "CREATE" },
1898 { XATTR_REPLACE, "REPLACE" }),
Dave Chinneree732592012-11-12 22:53:53 +11001899 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1900)
1901
Dave Chinner5a5881c2012-03-22 05:15:13 +00001902#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001903DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001904 TP_PROTO(struct xfs_da_args *args), \
1905 TP_ARGS(args))
1906DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1907DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1908DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1909DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1910DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001911DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1912
1913DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1914DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1915DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001916DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001917DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1918DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001919DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1920DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001921DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1922DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001923DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001924DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1925DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1926DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1927DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1928DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1929DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1930DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1931DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1932DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1933DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1934DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001935DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001936
1937DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001938DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001939DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1940DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1941
Dave Chinneree732592012-11-12 22:53:53 +11001942DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1943DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1944
1945DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1946DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1947DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1948
Dave Chinner5a5881c2012-03-22 05:15:13 +00001949#define DEFINE_DA_EVENT(name) \
1950DEFINE_EVENT(xfs_da_class, name, \
1951 TP_PROTO(struct xfs_da_args *args), \
1952 TP_ARGS(args))
1953DEFINE_DA_EVENT(xfs_da_split);
1954DEFINE_DA_EVENT(xfs_da_join);
1955DEFINE_DA_EVENT(xfs_da_link_before);
1956DEFINE_DA_EVENT(xfs_da_link_after);
1957DEFINE_DA_EVENT(xfs_da_unlink_back);
1958DEFINE_DA_EVENT(xfs_da_unlink_forward);
1959DEFINE_DA_EVENT(xfs_da_root_split);
1960DEFINE_DA_EVENT(xfs_da_root_join);
1961DEFINE_DA_EVENT(xfs_da_node_add);
1962DEFINE_DA_EVENT(xfs_da_node_create);
1963DEFINE_DA_EVENT(xfs_da_node_split);
1964DEFINE_DA_EVENT(xfs_da_node_remove);
1965DEFINE_DA_EVENT(xfs_da_node_rebalance);
1966DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001967DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001968DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1969DEFINE_DA_EVENT(xfs_da_grow_inode);
1970DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001971DEFINE_DA_EVENT(xfs_da_fixhashpath);
1972DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001973
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001974DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1975 TP_PROTO(struct xfs_da_args *args, int idx),
1976 TP_ARGS(args, idx),
1977 TP_STRUCT__entry(
1978 __field(dev_t, dev)
1979 __field(xfs_ino_t, ino)
1980 __field(int, op_flags)
1981 __field(int, idx)
1982 ),
1983 TP_fast_assign(
1984 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1985 __entry->ino = args->dp->i_ino;
1986 __entry->op_flags = args->op_flags;
1987 __entry->idx = idx;
1988 ),
1989 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1990 MAJOR(__entry->dev), MINOR(__entry->dev),
1991 __entry->ino,
1992 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1993 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001994)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001995
1996#define DEFINE_DIR2_SPACE_EVENT(name) \
1997DEFINE_EVENT(xfs_dir2_space_class, name, \
1998 TP_PROTO(struct xfs_da_args *args, int idx), \
1999 TP_ARGS(args, idx))
2000DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
2001DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
2002DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
2003DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002004
2005TRACE_EVENT(xfs_dir2_leafn_moveents,
2006 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
2007 TP_ARGS(args, src_idx, dst_idx, count),
2008 TP_STRUCT__entry(
2009 __field(dev_t, dev)
2010 __field(xfs_ino_t, ino)
2011 __field(int, op_flags)
2012 __field(int, src_idx)
2013 __field(int, dst_idx)
2014 __field(int, count)
2015 ),
2016 TP_fast_assign(
2017 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2018 __entry->ino = args->dp->i_ino;
2019 __entry->op_flags = args->op_flags;
2020 __entry->src_idx = src_idx;
2021 __entry->dst_idx = dst_idx;
2022 __entry->count = count;
2023 ),
2024 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
2025 "src_idx %d dst_idx %d count %d",
2026 MAJOR(__entry->dev), MINOR(__entry->dev),
2027 __entry->ino,
2028 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2029 __entry->src_idx,
2030 __entry->dst_idx,
2031 __entry->count)
2032);
2033
Dave Chinner3a85cd92010-01-14 01:33:55 +00002034#define XFS_SWAPEXT_INODES \
2035 { 0, "target" }, \
2036 { 1, "temp" }
2037
Darrick J. Wong0357d212018-12-18 14:32:30 -08002038TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
2039TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
2040TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
2041TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
2042TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
Dave Chinner3a85cd92010-01-14 01:33:55 +00002043
2044DECLARE_EVENT_CLASS(xfs_swap_extent_class,
2045 TP_PROTO(struct xfs_inode *ip, int which),
2046 TP_ARGS(ip, which),
2047 TP_STRUCT__entry(
2048 __field(dev_t, dev)
2049 __field(int, which)
2050 __field(xfs_ino_t, ino)
2051 __field(int, format)
2052 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00002053 __field(int, broot_size)
2054 __field(int, fork_off)
2055 ),
2056 TP_fast_assign(
2057 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2058 __entry->which = which;
2059 __entry->ino = ip->i_ino;
Christoph Hellwigf7e67b22020-05-18 10:28:05 -07002060 __entry->format = ip->i_df.if_format;
Christoph Hellwigdaf83962020-05-18 10:27:22 -07002061 __entry->nex = ip->i_df.if_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00002062 __entry->broot_size = ip->i_df.if_broot_bytes;
2063 __entry->fork_off = XFS_IFORK_BOFF(ip);
2064 ),
2065 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00002066 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00002067 MAJOR(__entry->dev), MINOR(__entry->dev),
2068 __entry->ino,
2069 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
2070 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
2071 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00002072 __entry->broot_size,
2073 __entry->fork_off)
2074)
2075
2076#define DEFINE_SWAPEXT_EVENT(name) \
2077DEFINE_EVENT(xfs_swap_extent_class, name, \
2078 TP_PROTO(struct xfs_inode *ip, int which), \
2079 TP_ARGS(ip, which))
2080
2081DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
2082DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
2083
Brian Fostere67d3d42017-08-08 18:21:53 -07002084TRACE_EVENT(xfs_log_recover,
2085 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
2086 TP_ARGS(log, headblk, tailblk),
2087 TP_STRUCT__entry(
2088 __field(dev_t, dev)
2089 __field(xfs_daddr_t, headblk)
2090 __field(xfs_daddr_t, tailblk)
2091 ),
2092 TP_fast_assign(
2093 __entry->dev = log->l_mp->m_super->s_dev;
2094 __entry->headblk = headblk;
2095 __entry->tailblk = tailblk;
2096 ),
2097 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2098 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2099 __entry->tailblk)
2100)
2101
Brian Foster5cd9cee2016-09-26 08:34:52 +10002102TRACE_EVENT(xfs_log_recover_record,
2103 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2104 TP_ARGS(log, rhead, pass),
2105 TP_STRUCT__entry(
2106 __field(dev_t, dev)
2107 __field(xfs_lsn_t, lsn)
2108 __field(int, len)
2109 __field(int, num_logops)
2110 __field(int, pass)
2111 ),
2112 TP_fast_assign(
2113 __entry->dev = log->l_mp->m_super->s_dev;
2114 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2115 __entry->len = be32_to_cpu(rhead->h_len);
2116 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2117 __entry->pass = pass;
2118 ),
2119 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2120 MAJOR(__entry->dev), MINOR(__entry->dev),
2121 __entry->lsn, __entry->len, __entry->num_logops,
2122 __entry->pass)
2123)
2124
Dave Chinner9abbc532010-04-13 15:06:46 +10002125DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002126 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10002127 struct xlog_recover_item *item, int pass),
2128 TP_ARGS(log, trans, item, pass),
2129 TP_STRUCT__entry(
2130 __field(dev_t, dev)
2131 __field(unsigned long, item)
2132 __field(xlog_tid_t, tid)
Brian Foster5cd9cee2016-09-26 08:34:52 +10002133 __field(xfs_lsn_t, lsn)
Dave Chinner9abbc532010-04-13 15:06:46 +10002134 __field(int, type)
2135 __field(int, pass)
2136 __field(int, count)
2137 __field(int, total)
2138 ),
2139 TP_fast_assign(
2140 __entry->dev = log->l_mp->m_super->s_dev;
2141 __entry->item = (unsigned long)item;
2142 __entry->tid = trans->r_log_tid;
Brian Foster5cd9cee2016-09-26 08:34:52 +10002143 __entry->lsn = trans->r_lsn;
Dave Chinner9abbc532010-04-13 15:06:46 +10002144 __entry->type = ITEM_TYPE(item);
2145 __entry->pass = pass;
2146 __entry->count = item->ri_cnt;
2147 __entry->total = item->ri_total;
2148 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08002149 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
Brian Foster5cd9cee2016-09-26 08:34:52 +10002150 "item type %s item region count/total %d/%d",
Dave Chinner9abbc532010-04-13 15:06:46 +10002151 MAJOR(__entry->dev), MINOR(__entry->dev),
2152 __entry->tid,
Brian Foster5cd9cee2016-09-26 08:34:52 +10002153 __entry->lsn,
Dave Chinner9abbc532010-04-13 15:06:46 +10002154 __entry->pass,
2155 (void *)__entry->item,
2156 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2157 __entry->count,
2158 __entry->total)
2159)
2160
2161#define DEFINE_LOG_RECOVER_ITEM(name) \
2162DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002163 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10002164 struct xlog_recover_item *item, int pass), \
2165 TP_ARGS(log, trans, item, pass))
2166
2167DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2168DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2169DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2170DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2171DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2172
2173DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002174 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002175 TP_ARGS(log, buf_f),
2176 TP_STRUCT__entry(
2177 __field(dev_t, dev)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002178 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002179 __field(unsigned short, len)
2180 __field(unsigned short, flags)
2181 __field(unsigned short, size)
2182 __field(unsigned int, map_size)
2183 ),
2184 TP_fast_assign(
2185 __entry->dev = log->l_mp->m_super->s_dev;
2186 __entry->blkno = buf_f->blf_blkno;
2187 __entry->len = buf_f->blf_len;
2188 __entry->flags = buf_f->blf_flags;
2189 __entry->size = buf_f->blf_size;
2190 __entry->map_size = buf_f->blf_map_size;
2191 ),
2192 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2193 "map_size %d",
2194 MAJOR(__entry->dev), MINOR(__entry->dev),
2195 __entry->blkno,
2196 __entry->len,
2197 __entry->flags,
2198 __entry->size,
2199 __entry->map_size)
2200)
2201
2202#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2203DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002204 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002205 TP_ARGS(log, buf_f))
2206
2207DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2208DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2209DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2210DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2211DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
Brian Foster5cd9cee2016-09-26 08:34:52 +10002212DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
Dave Chinner9abbc532010-04-13 15:06:46 +10002213DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2214DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2215DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2216
2217DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002218 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002219 TP_ARGS(log, in_f),
2220 TP_STRUCT__entry(
2221 __field(dev_t, dev)
2222 __field(xfs_ino_t, ino)
2223 __field(unsigned short, size)
2224 __field(int, fields)
2225 __field(unsigned short, asize)
2226 __field(unsigned short, dsize)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002227 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002228 __field(int, len)
2229 __field(int, boffset)
2230 ),
2231 TP_fast_assign(
2232 __entry->dev = log->l_mp->m_super->s_dev;
2233 __entry->ino = in_f->ilf_ino;
2234 __entry->size = in_f->ilf_size;
2235 __entry->fields = in_f->ilf_fields;
2236 __entry->asize = in_f->ilf_asize;
2237 __entry->dsize = in_f->ilf_dsize;
2238 __entry->blkno = in_f->ilf_blkno;
2239 __entry->len = in_f->ilf_len;
2240 __entry->boffset = in_f->ilf_boffset;
2241 ),
2242 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2243 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2244 MAJOR(__entry->dev), MINOR(__entry->dev),
2245 __entry->ino,
2246 __entry->size,
2247 __entry->fields,
2248 __entry->asize,
2249 __entry->dsize,
2250 __entry->blkno,
2251 __entry->len,
2252 __entry->boffset)
2253)
2254#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2255DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002256 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002257 TP_ARGS(log, in_f))
2258
2259DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2260DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2261DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2262
Brian Foster78d57e42015-08-19 09:58:48 +10002263DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2264 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2265 TP_ARGS(log, in_f),
2266 TP_STRUCT__entry(
2267 __field(dev_t, dev)
2268 __field(xfs_agnumber_t, agno)
2269 __field(xfs_agblock_t, agbno)
2270 __field(unsigned int, count)
2271 __field(unsigned int, isize)
2272 __field(xfs_agblock_t, length)
2273 __field(unsigned int, gen)
2274 ),
2275 TP_fast_assign(
2276 __entry->dev = log->l_mp->m_super->s_dev;
2277 __entry->agno = be32_to_cpu(in_f->icl_ag);
2278 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2279 __entry->count = be32_to_cpu(in_f->icl_count);
2280 __entry->isize = be32_to_cpu(in_f->icl_isize);
2281 __entry->length = be32_to_cpu(in_f->icl_length);
2282 __entry->gen = be32_to_cpu(in_f->icl_gen);
2283 ),
2284 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2285 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2286 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2287 __entry->length, __entry->gen)
2288)
2289#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2290DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2291 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2292 TP_ARGS(log, in_f))
2293
2294DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2295DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2296
Christoph Hellwiga46db602011-01-07 13:02:04 +00002297DECLARE_EVENT_CLASS(xfs_discard_class,
2298 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2299 xfs_agblock_t agbno, xfs_extlen_t len),
2300 TP_ARGS(mp, agno, agbno, len),
2301 TP_STRUCT__entry(
2302 __field(dev_t, dev)
2303 __field(xfs_agnumber_t, agno)
2304 __field(xfs_agblock_t, agbno)
2305 __field(xfs_extlen_t, len)
2306 ),
2307 TP_fast_assign(
2308 __entry->dev = mp->m_super->s_dev;
2309 __entry->agno = agno;
2310 __entry->agbno = agbno;
2311 __entry->len = len;
2312 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002313 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwiga46db602011-01-07 13:02:04 +00002314 MAJOR(__entry->dev), MINOR(__entry->dev),
2315 __entry->agno,
2316 __entry->agbno,
2317 __entry->len)
2318)
2319
2320#define DEFINE_DISCARD_EVENT(name) \
2321DEFINE_EVENT(xfs_discard_class, name, \
2322 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2323 xfs_agblock_t agbno, xfs_extlen_t len), \
2324 TP_ARGS(mp, agno, agbno, len))
2325DEFINE_DISCARD_EVENT(xfs_discard_extent);
2326DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2327DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2328DEFINE_DISCARD_EVENT(xfs_discard_busy);
2329
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002330/* btree cursor events */
Darrick J. Wongc4942132018-12-18 14:32:31 -08002331TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2332TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2333TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2334TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2335TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2336TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2337TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2338
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002339DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2340 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2341 TP_ARGS(cur, level, bp),
2342 TP_STRUCT__entry(
2343 __field(dev_t, dev)
2344 __field(xfs_btnum_t, btnum)
2345 __field(int, level)
2346 __field(int, nlevels)
2347 __field(int, ptr)
2348 __field(xfs_daddr_t, daddr)
2349 ),
2350 TP_fast_assign(
2351 __entry->dev = cur->bc_mp->m_super->s_dev;
2352 __entry->btnum = cur->bc_btnum;
2353 __entry->level = level;
2354 __entry->nlevels = cur->bc_nlevels;
2355 __entry->ptr = cur->bc_ptrs[level];
2356 __entry->daddr = bp ? bp->b_bn : -1;
2357 ),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002358 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002359 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002360 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002361 __entry->level,
2362 __entry->nlevels,
2363 __entry->ptr,
2364 (unsigned long long)__entry->daddr)
2365)
2366
2367#define DEFINE_BTREE_CUR_EVENT(name) \
2368DEFINE_EVENT(xfs_btree_cur_class, name, \
2369 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2370 TP_ARGS(cur, level, bp))
2371DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
Darrick J. Wong105f7d82016-08-03 11:10:21 +10002372DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002373
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002374/* deferred ops */
2375struct xfs_defer_pending;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002376
2377DECLARE_EVENT_CLASS(xfs_defer_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002378 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2379 TP_ARGS(tp, caller_ip),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002380 TP_STRUCT__entry(
2381 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002382 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002383 __field(char, committed)
Dave Chinnere632a562018-05-09 07:48:52 -07002384 __field(unsigned long, caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002385 ),
2386 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002387 __entry->dev = tp->t_mountp->m_super->s_dev;
2388 __entry->tp = tp;
Dave Chinnere632a562018-05-09 07:48:52 -07002389 __entry->caller_ip = caller_ip;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002390 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002391 TP_printk("dev %d:%d tp %p caller %pS",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002392 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002393 __entry->tp,
Dave Chinnere632a562018-05-09 07:48:52 -07002394 (char *)__entry->caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002395)
2396#define DEFINE_DEFER_EVENT(name) \
2397DEFINE_EVENT(xfs_defer_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002398 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2399 TP_ARGS(tp, caller_ip))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002400
2401DECLARE_EVENT_CLASS(xfs_defer_error_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002402 TP_PROTO(struct xfs_trans *tp, int error),
2403 TP_ARGS(tp, error),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002404 TP_STRUCT__entry(
2405 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002406 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002407 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002408 __field(int, error)
2409 ),
2410 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002411 __entry->dev = tp->t_mountp->m_super->s_dev;
2412 __entry->tp = tp;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002413 __entry->error = error;
2414 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002415 TP_printk("dev %d:%d tp %p err %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002416 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002417 __entry->tp,
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002418 __entry->error)
2419)
2420#define DEFINE_DEFER_ERROR_EVENT(name) \
2421DEFINE_EVENT(xfs_defer_error_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002422 TP_PROTO(struct xfs_trans *tp, int error), \
2423 TP_ARGS(tp, error))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002424
2425DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2426 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2427 TP_ARGS(mp, dfp),
2428 TP_STRUCT__entry(
2429 __field(dev_t, dev)
2430 __field(int, type)
2431 __field(void *, intent)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002432 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002433 __field(int, nr)
2434 ),
2435 TP_fast_assign(
2436 __entry->dev = mp ? mp->m_super->s_dev : 0;
Darrick J. Wong02b100f2018-12-12 08:46:22 -08002437 __entry->type = dfp->dfp_type;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002438 __entry->intent = dfp->dfp_intent;
Darrick J. Wongea78d802016-08-30 13:51:39 +10002439 __entry->committed = dfp->dfp_done != NULL;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002440 __entry->nr = dfp->dfp_count;
2441 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002442 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002443 MAJOR(__entry->dev), MINOR(__entry->dev),
2444 __entry->type,
2445 __entry->intent,
2446 __entry->committed,
2447 __entry->nr)
2448)
2449#define DEFINE_DEFER_PENDING_EVENT(name) \
2450DEFINE_EVENT(xfs_defer_pending_class, name, \
2451 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2452 TP_ARGS(mp, dfp))
2453
2454DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2455 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2456 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2457 TP_ARGS(mp, agno, type, agbno, len),
2458 TP_STRUCT__entry(
2459 __field(dev_t, dev)
2460 __field(xfs_agnumber_t, agno)
2461 __field(int, type)
2462 __field(xfs_agblock_t, agbno)
2463 __field(xfs_extlen_t, len)
2464 ),
2465 TP_fast_assign(
2466 __entry->dev = mp->m_super->s_dev;
2467 __entry->agno = agno;
2468 __entry->type = type;
2469 __entry->agbno = agbno;
2470 __entry->len = len;
2471 ),
2472 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2473 MAJOR(__entry->dev), MINOR(__entry->dev),
2474 __entry->type,
2475 __entry->agno,
2476 __entry->agbno,
2477 __entry->len)
2478);
2479#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2480DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2481 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2482 int type, \
2483 xfs_agblock_t bno, \
2484 xfs_extlen_t len), \
2485 TP_ARGS(mp, agno, type, bno, len))
2486
2487DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2488 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2489 int op,
2490 xfs_agblock_t agbno,
2491 xfs_ino_t ino,
2492 int whichfork,
2493 xfs_fileoff_t offset,
2494 xfs_filblks_t len,
2495 xfs_exntst_t state),
2496 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2497 TP_STRUCT__entry(
2498 __field(dev_t, dev)
2499 __field(xfs_agnumber_t, agno)
2500 __field(xfs_ino_t, ino)
2501 __field(xfs_agblock_t, agbno)
2502 __field(int, whichfork)
2503 __field(xfs_fileoff_t, l_loff)
2504 __field(xfs_filblks_t, l_len)
2505 __field(xfs_exntst_t, l_state)
2506 __field(int, op)
2507 ),
2508 TP_fast_assign(
2509 __entry->dev = mp->m_super->s_dev;
2510 __entry->agno = agno;
2511 __entry->ino = ino;
2512 __entry->agbno = agbno;
2513 __entry->whichfork = whichfork;
2514 __entry->l_loff = offset;
2515 __entry->l_len = len;
2516 __entry->l_state = state;
2517 __entry->op = op;
2518 ),
2519 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2520 MAJOR(__entry->dev), MINOR(__entry->dev),
2521 __entry->op,
2522 __entry->agno,
2523 __entry->agbno,
2524 __entry->ino,
2525 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2526 __entry->l_loff,
2527 __entry->l_len,
2528 __entry->l_state)
2529);
2530#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2531DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2532 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2533 int op, \
2534 xfs_agblock_t agbno, \
2535 xfs_ino_t ino, \
2536 int whichfork, \
2537 xfs_fileoff_t offset, \
2538 xfs_filblks_t len, \
2539 xfs_exntst_t state), \
2540 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2541
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002542DEFINE_DEFER_EVENT(xfs_defer_cancel);
2543DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2544DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2545DEFINE_DEFER_EVENT(xfs_defer_finish);
2546DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2547
2548DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2549DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002550
Brian Foster1ae093cb2018-08-01 07:20:34 -07002551DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2552DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002553DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2554DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
Darrick J. Wong4e919af2020-09-27 16:18:13 -07002555DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002556
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002557#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2558DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2559DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
Brian Fosterf8f28352018-05-07 17:38:47 -07002560DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2561DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002562
Darrick J. Wong673930c2016-08-03 11:33:43 +10002563/* rmap tracepoints */
2564DECLARE_EVENT_CLASS(xfs_rmap_class,
2565 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2566 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
Darrick J. Wong66e32372018-12-12 08:46:23 -08002567 const struct xfs_owner_info *oinfo),
Darrick J. Wong673930c2016-08-03 11:33:43 +10002568 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2569 TP_STRUCT__entry(
2570 __field(dev_t, dev)
2571 __field(xfs_agnumber_t, agno)
2572 __field(xfs_agblock_t, agbno)
2573 __field(xfs_extlen_t, len)
2574 __field(uint64_t, owner)
2575 __field(uint64_t, offset)
2576 __field(unsigned long, flags)
2577 ),
2578 TP_fast_assign(
2579 __entry->dev = mp->m_super->s_dev;
2580 __entry->agno = agno;
2581 __entry->agbno = agbno;
2582 __entry->len = len;
2583 __entry->owner = oinfo->oi_owner;
2584 __entry->offset = oinfo->oi_offset;
2585 __entry->flags = oinfo->oi_flags;
Darrick J. Wong035e00a2016-08-03 11:36:07 +10002586 if (unwritten)
2587 __entry->flags |= XFS_RMAP_UNWRITTEN;
Darrick J. Wong673930c2016-08-03 11:33:43 +10002588 ),
2589 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2590 MAJOR(__entry->dev), MINOR(__entry->dev),
2591 __entry->agno,
2592 __entry->agbno,
2593 __entry->len,
2594 __entry->owner,
2595 __entry->offset,
2596 __entry->flags)
2597);
2598#define DEFINE_RMAP_EVENT(name) \
2599DEFINE_EVENT(xfs_rmap_class, name, \
2600 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2601 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
Darrick J. Wong66e32372018-12-12 08:46:23 -08002602 const struct xfs_owner_info *oinfo), \
Darrick J. Wong673930c2016-08-03 11:33:43 +10002603 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2604
2605/* simple AG-based error/%ip tracepoint class */
2606DECLARE_EVENT_CLASS(xfs_ag_error_class,
2607 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2608 unsigned long caller_ip),
2609 TP_ARGS(mp, agno, error, caller_ip),
2610 TP_STRUCT__entry(
2611 __field(dev_t, dev)
2612 __field(xfs_agnumber_t, agno)
2613 __field(int, error)
2614 __field(unsigned long, caller_ip)
2615 ),
2616 TP_fast_assign(
2617 __entry->dev = mp->m_super->s_dev;
2618 __entry->agno = agno;
2619 __entry->error = error;
2620 __entry->caller_ip = caller_ip;
2621 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08002622 TP_printk("dev %d:%d agno %u error %d caller %pS",
Darrick J. Wong673930c2016-08-03 11:33:43 +10002623 MAJOR(__entry->dev), MINOR(__entry->dev),
2624 __entry->agno,
2625 __entry->error,
2626 (char *)__entry->caller_ip)
2627);
2628
2629#define DEFINE_AG_ERROR_EVENT(name) \
2630DEFINE_EVENT(xfs_ag_error_class, name, \
2631 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2632 unsigned long caller_ip), \
2633 TP_ARGS(mp, agno, error, caller_ip))
2634
2635DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2636DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2637DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2638DEFINE_RMAP_EVENT(xfs_rmap_map);
2639DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2640DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002641DEFINE_RMAP_EVENT(xfs_rmap_convert);
2642DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2643DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2644DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
Darrick J. Wong673930c2016-08-03 11:33:43 +10002645
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002646DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2647 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2648 xfs_agblock_t agbno, xfs_extlen_t len,
2649 uint64_t owner, uint64_t offset, unsigned int flags),
2650 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2651 TP_STRUCT__entry(
2652 __field(dev_t, dev)
2653 __field(xfs_agnumber_t, agno)
2654 __field(xfs_agblock_t, agbno)
2655 __field(xfs_extlen_t, len)
2656 __field(uint64_t, owner)
2657 __field(uint64_t, offset)
2658 __field(unsigned int, flags)
2659 ),
2660 TP_fast_assign(
2661 __entry->dev = mp->m_super->s_dev;
2662 __entry->agno = agno;
2663 __entry->agbno = agbno;
2664 __entry->len = len;
2665 __entry->owner = owner;
2666 __entry->offset = offset;
2667 __entry->flags = flags;
2668 ),
2669 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2670 MAJOR(__entry->dev), MINOR(__entry->dev),
2671 __entry->agno,
2672 __entry->agbno,
2673 __entry->len,
2674 __entry->owner,
2675 __entry->offset,
2676 __entry->flags)
2677);
2678#define DEFINE_RMAPBT_EVENT(name) \
2679DEFINE_EVENT(xfs_rmapbt_class, name, \
2680 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2681 xfs_agblock_t agbno, xfs_extlen_t len, \
2682 uint64_t owner, uint64_t offset, unsigned int flags), \
2683 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2684
2685#define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2686DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2687DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2688
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002689DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2690DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002691DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2692DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2693DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2694DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2695DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2696DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
Darrick J. Wongceeb9c82016-10-03 09:11:48 -07002697
2698DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2699DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2700DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2701DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
Darrick J. Wong0a1b0b32016-08-03 11:44:21 +10002702DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2703DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002704DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002705
Darrick J. Wong9f3afb52016-10-03 09:11:28 -07002706/* deferred bmbt updates */
2707#define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2708DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2709DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2710
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002711/* per-AG reservation */
2712DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2713 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2714 xfs_extlen_t len),
2715 TP_ARGS(pag, resv, len),
2716 TP_STRUCT__entry(
2717 __field(dev_t, dev)
2718 __field(xfs_agnumber_t, agno)
2719 __field(int, resv)
2720 __field(xfs_extlen_t, freeblks)
2721 __field(xfs_extlen_t, flcount)
2722 __field(xfs_extlen_t, reserved)
2723 __field(xfs_extlen_t, asked)
2724 __field(xfs_extlen_t, len)
2725 ),
2726 TP_fast_assign(
2727 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2728
2729 __entry->dev = pag->pag_mount->m_super->s_dev;
2730 __entry->agno = pag->pag_agno;
2731 __entry->resv = resv;
2732 __entry->freeblks = pag->pagf_freeblks;
2733 __entry->flcount = pag->pagf_flcount;
2734 __entry->reserved = r ? r->ar_reserved : 0;
2735 __entry->asked = r ? r->ar_asked : 0;
2736 __entry->len = len;
2737 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002738 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u "
2739 "resv %u ask %u len %u",
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002740 MAJOR(__entry->dev), MINOR(__entry->dev),
2741 __entry->agno,
2742 __entry->resv,
2743 __entry->freeblks,
2744 __entry->flcount,
2745 __entry->reserved,
2746 __entry->asked,
2747 __entry->len)
2748)
2749#define DEFINE_AG_RESV_EVENT(name) \
2750DEFINE_EVENT(xfs_ag_resv_class, name, \
2751 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2752 xfs_extlen_t len), \
2753 TP_ARGS(pag, type, len))
2754
2755/* per-AG reservation tracepoints */
2756DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2757DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2758DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2759DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2760DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2761DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2762
2763DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2764DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2765
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002766/* refcount tracepoint classes */
2767
2768/* reuse the discard trace class for agbno/aglen-based traces */
2769#define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2770
2771/* ag btree lookup tracepoint class */
Darrick J. Wong85f8dff2018-12-18 14:32:29 -08002772TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2773TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2774TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002775DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2776 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2777 xfs_agblock_t agbno, xfs_lookup_t dir),
2778 TP_ARGS(mp, agno, agbno, dir),
2779 TP_STRUCT__entry(
2780 __field(dev_t, dev)
2781 __field(xfs_agnumber_t, agno)
2782 __field(xfs_agblock_t, agbno)
2783 __field(xfs_lookup_t, dir)
2784 ),
2785 TP_fast_assign(
2786 __entry->dev = mp->m_super->s_dev;
2787 __entry->agno = agno;
2788 __entry->agbno = agbno;
2789 __entry->dir = dir;
2790 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002791 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002792 MAJOR(__entry->dev), MINOR(__entry->dev),
2793 __entry->agno,
2794 __entry->agbno,
2795 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2796 __entry->dir)
2797)
2798
2799#define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2800DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2801 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2802 xfs_agblock_t agbno, xfs_lookup_t dir), \
2803 TP_ARGS(mp, agno, agbno, dir))
2804
2805/* single-rcext tracepoint class */
2806DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2807 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2808 struct xfs_refcount_irec *irec),
2809 TP_ARGS(mp, agno, irec),
2810 TP_STRUCT__entry(
2811 __field(dev_t, dev)
2812 __field(xfs_agnumber_t, agno)
2813 __field(xfs_agblock_t, startblock)
2814 __field(xfs_extlen_t, blockcount)
2815 __field(xfs_nlink_t, refcount)
2816 ),
2817 TP_fast_assign(
2818 __entry->dev = mp->m_super->s_dev;
2819 __entry->agno = agno;
2820 __entry->startblock = irec->rc_startblock;
2821 __entry->blockcount = irec->rc_blockcount;
2822 __entry->refcount = irec->rc_refcount;
2823 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002824 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002825 MAJOR(__entry->dev), MINOR(__entry->dev),
2826 __entry->agno,
2827 __entry->startblock,
2828 __entry->blockcount,
2829 __entry->refcount)
2830)
2831
2832#define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2833DEFINE_EVENT(xfs_refcount_extent_class, name, \
2834 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2835 struct xfs_refcount_irec *irec), \
2836 TP_ARGS(mp, agno, irec))
2837
2838/* single-rcext and an agbno tracepoint class */
2839DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2840 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2841 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2842 TP_ARGS(mp, agno, irec, agbno),
2843 TP_STRUCT__entry(
2844 __field(dev_t, dev)
2845 __field(xfs_agnumber_t, agno)
2846 __field(xfs_agblock_t, startblock)
2847 __field(xfs_extlen_t, blockcount)
2848 __field(xfs_nlink_t, refcount)
2849 __field(xfs_agblock_t, agbno)
2850 ),
2851 TP_fast_assign(
2852 __entry->dev = mp->m_super->s_dev;
2853 __entry->agno = agno;
2854 __entry->startblock = irec->rc_startblock;
2855 __entry->blockcount = irec->rc_blockcount;
2856 __entry->refcount = irec->rc_refcount;
2857 __entry->agbno = agbno;
2858 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002859 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002860 MAJOR(__entry->dev), MINOR(__entry->dev),
2861 __entry->agno,
2862 __entry->startblock,
2863 __entry->blockcount,
2864 __entry->refcount,
2865 __entry->agbno)
2866)
2867
2868#define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2869DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2870 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2871 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2872 TP_ARGS(mp, agno, irec, agbno))
2873
2874/* double-rcext tracepoint class */
2875DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2876 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2877 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2878 TP_ARGS(mp, agno, i1, i2),
2879 TP_STRUCT__entry(
2880 __field(dev_t, dev)
2881 __field(xfs_agnumber_t, agno)
2882 __field(xfs_agblock_t, i1_startblock)
2883 __field(xfs_extlen_t, i1_blockcount)
2884 __field(xfs_nlink_t, i1_refcount)
2885 __field(xfs_agblock_t, i2_startblock)
2886 __field(xfs_extlen_t, i2_blockcount)
2887 __field(xfs_nlink_t, i2_refcount)
2888 ),
2889 TP_fast_assign(
2890 __entry->dev = mp->m_super->s_dev;
2891 __entry->agno = agno;
2892 __entry->i1_startblock = i1->rc_startblock;
2893 __entry->i1_blockcount = i1->rc_blockcount;
2894 __entry->i1_refcount = i1->rc_refcount;
2895 __entry->i2_startblock = i2->rc_startblock;
2896 __entry->i2_blockcount = i2->rc_blockcount;
2897 __entry->i2_refcount = i2->rc_refcount;
2898 ),
2899 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002900 "agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002901 MAJOR(__entry->dev), MINOR(__entry->dev),
2902 __entry->agno,
2903 __entry->i1_startblock,
2904 __entry->i1_blockcount,
2905 __entry->i1_refcount,
2906 __entry->i2_startblock,
2907 __entry->i2_blockcount,
2908 __entry->i2_refcount)
2909)
2910
2911#define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2912DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2913 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2914 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2915 TP_ARGS(mp, agno, i1, i2))
2916
2917/* double-rcext and an agbno tracepoint class */
2918DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
2919 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2920 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2921 xfs_agblock_t agbno),
2922 TP_ARGS(mp, agno, i1, i2, agbno),
2923 TP_STRUCT__entry(
2924 __field(dev_t, dev)
2925 __field(xfs_agnumber_t, agno)
2926 __field(xfs_agblock_t, i1_startblock)
2927 __field(xfs_extlen_t, i1_blockcount)
2928 __field(xfs_nlink_t, i1_refcount)
2929 __field(xfs_agblock_t, i2_startblock)
2930 __field(xfs_extlen_t, i2_blockcount)
2931 __field(xfs_nlink_t, i2_refcount)
2932 __field(xfs_agblock_t, agbno)
2933 ),
2934 TP_fast_assign(
2935 __entry->dev = mp->m_super->s_dev;
2936 __entry->agno = agno;
2937 __entry->i1_startblock = i1->rc_startblock;
2938 __entry->i1_blockcount = i1->rc_blockcount;
2939 __entry->i1_refcount = i1->rc_refcount;
2940 __entry->i2_startblock = i2->rc_startblock;
2941 __entry->i2_blockcount = i2->rc_blockcount;
2942 __entry->i2_refcount = i2->rc_refcount;
2943 __entry->agbno = agbno;
2944 ),
2945 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002946 "agbno %u len %u refcount %u @ agbno %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002947 MAJOR(__entry->dev), MINOR(__entry->dev),
2948 __entry->agno,
2949 __entry->i1_startblock,
2950 __entry->i1_blockcount,
2951 __entry->i1_refcount,
2952 __entry->i2_startblock,
2953 __entry->i2_blockcount,
2954 __entry->i2_refcount,
2955 __entry->agbno)
2956)
2957
2958#define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2959DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2960 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2961 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2962 xfs_agblock_t agbno), \
2963 TP_ARGS(mp, agno, i1, i2, agbno))
2964
2965/* triple-rcext tracepoint class */
2966DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
2967 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2968 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2969 struct xfs_refcount_irec *i3),
2970 TP_ARGS(mp, agno, i1, i2, i3),
2971 TP_STRUCT__entry(
2972 __field(dev_t, dev)
2973 __field(xfs_agnumber_t, agno)
2974 __field(xfs_agblock_t, i1_startblock)
2975 __field(xfs_extlen_t, i1_blockcount)
2976 __field(xfs_nlink_t, i1_refcount)
2977 __field(xfs_agblock_t, i2_startblock)
2978 __field(xfs_extlen_t, i2_blockcount)
2979 __field(xfs_nlink_t, i2_refcount)
2980 __field(xfs_agblock_t, i3_startblock)
2981 __field(xfs_extlen_t, i3_blockcount)
2982 __field(xfs_nlink_t, i3_refcount)
2983 ),
2984 TP_fast_assign(
2985 __entry->dev = mp->m_super->s_dev;
2986 __entry->agno = agno;
2987 __entry->i1_startblock = i1->rc_startblock;
2988 __entry->i1_blockcount = i1->rc_blockcount;
2989 __entry->i1_refcount = i1->rc_refcount;
2990 __entry->i2_startblock = i2->rc_startblock;
2991 __entry->i2_blockcount = i2->rc_blockcount;
2992 __entry->i2_refcount = i2->rc_refcount;
2993 __entry->i3_startblock = i3->rc_startblock;
2994 __entry->i3_blockcount = i3->rc_blockcount;
2995 __entry->i3_refcount = i3->rc_refcount;
2996 ),
2997 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2998 "agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002999 "agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003000 MAJOR(__entry->dev), MINOR(__entry->dev),
3001 __entry->agno,
3002 __entry->i1_startblock,
3003 __entry->i1_blockcount,
3004 __entry->i1_refcount,
3005 __entry->i2_startblock,
3006 __entry->i2_blockcount,
3007 __entry->i2_refcount,
3008 __entry->i3_startblock,
3009 __entry->i3_blockcount,
3010 __entry->i3_refcount)
3011);
3012
3013#define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
3014DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
3015 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3016 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3017 struct xfs_refcount_irec *i3), \
3018 TP_ARGS(mp, agno, i1, i2, i3))
3019
3020/* refcount btree tracepoints */
3021DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
3022DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
3023DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
3024DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
3025DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
3026DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
3027DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
3028DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
3029DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
3030DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
3031
3032/* refcount adjustment tracepoints */
3033DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
3034DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
Darrick J. Wong174edb02016-10-03 09:11:39 -07003035DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
3036DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003037DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
3038DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
Darrick J. Wong174edb02016-10-03 09:11:39 -07003039DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003040DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
3041DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
3042DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
3043DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
3044DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
3045DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
Darrick J. Wong174edb02016-10-03 09:11:39 -07003046DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003047DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
3048DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
3049DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
3050DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
3051DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
3052DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
3053DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
3054
3055/* reflink helpers */
3056DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
3057DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
3058DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
Darrick J. Wong33ba61292016-10-03 09:11:22 -07003059#define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
3060DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
3061DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003062
Darrick J. Wongf997ee22016-10-03 09:11:21 -07003063TRACE_EVENT(xfs_refcount_finish_one_leftover,
3064 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3065 int type, xfs_agblock_t agbno, xfs_extlen_t len,
3066 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
3067 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
3068 TP_STRUCT__entry(
3069 __field(dev_t, dev)
3070 __field(xfs_agnumber_t, agno)
3071 __field(int, type)
3072 __field(xfs_agblock_t, agbno)
3073 __field(xfs_extlen_t, len)
3074 __field(xfs_agblock_t, new_agbno)
3075 __field(xfs_extlen_t, new_len)
3076 ),
3077 TP_fast_assign(
3078 __entry->dev = mp->m_super->s_dev;
3079 __entry->agno = agno;
3080 __entry->type = type;
3081 __entry->agbno = agbno;
3082 __entry->len = len;
3083 __entry->new_agbno = new_agbno;
3084 __entry->new_len = new_len;
3085 ),
3086 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
3087 MAJOR(__entry->dev), MINOR(__entry->dev),
3088 __entry->type,
3089 __entry->agno,
3090 __entry->agbno,
3091 __entry->len,
3092 __entry->new_agbno,
3093 __entry->new_len)
3094);
3095
Darrick J. Wongf65306e2016-10-03 09:11:27 -07003096/* simple inode-based error/%ip tracepoint class */
3097DECLARE_EVENT_CLASS(xfs_inode_error_class,
3098 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3099 TP_ARGS(ip, error, caller_ip),
3100 TP_STRUCT__entry(
3101 __field(dev_t, dev)
3102 __field(xfs_ino_t, ino)
3103 __field(int, error)
3104 __field(unsigned long, caller_ip)
3105 ),
3106 TP_fast_assign(
3107 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3108 __entry->ino = ip->i_ino;
3109 __entry->error = error;
3110 __entry->caller_ip = caller_ip;
3111 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08003112 TP_printk("dev %d:%d ino %llx error %d caller %pS",
Darrick J. Wongf65306e2016-10-03 09:11:27 -07003113 MAJOR(__entry->dev), MINOR(__entry->dev),
3114 __entry->ino,
3115 __entry->error,
3116 (char *)__entry->caller_ip)
3117);
3118
3119#define DEFINE_INODE_ERROR_EVENT(name) \
3120DEFINE_EVENT(xfs_inode_error_class, name, \
3121 TP_PROTO(struct xfs_inode *ip, int error, \
3122 unsigned long caller_ip), \
3123 TP_ARGS(ip, error, caller_ip))
3124
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003125/* reflink tracepoint classes */
3126
3127/* two-file io tracepoint class */
3128DECLARE_EVENT_CLASS(xfs_double_io_class,
3129 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3130 struct xfs_inode *dest, xfs_off_t doffset),
3131 TP_ARGS(src, soffset, len, dest, doffset),
3132 TP_STRUCT__entry(
3133 __field(dev_t, dev)
3134 __field(xfs_ino_t, src_ino)
3135 __field(loff_t, src_isize)
3136 __field(loff_t, src_disize)
3137 __field(loff_t, src_offset)
3138 __field(size_t, len)
3139 __field(xfs_ino_t, dest_ino)
3140 __field(loff_t, dest_isize)
3141 __field(loff_t, dest_disize)
3142 __field(loff_t, dest_offset)
3143 ),
3144 TP_fast_assign(
3145 __entry->dev = VFS_I(src)->i_sb->s_dev;
3146 __entry->src_ino = src->i_ino;
3147 __entry->src_isize = VFS_I(src)->i_size;
3148 __entry->src_disize = src->i_d.di_size;
3149 __entry->src_offset = soffset;
3150 __entry->len = len;
3151 __entry->dest_ino = dest->i_ino;
3152 __entry->dest_isize = VFS_I(dest)->i_size;
3153 __entry->dest_disize = dest->i_d.di_size;
3154 __entry->dest_offset = doffset;
3155 ),
3156 TP_printk("dev %d:%d count %zd "
3157 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
3158 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
3159 MAJOR(__entry->dev), MINOR(__entry->dev),
3160 __entry->len,
3161 __entry->src_ino,
3162 __entry->src_isize,
3163 __entry->src_disize,
3164 __entry->src_offset,
3165 __entry->dest_ino,
3166 __entry->dest_isize,
3167 __entry->dest_disize,
3168 __entry->dest_offset)
3169)
3170
3171#define DEFINE_DOUBLE_IO_EVENT(name) \
3172DEFINE_EVENT(xfs_double_io_class, name, \
3173 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3174 struct xfs_inode *dest, xfs_off_t doffset), \
3175 TP_ARGS(src, soffset, len, dest, doffset))
3176
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003177/* inode/irec events */
3178DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3179 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3180 TP_ARGS(ip, irec),
3181 TP_STRUCT__entry(
3182 __field(dev_t, dev)
3183 __field(xfs_ino_t, ino)
3184 __field(xfs_fileoff_t, lblk)
3185 __field(xfs_extlen_t, len)
3186 __field(xfs_fsblock_t, pblk)
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003187 __field(int, state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003188 ),
3189 TP_fast_assign(
3190 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3191 __entry->ino = ip->i_ino;
3192 __entry->lblk = irec->br_startoff;
3193 __entry->len = irec->br_blockcount;
3194 __entry->pblk = irec->br_startblock;
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003195 __entry->state = irec->br_state;
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003196 ),
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003197 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d",
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003198 MAJOR(__entry->dev), MINOR(__entry->dev),
3199 __entry->ino,
3200 __entry->lblk,
3201 __entry->len,
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003202 __entry->pblk,
3203 __entry->state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003204);
3205#define DEFINE_INODE_IREC_EVENT(name) \
3206DEFINE_EVENT(xfs_inode_irec_class, name, \
3207 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3208 TP_ARGS(ip, irec))
3209
3210/* refcount/reflink tracepoint definitions */
3211
3212/* reflink tracepoints */
3213DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3214DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3215DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
Darrick J. Wong00fd1d52020-06-29 14:47:18 -07003216TRACE_EVENT(xfs_reflink_remap_blocks,
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003217 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3218 xfs_filblks_t len, struct xfs_inode *dest,
3219 xfs_fileoff_t doffset),
3220 TP_ARGS(src, soffset, len, dest, doffset),
3221 TP_STRUCT__entry(
3222 __field(dev_t, dev)
3223 __field(xfs_ino_t, src_ino)
3224 __field(xfs_fileoff_t, src_lblk)
3225 __field(xfs_filblks_t, len)
3226 __field(xfs_ino_t, dest_ino)
3227 __field(xfs_fileoff_t, dest_lblk)
3228 ),
3229 TP_fast_assign(
3230 __entry->dev = VFS_I(src)->i_sb->s_dev;
3231 __entry->src_ino = src->i_ino;
3232 __entry->src_lblk = soffset;
3233 __entry->len = len;
3234 __entry->dest_ino = dest->i_ino;
3235 __entry->dest_lblk = doffset;
3236 ),
3237 TP_printk("dev %d:%d len 0x%llx "
3238 "ino 0x%llx offset 0x%llx blocks -> "
3239 "ino 0x%llx offset 0x%llx blocks",
3240 MAJOR(__entry->dev), MINOR(__entry->dev),
3241 __entry->len,
3242 __entry->src_ino,
3243 __entry->src_lblk,
3244 __entry->dest_ino,
3245 __entry->dest_lblk)
3246);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003247DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3248DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3249DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3250DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003251DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3252DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
Darrick J. Wong00fd1d52020-06-29 14:47:18 -07003253DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
3254DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003255
3256/* dedupe tracepoints */
3257DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3258DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3259
3260/* ioctl tracepoints */
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003261TRACE_EVENT(xfs_ioctl_clone,
3262 TP_PROTO(struct inode *src, struct inode *dest),
3263 TP_ARGS(src, dest),
3264 TP_STRUCT__entry(
3265 __field(dev_t, dev)
3266 __field(unsigned long, src_ino)
3267 __field(loff_t, src_isize)
3268 __field(unsigned long, dest_ino)
3269 __field(loff_t, dest_isize)
3270 ),
3271 TP_fast_assign(
3272 __entry->dev = src->i_sb->s_dev;
3273 __entry->src_ino = src->i_ino;
3274 __entry->src_isize = i_size_read(src);
3275 __entry->dest_ino = dest->i_ino;
3276 __entry->dest_isize = i_size_read(dest);
3277 ),
3278 TP_printk("dev %d:%d "
3279 "ino 0x%lx isize 0x%llx -> "
Hou Tao42bf9db2017-04-14 11:43:27 -07003280 "ino 0x%lx isize 0x%llx",
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003281 MAJOR(__entry->dev), MINOR(__entry->dev),
3282 __entry->src_ino,
3283 __entry->src_isize,
3284 __entry->dest_ino,
3285 __entry->dest_isize)
3286);
3287
3288/* unshare tracepoints */
3289DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003290DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003291
3292/* copy on write */
3293DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
Darrick J. Wongbe51f812016-10-03 09:11:32 -07003294DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3295DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003296DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003297
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003298DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3299DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3300DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003301
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003302DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3303DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3304
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003305
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003306DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003307
Darrick J. Wong1f08af52016-10-03 09:11:53 -07003308/* rmap swapext tracepoints */
3309DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3310DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3311DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3312
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003313/* fsmap traces */
3314DECLARE_EVENT_CLASS(xfs_fsmap_class,
3315 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3316 struct xfs_rmap_irec *rmap),
3317 TP_ARGS(mp, keydev, agno, rmap),
3318 TP_STRUCT__entry(
3319 __field(dev_t, dev)
3320 __field(dev_t, keydev)
3321 __field(xfs_agnumber_t, agno)
3322 __field(xfs_fsblock_t, bno)
3323 __field(xfs_filblks_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003324 __field(uint64_t, owner)
3325 __field(uint64_t, offset)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003326 __field(unsigned int, flags)
3327 ),
3328 TP_fast_assign(
3329 __entry->dev = mp->m_super->s_dev;
3330 __entry->keydev = new_decode_dev(keydev);
3331 __entry->agno = agno;
3332 __entry->bno = rmap->rm_startblock;
3333 __entry->len = rmap->rm_blockcount;
3334 __entry->owner = rmap->rm_owner;
3335 __entry->offset = rmap->rm_offset;
3336 __entry->flags = rmap->rm_flags;
3337 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07003338 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld offset %llu flags 0x%x",
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003339 MAJOR(__entry->dev), MINOR(__entry->dev),
3340 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3341 __entry->agno,
3342 __entry->bno,
3343 __entry->len,
3344 __entry->owner,
3345 __entry->offset,
3346 __entry->flags)
3347)
3348#define DEFINE_FSMAP_EVENT(name) \
3349DEFINE_EVENT(xfs_fsmap_class, name, \
3350 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3351 struct xfs_rmap_irec *rmap), \
3352 TP_ARGS(mp, keydev, agno, rmap))
3353DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3354DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3355DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3356
3357DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3358 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3359 TP_ARGS(mp, fsmap),
3360 TP_STRUCT__entry(
3361 __field(dev_t, dev)
3362 __field(dev_t, keydev)
3363 __field(xfs_daddr_t, block)
3364 __field(xfs_daddr_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003365 __field(uint64_t, owner)
3366 __field(uint64_t, offset)
3367 __field(uint64_t, flags)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003368 ),
3369 TP_fast_assign(
3370 __entry->dev = mp->m_super->s_dev;
3371 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3372 __entry->block = fsmap->fmr_physical;
3373 __entry->len = fsmap->fmr_length;
3374 __entry->owner = fsmap->fmr_owner;
3375 __entry->offset = fsmap->fmr_offset;
3376 __entry->flags = fsmap->fmr_flags;
3377 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07003378 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld offset %llu flags 0x%llx",
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003379 MAJOR(__entry->dev), MINOR(__entry->dev),
3380 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3381 __entry->block,
3382 __entry->len,
3383 __entry->owner,
3384 __entry->offset,
3385 __entry->flags)
3386)
3387#define DEFINE_GETFSMAP_EVENT(name) \
3388DEFINE_EVENT(xfs_getfsmap_class, name, \
3389 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3390 TP_ARGS(mp, fsmap))
3391DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3392DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3393DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3394
Darrick J. Wongb872af22018-01-08 10:51:26 -08003395TRACE_EVENT(xfs_trans_resv_calc,
3396 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3397 struct xfs_trans_res *res),
3398 TP_ARGS(mp, type, res),
3399 TP_STRUCT__entry(
3400 __field(dev_t, dev)
3401 __field(int, type)
3402 __field(uint, logres)
3403 __field(int, logcount)
3404 __field(int, logflags)
3405 ),
3406 TP_fast_assign(
3407 __entry->dev = mp->m_super->s_dev;
3408 __entry->type = type;
3409 __entry->logres = res->tr_logres;
3410 __entry->logcount = res->tr_logcount;
3411 __entry->logflags = res->tr_logflags;
3412 ),
3413 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3414 MAJOR(__entry->dev), MINOR(__entry->dev),
3415 __entry->type,
3416 __entry->logres,
3417 __entry->logcount,
3418 __entry->logflags)
3419);
3420
Dave Chinnerba187812018-05-09 07:47:57 -07003421DECLARE_EVENT_CLASS(xfs_trans_class,
3422 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3423 TP_ARGS(tp, caller_ip),
3424 TP_STRUCT__entry(
3425 __field(dev_t, dev)
3426 __field(uint32_t, tid)
3427 __field(uint32_t, flags)
3428 __field(unsigned long, caller_ip)
3429 ),
3430 TP_fast_assign(
3431 __entry->dev = tp->t_mountp->m_super->s_dev;
3432 __entry->tid = 0;
3433 if (tp->t_ticket)
3434 __entry->tid = tp->t_ticket->t_tid;
3435 __entry->flags = tp->t_flags;
3436 __entry->caller_ip = caller_ip;
3437 ),
3438 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3439 MAJOR(__entry->dev), MINOR(__entry->dev),
3440 __entry->tid,
3441 __entry->flags,
3442 (char *)__entry->caller_ip)
3443)
3444
3445#define DEFINE_TRANS_EVENT(name) \
3446DEFINE_EVENT(xfs_trans_class, name, \
3447 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3448 TP_ARGS(tp, caller_ip))
3449DEFINE_TRANS_EVENT(xfs_trans_alloc);
3450DEFINE_TRANS_EVENT(xfs_trans_cancel);
3451DEFINE_TRANS_EVENT(xfs_trans_commit);
3452DEFINE_TRANS_EVENT(xfs_trans_dup);
3453DEFINE_TRANS_EVENT(xfs_trans_free);
3454DEFINE_TRANS_EVENT(xfs_trans_roll);
3455DEFINE_TRANS_EVENT(xfs_trans_add_item);
Christoph Hellwig195cd832019-06-28 19:27:31 -07003456DEFINE_TRANS_EVENT(xfs_trans_commit_items);
Dave Chinnerba187812018-05-09 07:47:57 -07003457DEFINE_TRANS_EVENT(xfs_trans_free_items);
3458
Darrick J. Wong9a4a5112019-02-07 10:37:14 -08003459TRACE_EVENT(xfs_iunlink_update_bucket,
3460 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3461 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3462 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3463 TP_STRUCT__entry(
3464 __field(dev_t, dev)
3465 __field(xfs_agnumber_t, agno)
3466 __field(unsigned int, bucket)
3467 __field(xfs_agino_t, old_ptr)
3468 __field(xfs_agino_t, new_ptr)
3469 ),
3470 TP_fast_assign(
3471 __entry->dev = mp->m_super->s_dev;
3472 __entry->agno = agno;
3473 __entry->bucket = bucket;
3474 __entry->old_ptr = old_ptr;
3475 __entry->new_ptr = new_ptr;
3476 ),
3477 TP_printk("dev %d:%d agno %u bucket %u old 0x%x new 0x%x",
3478 MAJOR(__entry->dev), MINOR(__entry->dev),
3479 __entry->agno,
3480 __entry->bucket,
3481 __entry->old_ptr,
3482 __entry->new_ptr)
3483);
3484
Darrick J. Wongf2fc16a2019-02-07 10:37:15 -08003485TRACE_EVENT(xfs_iunlink_update_dinode,
3486 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3487 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3488 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3489 TP_STRUCT__entry(
3490 __field(dev_t, dev)
3491 __field(xfs_agnumber_t, agno)
3492 __field(xfs_agino_t, agino)
3493 __field(xfs_agino_t, old_ptr)
3494 __field(xfs_agino_t, new_ptr)
3495 ),
3496 TP_fast_assign(
3497 __entry->dev = mp->m_super->s_dev;
3498 __entry->agno = agno;
3499 __entry->agino = agino;
3500 __entry->old_ptr = old_ptr;
3501 __entry->new_ptr = new_ptr;
3502 ),
3503 TP_printk("dev %d:%d agno %u agino 0x%x old 0x%x new 0x%x",
3504 MAJOR(__entry->dev), MINOR(__entry->dev),
3505 __entry->agno,
3506 __entry->agino,
3507 __entry->old_ptr,
3508 __entry->new_ptr)
3509);
3510
Darrick J. Wong4664c662019-02-07 10:37:16 -08003511DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3512 TP_PROTO(struct xfs_inode *ip),
3513 TP_ARGS(ip),
3514 TP_STRUCT__entry(
3515 __field(dev_t, dev)
3516 __field(xfs_agnumber_t, agno)
3517 __field(xfs_agino_t, agino)
3518 ),
3519 TP_fast_assign(
3520 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3521 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3522 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3523 ),
3524 TP_printk("dev %d:%d agno %u agino %u",
3525 MAJOR(__entry->dev), MINOR(__entry->dev),
3526 __entry->agno, __entry->agino)
3527)
3528
3529#define DEFINE_AGINODE_EVENT(name) \
3530DEFINE_EVENT(xfs_ag_inode_class, name, \
3531 TP_PROTO(struct xfs_inode *ip), \
3532 TP_ARGS(ip))
3533DEFINE_AGINODE_EVENT(xfs_iunlink);
3534DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
Darrick J. Wong9b247172019-02-07 10:37:16 -08003535DEFINE_AG_EVENT(xfs_iunlink_map_prev_fallback);
Darrick J. Wong4664c662019-02-07 10:37:16 -08003536
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003537DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3538 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3539 TP_ARGS(mp, flags),
3540 TP_STRUCT__entry(
3541 __field(dev_t, dev)
3542 __field(unsigned int, flags)
3543 ),
3544 TP_fast_assign(
3545 __entry->dev = mp->m_super->s_dev;
3546 __entry->flags = flags;
3547 ),
3548 TP_printk("dev %d:%d flags 0x%x",
3549 MAJOR(__entry->dev), MINOR(__entry->dev),
3550 __entry->flags)
3551);
3552#define DEFINE_FS_CORRUPT_EVENT(name) \
3553DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3554 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3555 TP_ARGS(mp, flags))
3556DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3557DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003558DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003559DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3560DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003561DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003562
3563DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3564 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3565 TP_ARGS(mp, agno, flags),
3566 TP_STRUCT__entry(
3567 __field(dev_t, dev)
3568 __field(xfs_agnumber_t, agno)
3569 __field(unsigned int, flags)
3570 ),
3571 TP_fast_assign(
3572 __entry->dev = mp->m_super->s_dev;
3573 __entry->agno = agno;
3574 __entry->flags = flags;
3575 ),
3576 TP_printk("dev %d:%d agno %u flags 0x%x",
3577 MAJOR(__entry->dev), MINOR(__entry->dev),
3578 __entry->agno, __entry->flags)
3579);
3580#define DEFINE_AG_CORRUPT_EVENT(name) \
3581DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3582 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3583 unsigned int flags), \
3584 TP_ARGS(mp, agno, flags))
3585DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3586DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003587DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003588
3589DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3590 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3591 TP_ARGS(ip, flags),
3592 TP_STRUCT__entry(
3593 __field(dev_t, dev)
3594 __field(xfs_ino_t, ino)
3595 __field(unsigned int, flags)
3596 ),
3597 TP_fast_assign(
3598 __entry->dev = ip->i_mount->m_super->s_dev;
3599 __entry->ino = ip->i_ino;
3600 __entry->flags = flags;
3601 ),
3602 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3603 MAJOR(__entry->dev), MINOR(__entry->dev),
3604 __entry->ino, __entry->flags)
3605);
3606#define DEFINE_INODE_CORRUPT_EVENT(name) \
3607DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3608 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3609 TP_ARGS(ip, flags))
3610DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3611DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3612
Darrick J. Wonga2114322019-07-02 09:39:38 -07003613TRACE_EVENT(xfs_iwalk_ag,
3614 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3615 xfs_agino_t startino),
3616 TP_ARGS(mp, agno, startino),
3617 TP_STRUCT__entry(
3618 __field(dev_t, dev)
3619 __field(xfs_agnumber_t, agno)
3620 __field(xfs_agino_t, startino)
3621 ),
3622 TP_fast_assign(
3623 __entry->dev = mp->m_super->s_dev;
3624 __entry->agno = agno;
3625 __entry->startino = startino;
3626 ),
3627 TP_printk("dev %d:%d agno %d startino %u",
3628 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3629 __entry->startino)
3630)
3631
3632TRACE_EVENT(xfs_iwalk_ag_rec,
3633 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3634 struct xfs_inobt_rec_incore *irec),
3635 TP_ARGS(mp, agno, irec),
3636 TP_STRUCT__entry(
3637 __field(dev_t, dev)
3638 __field(xfs_agnumber_t, agno)
3639 __field(xfs_agino_t, startino)
3640 __field(uint64_t, freemask)
3641 ),
3642 TP_fast_assign(
3643 __entry->dev = mp->m_super->s_dev;
3644 __entry->agno = agno;
3645 __entry->startino = irec->ir_startino;
3646 __entry->freemask = irec->ir_free;
3647 ),
3648 TP_printk("dev %d:%d agno %d startino %u freemask 0x%llx",
3649 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3650 __entry->startino, __entry->freemask)
3651)
3652
Darrick J. Wong40786712019-07-03 07:33:26 -07003653TRACE_EVENT(xfs_pwork_init,
3654 TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
3655 TP_ARGS(mp, nr_threads, pid),
3656 TP_STRUCT__entry(
3657 __field(dev_t, dev)
3658 __field(unsigned int, nr_threads)
3659 __field(pid_t, pid)
3660 ),
3661 TP_fast_assign(
3662 __entry->dev = mp->m_super->s_dev;
3663 __entry->nr_threads = nr_threads;
3664 __entry->pid = pid;
3665 ),
3666 TP_printk("dev %d:%d nr_threads %u pid %u",
3667 MAJOR(__entry->dev), MINOR(__entry->dev),
3668 __entry->nr_threads, __entry->pid)
3669)
3670
Dave Chinner0ad95682019-08-26 12:08:10 -07003671DECLARE_EVENT_CLASS(xfs_kmem_class,
3672 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
3673 TP_ARGS(size, flags, caller_ip),
3674 TP_STRUCT__entry(
3675 __field(ssize_t, size)
3676 __field(int, flags)
3677 __field(unsigned long, caller_ip)
3678 ),
3679 TP_fast_assign(
3680 __entry->size = size;
3681 __entry->flags = flags;
3682 __entry->caller_ip = caller_ip;
3683 ),
3684 TP_printk("size %zd flags 0x%x caller %pS",
3685 __entry->size,
3686 __entry->flags,
3687 (char *)__entry->caller_ip)
3688)
3689
3690#define DEFINE_KMEM_EVENT(name) \
3691DEFINE_EVENT(xfs_kmem_class, name, \
3692 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
3693 TP_ARGS(size, flags, caller_ip))
3694DEFINE_KMEM_EVENT(kmem_alloc);
Dave Chinnerf8f9ee42019-08-26 12:08:39 -07003695DEFINE_KMEM_EVENT(kmem_alloc_io);
Dave Chinner0ad95682019-08-26 12:08:10 -07003696DEFINE_KMEM_EVENT(kmem_alloc_large);
Dave Chinner0ad95682019-08-26 12:08:10 -07003697
Darrick J. Wong13eaec42019-12-11 13:19:06 -08003698TRACE_EVENT(xfs_check_new_dalign,
3699 TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
3700 TP_ARGS(mp, new_dalign, calc_rootino),
3701 TP_STRUCT__entry(
3702 __field(dev_t, dev)
3703 __field(int, new_dalign)
3704 __field(xfs_ino_t, sb_rootino)
3705 __field(xfs_ino_t, calc_rootino)
3706 ),
3707 TP_fast_assign(
3708 __entry->dev = mp->m_super->s_dev;
3709 __entry->new_dalign = new_dalign;
3710 __entry->sb_rootino = mp->m_sb.sb_rootino;
3711 __entry->calc_rootino = calc_rootino;
3712 ),
3713 TP_printk("dev %d:%d new_dalign %d sb_rootino %llu calc_rootino %llu",
3714 MAJOR(__entry->dev), MINOR(__entry->dev),
3715 __entry->new_dalign, __entry->sb_rootino,
3716 __entry->calc_rootino)
3717)
3718
Darrick J. Wonge06536a2020-03-11 10:40:26 -07003719TRACE_EVENT(xfs_btree_commit_afakeroot,
3720 TP_PROTO(struct xfs_btree_cur *cur),
3721 TP_ARGS(cur),
3722 TP_STRUCT__entry(
3723 __field(dev_t, dev)
3724 __field(xfs_btnum_t, btnum)
3725 __field(xfs_agnumber_t, agno)
3726 __field(xfs_agblock_t, agbno)
3727 __field(unsigned int, levels)
3728 __field(unsigned int, blocks)
3729 ),
3730 TP_fast_assign(
3731 __entry->dev = cur->bc_mp->m_super->s_dev;
3732 __entry->btnum = cur->bc_btnum;
3733 __entry->agno = cur->bc_ag.agno;
3734 __entry->agbno = cur->bc_ag.afake->af_root;
3735 __entry->levels = cur->bc_ag.afake->af_levels;
3736 __entry->blocks = cur->bc_ag.afake->af_blocks;
3737 ),
3738 TP_printk("dev %d:%d btree %s ag %u levels %u blocks %u root %u",
3739 MAJOR(__entry->dev), MINOR(__entry->dev),
3740 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3741 __entry->agno,
3742 __entry->levels,
3743 __entry->blocks,
3744 __entry->agbno)
3745)
3746
Darrick J. Wong349e1c02020-03-11 10:42:34 -07003747TRACE_EVENT(xfs_btree_commit_ifakeroot,
3748 TP_PROTO(struct xfs_btree_cur *cur),
3749 TP_ARGS(cur),
3750 TP_STRUCT__entry(
3751 __field(dev_t, dev)
3752 __field(xfs_btnum_t, btnum)
3753 __field(xfs_agnumber_t, agno)
3754 __field(xfs_agino_t, agino)
3755 __field(unsigned int, levels)
3756 __field(unsigned int, blocks)
3757 __field(int, whichfork)
3758 ),
3759 TP_fast_assign(
3760 __entry->dev = cur->bc_mp->m_super->s_dev;
3761 __entry->btnum = cur->bc_btnum;
3762 __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp,
3763 cur->bc_ino.ip->i_ino);
3764 __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp,
3765 cur->bc_ino.ip->i_ino);
3766 __entry->levels = cur->bc_ino.ifake->if_levels;
3767 __entry->blocks = cur->bc_ino.ifake->if_blocks;
3768 __entry->whichfork = cur->bc_ino.whichfork;
3769 ),
3770 TP_printk("dev %d:%d btree %s ag %u agino %u whichfork %s levels %u blocks %u",
3771 MAJOR(__entry->dev), MINOR(__entry->dev),
3772 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3773 __entry->agno,
3774 __entry->agino,
3775 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
3776 __entry->levels,
3777 __entry->blocks)
3778)
3779
Darrick J. Wong60e3d702020-03-11 10:51:50 -07003780TRACE_EVENT(xfs_btree_bload_level_geometry,
3781 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3782 uint64_t nr_this_level, unsigned int nr_per_block,
3783 unsigned int desired_npb, uint64_t blocks,
3784 uint64_t blocks_with_extra),
3785 TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks,
3786 blocks_with_extra),
3787 TP_STRUCT__entry(
3788 __field(dev_t, dev)
3789 __field(xfs_btnum_t, btnum)
3790 __field(unsigned int, level)
3791 __field(unsigned int, nlevels)
3792 __field(uint64_t, nr_this_level)
3793 __field(unsigned int, nr_per_block)
3794 __field(unsigned int, desired_npb)
3795 __field(unsigned long long, blocks)
3796 __field(unsigned long long, blocks_with_extra)
3797 ),
3798 TP_fast_assign(
3799 __entry->dev = cur->bc_mp->m_super->s_dev;
3800 __entry->btnum = cur->bc_btnum;
3801 __entry->level = level;
3802 __entry->nlevels = cur->bc_nlevels;
3803 __entry->nr_this_level = nr_this_level;
3804 __entry->nr_per_block = nr_per_block;
3805 __entry->desired_npb = desired_npb;
3806 __entry->blocks = blocks;
3807 __entry->blocks_with_extra = blocks_with_extra;
3808 ),
3809 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",
3810 MAJOR(__entry->dev), MINOR(__entry->dev),
3811 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3812 __entry->level,
3813 __entry->nlevels,
3814 __entry->nr_this_level,
3815 __entry->nr_per_block,
3816 __entry->desired_npb,
3817 __entry->blocks,
3818 __entry->blocks_with_extra)
3819)
3820
3821TRACE_EVENT(xfs_btree_bload_block,
3822 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3823 uint64_t block_idx, uint64_t nr_blocks,
3824 union xfs_btree_ptr *ptr, unsigned int nr_records),
3825 TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records),
3826 TP_STRUCT__entry(
3827 __field(dev_t, dev)
3828 __field(xfs_btnum_t, btnum)
3829 __field(unsigned int, level)
3830 __field(unsigned long long, block_idx)
3831 __field(unsigned long long, nr_blocks)
3832 __field(xfs_agnumber_t, agno)
3833 __field(xfs_agblock_t, agbno)
3834 __field(unsigned int, nr_records)
3835 ),
3836 TP_fast_assign(
3837 __entry->dev = cur->bc_mp->m_super->s_dev;
3838 __entry->btnum = cur->bc_btnum;
3839 __entry->level = level;
3840 __entry->block_idx = block_idx;
3841 __entry->nr_blocks = nr_blocks;
3842 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
3843 xfs_fsblock_t fsb = be64_to_cpu(ptr->l);
3844
3845 __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb);
3846 __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb);
3847 } else {
3848 __entry->agno = cur->bc_ag.agno;
3849 __entry->agbno = be32_to_cpu(ptr->s);
3850 }
3851 __entry->nr_records = nr_records;
3852 ),
3853 TP_printk("dev %d:%d btree %s level %u block %llu/%llu fsb (%u/%u) recs %u",
3854 MAJOR(__entry->dev), MINOR(__entry->dev),
3855 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3856 __entry->level,
3857 __entry->block_idx,
3858 __entry->nr_blocks,
3859 __entry->agno,
3860 __entry->agbno,
3861 __entry->nr_records)
3862)
3863
Darrick J. Wong06dbf822020-08-24 11:58:01 -07003864DECLARE_EVENT_CLASS(xfs_timestamp_range_class,
3865 TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max),
3866 TP_ARGS(mp, min, max),
3867 TP_STRUCT__entry(
3868 __field(dev_t, dev)
3869 __field(long long, min)
3870 __field(long long, max)
3871 ),
3872 TP_fast_assign(
3873 __entry->dev = mp->m_super->s_dev;
3874 __entry->min = min;
3875 __entry->max = max;
3876 ),
3877 TP_printk("dev %d:%d min %lld max %lld",
3878 MAJOR(__entry->dev), MINOR(__entry->dev),
3879 __entry->min,
3880 __entry->max)
3881)
3882
3883#define DEFINE_TIMESTAMP_RANGE_EVENT(name) \
3884DEFINE_EVENT(xfs_timestamp_range_class, name, \
3885 TP_PROTO(struct xfs_mount *mp, long long min, long long max), \
3886 TP_ARGS(mp, min, max))
3887DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range);
3888DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range);
3889
Darrick J. Wong38899f82021-01-22 16:48:38 -08003890DECLARE_EVENT_CLASS(xfs_eofblocks_class,
3891 TP_PROTO(struct xfs_mount *mp, struct xfs_eofblocks *eofb,
3892 unsigned long caller_ip),
3893 TP_ARGS(mp, eofb, caller_ip),
3894 TP_STRUCT__entry(
3895 __field(dev_t, dev)
3896 __field(__u32, flags)
3897 __field(uint32_t, uid)
3898 __field(uint32_t, gid)
3899 __field(prid_t, prid)
3900 __field(__u64, min_file_size)
3901 __field(unsigned long, caller_ip)
3902 ),
3903 TP_fast_assign(
3904 __entry->dev = mp->m_super->s_dev;
3905 __entry->flags = eofb ? eofb->eof_flags : 0;
3906 __entry->uid = eofb ? from_kuid(mp->m_super->s_user_ns,
3907 eofb->eof_uid) : 0;
3908 __entry->gid = eofb ? from_kgid(mp->m_super->s_user_ns,
3909 eofb->eof_gid) : 0;
3910 __entry->prid = eofb ? eofb->eof_prid : 0;
3911 __entry->min_file_size = eofb ? eofb->eof_min_file_size : 0;
3912 __entry->caller_ip = caller_ip;
3913 ),
3914 TP_printk("dev %d:%d flags 0x%x uid %u gid %u prid %u minsize %llu caller %pS",
3915 MAJOR(__entry->dev), MINOR(__entry->dev),
3916 __entry->flags,
3917 __entry->uid,
3918 __entry->gid,
3919 __entry->prid,
3920 __entry->min_file_size,
3921 (char *)__entry->caller_ip)
3922);
3923#define DEFINE_EOFBLOCKS_EVENT(name) \
3924DEFINE_EVENT(xfs_eofblocks_class, name, \
3925 TP_PROTO(struct xfs_mount *mp, struct xfs_eofblocks *eofb, \
3926 unsigned long caller_ip), \
3927 TP_ARGS(mp, eofb, caller_ip))
3928DEFINE_EOFBLOCKS_EVENT(xfs_ioc_free_eofblocks);
Darrick J. Wong85c5b272021-01-22 16:48:39 -08003929DEFINE_EOFBLOCKS_EVENT(xfs_blockgc_free_space);
Darrick J. Wong38899f82021-01-22 16:48:38 -08003930
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00003931#endif /* _TRACE_XFS_H */
3932
3933#undef TRACE_INCLUDE_PATH
3934#define TRACE_INCLUDE_PATH .
3935#define TRACE_INCLUDE_FILE xfs_trace
3936#include <trace/define_trace.h>