blob: 195a9cdb954e314d91bd0d270e3d1102f05da6e2 [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;
26struct xfs_buf_log_format;
27struct xfs_inode_log_format;
Alex Elder1ed845d2012-08-01 09:56:49 -050028struct xfs_bmbt_irec;
Darrick J. Wong2c813ad2016-08-03 11:08:36 +100029struct xfs_btree_cur;
Darrick J. Wong1946b912016-10-03 09:11:18 -070030struct xfs_refcount_irec;
Darrick J. Wonge89c0412017-03-28 14:56:37 -070031struct xfs_fsmap;
32struct xfs_rmap_irec;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000033
Christoph Hellwigea9a4882009-12-21 14:03:03 +000034DECLARE_EVENT_CLASS(xfs_attr_list_class,
35 TP_PROTO(struct xfs_attr_list_context *ctx),
36 TP_ARGS(ctx),
37 TP_STRUCT__entry(
38 __field(dev_t, dev)
39 __field(xfs_ino_t, ino)
40 __field(u32, hashval)
41 __field(u32, blkno)
42 __field(u32, offset)
43 __field(void *, alist)
44 __field(int, bufsize)
45 __field(int, count)
46 __field(int, firstu)
47 __field(int, dupcnt)
48 __field(int, flags)
49 ),
50 TP_fast_assign(
51 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
52 __entry->ino = ctx->dp->i_ino;
53 __entry->hashval = ctx->cursor->hashval;
54 __entry->blkno = ctx->cursor->blkno;
55 __entry->offset = ctx->cursor->offset;
56 __entry->alist = ctx->alist;
57 __entry->bufsize = ctx->bufsize;
58 __entry->count = ctx->count;
59 __entry->firstu = ctx->firstu;
60 __entry->flags = ctx->flags;
61 ),
62 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
Darrick J. Wong3d170aa2018-01-09 11:43:36 -080063 "alist %p size %u count %u firstu %u flags %d %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +000064 MAJOR(__entry->dev), MINOR(__entry->dev),
65 __entry->ino,
66 __entry->hashval,
67 __entry->blkno,
68 __entry->offset,
69 __entry->dupcnt,
70 __entry->alist,
71 __entry->bufsize,
72 __entry->count,
73 __entry->firstu,
74 __entry->flags,
75 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
76 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000077)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000078
79#define DEFINE_ATTR_LIST_EVENT(name) \
80DEFINE_EVENT(xfs_attr_list_class, name, \
81 TP_PROTO(struct xfs_attr_list_context *ctx), \
82 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000083DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
84DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
85DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
86DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
87DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
88DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
89DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
90DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +110091DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
92DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000093
Li Zefanf8adb4d2010-05-24 08:25:57 +000094DECLARE_EVENT_CLASS(xfs_perag_class,
95 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
96 unsigned long caller_ip),
97 TP_ARGS(mp, agno, refcount, caller_ip),
98 TP_STRUCT__entry(
99 __field(dev_t, dev)
100 __field(xfs_agnumber_t, agno)
101 __field(int, refcount)
102 __field(unsigned long, caller_ip)
103 ),
104 TP_fast_assign(
105 __entry->dev = mp->m_super->s_dev;
106 __entry->agno = agno;
107 __entry->refcount = refcount;
108 __entry->caller_ip = caller_ip;
109 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800110 TP_printk("dev %d:%d agno %u refcount %d caller %pS",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000111 MAJOR(__entry->dev), MINOR(__entry->dev),
112 __entry->agno,
113 __entry->refcount,
114 (char *)__entry->caller_ip)
115);
116
117#define DEFINE_PERAG_REF_EVENT(name) \
118DEFINE_EVENT(xfs_perag_class, name, \
119 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
120 unsigned long caller_ip), \
121 TP_ARGS(mp, agno, refcount, caller_ip))
122DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000123DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000124DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000125DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
126DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Brian Foster27b52862012-11-06 09:50:38 -0500127DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
128DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700129DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks);
130DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000131
Dave Chinnerd1230312013-11-01 15:27:19 +1100132DECLARE_EVENT_CLASS(xfs_ag_class,
133 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
134 TP_ARGS(mp, agno),
135 TP_STRUCT__entry(
136 __field(dev_t, dev)
137 __field(xfs_agnumber_t, agno)
138 ),
139 TP_fast_assign(
140 __entry->dev = mp->m_super->s_dev;
141 __entry->agno = agno;
142 ),
143 TP_printk("dev %d:%d agno %u",
144 MAJOR(__entry->dev), MINOR(__entry->dev),
145 __entry->agno)
146);
147#define DEFINE_AG_EVENT(name) \
148DEFINE_EVENT(xfs_ag_class, name, \
149 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
150 TP_ARGS(mp, agno))
151
152DEFINE_AG_EVENT(xfs_read_agf);
153DEFINE_AG_EVENT(xfs_alloc_read_agf);
154DEFINE_AG_EVENT(xfs_read_agi);
155DEFINE_AG_EVENT(xfs_ialloc_read_agi);
156
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000157TRACE_EVENT(xfs_attr_list_node_descend,
158 TP_PROTO(struct xfs_attr_list_context *ctx,
159 struct xfs_da_node_entry *btree),
160 TP_ARGS(ctx, btree),
161 TP_STRUCT__entry(
162 __field(dev_t, dev)
163 __field(xfs_ino_t, ino)
164 __field(u32, hashval)
165 __field(u32, blkno)
166 __field(u32, offset)
167 __field(void *, alist)
168 __field(int, bufsize)
169 __field(int, count)
170 __field(int, firstu)
171 __field(int, dupcnt)
172 __field(int, flags)
173 __field(u32, bt_hashval)
174 __field(u32, bt_before)
175 ),
176 TP_fast_assign(
177 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
178 __entry->ino = ctx->dp->i_ino;
179 __entry->hashval = ctx->cursor->hashval;
180 __entry->blkno = ctx->cursor->blkno;
181 __entry->offset = ctx->cursor->offset;
182 __entry->alist = ctx->alist;
183 __entry->bufsize = ctx->bufsize;
184 __entry->count = ctx->count;
185 __entry->firstu = ctx->firstu;
186 __entry->flags = ctx->flags;
187 __entry->bt_hashval = be32_to_cpu(btree->hashval);
188 __entry->bt_before = be32_to_cpu(btree->before);
189 ),
190 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
Darrick J. Wong3d170aa2018-01-09 11:43:36 -0800191 "alist %p size %u count %u firstu %u flags %d %s "
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000192 "node hashval %u, node before %u",
193 MAJOR(__entry->dev), MINOR(__entry->dev),
194 __entry->ino,
195 __entry->hashval,
196 __entry->blkno,
197 __entry->offset,
198 __entry->dupcnt,
199 __entry->alist,
200 __entry->bufsize,
201 __entry->count,
202 __entry->firstu,
203 __entry->flags,
204 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
205 __entry->bt_hashval,
206 __entry->bt_before)
207);
208
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000209DECLARE_EVENT_CLASS(xfs_bmap_class,
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700210 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000211 unsigned long caller_ip),
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700212 TP_ARGS(ip, cur, state, caller_ip),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000213 TP_STRUCT__entry(
214 __field(dev_t, dev)
215 __field(xfs_ino_t, ino)
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700216 __field(void *, leaf);
217 __field(int, pos);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000218 __field(xfs_fileoff_t, startoff)
219 __field(xfs_fsblock_t, startblock)
220 __field(xfs_filblks_t, blockcount)
221 __field(xfs_exntst_t, state)
222 __field(int, bmap_state)
223 __field(unsigned long, caller_ip)
224 ),
225 TP_fast_assign(
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700226 struct xfs_ifork *ifp;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000227 struct xfs_bmbt_irec r;
228
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700229 ifp = xfs_iext_state_to_fork(ip, state);
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700230 xfs_iext_get_extent(ifp, cur, &r);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000231 __entry->dev = VFS_I(ip)->i_sb->s_dev;
232 __entry->ino = ip->i_ino;
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700233 __entry->leaf = cur->leaf;
234 __entry->pos = cur->pos;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000235 __entry->startoff = r.br_startoff;
236 __entry->startblock = r.br_startblock;
237 __entry->blockcount = r.br_blockcount;
238 __entry->state = r.br_state;
239 __entry->bmap_state = state;
240 __entry->caller_ip = caller_ip;
241 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -0800242 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800243 "offset %lld block %lld count %lld flag %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000244 MAJOR(__entry->dev), MINOR(__entry->dev),
245 __entry->ino,
246 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700247 __entry->leaf,
248 __entry->pos,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000249 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -0700250 (int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000251 __entry->blockcount,
252 __entry->state,
253 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000254)
255
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000256#define DEFINE_BMAP_EVENT(name) \
257DEFINE_EVENT(xfs_bmap_class, name, \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700258 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000259 unsigned long caller_ip), \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700260 TP_ARGS(ip, cur, state, caller_ip))
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700261DEFINE_BMAP_EVENT(xfs_iext_insert);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000262DEFINE_BMAP_EVENT(xfs_iext_remove);
263DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
264DEFINE_BMAP_EVENT(xfs_bmap_post_update);
Christoph Hellwige8e0e172017-10-19 11:06:29 -0700265DEFINE_BMAP_EVENT(xfs_read_extent);
266DEFINE_BMAP_EVENT(xfs_write_extent);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000267
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000268DECLARE_EVENT_CLASS(xfs_buf_class,
269 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
270 TP_ARGS(bp, caller_ip),
271 TP_STRUCT__entry(
272 __field(dev_t, dev)
273 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000274 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000275 __field(int, hold)
276 __field(int, pincount)
277 __field(unsigned, lockval)
278 __field(unsigned, flags)
279 __field(unsigned long, caller_ip)
280 ),
281 TP_fast_assign(
282 __entry->dev = bp->b_target->bt_dev;
Dave Chinnerd61fa8c2018-11-19 13:31:07 -0800283 if (bp->b_bn == XFS_BUF_DADDR_NULL)
284 __entry->bno = bp->b_maps[0].bm_bn;
285 else
286 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000287 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000288 __entry->hold = atomic_read(&bp->b_hold);
289 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200290 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000291 __entry->flags = bp->b_flags;
292 __entry->caller_ip = caller_ip;
293 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000294 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800295 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000296 MAJOR(__entry->dev), MINOR(__entry->dev),
297 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000298 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000299 __entry->hold,
300 __entry->pincount,
301 __entry->lockval,
302 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
303 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000304)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000305
306#define DEFINE_BUF_EVENT(name) \
307DEFINE_EVENT(xfs_buf_class, name, \
308 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
309 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000310DEFINE_BUF_EVENT(xfs_buf_init);
311DEFINE_BUF_EVENT(xfs_buf_free);
312DEFINE_BUF_EVENT(xfs_buf_hold);
313DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000314DEFINE_BUF_EVENT(xfs_buf_iodone);
Dave Chinner595bff72014-10-02 09:05:14 +1000315DEFINE_BUF_EVENT(xfs_buf_submit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000316DEFINE_BUF_EVENT(xfs_buf_lock);
317DEFINE_BUF_EVENT(xfs_buf_lock_done);
Darrick J. Wong479c6412016-06-21 11:53:28 +1000318DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200319DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000320DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000321DEFINE_BUF_EVENT(xfs_buf_iowait);
322DEFINE_BUF_EVENT(xfs_buf_iowait_done);
323DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000324DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000325DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Brian Foster7912e7f2017-06-14 21:21:45 -0700326DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
Dave Chinner686865f2010-09-24 20:07:47 +1000327DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000328DEFINE_BUF_EVENT(xfs_buf_item_relse);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000329DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
330DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100331DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000332DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
333
334/* not really buffer traces, but the buf provides useful information */
335DEFINE_BUF_EVENT(xfs_btree_corrupt);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000336DEFINE_BUF_EVENT(xfs_reset_dqcounts);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000337
338/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000339DECLARE_EVENT_CLASS(xfs_buf_flags_class,
340 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
341 TP_ARGS(bp, flags, caller_ip),
342 TP_STRUCT__entry(
343 __field(dev_t, dev)
344 __field(xfs_daddr_t, bno)
345 __field(size_t, buffer_length)
346 __field(int, hold)
347 __field(int, pincount)
348 __field(unsigned, lockval)
349 __field(unsigned, flags)
350 __field(unsigned long, caller_ip)
351 ),
352 TP_fast_assign(
353 __entry->dev = bp->b_target->bt_dev;
354 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000355 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000356 __entry->flags = flags;
357 __entry->hold = atomic_read(&bp->b_hold);
358 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200359 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000360 __entry->caller_ip = caller_ip;
361 ),
362 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800363 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000364 MAJOR(__entry->dev), MINOR(__entry->dev),
365 (unsigned long long)__entry->bno,
366 __entry->buffer_length,
367 __entry->hold,
368 __entry->pincount,
369 __entry->lockval,
370 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
371 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000372)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000373
374#define DEFINE_BUF_FLAGS_EVENT(name) \
375DEFINE_EVENT(xfs_buf_flags_class, name, \
376 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
377 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000378DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
379DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
380DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
381
382TRACE_EVENT(xfs_buf_ioerror,
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800383 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000384 TP_ARGS(bp, error, caller_ip),
385 TP_STRUCT__entry(
386 __field(dev_t, dev)
387 __field(xfs_daddr_t, bno)
388 __field(size_t, buffer_length)
389 __field(unsigned, flags)
390 __field(int, hold)
391 __field(int, pincount)
392 __field(unsigned, lockval)
393 __field(int, error)
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800394 __field(xfs_failaddr_t, caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000395 ),
396 TP_fast_assign(
397 __entry->dev = bp->b_target->bt_dev;
398 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000399 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000400 __entry->hold = atomic_read(&bp->b_hold);
401 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200402 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000403 __entry->error = error;
404 __entry->flags = bp->b_flags;
405 __entry->caller_ip = caller_ip;
406 ),
407 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800408 "lock %d error %d flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000409 MAJOR(__entry->dev), MINOR(__entry->dev),
410 (unsigned long long)__entry->bno,
411 __entry->buffer_length,
412 __entry->hold,
413 __entry->pincount,
414 __entry->lockval,
415 __entry->error,
416 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
417 (void *)__entry->caller_ip)
418);
419
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000420DECLARE_EVENT_CLASS(xfs_buf_item_class,
421 TP_PROTO(struct xfs_buf_log_item *bip),
422 TP_ARGS(bip),
423 TP_STRUCT__entry(
424 __field(dev_t, dev)
425 __field(xfs_daddr_t, buf_bno)
426 __field(size_t, buf_len)
427 __field(int, buf_hold)
428 __field(int, buf_pincount)
429 __field(int, buf_lockval)
430 __field(unsigned, buf_flags)
431 __field(unsigned, bli_recur)
432 __field(int, bli_refcount)
433 __field(unsigned, bli_flags)
Dave Chinner22525c12018-05-09 07:47:34 -0700434 __field(unsigned long, li_flags)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000435 ),
436 TP_fast_assign(
437 __entry->dev = bip->bli_buf->b_target->bt_dev;
438 __entry->bli_flags = bip->bli_flags;
439 __entry->bli_recur = bip->bli_recur;
440 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
441 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000442 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000443 __entry->buf_flags = bip->bli_buf->b_flags;
444 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
445 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200446 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000447 __entry->li_flags = bip->bli_item.li_flags;
448 ),
449 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
450 "lock %d flags %s recur %d refcount %d bliflags %s "
Dave Chinnere6631f82018-05-09 07:49:37 -0700451 "liflags %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000452 MAJOR(__entry->dev), MINOR(__entry->dev),
453 (unsigned long long)__entry->buf_bno,
454 __entry->buf_len,
455 __entry->buf_hold,
456 __entry->buf_pincount,
457 __entry->buf_lockval,
458 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
459 __entry->bli_recur,
460 __entry->bli_refcount,
461 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000462 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000463)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000464
465#define DEFINE_BUF_ITEM_EVENT(name) \
466DEFINE_EVENT(xfs_buf_item_class, name, \
467 TP_PROTO(struct xfs_buf_log_item *bip), \
468 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000469DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000470DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000471DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
472DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
473DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000474DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000475DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
476DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
477DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000478DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000479DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
480DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
481DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
482DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
483DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
484DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
485DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
486DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
487DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
488DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
489DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
490DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
491DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
492DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
493
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000494DECLARE_EVENT_CLASS(xfs_filestream_class,
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700495 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno),
496 TP_ARGS(mp, ino, agno),
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000497 TP_STRUCT__entry(
498 __field(dev_t, dev)
499 __field(xfs_ino_t, ino)
500 __field(xfs_agnumber_t, agno)
501 __field(int, streams)
502 ),
503 TP_fast_assign(
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700504 __entry->dev = mp->m_super->s_dev;
505 __entry->ino = ino;
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000506 __entry->agno = agno;
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700507 __entry->streams = xfs_filestream_peek_ag(mp, agno);
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000508 ),
509 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
510 MAJOR(__entry->dev), MINOR(__entry->dev),
511 __entry->ino,
512 __entry->agno,
513 __entry->streams)
514)
515#define DEFINE_FILESTREAM_EVENT(name) \
516DEFINE_EVENT(xfs_filestream_class, name, \
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700517 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \
518 TP_ARGS(mp, ino, agno))
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000519DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
520DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
521DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
522
523TRACE_EVENT(xfs_filestream_pick,
524 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
525 xfs_extlen_t free, int nscan),
526 TP_ARGS(ip, agno, free, nscan),
527 TP_STRUCT__entry(
528 __field(dev_t, dev)
529 __field(xfs_ino_t, ino)
530 __field(xfs_agnumber_t, agno)
531 __field(int, streams)
532 __field(xfs_extlen_t, free)
533 __field(int, nscan)
534 ),
535 TP_fast_assign(
536 __entry->dev = VFS_I(ip)->i_sb->s_dev;
537 __entry->ino = ip->i_ino;
538 __entry->agno = agno;
539 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
540 __entry->free = free;
541 __entry->nscan = nscan;
542 ),
543 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
544 MAJOR(__entry->dev), MINOR(__entry->dev),
545 __entry->ino,
546 __entry->agno,
547 __entry->streams,
548 __entry->free,
549 __entry->nscan)
550);
551
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000552DECLARE_EVENT_CLASS(xfs_lock_class,
553 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
554 unsigned long caller_ip),
555 TP_ARGS(ip, lock_flags, caller_ip),
556 TP_STRUCT__entry(
557 __field(dev_t, dev)
558 __field(xfs_ino_t, ino)
559 __field(int, lock_flags)
560 __field(unsigned long, caller_ip)
561 ),
562 TP_fast_assign(
563 __entry->dev = VFS_I(ip)->i_sb->s_dev;
564 __entry->ino = ip->i_ino;
565 __entry->lock_flags = lock_flags;
566 __entry->caller_ip = caller_ip;
567 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800568 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000569 MAJOR(__entry->dev), MINOR(__entry->dev),
570 __entry->ino,
571 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
572 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000573)
574
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000575#define DEFINE_LOCK_EVENT(name) \
576DEFINE_EVENT(xfs_lock_class, name, \
577 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
578 unsigned long caller_ip), \
579 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000580DEFINE_LOCK_EVENT(xfs_ilock);
581DEFINE_LOCK_EVENT(xfs_ilock_nowait);
582DEFINE_LOCK_EVENT(xfs_ilock_demote);
583DEFINE_LOCK_EVENT(xfs_iunlock);
584
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000585DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000586 TP_PROTO(struct xfs_inode *ip),
587 TP_ARGS(ip),
588 TP_STRUCT__entry(
589 __field(dev_t, dev)
590 __field(xfs_ino_t, ino)
591 ),
592 TP_fast_assign(
593 __entry->dev = VFS_I(ip)->i_sb->s_dev;
594 __entry->ino = ip->i_ino;
595 ),
596 TP_printk("dev %d:%d ino 0x%llx",
597 MAJOR(__entry->dev), MINOR(__entry->dev),
598 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000599)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000600
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000601#define DEFINE_INODE_EVENT(name) \
602DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000603 TP_PROTO(struct xfs_inode *ip), \
604 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000605DEFINE_INODE_EVENT(xfs_iget_skip);
606DEFINE_INODE_EVENT(xfs_iget_reclaim);
607DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
608DEFINE_INODE_EVENT(xfs_iget_hit);
609DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000610
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000611DEFINE_INODE_EVENT(xfs_getattr);
612DEFINE_INODE_EVENT(xfs_setattr);
613DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500614DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000615DEFINE_INODE_EVENT(xfs_alloc_file_space);
616DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000617DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100618DEFINE_INODE_EVENT(xfs_collapse_file_space);
Namjae Jeona904b1c2015-03-25 15:08:56 +1100619DEFINE_INODE_EVENT(xfs_insert_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000620DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000621#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200622DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000623#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000624DEFINE_INODE_EVENT(xfs_vm_bmap);
625DEFINE_INODE_EVENT(xfs_file_ioctl);
626DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
627DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000628DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000629DEFINE_INODE_EVENT(xfs_file_fsync);
630DEFINE_INODE_EVENT(xfs_destroy_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400631DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000632
633DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
634DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
635
Brian Foster27b52862012-11-06 09:50:38 -0500636DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
637DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500638DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700639DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
640DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
641DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500642
Darrick J. Wong85f8dff2018-12-18 14:32:29 -0800643/*
644 * ftrace's __print_symbolic requires that all enum values be wrapped in the
645 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
646 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
647 * code.
648 */
649TRACE_DEFINE_ENUM(PE_SIZE_PTE);
650TRACE_DEFINE_ENUM(PE_SIZE_PMD);
651TRACE_DEFINE_ENUM(PE_SIZE_PUD);
652
Christoph Hellwigd522d562017-08-29 10:08:41 -0700653TRACE_EVENT(xfs_filemap_fault,
654 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
655 bool write_fault),
656 TP_ARGS(ip, pe_size, write_fault),
657 TP_STRUCT__entry(
658 __field(dev_t, dev)
659 __field(xfs_ino_t, ino)
660 __field(enum page_entry_size, pe_size)
661 __field(bool, write_fault)
662 ),
663 TP_fast_assign(
664 __entry->dev = VFS_I(ip)->i_sb->s_dev;
665 __entry->ino = ip->i_ino;
666 __entry->pe_size = pe_size;
667 __entry->write_fault = write_fault;
668 ),
669 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
670 MAJOR(__entry->dev), MINOR(__entry->dev),
671 __entry->ino,
672 __print_symbolic(__entry->pe_size,
673 { PE_SIZE_PTE, "PTE" },
674 { PE_SIZE_PMD, "PMD" },
675 { PE_SIZE_PUD, "PUD" }),
676 __entry->write_fault)
677)
678
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000679DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000680 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
681 TP_ARGS(ip, caller_ip),
682 TP_STRUCT__entry(
683 __field(dev_t, dev)
684 __field(xfs_ino_t, ino)
685 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100686 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000687 __field(unsigned long, caller_ip)
688 ),
689 TP_fast_assign(
690 __entry->dev = VFS_I(ip)->i_sb->s_dev;
691 __entry->ino = ip->i_ino;
692 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100693 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000694 __entry->caller_ip = caller_ip;
695 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800696 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000697 MAJOR(__entry->dev), MINOR(__entry->dev),
698 __entry->ino,
699 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100700 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000701 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000702)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000703
Brian Foster19cb7e32013-03-18 10:51:48 -0400704TRACE_EVENT(xfs_iomap_prealloc_size,
705 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
706 unsigned int writeio_blocks),
707 TP_ARGS(ip, blocks, shift, writeio_blocks),
708 TP_STRUCT__entry(
709 __field(dev_t, dev)
710 __field(xfs_ino_t, ino)
711 __field(xfs_fsblock_t, blocks)
712 __field(int, shift)
713 __field(unsigned int, writeio_blocks)
714 ),
715 TP_fast_assign(
716 __entry->dev = VFS_I(ip)->i_sb->s_dev;
717 __entry->ino = ip->i_ino;
718 __entry->blocks = blocks;
719 __entry->shift = shift;
720 __entry->writeio_blocks = writeio_blocks;
721 ),
722 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
723 "m_writeio_blocks %u",
724 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
725 __entry->blocks, __entry->shift, __entry->writeio_blocks)
726)
727
Brian Foster56d11152015-05-29 09:18:32 +1000728TRACE_EVENT(xfs_irec_merge_pre,
729 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
730 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
731 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
732 TP_STRUCT__entry(
733 __field(dev_t, dev)
734 __field(xfs_agnumber_t, agno)
735 __field(xfs_agino_t, agino)
736 __field(uint16_t, holemask)
737 __field(xfs_agino_t, nagino)
738 __field(uint16_t, nholemask)
739 ),
740 TP_fast_assign(
741 __entry->dev = mp->m_super->s_dev;
742 __entry->agno = agno;
743 __entry->agino = agino;
744 __entry->holemask = holemask;
745 __entry->nagino = nagino;
746 __entry->nholemask = holemask;
747 ),
748 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
749 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
750 __entry->agino, __entry->holemask, __entry->nagino,
751 __entry->nholemask)
752)
753
754TRACE_EVENT(xfs_irec_merge_post,
755 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
756 uint16_t holemask),
757 TP_ARGS(mp, agno, agino, holemask),
758 TP_STRUCT__entry(
759 __field(dev_t, dev)
760 __field(xfs_agnumber_t, agno)
761 __field(xfs_agino_t, agino)
762 __field(uint16_t, holemask)
763 ),
764 TP_fast_assign(
765 __entry->dev = mp->m_super->s_dev;
766 __entry->agno = agno;
767 __entry->agino = agino;
768 __entry->holemask = holemask;
769 ),
770 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
771 MINOR(__entry->dev), __entry->agno, __entry->agino,
772 __entry->holemask)
773)
774
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000775#define DEFINE_IREF_EVENT(name) \
776DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000777 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
778 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000779DEFINE_IREF_EVENT(xfs_irele);
780DEFINE_IREF_EVENT(xfs_inode_pin);
781DEFINE_IREF_EVENT(xfs_inode_unpin);
782DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100783
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000784DECLARE_EVENT_CLASS(xfs_namespace_class,
785 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
786 TP_ARGS(dp, name),
787 TP_STRUCT__entry(
788 __field(dev_t, dev)
789 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000790 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000791 __dynamic_array(char, name, name->len)
792 ),
793 TP_fast_assign(
794 __entry->dev = VFS_I(dp)->i_sb->s_dev;
795 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000796 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000797 memcpy(__get_str(name), name->name, name->len);
798 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000799 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000800 MAJOR(__entry->dev), MINOR(__entry->dev),
801 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000802 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000803 __get_str(name))
804)
805
806#define DEFINE_NAMESPACE_EVENT(name) \
807DEFINE_EVENT(xfs_namespace_class, name, \
808 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
809 TP_ARGS(dp, name))
810DEFINE_NAMESPACE_EVENT(xfs_remove);
811DEFINE_NAMESPACE_EVENT(xfs_link);
812DEFINE_NAMESPACE_EVENT(xfs_lookup);
813DEFINE_NAMESPACE_EVENT(xfs_create);
814DEFINE_NAMESPACE_EVENT(xfs_symlink);
815
816TRACE_EVENT(xfs_rename,
817 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
818 struct xfs_name *src_name, struct xfs_name *target_name),
819 TP_ARGS(src_dp, target_dp, src_name, target_name),
820 TP_STRUCT__entry(
821 __field(dev_t, dev)
822 __field(xfs_ino_t, src_dp_ino)
823 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000824 __field(int, src_namelen)
825 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000826 __dynamic_array(char, src_name, src_name->len)
827 __dynamic_array(char, target_name, target_name->len)
828 ),
829 TP_fast_assign(
830 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
831 __entry->src_dp_ino = src_dp->i_ino;
832 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000833 __entry->src_namelen = src_name->len;
834 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000835 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000836 memcpy(__get_str(target_name), target_name->name,
837 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000838 ),
839 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000840 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000841 MAJOR(__entry->dev), MINOR(__entry->dev),
842 __entry->src_dp_ino,
843 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000844 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000845 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000846 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000847 __get_str(target_name))
848)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000849
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000850DECLARE_EVENT_CLASS(xfs_dquot_class,
851 TP_PROTO(struct xfs_dquot *dqp),
852 TP_ARGS(dqp),
853 TP_STRUCT__entry(
854 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000855 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000856 __field(unsigned, flags)
857 __field(unsigned, nrefs)
858 __field(unsigned long long, res_bcount)
859 __field(unsigned long long, bcount)
860 __field(unsigned long long, icount)
861 __field(unsigned long long, blk_hardlimit)
862 __field(unsigned long long, blk_softlimit)
863 __field(unsigned long long, ino_hardlimit)
864 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000865 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000866 TP_fast_assign(
867 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000868 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000869 __entry->flags = dqp->dq_flags;
870 __entry->nrefs = dqp->q_nrefs;
871 __entry->res_bcount = dqp->q_res_bcount;
872 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
873 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
874 __entry->blk_hardlimit =
875 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
876 __entry->blk_softlimit =
877 be64_to_cpu(dqp->q_core.d_blk_softlimit);
878 __entry->ino_hardlimit =
879 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
880 __entry->ino_softlimit =
881 be64_to_cpu(dqp->q_core.d_ino_softlimit);
882 ),
883 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000884 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
885 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000886 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000887 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000888 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
889 __entry->nrefs,
890 __entry->res_bcount,
891 __entry->bcount,
892 __entry->blk_hardlimit,
893 __entry->blk_softlimit,
894 __entry->icount,
895 __entry->ino_hardlimit,
896 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000897)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000898
899#define DEFINE_DQUOT_EVENT(name) \
900DEFINE_EVENT(xfs_dquot_class, name, \
901 TP_PROTO(struct xfs_dquot *dqp), \
902 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000903DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000904DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
905DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000906DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
907DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000908DEFINE_DQUOT_EVENT(xfs_dqattach_found);
909DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000910DEFINE_DQUOT_EVENT(xfs_dqalloc);
911DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
912DEFINE_DQUOT_EVENT(xfs_dqread);
913DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000914DEFINE_DQUOT_EVENT(xfs_dqget_hit);
915DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000916DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
917DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000918DEFINE_DQUOT_EVENT(xfs_dqput);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000919DEFINE_DQUOT_EVENT(xfs_dqput_free);
920DEFINE_DQUOT_EVENT(xfs_dqrele);
921DEFINE_DQUOT_EVENT(xfs_dqflush);
922DEFINE_DQUOT_EVENT(xfs_dqflush_force);
923DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000924
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000925DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500926 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000927 TP_ARGS(log, tic),
928 TP_STRUCT__entry(
929 __field(dev_t, dev)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000930 __field(char, ocnt)
931 __field(char, cnt)
932 __field(int, curr_res)
933 __field(int, unit_res)
934 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100935 __field(int, reserveq)
936 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000937 __field(int, grant_reserve_cycle)
938 __field(int, grant_reserve_bytes)
939 __field(int, grant_write_cycle)
940 __field(int, grant_write_bytes)
941 __field(int, curr_cycle)
942 __field(int, curr_block)
943 __field(xfs_lsn_t, tail_lsn)
944 ),
945 TP_fast_assign(
946 __entry->dev = log->l_mp->m_super->s_dev;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000947 __entry->ocnt = tic->t_ocnt;
948 __entry->cnt = tic->t_cnt;
949 __entry->curr_res = tic->t_curr_res;
950 __entry->unit_res = tic->t_unit_res;
951 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000952 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
953 __entry->writeq = list_empty(&log->l_write_head.waiters);
954 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100955 &__entry->grant_reserve_cycle,
956 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000957 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100958 &__entry->grant_write_cycle,
959 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000960 __entry->curr_cycle = log->l_curr_cycle;
961 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100962 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000963 ),
Christoph Hellwig710b1e22016-04-06 09:20:36 +1000964 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100965 "t_unit_res %u t_flags %s reserveq %s "
966 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000967 "grant_reserve_bytes %d grant_write_cycle %d "
968 "grant_write_bytes %d curr_cycle %d curr_block %d "
969 "tail_cycle %d tail_block %d",
970 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000971 __entry->ocnt,
972 __entry->cnt,
973 __entry->curr_res,
974 __entry->unit_res,
975 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100976 __entry->reserveq ? "empty" : "active",
977 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000978 __entry->grant_reserve_cycle,
979 __entry->grant_reserve_bytes,
980 __entry->grant_write_cycle,
981 __entry->grant_write_bytes,
982 __entry->curr_cycle,
983 __entry->curr_block,
984 CYCLE_LSN(__entry->tail_lsn),
985 BLOCK_LSN(__entry->tail_lsn)
986 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000987)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000988
989#define DEFINE_LOGGRANT_EVENT(name) \
990DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -0500991 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000992 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000993DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
994DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000995DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +0000996DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
997DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +1100998DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +0000999DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1000DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1001DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1002DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001003DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1004DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1005DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1006DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1007DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1008DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1009
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001010DECLARE_EVENT_CLASS(xfs_log_item_class,
1011 TP_PROTO(struct xfs_log_item *lip),
1012 TP_ARGS(lip),
1013 TP_STRUCT__entry(
1014 __field(dev_t, dev)
1015 __field(void *, lip)
1016 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001017 __field(unsigned long, flags)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001018 __field(xfs_lsn_t, lsn)
1019 ),
1020 TP_fast_assign(
1021 __entry->dev = lip->li_mountp->m_super->s_dev;
1022 __entry->lip = lip;
1023 __entry->type = lip->li_type;
1024 __entry->flags = lip->li_flags;
1025 __entry->lsn = lip->li_lsn;
1026 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001027 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001028 MAJOR(__entry->dev), MINOR(__entry->dev),
1029 __entry->lip,
1030 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1031 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1032 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1033)
1034
Dave Chinner14c26c62012-04-24 16:33:31 +10001035TRACE_EVENT(xfs_log_force,
Carlos Maiolino9f278892016-04-06 09:46:30 +10001036 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1037 TP_ARGS(mp, lsn, caller_ip),
Dave Chinner14c26c62012-04-24 16:33:31 +10001038 TP_STRUCT__entry(
1039 __field(dev_t, dev)
1040 __field(xfs_lsn_t, lsn)
Carlos Maiolino9f278892016-04-06 09:46:30 +10001041 __field(unsigned long, caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001042 ),
1043 TP_fast_assign(
1044 __entry->dev = mp->m_super->s_dev;
1045 __entry->lsn = lsn;
Carlos Maiolino9f278892016-04-06 09:46:30 +10001046 __entry->caller_ip = caller_ip;
Dave Chinner14c26c62012-04-24 16:33:31 +10001047 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001048 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
Dave Chinner14c26c62012-04-24 16:33:31 +10001049 MAJOR(__entry->dev), MINOR(__entry->dev),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001050 __entry->lsn, (void *)__entry->caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001051)
1052
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001053#define DEFINE_LOG_ITEM_EVENT(name) \
1054DEFINE_EVENT(xfs_log_item_class, name, \
1055 TP_PROTO(struct xfs_log_item *lip), \
1056 TP_ARGS(lip))
1057DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001058DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1059DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001060DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001061
Dave Chinner750b9c92013-11-01 15:27:18 +11001062DECLARE_EVENT_CLASS(xfs_ail_class,
1063 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1064 TP_ARGS(lip, old_lsn, new_lsn),
1065 TP_STRUCT__entry(
1066 __field(dev_t, dev)
1067 __field(void *, lip)
1068 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001069 __field(unsigned long, flags)
Dave Chinner750b9c92013-11-01 15:27:18 +11001070 __field(xfs_lsn_t, old_lsn)
1071 __field(xfs_lsn_t, new_lsn)
1072 ),
1073 TP_fast_assign(
1074 __entry->dev = lip->li_mountp->m_super->s_dev;
1075 __entry->lip = lip;
1076 __entry->type = lip->li_type;
1077 __entry->flags = lip->li_flags;
1078 __entry->old_lsn = old_lsn;
1079 __entry->new_lsn = new_lsn;
1080 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001081 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 +11001082 MAJOR(__entry->dev), MINOR(__entry->dev),
1083 __entry->lip,
1084 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1085 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1086 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1087 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1088)
1089
1090#define DEFINE_AIL_EVENT(name) \
1091DEFINE_EVENT(xfs_ail_class, name, \
1092 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1093 TP_ARGS(lip, old_lsn, new_lsn))
1094DEFINE_AIL_EVENT(xfs_ail_insert);
1095DEFINE_AIL_EVENT(xfs_ail_move);
1096DEFINE_AIL_EVENT(xfs_ail_delete);
1097
1098TRACE_EVENT(xfs_log_assign_tail_lsn,
1099 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1100 TP_ARGS(log, new_lsn),
1101 TP_STRUCT__entry(
1102 __field(dev_t, dev)
1103 __field(xfs_lsn_t, new_lsn)
1104 __field(xfs_lsn_t, old_lsn)
1105 __field(xfs_lsn_t, last_sync_lsn)
1106 ),
1107 TP_fast_assign(
1108 __entry->dev = log->l_mp->m_super->s_dev;
1109 __entry->new_lsn = new_lsn;
1110 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1111 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1112 ),
1113 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1114 MAJOR(__entry->dev), MINOR(__entry->dev),
1115 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1116 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1117 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1118)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001119
Li Zefanf8adb4d2010-05-24 08:25:57 +00001120DECLARE_EVENT_CLASS(xfs_file_class,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001121 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1122 TP_ARGS(ip, count, offset),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001123 TP_STRUCT__entry(
1124 __field(dev_t, dev)
1125 __field(xfs_ino_t, ino)
1126 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001127 __field(loff_t, offset)
1128 __field(size_t, count)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001129 ),
1130 TP_fast_assign(
1131 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1132 __entry->ino = ip->i_ino;
1133 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001134 __entry->offset = offset;
1135 __entry->count = count;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001136 ),
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001137 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001138 MAJOR(__entry->dev), MINOR(__entry->dev),
1139 __entry->ino,
1140 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001141 __entry->offset,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001142 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001143)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001144
1145#define DEFINE_RW_EVENT(name) \
1146DEFINE_EVENT(xfs_file_class, name, \
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001147 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1148 TP_ARGS(ip, count, offset))
1149DEFINE_RW_EVENT(xfs_file_buffered_read);
1150DEFINE_RW_EVENT(xfs_file_direct_read);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001151DEFINE_RW_EVENT(xfs_file_dax_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001152DEFINE_RW_EVENT(xfs_file_buffered_write);
1153DEFINE_RW_EVENT(xfs_file_direct_write);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001154DEFINE_RW_EVENT(xfs_file_dax_write);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001155
Li Zefanf8adb4d2010-05-24 08:25:57 +00001156DECLARE_EVENT_CLASS(xfs_page_class,
Lukas Czerner34097df2013-05-21 23:58:01 -04001157 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1158 unsigned int len),
1159 TP_ARGS(inode, page, off, len),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001160 TP_STRUCT__entry(
1161 __field(dev_t, dev)
1162 __field(xfs_ino_t, ino)
1163 __field(pgoff_t, pgoff)
1164 __field(loff_t, size)
1165 __field(unsigned long, offset)
Lukas Czerner34097df2013-05-21 23:58:01 -04001166 __field(unsigned int, length)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001167 ),
1168 TP_fast_assign(
Li Zefanf8adb4d2010-05-24 08:25:57 +00001169 __entry->dev = inode->i_sb->s_dev;
1170 __entry->ino = XFS_I(inode)->i_ino;
1171 __entry->pgoff = page_offset(page);
1172 __entry->size = i_size_read(inode);
1173 __entry->offset = off;
Lukas Czerner34097df2013-05-21 23:58:01 -04001174 __entry->length = len;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001175 ),
1176 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Christoph Hellwig82cb1412018-07-11 22:26:05 -07001177 "length %x",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001178 MAJOR(__entry->dev), MINOR(__entry->dev),
1179 __entry->ino,
1180 __entry->pgoff,
1181 __entry->size,
1182 __entry->offset,
Christoph Hellwig82cb1412018-07-11 22:26:05 -07001183 __entry->length)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001184)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001185
1186#define DEFINE_PAGE_EVENT(name) \
1187DEFINE_EVENT(xfs_page_class, name, \
Lukas Czerner34097df2013-05-21 23:58:01 -04001188 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1189 unsigned int len), \
1190 TP_ARGS(inode, page, off, len))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001191DEFINE_PAGE_EVENT(xfs_writepage);
1192DEFINE_PAGE_EVENT(xfs_releasepage);
1193DEFINE_PAGE_EVENT(xfs_invalidatepage);
1194
Dave Chinner121e2132016-01-08 11:28:35 +11001195DECLARE_EVENT_CLASS(xfs_readpage_class,
1196 TP_PROTO(struct inode *inode, int nr_pages),
1197 TP_ARGS(inode, nr_pages),
1198 TP_STRUCT__entry(
1199 __field(dev_t, dev)
1200 __field(xfs_ino_t, ino)
1201 __field(int, nr_pages)
1202 ),
1203 TP_fast_assign(
1204 __entry->dev = inode->i_sb->s_dev;
1205 __entry->ino = inode->i_ino;
1206 __entry->nr_pages = nr_pages;
1207 ),
1208 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1209 MAJOR(__entry->dev), MINOR(__entry->dev),
1210 __entry->ino,
1211 __entry->nr_pages)
1212)
1213
1214#define DEFINE_READPAGE_EVENT(name) \
1215DEFINE_EVENT(xfs_readpage_class, name, \
1216 TP_PROTO(struct inode *inode, int nr_pages), \
1217 TP_ARGS(inode, nr_pages))
1218DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1219DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1220
Christoph Hellwiga206c812010-12-10 08:42:20 +00001221DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001222 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001223 int whichfork, struct xfs_bmbt_irec *irec),
1224 TP_ARGS(ip, offset, count, whichfork, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001225 TP_STRUCT__entry(
1226 __field(dev_t, dev)
1227 __field(xfs_ino_t, ino)
1228 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001229 __field(loff_t, offset)
1230 __field(size_t, count)
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001231 __field(int, whichfork)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001232 __field(xfs_fileoff_t, startoff)
1233 __field(xfs_fsblock_t, startblock)
1234 __field(xfs_filblks_t, blockcount)
1235 ),
1236 TP_fast_assign(
1237 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1238 __entry->ino = ip->i_ino;
1239 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001240 __entry->offset = offset;
1241 __entry->count = count;
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001242 __entry->whichfork = whichfork;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001243 __entry->startoff = irec ? irec->br_startoff : 0;
1244 __entry->startblock = irec ? irec->br_startblock : 0;
1245 __entry->blockcount = irec ? irec->br_blockcount : 0;
1246 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001247 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001248 "fork %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001249 MAJOR(__entry->dev), MINOR(__entry->dev),
1250 __entry->ino,
1251 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001252 __entry->offset,
1253 __entry->count,
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001254 __entry->whichfork == XFS_COW_FORK ? "cow" : "data",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001255 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07001256 (int64_t)__entry->startblock,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001257 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001258)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001259
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001260#define DEFINE_IMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001261DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001262 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001263 int whichfork, struct xfs_bmbt_irec *irec), \
1264 TP_ARGS(ip, offset, count, whichfork, irec))
1265DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1266DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1267DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1268DEFINE_IMAP_EVENT(xfs_iomap_found);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001269
Li Zefanf8adb4d2010-05-24 08:25:57 +00001270DECLARE_EVENT_CLASS(xfs_simple_io_class,
1271 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1272 TP_ARGS(ip, offset, count),
1273 TP_STRUCT__entry(
1274 __field(dev_t, dev)
1275 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001276 __field(loff_t, isize)
1277 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001278 __field(loff_t, offset)
1279 __field(size_t, count)
1280 ),
1281 TP_fast_assign(
1282 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1283 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001284 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001285 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001286 __entry->offset = offset;
1287 __entry->count = count;
1288 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001289 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001290 "offset 0x%llx count %zd",
1291 MAJOR(__entry->dev), MINOR(__entry->dev),
1292 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001293 __entry->isize,
1294 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001295 __entry->offset,
1296 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001297);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001298
1299#define DEFINE_SIMPLE_IO_EVENT(name) \
1300DEFINE_EVENT(xfs_simple_io_class, name, \
1301 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1302 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001303DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1304DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001305DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Brian Foster0a50f162015-10-12 16:02:08 +11001306DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001307DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1308DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1309DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001310
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001311DECLARE_EVENT_CLASS(xfs_itrunc_class,
1312 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1313 TP_ARGS(ip, new_size),
1314 TP_STRUCT__entry(
1315 __field(dev_t, dev)
1316 __field(xfs_ino_t, ino)
1317 __field(xfs_fsize_t, size)
1318 __field(xfs_fsize_t, new_size)
1319 ),
1320 TP_fast_assign(
1321 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1322 __entry->ino = ip->i_ino;
1323 __entry->size = ip->i_d.di_size;
1324 __entry->new_size = new_size;
1325 ),
1326 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1327 MAJOR(__entry->dev), MINOR(__entry->dev),
1328 __entry->ino,
1329 __entry->size,
1330 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001331)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001332
1333#define DEFINE_ITRUNC_EVENT(name) \
1334DEFINE_EVENT(xfs_itrunc_class, name, \
1335 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1336 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001337DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1338DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001339
1340TRACE_EVENT(xfs_pagecache_inval,
1341 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1342 TP_ARGS(ip, start, finish),
1343 TP_STRUCT__entry(
1344 __field(dev_t, dev)
1345 __field(xfs_ino_t, ino)
1346 __field(xfs_fsize_t, size)
1347 __field(xfs_off_t, start)
1348 __field(xfs_off_t, finish)
1349 ),
1350 TP_fast_assign(
1351 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1352 __entry->ino = ip->i_ino;
1353 __entry->size = ip->i_d.di_size;
1354 __entry->start = start;
1355 __entry->finish = finish;
1356 ),
1357 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1358 MAJOR(__entry->dev), MINOR(__entry->dev),
1359 __entry->ino,
1360 __entry->size,
1361 __entry->start,
1362 __entry->finish)
1363);
1364
1365TRACE_EVENT(xfs_bunmap,
1366 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1367 int flags, unsigned long caller_ip),
1368 TP_ARGS(ip, bno, len, flags, caller_ip),
1369 TP_STRUCT__entry(
1370 __field(dev_t, dev)
1371 __field(xfs_ino_t, ino)
1372 __field(xfs_fsize_t, size)
1373 __field(xfs_fileoff_t, bno)
1374 __field(xfs_filblks_t, len)
1375 __field(unsigned long, caller_ip)
1376 __field(int, flags)
1377 ),
1378 TP_fast_assign(
1379 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1380 __entry->ino = ip->i_ino;
1381 __entry->size = ip->i_d.di_size;
1382 __entry->bno = bno;
1383 __entry->len = len;
1384 __entry->caller_ip = caller_ip;
1385 __entry->flags = flags;
1386 ),
1387 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 -08001388 "flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001389 MAJOR(__entry->dev), MINOR(__entry->dev),
1390 __entry->ino,
1391 __entry->size,
1392 __entry->bno,
1393 __entry->len,
1394 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1395 (void *)__entry->caller_ip)
1396
1397);
1398
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001399DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001400 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1401 xfs_agblock_t agbno, xfs_extlen_t len),
1402 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001403 TP_STRUCT__entry(
1404 __field(dev_t, dev)
1405 __field(xfs_agnumber_t, agno)
1406 __field(xfs_agblock_t, agbno)
1407 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001408 ),
1409 TP_fast_assign(
1410 __entry->dev = mp->m_super->s_dev;
1411 __entry->agno = agno;
1412 __entry->agbno = agbno;
1413 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001414 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001415 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001416 MAJOR(__entry->dev), MINOR(__entry->dev),
1417 __entry->agno,
1418 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001419 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001420);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001421#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001422DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001423 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1424 xfs_agblock_t agbno, xfs_extlen_t len), \
1425 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001426DEFINE_BUSY_EVENT(xfs_extent_busy);
1427DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1428DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1429DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1430DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001431
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001432TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001433 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1434 xfs_agblock_t agbno, xfs_extlen_t len,
1435 xfs_agblock_t tbno, xfs_extlen_t tlen),
1436 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1437 TP_STRUCT__entry(
1438 __field(dev_t, dev)
1439 __field(xfs_agnumber_t, agno)
1440 __field(xfs_agblock_t, agbno)
1441 __field(xfs_extlen_t, len)
1442 __field(xfs_agblock_t, tbno)
1443 __field(xfs_extlen_t, tlen)
1444 ),
1445 TP_fast_assign(
1446 __entry->dev = mp->m_super->s_dev;
1447 __entry->agno = agno;
1448 __entry->agbno = agbno;
1449 __entry->len = len;
1450 __entry->tbno = tbno;
1451 __entry->tlen = tlen;
1452 ),
1453 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1454 MAJOR(__entry->dev), MINOR(__entry->dev),
1455 __entry->agno,
1456 __entry->agbno,
1457 __entry->len,
1458 __entry->tbno,
1459 __entry->tlen)
1460);
1461
Brian Fostera27ba262018-03-15 10:51:58 -07001462DECLARE_EVENT_CLASS(xfs_agf_class,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001463 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1464 unsigned long caller_ip),
1465 TP_ARGS(mp, agf, flags, caller_ip),
1466 TP_STRUCT__entry(
1467 __field(dev_t, dev)
1468 __field(xfs_agnumber_t, agno)
1469 __field(int, flags)
1470 __field(__u32, length)
1471 __field(__u32, bno_root)
1472 __field(__u32, cnt_root)
1473 __field(__u32, bno_level)
1474 __field(__u32, cnt_level)
1475 __field(__u32, flfirst)
1476 __field(__u32, fllast)
1477 __field(__u32, flcount)
1478 __field(__u32, freeblks)
1479 __field(__u32, longest)
1480 __field(unsigned long, caller_ip)
1481 ),
1482 TP_fast_assign(
1483 __entry->dev = mp->m_super->s_dev;
1484 __entry->agno = be32_to_cpu(agf->agf_seqno),
1485 __entry->flags = flags;
1486 __entry->length = be32_to_cpu(agf->agf_length),
1487 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1488 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1489 __entry->bno_level =
1490 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1491 __entry->cnt_level =
1492 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1493 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1494 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1495 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1496 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1497 __entry->longest = be32_to_cpu(agf->agf_longest);
1498 __entry->caller_ip = caller_ip;
1499 ),
1500 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1501 "levels b %u c %u flfirst %u fllast %u flcount %u "
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001502 "freeblks %u longest %u caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001503 MAJOR(__entry->dev), MINOR(__entry->dev),
1504 __entry->agno,
1505 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1506 __entry->length,
1507 __entry->bno_root,
1508 __entry->cnt_root,
1509 __entry->bno_level,
1510 __entry->cnt_level,
1511 __entry->flfirst,
1512 __entry->fllast,
1513 __entry->flcount,
1514 __entry->freeblks,
1515 __entry->longest,
1516 (void *)__entry->caller_ip)
1517);
Brian Fostera27ba262018-03-15 10:51:58 -07001518#define DEFINE_AGF_EVENT(name) \
1519DEFINE_EVENT(xfs_agf_class, name, \
1520 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1521 unsigned long caller_ip), \
1522 TP_ARGS(mp, agf, flags, caller_ip))
1523DEFINE_AGF_EVENT(xfs_agf);
1524DEFINE_AGF_EVENT(xfs_agfl_reset);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001525
1526TRACE_EVENT(xfs_free_extent,
1527 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001528 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1529 int haveright),
1530 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001531 TP_STRUCT__entry(
1532 __field(dev_t, dev)
1533 __field(xfs_agnumber_t, agno)
1534 __field(xfs_agblock_t, agbno)
1535 __field(xfs_extlen_t, len)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001536 __field(int, resv)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001537 __field(int, haveleft)
1538 __field(int, haveright)
1539 ),
1540 TP_fast_assign(
1541 __entry->dev = mp->m_super->s_dev;
1542 __entry->agno = agno;
1543 __entry->agbno = agbno;
1544 __entry->len = len;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001545 __entry->resv = resv;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001546 __entry->haveleft = haveleft;
1547 __entry->haveright = haveright;
1548 ),
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001549 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001550 MAJOR(__entry->dev), MINOR(__entry->dev),
1551 __entry->agno,
1552 __entry->agbno,
1553 __entry->len,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001554 __entry->resv,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001555 __entry->haveleft ?
1556 (__entry->haveright ? "both" : "left") :
1557 (__entry->haveright ? "right" : "none"))
1558
1559);
1560
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001561DECLARE_EVENT_CLASS(xfs_alloc_class,
1562 TP_PROTO(struct xfs_alloc_arg *args),
1563 TP_ARGS(args),
1564 TP_STRUCT__entry(
1565 __field(dev_t, dev)
1566 __field(xfs_agnumber_t, agno)
1567 __field(xfs_agblock_t, agbno)
1568 __field(xfs_extlen_t, minlen)
1569 __field(xfs_extlen_t, maxlen)
1570 __field(xfs_extlen_t, mod)
1571 __field(xfs_extlen_t, prod)
1572 __field(xfs_extlen_t, minleft)
1573 __field(xfs_extlen_t, total)
1574 __field(xfs_extlen_t, alignment)
1575 __field(xfs_extlen_t, minalignslop)
1576 __field(xfs_extlen_t, len)
1577 __field(short, type)
1578 __field(short, otype)
1579 __field(char, wasdel)
1580 __field(char, wasfromfl)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001581 __field(int, resv)
Dave Chinner292378e2016-09-26 08:21:28 +10001582 __field(int, datatype)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001583 __field(xfs_fsblock_t, firstblock)
1584 ),
1585 TP_fast_assign(
1586 __entry->dev = args->mp->m_super->s_dev;
1587 __entry->agno = args->agno;
1588 __entry->agbno = args->agbno;
1589 __entry->minlen = args->minlen;
1590 __entry->maxlen = args->maxlen;
1591 __entry->mod = args->mod;
1592 __entry->prod = args->prod;
1593 __entry->minleft = args->minleft;
1594 __entry->total = args->total;
1595 __entry->alignment = args->alignment;
1596 __entry->minalignslop = args->minalignslop;
1597 __entry->len = args->len;
1598 __entry->type = args->type;
1599 __entry->otype = args->otype;
1600 __entry->wasdel = args->wasdel;
1601 __entry->wasfromfl = args->wasfromfl;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001602 __entry->resv = args->resv;
Dave Chinner292378e2016-09-26 08:21:28 +10001603 __entry->datatype = args->datatype;
Brian Foster64396ff2018-07-11 22:26:30 -07001604 __entry->firstblock = args->tp->t_firstblock;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001605 ),
1606 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1607 "prod %u minleft %u total %u alignment %u minalignslop %u "
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001608 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
Dave Chinner292378e2016-09-26 08:21:28 +10001609 "datatype 0x%x firstblock 0x%llx",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001610 MAJOR(__entry->dev), MINOR(__entry->dev),
1611 __entry->agno,
1612 __entry->agbno,
1613 __entry->minlen,
1614 __entry->maxlen,
1615 __entry->mod,
1616 __entry->prod,
1617 __entry->minleft,
1618 __entry->total,
1619 __entry->alignment,
1620 __entry->minalignslop,
1621 __entry->len,
1622 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1623 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1624 __entry->wasdel,
1625 __entry->wasfromfl,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001626 __entry->resv,
Dave Chinner292378e2016-09-26 08:21:28 +10001627 __entry->datatype,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001628 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001629)
1630
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001631#define DEFINE_ALLOC_EVENT(name) \
1632DEFINE_EVENT(xfs_alloc_class, name, \
1633 TP_PROTO(struct xfs_alloc_arg *args), \
1634 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001635DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001636DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001637DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1638DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1639DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1640DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1641DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1642DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001643DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1644DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001645DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1646DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1647DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1648DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1649DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001650DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001651DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1652DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1653DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1654DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1655DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1656DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1657DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1658DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1659DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1660
Dave Chinner5a5881c2012-03-22 05:15:13 +00001661DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001662 TP_PROTO(struct xfs_da_args *args),
1663 TP_ARGS(args),
1664 TP_STRUCT__entry(
1665 __field(dev_t, dev)
1666 __field(xfs_ino_t, ino)
1667 __dynamic_array(char, name, args->namelen)
1668 __field(int, namelen)
1669 __field(xfs_dahash_t, hashval)
1670 __field(xfs_ino_t, inumber)
1671 __field(int, op_flags)
1672 ),
1673 TP_fast_assign(
1674 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1675 __entry->ino = args->dp->i_ino;
1676 if (args->namelen)
1677 memcpy(__get_str(name), args->name, args->namelen);
1678 __entry->namelen = args->namelen;
1679 __entry->hashval = args->hashval;
1680 __entry->inumber = args->inumber;
1681 __entry->op_flags = args->op_flags;
1682 ),
1683 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1684 "inumber 0x%llx op_flags %s",
1685 MAJOR(__entry->dev), MINOR(__entry->dev),
1686 __entry->ino,
1687 __entry->namelen,
1688 __entry->namelen ? __get_str(name) : NULL,
1689 __entry->namelen,
1690 __entry->hashval,
1691 __entry->inumber,
1692 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001693)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001694
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001695#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001696DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001697 TP_PROTO(struct xfs_da_args *args), \
1698 TP_ARGS(args))
1699DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1700DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1701DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1702DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1703DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1704DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1705DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1706DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1707DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1708DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1709DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1710DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1711DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1712DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1713DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1714DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1715DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1716DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1717DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1718DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1719DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1720DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1721DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1722DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1723DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1724
Dave Chinneree732592012-11-12 22:53:53 +11001725DECLARE_EVENT_CLASS(xfs_attr_class,
1726 TP_PROTO(struct xfs_da_args *args),
1727 TP_ARGS(args),
1728 TP_STRUCT__entry(
1729 __field(dev_t, dev)
1730 __field(xfs_ino_t, ino)
1731 __dynamic_array(char, name, args->namelen)
1732 __field(int, namelen)
1733 __field(int, valuelen)
1734 __field(xfs_dahash_t, hashval)
Eric Sandeene4435232018-04-17 17:17:35 -07001735 __field(int, flags)
Dave Chinneree732592012-11-12 22:53:53 +11001736 __field(int, op_flags)
1737 ),
1738 TP_fast_assign(
1739 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1740 __entry->ino = args->dp->i_ino;
1741 if (args->namelen)
1742 memcpy(__get_str(name), args->name, args->namelen);
1743 __entry->namelen = args->namelen;
1744 __entry->valuelen = args->valuelen;
1745 __entry->hashval = args->hashval;
Eric Sandeene4435232018-04-17 17:17:35 -07001746 __entry->flags = args->flags;
Dave Chinneree732592012-11-12 22:53:53 +11001747 __entry->op_flags = args->op_flags;
1748 ),
1749 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
Eric Sandeene4435232018-04-17 17:17:35 -07001750 "hashval 0x%x flags %s op_flags %s",
Dave Chinneree732592012-11-12 22:53:53 +11001751 MAJOR(__entry->dev), MINOR(__entry->dev),
1752 __entry->ino,
1753 __entry->namelen,
1754 __entry->namelen ? __get_str(name) : NULL,
1755 __entry->namelen,
1756 __entry->valuelen,
1757 __entry->hashval,
Eric Sandeene4435232018-04-17 17:17:35 -07001758 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
Dave Chinneree732592012-11-12 22:53:53 +11001759 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1760)
1761
Dave Chinner5a5881c2012-03-22 05:15:13 +00001762#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001763DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001764 TP_PROTO(struct xfs_da_args *args), \
1765 TP_ARGS(args))
1766DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1767DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1768DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1769DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1770DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001771DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1772
1773DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1774DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1775DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001776DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001777DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1778DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001779DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1780DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001781DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1782DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001783DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001784DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1785DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1786DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1787DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1788DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1789DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1790DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1791DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1792DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1793DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1794DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001795DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001796
1797DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001798DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001799DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1800DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1801
Dave Chinneree732592012-11-12 22:53:53 +11001802DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1803DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1804
1805DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1806DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1807DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1808
Dave Chinner5a5881c2012-03-22 05:15:13 +00001809#define DEFINE_DA_EVENT(name) \
1810DEFINE_EVENT(xfs_da_class, name, \
1811 TP_PROTO(struct xfs_da_args *args), \
1812 TP_ARGS(args))
1813DEFINE_DA_EVENT(xfs_da_split);
1814DEFINE_DA_EVENT(xfs_da_join);
1815DEFINE_DA_EVENT(xfs_da_link_before);
1816DEFINE_DA_EVENT(xfs_da_link_after);
1817DEFINE_DA_EVENT(xfs_da_unlink_back);
1818DEFINE_DA_EVENT(xfs_da_unlink_forward);
1819DEFINE_DA_EVENT(xfs_da_root_split);
1820DEFINE_DA_EVENT(xfs_da_root_join);
1821DEFINE_DA_EVENT(xfs_da_node_add);
1822DEFINE_DA_EVENT(xfs_da_node_create);
1823DEFINE_DA_EVENT(xfs_da_node_split);
1824DEFINE_DA_EVENT(xfs_da_node_remove);
1825DEFINE_DA_EVENT(xfs_da_node_rebalance);
1826DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001827DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001828DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1829DEFINE_DA_EVENT(xfs_da_grow_inode);
1830DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001831DEFINE_DA_EVENT(xfs_da_fixhashpath);
1832DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001833
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001834DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1835 TP_PROTO(struct xfs_da_args *args, int idx),
1836 TP_ARGS(args, idx),
1837 TP_STRUCT__entry(
1838 __field(dev_t, dev)
1839 __field(xfs_ino_t, ino)
1840 __field(int, op_flags)
1841 __field(int, idx)
1842 ),
1843 TP_fast_assign(
1844 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1845 __entry->ino = args->dp->i_ino;
1846 __entry->op_flags = args->op_flags;
1847 __entry->idx = idx;
1848 ),
1849 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1850 MAJOR(__entry->dev), MINOR(__entry->dev),
1851 __entry->ino,
1852 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1853 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001854)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001855
1856#define DEFINE_DIR2_SPACE_EVENT(name) \
1857DEFINE_EVENT(xfs_dir2_space_class, name, \
1858 TP_PROTO(struct xfs_da_args *args, int idx), \
1859 TP_ARGS(args, idx))
1860DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1861DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1862DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1863DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001864
1865TRACE_EVENT(xfs_dir2_leafn_moveents,
1866 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1867 TP_ARGS(args, src_idx, dst_idx, count),
1868 TP_STRUCT__entry(
1869 __field(dev_t, dev)
1870 __field(xfs_ino_t, ino)
1871 __field(int, op_flags)
1872 __field(int, src_idx)
1873 __field(int, dst_idx)
1874 __field(int, count)
1875 ),
1876 TP_fast_assign(
1877 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1878 __entry->ino = args->dp->i_ino;
1879 __entry->op_flags = args->op_flags;
1880 __entry->src_idx = src_idx;
1881 __entry->dst_idx = dst_idx;
1882 __entry->count = count;
1883 ),
1884 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1885 "src_idx %d dst_idx %d count %d",
1886 MAJOR(__entry->dev), MINOR(__entry->dev),
1887 __entry->ino,
1888 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1889 __entry->src_idx,
1890 __entry->dst_idx,
1891 __entry->count)
1892);
1893
Dave Chinner3a85cd92010-01-14 01:33:55 +00001894#define XFS_SWAPEXT_INODES \
1895 { 0, "target" }, \
1896 { 1, "temp" }
1897
Darrick J. Wong0357d212018-12-18 14:32:30 -08001898TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
1899TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
1900TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
1901TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
1902TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
Dave Chinner3a85cd92010-01-14 01:33:55 +00001903
1904DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1905 TP_PROTO(struct xfs_inode *ip, int which),
1906 TP_ARGS(ip, which),
1907 TP_STRUCT__entry(
1908 __field(dev_t, dev)
1909 __field(int, which)
1910 __field(xfs_ino_t, ino)
1911 __field(int, format)
1912 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001913 __field(int, broot_size)
1914 __field(int, fork_off)
1915 ),
1916 TP_fast_assign(
1917 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1918 __entry->which = which;
1919 __entry->ino = ip->i_ino;
1920 __entry->format = ip->i_d.di_format;
1921 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001922 __entry->broot_size = ip->i_df.if_broot_bytes;
1923 __entry->fork_off = XFS_IFORK_BOFF(ip);
1924 ),
1925 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001926 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001927 MAJOR(__entry->dev), MINOR(__entry->dev),
1928 __entry->ino,
1929 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1930 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1931 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001932 __entry->broot_size,
1933 __entry->fork_off)
1934)
1935
1936#define DEFINE_SWAPEXT_EVENT(name) \
1937DEFINE_EVENT(xfs_swap_extent_class, name, \
1938 TP_PROTO(struct xfs_inode *ip, int which), \
1939 TP_ARGS(ip, which))
1940
1941DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1942DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1943
Brian Fostere67d3d42017-08-08 18:21:53 -07001944TRACE_EVENT(xfs_log_recover,
1945 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
1946 TP_ARGS(log, headblk, tailblk),
1947 TP_STRUCT__entry(
1948 __field(dev_t, dev)
1949 __field(xfs_daddr_t, headblk)
1950 __field(xfs_daddr_t, tailblk)
1951 ),
1952 TP_fast_assign(
1953 __entry->dev = log->l_mp->m_super->s_dev;
1954 __entry->headblk = headblk;
1955 __entry->tailblk = tailblk;
1956 ),
1957 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
1958 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
1959 __entry->tailblk)
1960)
1961
Brian Foster5cd9cee2016-09-26 08:34:52 +10001962TRACE_EVENT(xfs_log_recover_record,
1963 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
1964 TP_ARGS(log, rhead, pass),
1965 TP_STRUCT__entry(
1966 __field(dev_t, dev)
1967 __field(xfs_lsn_t, lsn)
1968 __field(int, len)
1969 __field(int, num_logops)
1970 __field(int, pass)
1971 ),
1972 TP_fast_assign(
1973 __entry->dev = log->l_mp->m_super->s_dev;
1974 __entry->lsn = be64_to_cpu(rhead->h_lsn);
1975 __entry->len = be32_to_cpu(rhead->h_len);
1976 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
1977 __entry->pass = pass;
1978 ),
1979 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
1980 MAJOR(__entry->dev), MINOR(__entry->dev),
1981 __entry->lsn, __entry->len, __entry->num_logops,
1982 __entry->pass)
1983)
1984
Dave Chinner9abbc532010-04-13 15:06:46 +10001985DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001986 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10001987 struct xlog_recover_item *item, int pass),
1988 TP_ARGS(log, trans, item, pass),
1989 TP_STRUCT__entry(
1990 __field(dev_t, dev)
1991 __field(unsigned long, item)
1992 __field(xlog_tid_t, tid)
Brian Foster5cd9cee2016-09-26 08:34:52 +10001993 __field(xfs_lsn_t, lsn)
Dave Chinner9abbc532010-04-13 15:06:46 +10001994 __field(int, type)
1995 __field(int, pass)
1996 __field(int, count)
1997 __field(int, total)
1998 ),
1999 TP_fast_assign(
2000 __entry->dev = log->l_mp->m_super->s_dev;
2001 __entry->item = (unsigned long)item;
2002 __entry->tid = trans->r_log_tid;
Brian Foster5cd9cee2016-09-26 08:34:52 +10002003 __entry->lsn = trans->r_lsn;
Dave Chinner9abbc532010-04-13 15:06:46 +10002004 __entry->type = ITEM_TYPE(item);
2005 __entry->pass = pass;
2006 __entry->count = item->ri_cnt;
2007 __entry->total = item->ri_total;
2008 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08002009 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
Brian Foster5cd9cee2016-09-26 08:34:52 +10002010 "item type %s item region count/total %d/%d",
Dave Chinner9abbc532010-04-13 15:06:46 +10002011 MAJOR(__entry->dev), MINOR(__entry->dev),
2012 __entry->tid,
Brian Foster5cd9cee2016-09-26 08:34:52 +10002013 __entry->lsn,
Dave Chinner9abbc532010-04-13 15:06:46 +10002014 __entry->pass,
2015 (void *)__entry->item,
2016 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2017 __entry->count,
2018 __entry->total)
2019)
2020
2021#define DEFINE_LOG_RECOVER_ITEM(name) \
2022DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002023 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10002024 struct xlog_recover_item *item, int pass), \
2025 TP_ARGS(log, trans, item, pass))
2026
2027DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2028DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2029DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2030DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2031DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2032
2033DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002034 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002035 TP_ARGS(log, buf_f),
2036 TP_STRUCT__entry(
2037 __field(dev_t, dev)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002038 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002039 __field(unsigned short, len)
2040 __field(unsigned short, flags)
2041 __field(unsigned short, size)
2042 __field(unsigned int, map_size)
2043 ),
2044 TP_fast_assign(
2045 __entry->dev = log->l_mp->m_super->s_dev;
2046 __entry->blkno = buf_f->blf_blkno;
2047 __entry->len = buf_f->blf_len;
2048 __entry->flags = buf_f->blf_flags;
2049 __entry->size = buf_f->blf_size;
2050 __entry->map_size = buf_f->blf_map_size;
2051 ),
2052 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2053 "map_size %d",
2054 MAJOR(__entry->dev), MINOR(__entry->dev),
2055 __entry->blkno,
2056 __entry->len,
2057 __entry->flags,
2058 __entry->size,
2059 __entry->map_size)
2060)
2061
2062#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2063DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002064 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002065 TP_ARGS(log, buf_f))
2066
2067DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2068DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2069DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2070DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2071DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
Brian Foster5cd9cee2016-09-26 08:34:52 +10002072DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
Dave Chinner9abbc532010-04-13 15:06:46 +10002073DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2074DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2075DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2076
2077DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002078 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002079 TP_ARGS(log, in_f),
2080 TP_STRUCT__entry(
2081 __field(dev_t, dev)
2082 __field(xfs_ino_t, ino)
2083 __field(unsigned short, size)
2084 __field(int, fields)
2085 __field(unsigned short, asize)
2086 __field(unsigned short, dsize)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002087 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002088 __field(int, len)
2089 __field(int, boffset)
2090 ),
2091 TP_fast_assign(
2092 __entry->dev = log->l_mp->m_super->s_dev;
2093 __entry->ino = in_f->ilf_ino;
2094 __entry->size = in_f->ilf_size;
2095 __entry->fields = in_f->ilf_fields;
2096 __entry->asize = in_f->ilf_asize;
2097 __entry->dsize = in_f->ilf_dsize;
2098 __entry->blkno = in_f->ilf_blkno;
2099 __entry->len = in_f->ilf_len;
2100 __entry->boffset = in_f->ilf_boffset;
2101 ),
2102 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2103 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2104 MAJOR(__entry->dev), MINOR(__entry->dev),
2105 __entry->ino,
2106 __entry->size,
2107 __entry->fields,
2108 __entry->asize,
2109 __entry->dsize,
2110 __entry->blkno,
2111 __entry->len,
2112 __entry->boffset)
2113)
2114#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2115DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002116 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002117 TP_ARGS(log, in_f))
2118
2119DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2120DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2121DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2122
Brian Foster78d57e42015-08-19 09:58:48 +10002123DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2124 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2125 TP_ARGS(log, in_f),
2126 TP_STRUCT__entry(
2127 __field(dev_t, dev)
2128 __field(xfs_agnumber_t, agno)
2129 __field(xfs_agblock_t, agbno)
2130 __field(unsigned int, count)
2131 __field(unsigned int, isize)
2132 __field(xfs_agblock_t, length)
2133 __field(unsigned int, gen)
2134 ),
2135 TP_fast_assign(
2136 __entry->dev = log->l_mp->m_super->s_dev;
2137 __entry->agno = be32_to_cpu(in_f->icl_ag);
2138 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2139 __entry->count = be32_to_cpu(in_f->icl_count);
2140 __entry->isize = be32_to_cpu(in_f->icl_isize);
2141 __entry->length = be32_to_cpu(in_f->icl_length);
2142 __entry->gen = be32_to_cpu(in_f->icl_gen);
2143 ),
2144 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2145 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2146 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2147 __entry->length, __entry->gen)
2148)
2149#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2150DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2151 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2152 TP_ARGS(log, in_f))
2153
2154DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2155DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2156
Christoph Hellwiga46db602011-01-07 13:02:04 +00002157DECLARE_EVENT_CLASS(xfs_discard_class,
2158 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2159 xfs_agblock_t agbno, xfs_extlen_t len),
2160 TP_ARGS(mp, agno, agbno, len),
2161 TP_STRUCT__entry(
2162 __field(dev_t, dev)
2163 __field(xfs_agnumber_t, agno)
2164 __field(xfs_agblock_t, agbno)
2165 __field(xfs_extlen_t, len)
2166 ),
2167 TP_fast_assign(
2168 __entry->dev = mp->m_super->s_dev;
2169 __entry->agno = agno;
2170 __entry->agbno = agbno;
2171 __entry->len = len;
2172 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002173 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwiga46db602011-01-07 13:02:04 +00002174 MAJOR(__entry->dev), MINOR(__entry->dev),
2175 __entry->agno,
2176 __entry->agbno,
2177 __entry->len)
2178)
2179
2180#define DEFINE_DISCARD_EVENT(name) \
2181DEFINE_EVENT(xfs_discard_class, name, \
2182 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2183 xfs_agblock_t agbno, xfs_extlen_t len), \
2184 TP_ARGS(mp, agno, agbno, len))
2185DEFINE_DISCARD_EVENT(xfs_discard_extent);
2186DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2187DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2188DEFINE_DISCARD_EVENT(xfs_discard_busy);
2189
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002190/* btree cursor events */
Darrick J. Wongc4942132018-12-18 14:32:31 -08002191TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2192TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2193TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2194TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2195TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2196TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2197TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2198
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002199DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2200 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2201 TP_ARGS(cur, level, bp),
2202 TP_STRUCT__entry(
2203 __field(dev_t, dev)
2204 __field(xfs_btnum_t, btnum)
2205 __field(int, level)
2206 __field(int, nlevels)
2207 __field(int, ptr)
2208 __field(xfs_daddr_t, daddr)
2209 ),
2210 TP_fast_assign(
2211 __entry->dev = cur->bc_mp->m_super->s_dev;
2212 __entry->btnum = cur->bc_btnum;
2213 __entry->level = level;
2214 __entry->nlevels = cur->bc_nlevels;
2215 __entry->ptr = cur->bc_ptrs[level];
2216 __entry->daddr = bp ? bp->b_bn : -1;
2217 ),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002218 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002219 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002220 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002221 __entry->level,
2222 __entry->nlevels,
2223 __entry->ptr,
2224 (unsigned long long)__entry->daddr)
2225)
2226
2227#define DEFINE_BTREE_CUR_EVENT(name) \
2228DEFINE_EVENT(xfs_btree_cur_class, name, \
2229 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2230 TP_ARGS(cur, level, bp))
2231DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
Darrick J. Wong105f7d82016-08-03 11:10:21 +10002232DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002233
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002234/* deferred ops */
2235struct xfs_defer_pending;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002236
2237DECLARE_EVENT_CLASS(xfs_defer_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002238 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2239 TP_ARGS(tp, caller_ip),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002240 TP_STRUCT__entry(
2241 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002242 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002243 __field(char, committed)
Dave Chinnere632a562018-05-09 07:48:52 -07002244 __field(unsigned long, caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002245 ),
2246 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002247 __entry->dev = tp->t_mountp->m_super->s_dev;
2248 __entry->tp = tp;
Dave Chinnere632a562018-05-09 07:48:52 -07002249 __entry->caller_ip = caller_ip;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002250 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002251 TP_printk("dev %d:%d tp %p caller %pS",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002252 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002253 __entry->tp,
Dave Chinnere632a562018-05-09 07:48:52 -07002254 (char *)__entry->caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002255)
2256#define DEFINE_DEFER_EVENT(name) \
2257DEFINE_EVENT(xfs_defer_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002258 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2259 TP_ARGS(tp, caller_ip))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002260
2261DECLARE_EVENT_CLASS(xfs_defer_error_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002262 TP_PROTO(struct xfs_trans *tp, int error),
2263 TP_ARGS(tp, error),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002264 TP_STRUCT__entry(
2265 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002266 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002267 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002268 __field(int, error)
2269 ),
2270 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002271 __entry->dev = tp->t_mountp->m_super->s_dev;
2272 __entry->tp = tp;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002273 __entry->error = error;
2274 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002275 TP_printk("dev %d:%d tp %p err %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002276 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002277 __entry->tp,
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002278 __entry->error)
2279)
2280#define DEFINE_DEFER_ERROR_EVENT(name) \
2281DEFINE_EVENT(xfs_defer_error_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002282 TP_PROTO(struct xfs_trans *tp, int error), \
2283 TP_ARGS(tp, error))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002284
2285DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2286 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2287 TP_ARGS(mp, dfp),
2288 TP_STRUCT__entry(
2289 __field(dev_t, dev)
2290 __field(int, type)
2291 __field(void *, intent)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002292 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002293 __field(int, nr)
2294 ),
2295 TP_fast_assign(
2296 __entry->dev = mp ? mp->m_super->s_dev : 0;
Darrick J. Wong02b100f2018-12-12 08:46:22 -08002297 __entry->type = dfp->dfp_type;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002298 __entry->intent = dfp->dfp_intent;
Darrick J. Wongea78d802016-08-30 13:51:39 +10002299 __entry->committed = dfp->dfp_done != NULL;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002300 __entry->nr = dfp->dfp_count;
2301 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002302 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002303 MAJOR(__entry->dev), MINOR(__entry->dev),
2304 __entry->type,
2305 __entry->intent,
2306 __entry->committed,
2307 __entry->nr)
2308)
2309#define DEFINE_DEFER_PENDING_EVENT(name) \
2310DEFINE_EVENT(xfs_defer_pending_class, name, \
2311 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2312 TP_ARGS(mp, dfp))
2313
2314DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2315 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2316 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2317 TP_ARGS(mp, agno, type, agbno, len),
2318 TP_STRUCT__entry(
2319 __field(dev_t, dev)
2320 __field(xfs_agnumber_t, agno)
2321 __field(int, type)
2322 __field(xfs_agblock_t, agbno)
2323 __field(xfs_extlen_t, len)
2324 ),
2325 TP_fast_assign(
2326 __entry->dev = mp->m_super->s_dev;
2327 __entry->agno = agno;
2328 __entry->type = type;
2329 __entry->agbno = agbno;
2330 __entry->len = len;
2331 ),
2332 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2333 MAJOR(__entry->dev), MINOR(__entry->dev),
2334 __entry->type,
2335 __entry->agno,
2336 __entry->agbno,
2337 __entry->len)
2338);
2339#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2340DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2341 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2342 int type, \
2343 xfs_agblock_t bno, \
2344 xfs_extlen_t len), \
2345 TP_ARGS(mp, agno, type, bno, len))
2346
2347DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2348 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2349 int op,
2350 xfs_agblock_t agbno,
2351 xfs_ino_t ino,
2352 int whichfork,
2353 xfs_fileoff_t offset,
2354 xfs_filblks_t len,
2355 xfs_exntst_t state),
2356 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2357 TP_STRUCT__entry(
2358 __field(dev_t, dev)
2359 __field(xfs_agnumber_t, agno)
2360 __field(xfs_ino_t, ino)
2361 __field(xfs_agblock_t, agbno)
2362 __field(int, whichfork)
2363 __field(xfs_fileoff_t, l_loff)
2364 __field(xfs_filblks_t, l_len)
2365 __field(xfs_exntst_t, l_state)
2366 __field(int, op)
2367 ),
2368 TP_fast_assign(
2369 __entry->dev = mp->m_super->s_dev;
2370 __entry->agno = agno;
2371 __entry->ino = ino;
2372 __entry->agbno = agbno;
2373 __entry->whichfork = whichfork;
2374 __entry->l_loff = offset;
2375 __entry->l_len = len;
2376 __entry->l_state = state;
2377 __entry->op = op;
2378 ),
2379 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2380 MAJOR(__entry->dev), MINOR(__entry->dev),
2381 __entry->op,
2382 __entry->agno,
2383 __entry->agbno,
2384 __entry->ino,
2385 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2386 __entry->l_loff,
2387 __entry->l_len,
2388 __entry->l_state)
2389);
2390#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2391DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2392 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2393 int op, \
2394 xfs_agblock_t agbno, \
2395 xfs_ino_t ino, \
2396 int whichfork, \
2397 xfs_fileoff_t offset, \
2398 xfs_filblks_t len, \
2399 xfs_exntst_t state), \
2400 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2401
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002402DEFINE_DEFER_EVENT(xfs_defer_cancel);
2403DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2404DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2405DEFINE_DEFER_EVENT(xfs_defer_finish);
2406DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2407
2408DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2409DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002410
Brian Foster1ae093cb2018-08-01 07:20:34 -07002411DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2412DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002413DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2414DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2415
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002416#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2417DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2418DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
Brian Fosterf8f28352018-05-07 17:38:47 -07002419DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2420DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002421
Darrick J. Wong673930c2016-08-03 11:33:43 +10002422/* rmap tracepoints */
2423DECLARE_EVENT_CLASS(xfs_rmap_class,
2424 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2425 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
Darrick J. Wong66e32372018-12-12 08:46:23 -08002426 const struct xfs_owner_info *oinfo),
Darrick J. Wong673930c2016-08-03 11:33:43 +10002427 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2428 TP_STRUCT__entry(
2429 __field(dev_t, dev)
2430 __field(xfs_agnumber_t, agno)
2431 __field(xfs_agblock_t, agbno)
2432 __field(xfs_extlen_t, len)
2433 __field(uint64_t, owner)
2434 __field(uint64_t, offset)
2435 __field(unsigned long, flags)
2436 ),
2437 TP_fast_assign(
2438 __entry->dev = mp->m_super->s_dev;
2439 __entry->agno = agno;
2440 __entry->agbno = agbno;
2441 __entry->len = len;
2442 __entry->owner = oinfo->oi_owner;
2443 __entry->offset = oinfo->oi_offset;
2444 __entry->flags = oinfo->oi_flags;
Darrick J. Wong035e00a2016-08-03 11:36:07 +10002445 if (unwritten)
2446 __entry->flags |= XFS_RMAP_UNWRITTEN;
Darrick J. Wong673930c2016-08-03 11:33:43 +10002447 ),
2448 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2449 MAJOR(__entry->dev), MINOR(__entry->dev),
2450 __entry->agno,
2451 __entry->agbno,
2452 __entry->len,
2453 __entry->owner,
2454 __entry->offset,
2455 __entry->flags)
2456);
2457#define DEFINE_RMAP_EVENT(name) \
2458DEFINE_EVENT(xfs_rmap_class, name, \
2459 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2460 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
Darrick J. Wong66e32372018-12-12 08:46:23 -08002461 const struct xfs_owner_info *oinfo), \
Darrick J. Wong673930c2016-08-03 11:33:43 +10002462 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2463
2464/* simple AG-based error/%ip tracepoint class */
2465DECLARE_EVENT_CLASS(xfs_ag_error_class,
2466 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2467 unsigned long caller_ip),
2468 TP_ARGS(mp, agno, error, caller_ip),
2469 TP_STRUCT__entry(
2470 __field(dev_t, dev)
2471 __field(xfs_agnumber_t, agno)
2472 __field(int, error)
2473 __field(unsigned long, caller_ip)
2474 ),
2475 TP_fast_assign(
2476 __entry->dev = mp->m_super->s_dev;
2477 __entry->agno = agno;
2478 __entry->error = error;
2479 __entry->caller_ip = caller_ip;
2480 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08002481 TP_printk("dev %d:%d agno %u error %d caller %pS",
Darrick J. Wong673930c2016-08-03 11:33:43 +10002482 MAJOR(__entry->dev), MINOR(__entry->dev),
2483 __entry->agno,
2484 __entry->error,
2485 (char *)__entry->caller_ip)
2486);
2487
2488#define DEFINE_AG_ERROR_EVENT(name) \
2489DEFINE_EVENT(xfs_ag_error_class, name, \
2490 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2491 unsigned long caller_ip), \
2492 TP_ARGS(mp, agno, error, caller_ip))
2493
2494DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2495DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2496DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2497DEFINE_RMAP_EVENT(xfs_rmap_map);
2498DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2499DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002500DEFINE_RMAP_EVENT(xfs_rmap_convert);
2501DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2502DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2503DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
Darrick J. Wong673930c2016-08-03 11:33:43 +10002504
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002505DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2506 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2507 xfs_agblock_t agbno, xfs_extlen_t len,
2508 uint64_t owner, uint64_t offset, unsigned int flags),
2509 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2510 TP_STRUCT__entry(
2511 __field(dev_t, dev)
2512 __field(xfs_agnumber_t, agno)
2513 __field(xfs_agblock_t, agbno)
2514 __field(xfs_extlen_t, len)
2515 __field(uint64_t, owner)
2516 __field(uint64_t, offset)
2517 __field(unsigned int, flags)
2518 ),
2519 TP_fast_assign(
2520 __entry->dev = mp->m_super->s_dev;
2521 __entry->agno = agno;
2522 __entry->agbno = agbno;
2523 __entry->len = len;
2524 __entry->owner = owner;
2525 __entry->offset = offset;
2526 __entry->flags = flags;
2527 ),
2528 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2529 MAJOR(__entry->dev), MINOR(__entry->dev),
2530 __entry->agno,
2531 __entry->agbno,
2532 __entry->len,
2533 __entry->owner,
2534 __entry->offset,
2535 __entry->flags)
2536);
2537#define DEFINE_RMAPBT_EVENT(name) \
2538DEFINE_EVENT(xfs_rmapbt_class, name, \
2539 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2540 xfs_agblock_t agbno, xfs_extlen_t len, \
2541 uint64_t owner, uint64_t offset, unsigned int flags), \
2542 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2543
2544#define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2545DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2546DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2547
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002548DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2549DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002550DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2551DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2552DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2553DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2554DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2555DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
Darrick J. Wongceeb9c82016-10-03 09:11:48 -07002556
2557DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2558DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2559DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2560DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
Darrick J. Wong0a1b0b32016-08-03 11:44:21 +10002561DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2562DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002563DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002564
Darrick J. Wong9f3afb52016-10-03 09:11:28 -07002565/* deferred bmbt updates */
2566#define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2567DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2568DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2569
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002570/* per-AG reservation */
2571DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2572 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2573 xfs_extlen_t len),
2574 TP_ARGS(pag, resv, len),
2575 TP_STRUCT__entry(
2576 __field(dev_t, dev)
2577 __field(xfs_agnumber_t, agno)
2578 __field(int, resv)
2579 __field(xfs_extlen_t, freeblks)
2580 __field(xfs_extlen_t, flcount)
2581 __field(xfs_extlen_t, reserved)
2582 __field(xfs_extlen_t, asked)
2583 __field(xfs_extlen_t, len)
2584 ),
2585 TP_fast_assign(
2586 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2587
2588 __entry->dev = pag->pag_mount->m_super->s_dev;
2589 __entry->agno = pag->pag_agno;
2590 __entry->resv = resv;
2591 __entry->freeblks = pag->pagf_freeblks;
2592 __entry->flcount = pag->pagf_flcount;
2593 __entry->reserved = r ? r->ar_reserved : 0;
2594 __entry->asked = r ? r->ar_asked : 0;
2595 __entry->len = len;
2596 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002597 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u "
2598 "resv %u ask %u len %u",
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002599 MAJOR(__entry->dev), MINOR(__entry->dev),
2600 __entry->agno,
2601 __entry->resv,
2602 __entry->freeblks,
2603 __entry->flcount,
2604 __entry->reserved,
2605 __entry->asked,
2606 __entry->len)
2607)
2608#define DEFINE_AG_RESV_EVENT(name) \
2609DEFINE_EVENT(xfs_ag_resv_class, name, \
2610 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2611 xfs_extlen_t len), \
2612 TP_ARGS(pag, type, len))
2613
2614/* per-AG reservation tracepoints */
2615DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2616DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2617DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2618DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2619DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2620DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2621
2622DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2623DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2624
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002625/* refcount tracepoint classes */
2626
2627/* reuse the discard trace class for agbno/aglen-based traces */
2628#define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2629
2630/* ag btree lookup tracepoint class */
Darrick J. Wong85f8dff2018-12-18 14:32:29 -08002631TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2632TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2633TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002634DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2635 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2636 xfs_agblock_t agbno, xfs_lookup_t dir),
2637 TP_ARGS(mp, agno, agbno, dir),
2638 TP_STRUCT__entry(
2639 __field(dev_t, dev)
2640 __field(xfs_agnumber_t, agno)
2641 __field(xfs_agblock_t, agbno)
2642 __field(xfs_lookup_t, dir)
2643 ),
2644 TP_fast_assign(
2645 __entry->dev = mp->m_super->s_dev;
2646 __entry->agno = agno;
2647 __entry->agbno = agbno;
2648 __entry->dir = dir;
2649 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002650 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002651 MAJOR(__entry->dev), MINOR(__entry->dev),
2652 __entry->agno,
2653 __entry->agbno,
2654 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2655 __entry->dir)
2656)
2657
2658#define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2659DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2660 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2661 xfs_agblock_t agbno, xfs_lookup_t dir), \
2662 TP_ARGS(mp, agno, agbno, dir))
2663
2664/* single-rcext tracepoint class */
2665DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2666 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2667 struct xfs_refcount_irec *irec),
2668 TP_ARGS(mp, agno, irec),
2669 TP_STRUCT__entry(
2670 __field(dev_t, dev)
2671 __field(xfs_agnumber_t, agno)
2672 __field(xfs_agblock_t, startblock)
2673 __field(xfs_extlen_t, blockcount)
2674 __field(xfs_nlink_t, refcount)
2675 ),
2676 TP_fast_assign(
2677 __entry->dev = mp->m_super->s_dev;
2678 __entry->agno = agno;
2679 __entry->startblock = irec->rc_startblock;
2680 __entry->blockcount = irec->rc_blockcount;
2681 __entry->refcount = irec->rc_refcount;
2682 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002683 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002684 MAJOR(__entry->dev), MINOR(__entry->dev),
2685 __entry->agno,
2686 __entry->startblock,
2687 __entry->blockcount,
2688 __entry->refcount)
2689)
2690
2691#define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2692DEFINE_EVENT(xfs_refcount_extent_class, name, \
2693 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2694 struct xfs_refcount_irec *irec), \
2695 TP_ARGS(mp, agno, irec))
2696
2697/* single-rcext and an agbno tracepoint class */
2698DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2699 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2700 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2701 TP_ARGS(mp, agno, irec, agbno),
2702 TP_STRUCT__entry(
2703 __field(dev_t, dev)
2704 __field(xfs_agnumber_t, agno)
2705 __field(xfs_agblock_t, startblock)
2706 __field(xfs_extlen_t, blockcount)
2707 __field(xfs_nlink_t, refcount)
2708 __field(xfs_agblock_t, agbno)
2709 ),
2710 TP_fast_assign(
2711 __entry->dev = mp->m_super->s_dev;
2712 __entry->agno = agno;
2713 __entry->startblock = irec->rc_startblock;
2714 __entry->blockcount = irec->rc_blockcount;
2715 __entry->refcount = irec->rc_refcount;
2716 __entry->agbno = agbno;
2717 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002718 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002719 MAJOR(__entry->dev), MINOR(__entry->dev),
2720 __entry->agno,
2721 __entry->startblock,
2722 __entry->blockcount,
2723 __entry->refcount,
2724 __entry->agbno)
2725)
2726
2727#define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2728DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2729 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2730 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2731 TP_ARGS(mp, agno, irec, agbno))
2732
2733/* double-rcext tracepoint class */
2734DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2735 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2736 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2737 TP_ARGS(mp, agno, i1, i2),
2738 TP_STRUCT__entry(
2739 __field(dev_t, dev)
2740 __field(xfs_agnumber_t, agno)
2741 __field(xfs_agblock_t, i1_startblock)
2742 __field(xfs_extlen_t, i1_blockcount)
2743 __field(xfs_nlink_t, i1_refcount)
2744 __field(xfs_agblock_t, i2_startblock)
2745 __field(xfs_extlen_t, i2_blockcount)
2746 __field(xfs_nlink_t, i2_refcount)
2747 ),
2748 TP_fast_assign(
2749 __entry->dev = mp->m_super->s_dev;
2750 __entry->agno = agno;
2751 __entry->i1_startblock = i1->rc_startblock;
2752 __entry->i1_blockcount = i1->rc_blockcount;
2753 __entry->i1_refcount = i1->rc_refcount;
2754 __entry->i2_startblock = i2->rc_startblock;
2755 __entry->i2_blockcount = i2->rc_blockcount;
2756 __entry->i2_refcount = i2->rc_refcount;
2757 ),
2758 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002759 "agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002760 MAJOR(__entry->dev), MINOR(__entry->dev),
2761 __entry->agno,
2762 __entry->i1_startblock,
2763 __entry->i1_blockcount,
2764 __entry->i1_refcount,
2765 __entry->i2_startblock,
2766 __entry->i2_blockcount,
2767 __entry->i2_refcount)
2768)
2769
2770#define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2771DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2772 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2773 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2774 TP_ARGS(mp, agno, i1, i2))
2775
2776/* double-rcext and an agbno tracepoint class */
2777DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
2778 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2779 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2780 xfs_agblock_t agbno),
2781 TP_ARGS(mp, agno, i1, i2, agbno),
2782 TP_STRUCT__entry(
2783 __field(dev_t, dev)
2784 __field(xfs_agnumber_t, agno)
2785 __field(xfs_agblock_t, i1_startblock)
2786 __field(xfs_extlen_t, i1_blockcount)
2787 __field(xfs_nlink_t, i1_refcount)
2788 __field(xfs_agblock_t, i2_startblock)
2789 __field(xfs_extlen_t, i2_blockcount)
2790 __field(xfs_nlink_t, i2_refcount)
2791 __field(xfs_agblock_t, agbno)
2792 ),
2793 TP_fast_assign(
2794 __entry->dev = mp->m_super->s_dev;
2795 __entry->agno = agno;
2796 __entry->i1_startblock = i1->rc_startblock;
2797 __entry->i1_blockcount = i1->rc_blockcount;
2798 __entry->i1_refcount = i1->rc_refcount;
2799 __entry->i2_startblock = i2->rc_startblock;
2800 __entry->i2_blockcount = i2->rc_blockcount;
2801 __entry->i2_refcount = i2->rc_refcount;
2802 __entry->agbno = agbno;
2803 ),
2804 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002805 "agbno %u len %u refcount %u @ agbno %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002806 MAJOR(__entry->dev), MINOR(__entry->dev),
2807 __entry->agno,
2808 __entry->i1_startblock,
2809 __entry->i1_blockcount,
2810 __entry->i1_refcount,
2811 __entry->i2_startblock,
2812 __entry->i2_blockcount,
2813 __entry->i2_refcount,
2814 __entry->agbno)
2815)
2816
2817#define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2818DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2819 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2820 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2821 xfs_agblock_t agbno), \
2822 TP_ARGS(mp, agno, i1, i2, agbno))
2823
2824/* triple-rcext tracepoint class */
2825DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
2826 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2827 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2828 struct xfs_refcount_irec *i3),
2829 TP_ARGS(mp, agno, i1, i2, i3),
2830 TP_STRUCT__entry(
2831 __field(dev_t, dev)
2832 __field(xfs_agnumber_t, agno)
2833 __field(xfs_agblock_t, i1_startblock)
2834 __field(xfs_extlen_t, i1_blockcount)
2835 __field(xfs_nlink_t, i1_refcount)
2836 __field(xfs_agblock_t, i2_startblock)
2837 __field(xfs_extlen_t, i2_blockcount)
2838 __field(xfs_nlink_t, i2_refcount)
2839 __field(xfs_agblock_t, i3_startblock)
2840 __field(xfs_extlen_t, i3_blockcount)
2841 __field(xfs_nlink_t, i3_refcount)
2842 ),
2843 TP_fast_assign(
2844 __entry->dev = mp->m_super->s_dev;
2845 __entry->agno = agno;
2846 __entry->i1_startblock = i1->rc_startblock;
2847 __entry->i1_blockcount = i1->rc_blockcount;
2848 __entry->i1_refcount = i1->rc_refcount;
2849 __entry->i2_startblock = i2->rc_startblock;
2850 __entry->i2_blockcount = i2->rc_blockcount;
2851 __entry->i2_refcount = i2->rc_refcount;
2852 __entry->i3_startblock = i3->rc_startblock;
2853 __entry->i3_blockcount = i3->rc_blockcount;
2854 __entry->i3_refcount = i3->rc_refcount;
2855 ),
2856 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2857 "agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002858 "agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002859 MAJOR(__entry->dev), MINOR(__entry->dev),
2860 __entry->agno,
2861 __entry->i1_startblock,
2862 __entry->i1_blockcount,
2863 __entry->i1_refcount,
2864 __entry->i2_startblock,
2865 __entry->i2_blockcount,
2866 __entry->i2_refcount,
2867 __entry->i3_startblock,
2868 __entry->i3_blockcount,
2869 __entry->i3_refcount)
2870);
2871
2872#define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2873DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
2874 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2875 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2876 struct xfs_refcount_irec *i3), \
2877 TP_ARGS(mp, agno, i1, i2, i3))
2878
2879/* refcount btree tracepoints */
2880DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
2881DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
2882DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
2883DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
2884DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
2885DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
2886DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
2887DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
2888DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
2889DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
2890
2891/* refcount adjustment tracepoints */
2892DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
2893DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
Darrick J. Wong174edb02016-10-03 09:11:39 -07002894DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
2895DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002896DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
2897DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
Darrick J. Wong174edb02016-10-03 09:11:39 -07002898DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002899DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
2900DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
2901DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
2902DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
2903DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
2904DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
Darrick J. Wong174edb02016-10-03 09:11:39 -07002905DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002906DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
2907DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
2908DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
2909DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
2910DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
2911DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
2912DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
2913
2914/* reflink helpers */
2915DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
2916DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
2917DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
Darrick J. Wong33ba61292016-10-03 09:11:22 -07002918#define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2919DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
2920DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002921
Darrick J. Wongf997ee22016-10-03 09:11:21 -07002922TRACE_EVENT(xfs_refcount_finish_one_leftover,
2923 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2924 int type, xfs_agblock_t agbno, xfs_extlen_t len,
2925 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
2926 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
2927 TP_STRUCT__entry(
2928 __field(dev_t, dev)
2929 __field(xfs_agnumber_t, agno)
2930 __field(int, type)
2931 __field(xfs_agblock_t, agbno)
2932 __field(xfs_extlen_t, len)
2933 __field(xfs_agblock_t, new_agbno)
2934 __field(xfs_extlen_t, new_len)
2935 ),
2936 TP_fast_assign(
2937 __entry->dev = mp->m_super->s_dev;
2938 __entry->agno = agno;
2939 __entry->type = type;
2940 __entry->agbno = agbno;
2941 __entry->len = len;
2942 __entry->new_agbno = new_agbno;
2943 __entry->new_len = new_len;
2944 ),
2945 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
2946 MAJOR(__entry->dev), MINOR(__entry->dev),
2947 __entry->type,
2948 __entry->agno,
2949 __entry->agbno,
2950 __entry->len,
2951 __entry->new_agbno,
2952 __entry->new_len)
2953);
2954
Darrick J. Wongf65306e2016-10-03 09:11:27 -07002955/* simple inode-based error/%ip tracepoint class */
2956DECLARE_EVENT_CLASS(xfs_inode_error_class,
2957 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
2958 TP_ARGS(ip, error, caller_ip),
2959 TP_STRUCT__entry(
2960 __field(dev_t, dev)
2961 __field(xfs_ino_t, ino)
2962 __field(int, error)
2963 __field(unsigned long, caller_ip)
2964 ),
2965 TP_fast_assign(
2966 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2967 __entry->ino = ip->i_ino;
2968 __entry->error = error;
2969 __entry->caller_ip = caller_ip;
2970 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08002971 TP_printk("dev %d:%d ino %llx error %d caller %pS",
Darrick J. Wongf65306e2016-10-03 09:11:27 -07002972 MAJOR(__entry->dev), MINOR(__entry->dev),
2973 __entry->ino,
2974 __entry->error,
2975 (char *)__entry->caller_ip)
2976);
2977
2978#define DEFINE_INODE_ERROR_EVENT(name) \
2979DEFINE_EVENT(xfs_inode_error_class, name, \
2980 TP_PROTO(struct xfs_inode *ip, int error, \
2981 unsigned long caller_ip), \
2982 TP_ARGS(ip, error, caller_ip))
2983
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07002984/* reflink tracepoint classes */
2985
2986/* two-file io tracepoint class */
2987DECLARE_EVENT_CLASS(xfs_double_io_class,
2988 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
2989 struct xfs_inode *dest, xfs_off_t doffset),
2990 TP_ARGS(src, soffset, len, dest, doffset),
2991 TP_STRUCT__entry(
2992 __field(dev_t, dev)
2993 __field(xfs_ino_t, src_ino)
2994 __field(loff_t, src_isize)
2995 __field(loff_t, src_disize)
2996 __field(loff_t, src_offset)
2997 __field(size_t, len)
2998 __field(xfs_ino_t, dest_ino)
2999 __field(loff_t, dest_isize)
3000 __field(loff_t, dest_disize)
3001 __field(loff_t, dest_offset)
3002 ),
3003 TP_fast_assign(
3004 __entry->dev = VFS_I(src)->i_sb->s_dev;
3005 __entry->src_ino = src->i_ino;
3006 __entry->src_isize = VFS_I(src)->i_size;
3007 __entry->src_disize = src->i_d.di_size;
3008 __entry->src_offset = soffset;
3009 __entry->len = len;
3010 __entry->dest_ino = dest->i_ino;
3011 __entry->dest_isize = VFS_I(dest)->i_size;
3012 __entry->dest_disize = dest->i_d.di_size;
3013 __entry->dest_offset = doffset;
3014 ),
3015 TP_printk("dev %d:%d count %zd "
3016 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
3017 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
3018 MAJOR(__entry->dev), MINOR(__entry->dev),
3019 __entry->len,
3020 __entry->src_ino,
3021 __entry->src_isize,
3022 __entry->src_disize,
3023 __entry->src_offset,
3024 __entry->dest_ino,
3025 __entry->dest_isize,
3026 __entry->dest_disize,
3027 __entry->dest_offset)
3028)
3029
3030#define DEFINE_DOUBLE_IO_EVENT(name) \
3031DEFINE_EVENT(xfs_double_io_class, name, \
3032 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3033 struct xfs_inode *dest, xfs_off_t doffset), \
3034 TP_ARGS(src, soffset, len, dest, doffset))
3035
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003036/* inode/irec events */
3037DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3038 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3039 TP_ARGS(ip, irec),
3040 TP_STRUCT__entry(
3041 __field(dev_t, dev)
3042 __field(xfs_ino_t, ino)
3043 __field(xfs_fileoff_t, lblk)
3044 __field(xfs_extlen_t, len)
3045 __field(xfs_fsblock_t, pblk)
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003046 __field(int, state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003047 ),
3048 TP_fast_assign(
3049 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3050 __entry->ino = ip->i_ino;
3051 __entry->lblk = irec->br_startoff;
3052 __entry->len = irec->br_blockcount;
3053 __entry->pblk = irec->br_startblock;
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003054 __entry->state = irec->br_state;
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003055 ),
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003056 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 -07003057 MAJOR(__entry->dev), MINOR(__entry->dev),
3058 __entry->ino,
3059 __entry->lblk,
3060 __entry->len,
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003061 __entry->pblk,
3062 __entry->state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003063);
3064#define DEFINE_INODE_IREC_EVENT(name) \
3065DEFINE_EVENT(xfs_inode_irec_class, name, \
3066 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3067 TP_ARGS(ip, irec))
3068
3069/* refcount/reflink tracepoint definitions */
3070
3071/* reflink tracepoints */
3072DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3073DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3074DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08003075DEFINE_IMAP_EVENT(xfs_reflink_remap_imap);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003076TRACE_EVENT(xfs_reflink_remap_blocks_loop,
3077 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3078 xfs_filblks_t len, struct xfs_inode *dest,
3079 xfs_fileoff_t doffset),
3080 TP_ARGS(src, soffset, len, dest, doffset),
3081 TP_STRUCT__entry(
3082 __field(dev_t, dev)
3083 __field(xfs_ino_t, src_ino)
3084 __field(xfs_fileoff_t, src_lblk)
3085 __field(xfs_filblks_t, len)
3086 __field(xfs_ino_t, dest_ino)
3087 __field(xfs_fileoff_t, dest_lblk)
3088 ),
3089 TP_fast_assign(
3090 __entry->dev = VFS_I(src)->i_sb->s_dev;
3091 __entry->src_ino = src->i_ino;
3092 __entry->src_lblk = soffset;
3093 __entry->len = len;
3094 __entry->dest_ino = dest->i_ino;
3095 __entry->dest_lblk = doffset;
3096 ),
3097 TP_printk("dev %d:%d len 0x%llx "
3098 "ino 0x%llx offset 0x%llx blocks -> "
3099 "ino 0x%llx offset 0x%llx blocks",
3100 MAJOR(__entry->dev), MINOR(__entry->dev),
3101 __entry->len,
3102 __entry->src_ino,
3103 __entry->src_lblk,
3104 __entry->dest_ino,
3105 __entry->dest_lblk)
3106);
3107TRACE_EVENT(xfs_reflink_punch_range,
3108 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3109 xfs_extlen_t len),
3110 TP_ARGS(ip, lblk, len),
3111 TP_STRUCT__entry(
3112 __field(dev_t, dev)
3113 __field(xfs_ino_t, ino)
3114 __field(xfs_fileoff_t, lblk)
3115 __field(xfs_extlen_t, len)
3116 ),
3117 TP_fast_assign(
3118 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3119 __entry->ino = ip->i_ino;
3120 __entry->lblk = lblk;
3121 __entry->len = len;
3122 ),
3123 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x",
3124 MAJOR(__entry->dev), MINOR(__entry->dev),
3125 __entry->ino,
3126 __entry->lblk,
3127 __entry->len)
3128);
3129TRACE_EVENT(xfs_reflink_remap,
3130 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3131 xfs_extlen_t len, xfs_fsblock_t new_pblk),
3132 TP_ARGS(ip, lblk, len, new_pblk),
3133 TP_STRUCT__entry(
3134 __field(dev_t, dev)
3135 __field(xfs_ino_t, ino)
3136 __field(xfs_fileoff_t, lblk)
3137 __field(xfs_extlen_t, len)
3138 __field(xfs_fsblock_t, new_pblk)
3139 ),
3140 TP_fast_assign(
3141 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3142 __entry->ino = ip->i_ino;
3143 __entry->lblk = lblk;
3144 __entry->len = len;
3145 __entry->new_pblk = new_pblk;
3146 ),
3147 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu",
3148 MAJOR(__entry->dev), MINOR(__entry->dev),
3149 __entry->ino,
3150 __entry->lblk,
3151 __entry->len,
3152 __entry->new_pblk)
3153);
3154DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3155DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3156DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3157DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003158DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3159DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3160
3161/* dedupe tracepoints */
3162DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3163DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3164
3165/* ioctl tracepoints */
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003166TRACE_EVENT(xfs_ioctl_clone,
3167 TP_PROTO(struct inode *src, struct inode *dest),
3168 TP_ARGS(src, dest),
3169 TP_STRUCT__entry(
3170 __field(dev_t, dev)
3171 __field(unsigned long, src_ino)
3172 __field(loff_t, src_isize)
3173 __field(unsigned long, dest_ino)
3174 __field(loff_t, dest_isize)
3175 ),
3176 TP_fast_assign(
3177 __entry->dev = src->i_sb->s_dev;
3178 __entry->src_ino = src->i_ino;
3179 __entry->src_isize = i_size_read(src);
3180 __entry->dest_ino = dest->i_ino;
3181 __entry->dest_isize = i_size_read(dest);
3182 ),
3183 TP_printk("dev %d:%d "
3184 "ino 0x%lx isize 0x%llx -> "
Hou Tao42bf9db2017-04-14 11:43:27 -07003185 "ino 0x%lx isize 0x%llx",
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003186 MAJOR(__entry->dev), MINOR(__entry->dev),
3187 __entry->src_ino,
3188 __entry->src_isize,
3189 __entry->dest_ino,
3190 __entry->dest_isize)
3191);
3192
3193/* unshare tracepoints */
3194DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003195DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003196
3197/* copy on write */
3198DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
Darrick J. Wongbe51f812016-10-03 09:11:32 -07003199DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3200DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003201DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003202
Christoph Hellwig54a4ef82017-02-06 13:00:54 -08003203DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003204
3205DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3206DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3207DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003208
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003209DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3210DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3211
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003212
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003213DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003214
Darrick J. Wong1f08af52016-10-03 09:11:53 -07003215/* rmap swapext tracepoints */
3216DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3217DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3218DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3219
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003220/* fsmap traces */
3221DECLARE_EVENT_CLASS(xfs_fsmap_class,
3222 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3223 struct xfs_rmap_irec *rmap),
3224 TP_ARGS(mp, keydev, agno, rmap),
3225 TP_STRUCT__entry(
3226 __field(dev_t, dev)
3227 __field(dev_t, keydev)
3228 __field(xfs_agnumber_t, agno)
3229 __field(xfs_fsblock_t, bno)
3230 __field(xfs_filblks_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003231 __field(uint64_t, owner)
3232 __field(uint64_t, offset)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003233 __field(unsigned int, flags)
3234 ),
3235 TP_fast_assign(
3236 __entry->dev = mp->m_super->s_dev;
3237 __entry->keydev = new_decode_dev(keydev);
3238 __entry->agno = agno;
3239 __entry->bno = rmap->rm_startblock;
3240 __entry->len = rmap->rm_blockcount;
3241 __entry->owner = rmap->rm_owner;
3242 __entry->offset = rmap->rm_offset;
3243 __entry->flags = rmap->rm_flags;
3244 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07003245 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 -07003246 MAJOR(__entry->dev), MINOR(__entry->dev),
3247 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3248 __entry->agno,
3249 __entry->bno,
3250 __entry->len,
3251 __entry->owner,
3252 __entry->offset,
3253 __entry->flags)
3254)
3255#define DEFINE_FSMAP_EVENT(name) \
3256DEFINE_EVENT(xfs_fsmap_class, name, \
3257 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3258 struct xfs_rmap_irec *rmap), \
3259 TP_ARGS(mp, keydev, agno, rmap))
3260DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3261DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3262DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3263
3264DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3265 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3266 TP_ARGS(mp, fsmap),
3267 TP_STRUCT__entry(
3268 __field(dev_t, dev)
3269 __field(dev_t, keydev)
3270 __field(xfs_daddr_t, block)
3271 __field(xfs_daddr_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003272 __field(uint64_t, owner)
3273 __field(uint64_t, offset)
3274 __field(uint64_t, flags)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003275 ),
3276 TP_fast_assign(
3277 __entry->dev = mp->m_super->s_dev;
3278 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3279 __entry->block = fsmap->fmr_physical;
3280 __entry->len = fsmap->fmr_length;
3281 __entry->owner = fsmap->fmr_owner;
3282 __entry->offset = fsmap->fmr_offset;
3283 __entry->flags = fsmap->fmr_flags;
3284 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07003285 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 -07003286 MAJOR(__entry->dev), MINOR(__entry->dev),
3287 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3288 __entry->block,
3289 __entry->len,
3290 __entry->owner,
3291 __entry->offset,
3292 __entry->flags)
3293)
3294#define DEFINE_GETFSMAP_EVENT(name) \
3295DEFINE_EVENT(xfs_getfsmap_class, name, \
3296 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3297 TP_ARGS(mp, fsmap))
3298DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3299DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3300DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3301
Darrick J. Wongb872af22018-01-08 10:51:26 -08003302TRACE_EVENT(xfs_trans_resv_calc,
3303 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3304 struct xfs_trans_res *res),
3305 TP_ARGS(mp, type, res),
3306 TP_STRUCT__entry(
3307 __field(dev_t, dev)
3308 __field(int, type)
3309 __field(uint, logres)
3310 __field(int, logcount)
3311 __field(int, logflags)
3312 ),
3313 TP_fast_assign(
3314 __entry->dev = mp->m_super->s_dev;
3315 __entry->type = type;
3316 __entry->logres = res->tr_logres;
3317 __entry->logcount = res->tr_logcount;
3318 __entry->logflags = res->tr_logflags;
3319 ),
3320 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3321 MAJOR(__entry->dev), MINOR(__entry->dev),
3322 __entry->type,
3323 __entry->logres,
3324 __entry->logcount,
3325 __entry->logflags)
3326);
3327
Dave Chinnerba187812018-05-09 07:47:57 -07003328DECLARE_EVENT_CLASS(xfs_trans_class,
3329 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3330 TP_ARGS(tp, caller_ip),
3331 TP_STRUCT__entry(
3332 __field(dev_t, dev)
3333 __field(uint32_t, tid)
3334 __field(uint32_t, flags)
3335 __field(unsigned long, caller_ip)
3336 ),
3337 TP_fast_assign(
3338 __entry->dev = tp->t_mountp->m_super->s_dev;
3339 __entry->tid = 0;
3340 if (tp->t_ticket)
3341 __entry->tid = tp->t_ticket->t_tid;
3342 __entry->flags = tp->t_flags;
3343 __entry->caller_ip = caller_ip;
3344 ),
3345 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3346 MAJOR(__entry->dev), MINOR(__entry->dev),
3347 __entry->tid,
3348 __entry->flags,
3349 (char *)__entry->caller_ip)
3350)
3351
3352#define DEFINE_TRANS_EVENT(name) \
3353DEFINE_EVENT(xfs_trans_class, name, \
3354 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3355 TP_ARGS(tp, caller_ip))
3356DEFINE_TRANS_EVENT(xfs_trans_alloc);
3357DEFINE_TRANS_EVENT(xfs_trans_cancel);
3358DEFINE_TRANS_EVENT(xfs_trans_commit);
3359DEFINE_TRANS_EVENT(xfs_trans_dup);
3360DEFINE_TRANS_EVENT(xfs_trans_free);
3361DEFINE_TRANS_EVENT(xfs_trans_roll);
3362DEFINE_TRANS_EVENT(xfs_trans_add_item);
Christoph Hellwig195cd832019-06-28 19:27:31 -07003363DEFINE_TRANS_EVENT(xfs_trans_commit_items);
Dave Chinnerba187812018-05-09 07:47:57 -07003364DEFINE_TRANS_EVENT(xfs_trans_free_items);
3365
Darrick J. Wong9a4a5112019-02-07 10:37:14 -08003366TRACE_EVENT(xfs_iunlink_update_bucket,
3367 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3368 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3369 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3370 TP_STRUCT__entry(
3371 __field(dev_t, dev)
3372 __field(xfs_agnumber_t, agno)
3373 __field(unsigned int, bucket)
3374 __field(xfs_agino_t, old_ptr)
3375 __field(xfs_agino_t, new_ptr)
3376 ),
3377 TP_fast_assign(
3378 __entry->dev = mp->m_super->s_dev;
3379 __entry->agno = agno;
3380 __entry->bucket = bucket;
3381 __entry->old_ptr = old_ptr;
3382 __entry->new_ptr = new_ptr;
3383 ),
3384 TP_printk("dev %d:%d agno %u bucket %u old 0x%x new 0x%x",
3385 MAJOR(__entry->dev), MINOR(__entry->dev),
3386 __entry->agno,
3387 __entry->bucket,
3388 __entry->old_ptr,
3389 __entry->new_ptr)
3390);
3391
Darrick J. Wongf2fc16a2019-02-07 10:37:15 -08003392TRACE_EVENT(xfs_iunlink_update_dinode,
3393 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3394 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3395 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3396 TP_STRUCT__entry(
3397 __field(dev_t, dev)
3398 __field(xfs_agnumber_t, agno)
3399 __field(xfs_agino_t, agino)
3400 __field(xfs_agino_t, old_ptr)
3401 __field(xfs_agino_t, new_ptr)
3402 ),
3403 TP_fast_assign(
3404 __entry->dev = mp->m_super->s_dev;
3405 __entry->agno = agno;
3406 __entry->agino = agino;
3407 __entry->old_ptr = old_ptr;
3408 __entry->new_ptr = new_ptr;
3409 ),
3410 TP_printk("dev %d:%d agno %u agino 0x%x old 0x%x new 0x%x",
3411 MAJOR(__entry->dev), MINOR(__entry->dev),
3412 __entry->agno,
3413 __entry->agino,
3414 __entry->old_ptr,
3415 __entry->new_ptr)
3416);
3417
Darrick J. Wong4664c662019-02-07 10:37:16 -08003418DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3419 TP_PROTO(struct xfs_inode *ip),
3420 TP_ARGS(ip),
3421 TP_STRUCT__entry(
3422 __field(dev_t, dev)
3423 __field(xfs_agnumber_t, agno)
3424 __field(xfs_agino_t, agino)
3425 ),
3426 TP_fast_assign(
3427 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3428 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3429 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3430 ),
3431 TP_printk("dev %d:%d agno %u agino %u",
3432 MAJOR(__entry->dev), MINOR(__entry->dev),
3433 __entry->agno, __entry->agino)
3434)
3435
3436#define DEFINE_AGINODE_EVENT(name) \
3437DEFINE_EVENT(xfs_ag_inode_class, name, \
3438 TP_PROTO(struct xfs_inode *ip), \
3439 TP_ARGS(ip))
3440DEFINE_AGINODE_EVENT(xfs_iunlink);
3441DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
Darrick J. Wong9b247172019-02-07 10:37:16 -08003442DEFINE_AG_EVENT(xfs_iunlink_map_prev_fallback);
Darrick J. Wong4664c662019-02-07 10:37:16 -08003443
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003444DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3445 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3446 TP_ARGS(mp, flags),
3447 TP_STRUCT__entry(
3448 __field(dev_t, dev)
3449 __field(unsigned int, flags)
3450 ),
3451 TP_fast_assign(
3452 __entry->dev = mp->m_super->s_dev;
3453 __entry->flags = flags;
3454 ),
3455 TP_printk("dev %d:%d flags 0x%x",
3456 MAJOR(__entry->dev), MINOR(__entry->dev),
3457 __entry->flags)
3458);
3459#define DEFINE_FS_CORRUPT_EVENT(name) \
3460DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3461 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3462 TP_ARGS(mp, flags))
3463DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3464DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003465DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003466DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3467DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003468DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003469
3470DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3471 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3472 TP_ARGS(mp, agno, flags),
3473 TP_STRUCT__entry(
3474 __field(dev_t, dev)
3475 __field(xfs_agnumber_t, agno)
3476 __field(unsigned int, flags)
3477 ),
3478 TP_fast_assign(
3479 __entry->dev = mp->m_super->s_dev;
3480 __entry->agno = agno;
3481 __entry->flags = flags;
3482 ),
3483 TP_printk("dev %d:%d agno %u flags 0x%x",
3484 MAJOR(__entry->dev), MINOR(__entry->dev),
3485 __entry->agno, __entry->flags)
3486);
3487#define DEFINE_AG_CORRUPT_EVENT(name) \
3488DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3489 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3490 unsigned int flags), \
3491 TP_ARGS(mp, agno, flags))
3492DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3493DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003494DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003495
3496DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3497 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3498 TP_ARGS(ip, flags),
3499 TP_STRUCT__entry(
3500 __field(dev_t, dev)
3501 __field(xfs_ino_t, ino)
3502 __field(unsigned int, flags)
3503 ),
3504 TP_fast_assign(
3505 __entry->dev = ip->i_mount->m_super->s_dev;
3506 __entry->ino = ip->i_ino;
3507 __entry->flags = flags;
3508 ),
3509 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3510 MAJOR(__entry->dev), MINOR(__entry->dev),
3511 __entry->ino, __entry->flags)
3512);
3513#define DEFINE_INODE_CORRUPT_EVENT(name) \
3514DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3515 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3516 TP_ARGS(ip, flags))
3517DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3518DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3519
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00003520#endif /* _TRACE_XFS_H */
3521
3522#undef TRACE_INCLUDE_PATH
3523#define TRACE_INCLUDE_PATH .
3524#define TRACE_INCLUDE_FILE xfs_trace
3525#include <trace/define_trace.h>