blob: 2eef14791cc548d2dc8e50ba3fc4e9d79afad04a [file] [log] [blame]
Dave Chinner0b61f8a2018-06-05 19:42:14 -07001// SPDX-License-Identifier: GPL-2.0
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002/*
3 * Copyright (c) 2009, Christoph Hellwig
4 * All Rights Reserved.
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00005 */
6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM xfs
8
9#if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
10#define _TRACE_XFS_H
11
12#include <linux/tracepoint.h>
13
14struct xfs_agf;
15struct xfs_alloc_arg;
16struct xfs_attr_list_context;
17struct xfs_buf_log_item;
18struct xfs_da_args;
19struct xfs_da_node_entry;
20struct xfs_dquot;
Christoph Hellwig9e4c1092011-10-11 15:14:11 +000021struct xfs_log_item;
Mark Tinguelyad223e62012-06-14 09:22:15 -050022struct xlog;
Dave Chinner750b9c92013-11-01 15:27:18 +110023struct xlog_ticket;
Dave Chinner9abbc532010-04-13 15:06:46 +100024struct xlog_recover;
25struct xlog_recover_item;
Dave Chinner0ad95682019-08-26 12:08:10 -070026struct xlog_rec_header;
Dave Chinner9abbc532010-04-13 15:06:46 +100027struct xfs_buf_log_format;
28struct xfs_inode_log_format;
Alex Elder1ed845d2012-08-01 09:56:49 -050029struct xfs_bmbt_irec;
Darrick J. Wong2c813ad2016-08-03 11:08:36 +100030struct xfs_btree_cur;
Darrick J. Wong1946b912016-10-03 09:11:18 -070031struct xfs_refcount_irec;
Darrick J. Wonge89c0412017-03-28 14:56:37 -070032struct xfs_fsmap;
33struct xfs_rmap_irec;
Dave Chinner0ad95682019-08-26 12:08:10 -070034struct xfs_icreate_log;
35struct xfs_owner_info;
36struct xfs_trans_res;
37struct xfs_inobt_rec_incore;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000038
Christoph Hellwigea9a4882009-12-21 14:03:03 +000039DECLARE_EVENT_CLASS(xfs_attr_list_class,
40 TP_PROTO(struct xfs_attr_list_context *ctx),
41 TP_ARGS(ctx),
42 TP_STRUCT__entry(
43 __field(dev_t, dev)
44 __field(xfs_ino_t, ino)
45 __field(u32, hashval)
46 __field(u32, blkno)
47 __field(u32, offset)
48 __field(void *, alist)
49 __field(int, bufsize)
50 __field(int, count)
51 __field(int, firstu)
52 __field(int, dupcnt)
53 __field(int, flags)
54 ),
55 TP_fast_assign(
56 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
57 __entry->ino = ctx->dp->i_ino;
58 __entry->hashval = ctx->cursor->hashval;
59 __entry->blkno = ctx->cursor->blkno;
60 __entry->offset = ctx->cursor->offset;
61 __entry->alist = ctx->alist;
62 __entry->bufsize = ctx->bufsize;
63 __entry->count = ctx->count;
64 __entry->firstu = ctx->firstu;
65 __entry->flags = ctx->flags;
66 ),
67 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 -080068 "alist %p size %u count %u firstu %u flags %d %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +000069 MAJOR(__entry->dev), MINOR(__entry->dev),
70 __entry->ino,
71 __entry->hashval,
72 __entry->blkno,
73 __entry->offset,
74 __entry->dupcnt,
75 __entry->alist,
76 __entry->bufsize,
77 __entry->count,
78 __entry->firstu,
79 __entry->flags,
80 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
81 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000082)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000083
84#define DEFINE_ATTR_LIST_EVENT(name) \
85DEFINE_EVENT(xfs_attr_list_class, name, \
86 TP_PROTO(struct xfs_attr_list_context *ctx), \
87 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000088DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
89DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
90DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
91DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
92DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
93DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
94DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
95DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +110096DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000098
Li Zefanf8adb4d2010-05-24 08:25:57 +000099DECLARE_EVENT_CLASS(xfs_perag_class,
100 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
101 unsigned long caller_ip),
102 TP_ARGS(mp, agno, refcount, caller_ip),
103 TP_STRUCT__entry(
104 __field(dev_t, dev)
105 __field(xfs_agnumber_t, agno)
106 __field(int, refcount)
107 __field(unsigned long, caller_ip)
108 ),
109 TP_fast_assign(
110 __entry->dev = mp->m_super->s_dev;
111 __entry->agno = agno;
112 __entry->refcount = refcount;
113 __entry->caller_ip = caller_ip;
114 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800115 TP_printk("dev %d:%d agno %u refcount %d caller %pS",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000116 MAJOR(__entry->dev), MINOR(__entry->dev),
117 __entry->agno,
118 __entry->refcount,
119 (char *)__entry->caller_ip)
120);
121
122#define DEFINE_PERAG_REF_EVENT(name) \
123DEFINE_EVENT(xfs_perag_class, name, \
124 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
125 unsigned long caller_ip), \
126 TP_ARGS(mp, agno, refcount, caller_ip))
127DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000128DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000129DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000130DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
131DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Brian Foster27b52862012-11-06 09:50:38 -0500132DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
133DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700134DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks);
135DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000136
Dave Chinnerd1230312013-11-01 15:27:19 +1100137DECLARE_EVENT_CLASS(xfs_ag_class,
138 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
139 TP_ARGS(mp, agno),
140 TP_STRUCT__entry(
141 __field(dev_t, dev)
142 __field(xfs_agnumber_t, agno)
143 ),
144 TP_fast_assign(
145 __entry->dev = mp->m_super->s_dev;
146 __entry->agno = agno;
147 ),
148 TP_printk("dev %d:%d agno %u",
149 MAJOR(__entry->dev), MINOR(__entry->dev),
150 __entry->agno)
151);
152#define DEFINE_AG_EVENT(name) \
153DEFINE_EVENT(xfs_ag_class, name, \
154 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
155 TP_ARGS(mp, agno))
156
157DEFINE_AG_EVENT(xfs_read_agf);
158DEFINE_AG_EVENT(xfs_alloc_read_agf);
159DEFINE_AG_EVENT(xfs_read_agi);
160DEFINE_AG_EVENT(xfs_ialloc_read_agi);
161
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000162TRACE_EVENT(xfs_attr_list_node_descend,
163 TP_PROTO(struct xfs_attr_list_context *ctx,
164 struct xfs_da_node_entry *btree),
165 TP_ARGS(ctx, btree),
166 TP_STRUCT__entry(
167 __field(dev_t, dev)
168 __field(xfs_ino_t, ino)
169 __field(u32, hashval)
170 __field(u32, blkno)
171 __field(u32, offset)
172 __field(void *, alist)
173 __field(int, bufsize)
174 __field(int, count)
175 __field(int, firstu)
176 __field(int, dupcnt)
177 __field(int, flags)
178 __field(u32, bt_hashval)
179 __field(u32, bt_before)
180 ),
181 TP_fast_assign(
182 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
183 __entry->ino = ctx->dp->i_ino;
184 __entry->hashval = ctx->cursor->hashval;
185 __entry->blkno = ctx->cursor->blkno;
186 __entry->offset = ctx->cursor->offset;
187 __entry->alist = ctx->alist;
188 __entry->bufsize = ctx->bufsize;
189 __entry->count = ctx->count;
190 __entry->firstu = ctx->firstu;
191 __entry->flags = ctx->flags;
192 __entry->bt_hashval = be32_to_cpu(btree->hashval);
193 __entry->bt_before = be32_to_cpu(btree->before);
194 ),
195 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 -0800196 "alist %p size %u count %u firstu %u flags %d %s "
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000197 "node hashval %u, node before %u",
198 MAJOR(__entry->dev), MINOR(__entry->dev),
199 __entry->ino,
200 __entry->hashval,
201 __entry->blkno,
202 __entry->offset,
203 __entry->dupcnt,
204 __entry->alist,
205 __entry->bufsize,
206 __entry->count,
207 __entry->firstu,
208 __entry->flags,
209 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
210 __entry->bt_hashval,
211 __entry->bt_before)
212);
213
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000214DECLARE_EVENT_CLASS(xfs_bmap_class,
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700215 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000216 unsigned long caller_ip),
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700217 TP_ARGS(ip, cur, state, caller_ip),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000218 TP_STRUCT__entry(
219 __field(dev_t, dev)
220 __field(xfs_ino_t, ino)
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700221 __field(void *, leaf);
222 __field(int, pos);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000223 __field(xfs_fileoff_t, startoff)
224 __field(xfs_fsblock_t, startblock)
225 __field(xfs_filblks_t, blockcount)
226 __field(xfs_exntst_t, state)
227 __field(int, bmap_state)
228 __field(unsigned long, caller_ip)
229 ),
230 TP_fast_assign(
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700231 struct xfs_ifork *ifp;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000232 struct xfs_bmbt_irec r;
233
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700234 ifp = xfs_iext_state_to_fork(ip, state);
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700235 xfs_iext_get_extent(ifp, cur, &r);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000236 __entry->dev = VFS_I(ip)->i_sb->s_dev;
237 __entry->ino = ip->i_ino;
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700238 __entry->leaf = cur->leaf;
239 __entry->pos = cur->pos;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000240 __entry->startoff = r.br_startoff;
241 __entry->startblock = r.br_startblock;
242 __entry->blockcount = r.br_blockcount;
243 __entry->state = r.br_state;
244 __entry->bmap_state = state;
245 __entry->caller_ip = caller_ip;
246 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -0800247 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800248 "offset %lld block %lld count %lld flag %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000249 MAJOR(__entry->dev), MINOR(__entry->dev),
250 __entry->ino,
251 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700252 __entry->leaf,
253 __entry->pos,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000254 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -0700255 (int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000256 __entry->blockcount,
257 __entry->state,
258 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000259)
260
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000261#define DEFINE_BMAP_EVENT(name) \
262DEFINE_EVENT(xfs_bmap_class, name, \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700263 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000264 unsigned long caller_ip), \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700265 TP_ARGS(ip, cur, state, caller_ip))
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700266DEFINE_BMAP_EVENT(xfs_iext_insert);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000267DEFINE_BMAP_EVENT(xfs_iext_remove);
268DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
269DEFINE_BMAP_EVENT(xfs_bmap_post_update);
Christoph Hellwige8e0e172017-10-19 11:06:29 -0700270DEFINE_BMAP_EVENT(xfs_read_extent);
271DEFINE_BMAP_EVENT(xfs_write_extent);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000272
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000273DECLARE_EVENT_CLASS(xfs_buf_class,
274 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
275 TP_ARGS(bp, caller_ip),
276 TP_STRUCT__entry(
277 __field(dev_t, dev)
278 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000279 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000280 __field(int, hold)
281 __field(int, pincount)
282 __field(unsigned, lockval)
283 __field(unsigned, flags)
284 __field(unsigned long, caller_ip)
285 ),
286 TP_fast_assign(
287 __entry->dev = bp->b_target->bt_dev;
Dave Chinnerd61fa8c2018-11-19 13:31:07 -0800288 if (bp->b_bn == XFS_BUF_DADDR_NULL)
289 __entry->bno = bp->b_maps[0].bm_bn;
290 else
291 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000292 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000293 __entry->hold = atomic_read(&bp->b_hold);
294 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200295 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000296 __entry->flags = bp->b_flags;
297 __entry->caller_ip = caller_ip;
298 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000299 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800300 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000301 MAJOR(__entry->dev), MINOR(__entry->dev),
302 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000303 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000304 __entry->hold,
305 __entry->pincount,
306 __entry->lockval,
307 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
308 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000309)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000310
311#define DEFINE_BUF_EVENT(name) \
312DEFINE_EVENT(xfs_buf_class, name, \
313 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
314 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000315DEFINE_BUF_EVENT(xfs_buf_init);
316DEFINE_BUF_EVENT(xfs_buf_free);
317DEFINE_BUF_EVENT(xfs_buf_hold);
318DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000319DEFINE_BUF_EVENT(xfs_buf_iodone);
Dave Chinner595bff72014-10-02 09:05:14 +1000320DEFINE_BUF_EVENT(xfs_buf_submit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000321DEFINE_BUF_EVENT(xfs_buf_lock);
322DEFINE_BUF_EVENT(xfs_buf_lock_done);
Darrick J. Wong479c6412016-06-21 11:53:28 +1000323DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200324DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000325DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000326DEFINE_BUF_EVENT(xfs_buf_iowait);
327DEFINE_BUF_EVENT(xfs_buf_iowait_done);
328DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000329DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000330DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Brian Foster7912e7f2017-06-14 21:21:45 -0700331DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
Dave Chinner686865f2010-09-24 20:07:47 +1000332DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000333DEFINE_BUF_EVENT(xfs_buf_item_relse);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000334DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
335DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100336DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000337DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
338
339/* not really buffer traces, but the buf provides useful information */
340DEFINE_BUF_EVENT(xfs_btree_corrupt);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000341DEFINE_BUF_EVENT(xfs_reset_dqcounts);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000342
343/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000344DECLARE_EVENT_CLASS(xfs_buf_flags_class,
345 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
346 TP_ARGS(bp, flags, caller_ip),
347 TP_STRUCT__entry(
348 __field(dev_t, dev)
349 __field(xfs_daddr_t, bno)
350 __field(size_t, buffer_length)
351 __field(int, hold)
352 __field(int, pincount)
353 __field(unsigned, lockval)
354 __field(unsigned, flags)
355 __field(unsigned long, caller_ip)
356 ),
357 TP_fast_assign(
358 __entry->dev = bp->b_target->bt_dev;
359 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000360 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000361 __entry->flags = flags;
362 __entry->hold = atomic_read(&bp->b_hold);
363 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200364 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000365 __entry->caller_ip = caller_ip;
366 ),
367 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800368 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000369 MAJOR(__entry->dev), MINOR(__entry->dev),
370 (unsigned long long)__entry->bno,
371 __entry->buffer_length,
372 __entry->hold,
373 __entry->pincount,
374 __entry->lockval,
375 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
376 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000377)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000378
379#define DEFINE_BUF_FLAGS_EVENT(name) \
380DEFINE_EVENT(xfs_buf_flags_class, name, \
381 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
382 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000383DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
384DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
385DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
386
387TRACE_EVENT(xfs_buf_ioerror,
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800388 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000389 TP_ARGS(bp, error, caller_ip),
390 TP_STRUCT__entry(
391 __field(dev_t, dev)
392 __field(xfs_daddr_t, bno)
393 __field(size_t, buffer_length)
394 __field(unsigned, flags)
395 __field(int, hold)
396 __field(int, pincount)
397 __field(unsigned, lockval)
398 __field(int, error)
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800399 __field(xfs_failaddr_t, caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000400 ),
401 TP_fast_assign(
402 __entry->dev = bp->b_target->bt_dev;
403 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000404 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000405 __entry->hold = atomic_read(&bp->b_hold);
406 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200407 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000408 __entry->error = error;
409 __entry->flags = bp->b_flags;
410 __entry->caller_ip = caller_ip;
411 ),
412 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800413 "lock %d error %d flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000414 MAJOR(__entry->dev), MINOR(__entry->dev),
415 (unsigned long long)__entry->bno,
416 __entry->buffer_length,
417 __entry->hold,
418 __entry->pincount,
419 __entry->lockval,
420 __entry->error,
421 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
422 (void *)__entry->caller_ip)
423);
424
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000425DECLARE_EVENT_CLASS(xfs_buf_item_class,
426 TP_PROTO(struct xfs_buf_log_item *bip),
427 TP_ARGS(bip),
428 TP_STRUCT__entry(
429 __field(dev_t, dev)
430 __field(xfs_daddr_t, buf_bno)
431 __field(size_t, buf_len)
432 __field(int, buf_hold)
433 __field(int, buf_pincount)
434 __field(int, buf_lockval)
435 __field(unsigned, buf_flags)
436 __field(unsigned, bli_recur)
437 __field(int, bli_refcount)
438 __field(unsigned, bli_flags)
Dave Chinner22525c12018-05-09 07:47:34 -0700439 __field(unsigned long, li_flags)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000440 ),
441 TP_fast_assign(
442 __entry->dev = bip->bli_buf->b_target->bt_dev;
443 __entry->bli_flags = bip->bli_flags;
444 __entry->bli_recur = bip->bli_recur;
445 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
446 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000447 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000448 __entry->buf_flags = bip->bli_buf->b_flags;
449 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
450 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200451 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000452 __entry->li_flags = bip->bli_item.li_flags;
453 ),
454 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
455 "lock %d flags %s recur %d refcount %d bliflags %s "
Dave Chinnere6631f82018-05-09 07:49:37 -0700456 "liflags %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000457 MAJOR(__entry->dev), MINOR(__entry->dev),
458 (unsigned long long)__entry->buf_bno,
459 __entry->buf_len,
460 __entry->buf_hold,
461 __entry->buf_pincount,
462 __entry->buf_lockval,
463 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
464 __entry->bli_recur,
465 __entry->bli_refcount,
466 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000467 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000468)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000469
470#define DEFINE_BUF_ITEM_EVENT(name) \
471DEFINE_EVENT(xfs_buf_item_class, name, \
472 TP_PROTO(struct xfs_buf_log_item *bip), \
473 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000474DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000475DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000476DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
477DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
478DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000479DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000480DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
481DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
482DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwigddf92052019-06-28 19:27:32 -0700483DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000484DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
485DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
486DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
487DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
488DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
489DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
490DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
491DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
492DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
493DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
494DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
495DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
496DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
497DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
498
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000499DECLARE_EVENT_CLASS(xfs_filestream_class,
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700500 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno),
501 TP_ARGS(mp, ino, agno),
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000502 TP_STRUCT__entry(
503 __field(dev_t, dev)
504 __field(xfs_ino_t, ino)
505 __field(xfs_agnumber_t, agno)
506 __field(int, streams)
507 ),
508 TP_fast_assign(
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700509 __entry->dev = mp->m_super->s_dev;
510 __entry->ino = ino;
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000511 __entry->agno = agno;
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700512 __entry->streams = xfs_filestream_peek_ag(mp, agno);
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000513 ),
514 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
515 MAJOR(__entry->dev), MINOR(__entry->dev),
516 __entry->ino,
517 __entry->agno,
518 __entry->streams)
519)
520#define DEFINE_FILESTREAM_EVENT(name) \
521DEFINE_EVENT(xfs_filestream_class, name, \
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700522 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \
523 TP_ARGS(mp, ino, agno))
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000524DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
525DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
526DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
527
528TRACE_EVENT(xfs_filestream_pick,
529 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
530 xfs_extlen_t free, int nscan),
531 TP_ARGS(ip, agno, free, nscan),
532 TP_STRUCT__entry(
533 __field(dev_t, dev)
534 __field(xfs_ino_t, ino)
535 __field(xfs_agnumber_t, agno)
536 __field(int, streams)
537 __field(xfs_extlen_t, free)
538 __field(int, nscan)
539 ),
540 TP_fast_assign(
541 __entry->dev = VFS_I(ip)->i_sb->s_dev;
542 __entry->ino = ip->i_ino;
543 __entry->agno = agno;
544 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
545 __entry->free = free;
546 __entry->nscan = nscan;
547 ),
548 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
549 MAJOR(__entry->dev), MINOR(__entry->dev),
550 __entry->ino,
551 __entry->agno,
552 __entry->streams,
553 __entry->free,
554 __entry->nscan)
555);
556
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000557DECLARE_EVENT_CLASS(xfs_lock_class,
558 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
559 unsigned long caller_ip),
560 TP_ARGS(ip, lock_flags, caller_ip),
561 TP_STRUCT__entry(
562 __field(dev_t, dev)
563 __field(xfs_ino_t, ino)
564 __field(int, lock_flags)
565 __field(unsigned long, caller_ip)
566 ),
567 TP_fast_assign(
568 __entry->dev = VFS_I(ip)->i_sb->s_dev;
569 __entry->ino = ip->i_ino;
570 __entry->lock_flags = lock_flags;
571 __entry->caller_ip = caller_ip;
572 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800573 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000574 MAJOR(__entry->dev), MINOR(__entry->dev),
575 __entry->ino,
576 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
577 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000578)
579
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000580#define DEFINE_LOCK_EVENT(name) \
581DEFINE_EVENT(xfs_lock_class, name, \
582 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
583 unsigned long caller_ip), \
584 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000585DEFINE_LOCK_EVENT(xfs_ilock);
586DEFINE_LOCK_EVENT(xfs_ilock_nowait);
587DEFINE_LOCK_EVENT(xfs_ilock_demote);
588DEFINE_LOCK_EVENT(xfs_iunlock);
589
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000590DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000591 TP_PROTO(struct xfs_inode *ip),
592 TP_ARGS(ip),
593 TP_STRUCT__entry(
594 __field(dev_t, dev)
595 __field(xfs_ino_t, ino)
596 ),
597 TP_fast_assign(
598 __entry->dev = VFS_I(ip)->i_sb->s_dev;
599 __entry->ino = ip->i_ino;
600 ),
601 TP_printk("dev %d:%d ino 0x%llx",
602 MAJOR(__entry->dev), MINOR(__entry->dev),
603 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000604)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000605
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000606#define DEFINE_INODE_EVENT(name) \
607DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000608 TP_PROTO(struct xfs_inode *ip), \
609 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000610DEFINE_INODE_EVENT(xfs_iget_skip);
611DEFINE_INODE_EVENT(xfs_iget_reclaim);
612DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
613DEFINE_INODE_EVENT(xfs_iget_hit);
614DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000615
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000616DEFINE_INODE_EVENT(xfs_getattr);
617DEFINE_INODE_EVENT(xfs_setattr);
618DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500619DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000620DEFINE_INODE_EVENT(xfs_alloc_file_space);
621DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000622DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100623DEFINE_INODE_EVENT(xfs_collapse_file_space);
Namjae Jeona904b1c2015-03-25 15:08:56 +1100624DEFINE_INODE_EVENT(xfs_insert_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000625DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000626#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200627DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000628#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000629DEFINE_INODE_EVENT(xfs_vm_bmap);
630DEFINE_INODE_EVENT(xfs_file_ioctl);
631DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
632DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000633DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000634DEFINE_INODE_EVENT(xfs_file_fsync);
635DEFINE_INODE_EVENT(xfs_destroy_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400636DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000637
638DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
639DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
640
Brian Foster27b52862012-11-06 09:50:38 -0500641DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
642DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500643DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700644DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
645DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
646DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500647
Darrick J. Wong85f8dff2018-12-18 14:32:29 -0800648/*
649 * ftrace's __print_symbolic requires that all enum values be wrapped in the
650 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
651 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
652 * code.
653 */
654TRACE_DEFINE_ENUM(PE_SIZE_PTE);
655TRACE_DEFINE_ENUM(PE_SIZE_PMD);
656TRACE_DEFINE_ENUM(PE_SIZE_PUD);
657
Christoph Hellwigd522d562017-08-29 10:08:41 -0700658TRACE_EVENT(xfs_filemap_fault,
659 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
660 bool write_fault),
661 TP_ARGS(ip, pe_size, write_fault),
662 TP_STRUCT__entry(
663 __field(dev_t, dev)
664 __field(xfs_ino_t, ino)
665 __field(enum page_entry_size, pe_size)
666 __field(bool, write_fault)
667 ),
668 TP_fast_assign(
669 __entry->dev = VFS_I(ip)->i_sb->s_dev;
670 __entry->ino = ip->i_ino;
671 __entry->pe_size = pe_size;
672 __entry->write_fault = write_fault;
673 ),
674 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
675 MAJOR(__entry->dev), MINOR(__entry->dev),
676 __entry->ino,
677 __print_symbolic(__entry->pe_size,
678 { PE_SIZE_PTE, "PTE" },
679 { PE_SIZE_PMD, "PMD" },
680 { PE_SIZE_PUD, "PUD" }),
681 __entry->write_fault)
682)
683
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000684DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000685 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
686 TP_ARGS(ip, caller_ip),
687 TP_STRUCT__entry(
688 __field(dev_t, dev)
689 __field(xfs_ino_t, ino)
690 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100691 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000692 __field(unsigned long, caller_ip)
693 ),
694 TP_fast_assign(
695 __entry->dev = VFS_I(ip)->i_sb->s_dev;
696 __entry->ino = ip->i_ino;
697 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100698 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000699 __entry->caller_ip = caller_ip;
700 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800701 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000702 MAJOR(__entry->dev), MINOR(__entry->dev),
703 __entry->ino,
704 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100705 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000706 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000707)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000708
Brian Foster19cb7e32013-03-18 10:51:48 -0400709TRACE_EVENT(xfs_iomap_prealloc_size,
710 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
711 unsigned int writeio_blocks),
712 TP_ARGS(ip, blocks, shift, writeio_blocks),
713 TP_STRUCT__entry(
714 __field(dev_t, dev)
715 __field(xfs_ino_t, ino)
716 __field(xfs_fsblock_t, blocks)
717 __field(int, shift)
718 __field(unsigned int, writeio_blocks)
719 ),
720 TP_fast_assign(
721 __entry->dev = VFS_I(ip)->i_sb->s_dev;
722 __entry->ino = ip->i_ino;
723 __entry->blocks = blocks;
724 __entry->shift = shift;
725 __entry->writeio_blocks = writeio_blocks;
726 ),
727 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
728 "m_writeio_blocks %u",
729 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
730 __entry->blocks, __entry->shift, __entry->writeio_blocks)
731)
732
Brian Foster56d11152015-05-29 09:18:32 +1000733TRACE_EVENT(xfs_irec_merge_pre,
734 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
735 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
736 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
737 TP_STRUCT__entry(
738 __field(dev_t, dev)
739 __field(xfs_agnumber_t, agno)
740 __field(xfs_agino_t, agino)
741 __field(uint16_t, holemask)
742 __field(xfs_agino_t, nagino)
743 __field(uint16_t, nholemask)
744 ),
745 TP_fast_assign(
746 __entry->dev = mp->m_super->s_dev;
747 __entry->agno = agno;
748 __entry->agino = agino;
749 __entry->holemask = holemask;
750 __entry->nagino = nagino;
751 __entry->nholemask = holemask;
752 ),
753 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
754 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
755 __entry->agino, __entry->holemask, __entry->nagino,
756 __entry->nholemask)
757)
758
759TRACE_EVENT(xfs_irec_merge_post,
760 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
761 uint16_t holemask),
762 TP_ARGS(mp, agno, agino, holemask),
763 TP_STRUCT__entry(
764 __field(dev_t, dev)
765 __field(xfs_agnumber_t, agno)
766 __field(xfs_agino_t, agino)
767 __field(uint16_t, holemask)
768 ),
769 TP_fast_assign(
770 __entry->dev = mp->m_super->s_dev;
771 __entry->agno = agno;
772 __entry->agino = agino;
773 __entry->holemask = holemask;
774 ),
775 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
776 MINOR(__entry->dev), __entry->agno, __entry->agino,
777 __entry->holemask)
778)
779
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000780#define DEFINE_IREF_EVENT(name) \
781DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000782 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
783 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000784DEFINE_IREF_EVENT(xfs_irele);
785DEFINE_IREF_EVENT(xfs_inode_pin);
786DEFINE_IREF_EVENT(xfs_inode_unpin);
787DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100788
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000789DECLARE_EVENT_CLASS(xfs_namespace_class,
790 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
791 TP_ARGS(dp, name),
792 TP_STRUCT__entry(
793 __field(dev_t, dev)
794 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000795 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000796 __dynamic_array(char, name, name->len)
797 ),
798 TP_fast_assign(
799 __entry->dev = VFS_I(dp)->i_sb->s_dev;
800 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000801 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000802 memcpy(__get_str(name), name->name, name->len);
803 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000804 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000805 MAJOR(__entry->dev), MINOR(__entry->dev),
806 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000807 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000808 __get_str(name))
809)
810
811#define DEFINE_NAMESPACE_EVENT(name) \
812DEFINE_EVENT(xfs_namespace_class, name, \
813 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
814 TP_ARGS(dp, name))
815DEFINE_NAMESPACE_EVENT(xfs_remove);
816DEFINE_NAMESPACE_EVENT(xfs_link);
817DEFINE_NAMESPACE_EVENT(xfs_lookup);
818DEFINE_NAMESPACE_EVENT(xfs_create);
819DEFINE_NAMESPACE_EVENT(xfs_symlink);
820
821TRACE_EVENT(xfs_rename,
822 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
823 struct xfs_name *src_name, struct xfs_name *target_name),
824 TP_ARGS(src_dp, target_dp, src_name, target_name),
825 TP_STRUCT__entry(
826 __field(dev_t, dev)
827 __field(xfs_ino_t, src_dp_ino)
828 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000829 __field(int, src_namelen)
830 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000831 __dynamic_array(char, src_name, src_name->len)
832 __dynamic_array(char, target_name, target_name->len)
833 ),
834 TP_fast_assign(
835 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
836 __entry->src_dp_ino = src_dp->i_ino;
837 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000838 __entry->src_namelen = src_name->len;
839 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000840 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000841 memcpy(__get_str(target_name), target_name->name,
842 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000843 ),
844 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000845 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000846 MAJOR(__entry->dev), MINOR(__entry->dev),
847 __entry->src_dp_ino,
848 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000849 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000850 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000851 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000852 __get_str(target_name))
853)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000854
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000855DECLARE_EVENT_CLASS(xfs_dquot_class,
856 TP_PROTO(struct xfs_dquot *dqp),
857 TP_ARGS(dqp),
858 TP_STRUCT__entry(
859 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000860 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000861 __field(unsigned, flags)
862 __field(unsigned, nrefs)
863 __field(unsigned long long, res_bcount)
864 __field(unsigned long long, bcount)
865 __field(unsigned long long, icount)
866 __field(unsigned long long, blk_hardlimit)
867 __field(unsigned long long, blk_softlimit)
868 __field(unsigned long long, ino_hardlimit)
869 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000870 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000871 TP_fast_assign(
872 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000873 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000874 __entry->flags = dqp->dq_flags;
875 __entry->nrefs = dqp->q_nrefs;
876 __entry->res_bcount = dqp->q_res_bcount;
877 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
878 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
879 __entry->blk_hardlimit =
880 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
881 __entry->blk_softlimit =
882 be64_to_cpu(dqp->q_core.d_blk_softlimit);
883 __entry->ino_hardlimit =
884 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
885 __entry->ino_softlimit =
886 be64_to_cpu(dqp->q_core.d_ino_softlimit);
887 ),
888 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000889 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
890 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000891 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000892 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000893 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
894 __entry->nrefs,
895 __entry->res_bcount,
896 __entry->bcount,
897 __entry->blk_hardlimit,
898 __entry->blk_softlimit,
899 __entry->icount,
900 __entry->ino_hardlimit,
901 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000902)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000903
904#define DEFINE_DQUOT_EVENT(name) \
905DEFINE_EVENT(xfs_dquot_class, name, \
906 TP_PROTO(struct xfs_dquot *dqp), \
907 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000908DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000909DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
910DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000911DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
912DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000913DEFINE_DQUOT_EVENT(xfs_dqattach_found);
914DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000915DEFINE_DQUOT_EVENT(xfs_dqalloc);
916DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
917DEFINE_DQUOT_EVENT(xfs_dqread);
918DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000919DEFINE_DQUOT_EVENT(xfs_dqget_hit);
920DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000921DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
922DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000923DEFINE_DQUOT_EVENT(xfs_dqput);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000924DEFINE_DQUOT_EVENT(xfs_dqput_free);
925DEFINE_DQUOT_EVENT(xfs_dqrele);
926DEFINE_DQUOT_EVENT(xfs_dqflush);
927DEFINE_DQUOT_EVENT(xfs_dqflush_force);
928DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000929
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000930DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500931 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000932 TP_ARGS(log, tic),
933 TP_STRUCT__entry(
934 __field(dev_t, dev)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000935 __field(char, ocnt)
936 __field(char, cnt)
937 __field(int, curr_res)
938 __field(int, unit_res)
939 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100940 __field(int, reserveq)
941 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000942 __field(int, grant_reserve_cycle)
943 __field(int, grant_reserve_bytes)
944 __field(int, grant_write_cycle)
945 __field(int, grant_write_bytes)
946 __field(int, curr_cycle)
947 __field(int, curr_block)
948 __field(xfs_lsn_t, tail_lsn)
949 ),
950 TP_fast_assign(
951 __entry->dev = log->l_mp->m_super->s_dev;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000952 __entry->ocnt = tic->t_ocnt;
953 __entry->cnt = tic->t_cnt;
954 __entry->curr_res = tic->t_curr_res;
955 __entry->unit_res = tic->t_unit_res;
956 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000957 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
958 __entry->writeq = list_empty(&log->l_write_head.waiters);
959 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100960 &__entry->grant_reserve_cycle,
961 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000962 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100963 &__entry->grant_write_cycle,
964 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000965 __entry->curr_cycle = log->l_curr_cycle;
966 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100967 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000968 ),
Christoph Hellwig710b1e22016-04-06 09:20:36 +1000969 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100970 "t_unit_res %u t_flags %s reserveq %s "
971 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000972 "grant_reserve_bytes %d grant_write_cycle %d "
973 "grant_write_bytes %d curr_cycle %d curr_block %d "
974 "tail_cycle %d tail_block %d",
975 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000976 __entry->ocnt,
977 __entry->cnt,
978 __entry->curr_res,
979 __entry->unit_res,
980 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100981 __entry->reserveq ? "empty" : "active",
982 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000983 __entry->grant_reserve_cycle,
984 __entry->grant_reserve_bytes,
985 __entry->grant_write_cycle,
986 __entry->grant_write_bytes,
987 __entry->curr_cycle,
988 __entry->curr_block,
989 CYCLE_LSN(__entry->tail_lsn),
990 BLOCK_LSN(__entry->tail_lsn)
991 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000992)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000993
994#define DEFINE_LOGGRANT_EVENT(name) \
995DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -0500996 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000997 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000998DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
999DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001000DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +00001001DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1002DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +11001003DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +00001004DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1005DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1006DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1007DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001008DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1009DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1010DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1011DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1012DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1013DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1014
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001015DECLARE_EVENT_CLASS(xfs_log_item_class,
1016 TP_PROTO(struct xfs_log_item *lip),
1017 TP_ARGS(lip),
1018 TP_STRUCT__entry(
1019 __field(dev_t, dev)
1020 __field(void *, lip)
1021 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001022 __field(unsigned long, flags)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001023 __field(xfs_lsn_t, lsn)
1024 ),
1025 TP_fast_assign(
1026 __entry->dev = lip->li_mountp->m_super->s_dev;
1027 __entry->lip = lip;
1028 __entry->type = lip->li_type;
1029 __entry->flags = lip->li_flags;
1030 __entry->lsn = lip->li_lsn;
1031 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001032 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001033 MAJOR(__entry->dev), MINOR(__entry->dev),
1034 __entry->lip,
1035 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1036 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1037 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1038)
1039
Dave Chinner14c26c62012-04-24 16:33:31 +10001040TRACE_EVENT(xfs_log_force,
Carlos Maiolino9f278892016-04-06 09:46:30 +10001041 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1042 TP_ARGS(mp, lsn, caller_ip),
Dave Chinner14c26c62012-04-24 16:33:31 +10001043 TP_STRUCT__entry(
1044 __field(dev_t, dev)
1045 __field(xfs_lsn_t, lsn)
Carlos Maiolino9f278892016-04-06 09:46:30 +10001046 __field(unsigned long, caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001047 ),
1048 TP_fast_assign(
1049 __entry->dev = mp->m_super->s_dev;
1050 __entry->lsn = lsn;
Carlos Maiolino9f278892016-04-06 09:46:30 +10001051 __entry->caller_ip = caller_ip;
Dave Chinner14c26c62012-04-24 16:33:31 +10001052 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001053 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
Dave Chinner14c26c62012-04-24 16:33:31 +10001054 MAJOR(__entry->dev), MINOR(__entry->dev),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001055 __entry->lsn, (void *)__entry->caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001056)
1057
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001058#define DEFINE_LOG_ITEM_EVENT(name) \
1059DEFINE_EVENT(xfs_log_item_class, name, \
1060 TP_PROTO(struct xfs_log_item *lip), \
1061 TP_ARGS(lip))
1062DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001063DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1064DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001065DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001066
Dave Chinner750b9c92013-11-01 15:27:18 +11001067DECLARE_EVENT_CLASS(xfs_ail_class,
1068 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1069 TP_ARGS(lip, old_lsn, new_lsn),
1070 TP_STRUCT__entry(
1071 __field(dev_t, dev)
1072 __field(void *, lip)
1073 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001074 __field(unsigned long, flags)
Dave Chinner750b9c92013-11-01 15:27:18 +11001075 __field(xfs_lsn_t, old_lsn)
1076 __field(xfs_lsn_t, new_lsn)
1077 ),
1078 TP_fast_assign(
1079 __entry->dev = lip->li_mountp->m_super->s_dev;
1080 __entry->lip = lip;
1081 __entry->type = lip->li_type;
1082 __entry->flags = lip->li_flags;
1083 __entry->old_lsn = old_lsn;
1084 __entry->new_lsn = new_lsn;
1085 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001086 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 +11001087 MAJOR(__entry->dev), MINOR(__entry->dev),
1088 __entry->lip,
1089 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1090 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1091 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1092 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1093)
1094
1095#define DEFINE_AIL_EVENT(name) \
1096DEFINE_EVENT(xfs_ail_class, name, \
1097 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1098 TP_ARGS(lip, old_lsn, new_lsn))
1099DEFINE_AIL_EVENT(xfs_ail_insert);
1100DEFINE_AIL_EVENT(xfs_ail_move);
1101DEFINE_AIL_EVENT(xfs_ail_delete);
1102
1103TRACE_EVENT(xfs_log_assign_tail_lsn,
1104 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1105 TP_ARGS(log, new_lsn),
1106 TP_STRUCT__entry(
1107 __field(dev_t, dev)
1108 __field(xfs_lsn_t, new_lsn)
1109 __field(xfs_lsn_t, old_lsn)
1110 __field(xfs_lsn_t, last_sync_lsn)
1111 ),
1112 TP_fast_assign(
1113 __entry->dev = log->l_mp->m_super->s_dev;
1114 __entry->new_lsn = new_lsn;
1115 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1116 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1117 ),
1118 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1119 MAJOR(__entry->dev), MINOR(__entry->dev),
1120 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1121 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1122 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1123)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001124
Li Zefanf8adb4d2010-05-24 08:25:57 +00001125DECLARE_EVENT_CLASS(xfs_file_class,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001126 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1127 TP_ARGS(ip, count, offset),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001128 TP_STRUCT__entry(
1129 __field(dev_t, dev)
1130 __field(xfs_ino_t, ino)
1131 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001132 __field(loff_t, offset)
1133 __field(size_t, count)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001134 ),
1135 TP_fast_assign(
1136 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1137 __entry->ino = ip->i_ino;
1138 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001139 __entry->offset = offset;
1140 __entry->count = count;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001141 ),
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001142 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001143 MAJOR(__entry->dev), MINOR(__entry->dev),
1144 __entry->ino,
1145 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001146 __entry->offset,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001147 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001148)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001149
1150#define DEFINE_RW_EVENT(name) \
1151DEFINE_EVENT(xfs_file_class, name, \
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001152 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1153 TP_ARGS(ip, count, offset))
1154DEFINE_RW_EVENT(xfs_file_buffered_read);
1155DEFINE_RW_EVENT(xfs_file_direct_read);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001156DEFINE_RW_EVENT(xfs_file_dax_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001157DEFINE_RW_EVENT(xfs_file_buffered_write);
1158DEFINE_RW_EVENT(xfs_file_direct_write);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001159DEFINE_RW_EVENT(xfs_file_dax_write);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001160
Christoph Hellwiga206c812010-12-10 08:42:20 +00001161DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001162 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001163 int whichfork, struct xfs_bmbt_irec *irec),
1164 TP_ARGS(ip, offset, count, whichfork, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001165 TP_STRUCT__entry(
1166 __field(dev_t, dev)
1167 __field(xfs_ino_t, ino)
1168 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001169 __field(loff_t, offset)
1170 __field(size_t, count)
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001171 __field(int, whichfork)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001172 __field(xfs_fileoff_t, startoff)
1173 __field(xfs_fsblock_t, startblock)
1174 __field(xfs_filblks_t, blockcount)
1175 ),
1176 TP_fast_assign(
1177 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1178 __entry->ino = ip->i_ino;
1179 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001180 __entry->offset = offset;
1181 __entry->count = count;
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001182 __entry->whichfork = whichfork;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001183 __entry->startoff = irec ? irec->br_startoff : 0;
1184 __entry->startblock = irec ? irec->br_startblock : 0;
1185 __entry->blockcount = irec ? irec->br_blockcount : 0;
1186 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001187 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001188 "fork %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001189 MAJOR(__entry->dev), MINOR(__entry->dev),
1190 __entry->ino,
1191 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001192 __entry->offset,
1193 __entry->count,
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001194 __entry->whichfork == XFS_COW_FORK ? "cow" : "data",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001195 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07001196 (int64_t)__entry->startblock,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001197 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001198)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001199
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001200#define DEFINE_IMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001201DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001202 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001203 int whichfork, struct xfs_bmbt_irec *irec), \
1204 TP_ARGS(ip, offset, count, whichfork, irec))
1205DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1206DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1207DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1208DEFINE_IMAP_EVENT(xfs_iomap_found);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001209
Li Zefanf8adb4d2010-05-24 08:25:57 +00001210DECLARE_EVENT_CLASS(xfs_simple_io_class,
1211 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1212 TP_ARGS(ip, offset, count),
1213 TP_STRUCT__entry(
1214 __field(dev_t, dev)
1215 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001216 __field(loff_t, isize)
1217 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001218 __field(loff_t, offset)
1219 __field(size_t, count)
1220 ),
1221 TP_fast_assign(
1222 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1223 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001224 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001225 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001226 __entry->offset = offset;
1227 __entry->count = count;
1228 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001229 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001230 "offset 0x%llx count %zd",
1231 MAJOR(__entry->dev), MINOR(__entry->dev),
1232 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001233 __entry->isize,
1234 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001235 __entry->offset,
1236 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001237);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001238
1239#define DEFINE_SIMPLE_IO_EVENT(name) \
1240DEFINE_EVENT(xfs_simple_io_class, name, \
1241 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1242 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001243DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1244DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001245DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Brian Foster0a50f162015-10-12 16:02:08 +11001246DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001247DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1248DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1249DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001250
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001251DECLARE_EVENT_CLASS(xfs_itrunc_class,
1252 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1253 TP_ARGS(ip, new_size),
1254 TP_STRUCT__entry(
1255 __field(dev_t, dev)
1256 __field(xfs_ino_t, ino)
1257 __field(xfs_fsize_t, size)
1258 __field(xfs_fsize_t, new_size)
1259 ),
1260 TP_fast_assign(
1261 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1262 __entry->ino = ip->i_ino;
1263 __entry->size = ip->i_d.di_size;
1264 __entry->new_size = new_size;
1265 ),
1266 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1267 MAJOR(__entry->dev), MINOR(__entry->dev),
1268 __entry->ino,
1269 __entry->size,
1270 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001271)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001272
1273#define DEFINE_ITRUNC_EVENT(name) \
1274DEFINE_EVENT(xfs_itrunc_class, name, \
1275 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1276 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001277DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1278DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001279
1280TRACE_EVENT(xfs_pagecache_inval,
1281 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1282 TP_ARGS(ip, start, finish),
1283 TP_STRUCT__entry(
1284 __field(dev_t, dev)
1285 __field(xfs_ino_t, ino)
1286 __field(xfs_fsize_t, size)
1287 __field(xfs_off_t, start)
1288 __field(xfs_off_t, finish)
1289 ),
1290 TP_fast_assign(
1291 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1292 __entry->ino = ip->i_ino;
1293 __entry->size = ip->i_d.di_size;
1294 __entry->start = start;
1295 __entry->finish = finish;
1296 ),
1297 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1298 MAJOR(__entry->dev), MINOR(__entry->dev),
1299 __entry->ino,
1300 __entry->size,
1301 __entry->start,
1302 __entry->finish)
1303);
1304
1305TRACE_EVENT(xfs_bunmap,
1306 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1307 int flags, unsigned long caller_ip),
1308 TP_ARGS(ip, bno, len, flags, caller_ip),
1309 TP_STRUCT__entry(
1310 __field(dev_t, dev)
1311 __field(xfs_ino_t, ino)
1312 __field(xfs_fsize_t, size)
1313 __field(xfs_fileoff_t, bno)
1314 __field(xfs_filblks_t, len)
1315 __field(unsigned long, caller_ip)
1316 __field(int, flags)
1317 ),
1318 TP_fast_assign(
1319 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1320 __entry->ino = ip->i_ino;
1321 __entry->size = ip->i_d.di_size;
1322 __entry->bno = bno;
1323 __entry->len = len;
1324 __entry->caller_ip = caller_ip;
1325 __entry->flags = flags;
1326 ),
1327 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 -08001328 "flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001329 MAJOR(__entry->dev), MINOR(__entry->dev),
1330 __entry->ino,
1331 __entry->size,
1332 __entry->bno,
1333 __entry->len,
1334 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1335 (void *)__entry->caller_ip)
1336
1337);
1338
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001339DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001340 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1341 xfs_agblock_t agbno, xfs_extlen_t len),
1342 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001343 TP_STRUCT__entry(
1344 __field(dev_t, dev)
1345 __field(xfs_agnumber_t, agno)
1346 __field(xfs_agblock_t, agbno)
1347 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001348 ),
1349 TP_fast_assign(
1350 __entry->dev = mp->m_super->s_dev;
1351 __entry->agno = agno;
1352 __entry->agbno = agbno;
1353 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001354 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001355 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001356 MAJOR(__entry->dev), MINOR(__entry->dev),
1357 __entry->agno,
1358 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001359 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001360);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001361#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001362DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001363 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1364 xfs_agblock_t agbno, xfs_extlen_t len), \
1365 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001366DEFINE_BUSY_EVENT(xfs_extent_busy);
1367DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1368DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1369DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1370DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001371
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001372TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001373 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1374 xfs_agblock_t agbno, xfs_extlen_t len,
1375 xfs_agblock_t tbno, xfs_extlen_t tlen),
1376 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1377 TP_STRUCT__entry(
1378 __field(dev_t, dev)
1379 __field(xfs_agnumber_t, agno)
1380 __field(xfs_agblock_t, agbno)
1381 __field(xfs_extlen_t, len)
1382 __field(xfs_agblock_t, tbno)
1383 __field(xfs_extlen_t, tlen)
1384 ),
1385 TP_fast_assign(
1386 __entry->dev = mp->m_super->s_dev;
1387 __entry->agno = agno;
1388 __entry->agbno = agbno;
1389 __entry->len = len;
1390 __entry->tbno = tbno;
1391 __entry->tlen = tlen;
1392 ),
1393 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1394 MAJOR(__entry->dev), MINOR(__entry->dev),
1395 __entry->agno,
1396 __entry->agbno,
1397 __entry->len,
1398 __entry->tbno,
1399 __entry->tlen)
1400);
1401
Brian Fostera27ba262018-03-15 10:51:58 -07001402DECLARE_EVENT_CLASS(xfs_agf_class,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001403 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1404 unsigned long caller_ip),
1405 TP_ARGS(mp, agf, flags, caller_ip),
1406 TP_STRUCT__entry(
1407 __field(dev_t, dev)
1408 __field(xfs_agnumber_t, agno)
1409 __field(int, flags)
1410 __field(__u32, length)
1411 __field(__u32, bno_root)
1412 __field(__u32, cnt_root)
1413 __field(__u32, bno_level)
1414 __field(__u32, cnt_level)
1415 __field(__u32, flfirst)
1416 __field(__u32, fllast)
1417 __field(__u32, flcount)
1418 __field(__u32, freeblks)
1419 __field(__u32, longest)
1420 __field(unsigned long, caller_ip)
1421 ),
1422 TP_fast_assign(
1423 __entry->dev = mp->m_super->s_dev;
1424 __entry->agno = be32_to_cpu(agf->agf_seqno),
1425 __entry->flags = flags;
1426 __entry->length = be32_to_cpu(agf->agf_length),
1427 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1428 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1429 __entry->bno_level =
1430 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1431 __entry->cnt_level =
1432 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1433 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1434 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1435 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1436 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1437 __entry->longest = be32_to_cpu(agf->agf_longest);
1438 __entry->caller_ip = caller_ip;
1439 ),
1440 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1441 "levels b %u c %u flfirst %u fllast %u flcount %u "
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001442 "freeblks %u longest %u caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001443 MAJOR(__entry->dev), MINOR(__entry->dev),
1444 __entry->agno,
1445 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1446 __entry->length,
1447 __entry->bno_root,
1448 __entry->cnt_root,
1449 __entry->bno_level,
1450 __entry->cnt_level,
1451 __entry->flfirst,
1452 __entry->fllast,
1453 __entry->flcount,
1454 __entry->freeblks,
1455 __entry->longest,
1456 (void *)__entry->caller_ip)
1457);
Brian Fostera27ba262018-03-15 10:51:58 -07001458#define DEFINE_AGF_EVENT(name) \
1459DEFINE_EVENT(xfs_agf_class, name, \
1460 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1461 unsigned long caller_ip), \
1462 TP_ARGS(mp, agf, flags, caller_ip))
1463DEFINE_AGF_EVENT(xfs_agf);
1464DEFINE_AGF_EVENT(xfs_agfl_reset);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001465
1466TRACE_EVENT(xfs_free_extent,
1467 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001468 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1469 int haveright),
1470 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001471 TP_STRUCT__entry(
1472 __field(dev_t, dev)
1473 __field(xfs_agnumber_t, agno)
1474 __field(xfs_agblock_t, agbno)
1475 __field(xfs_extlen_t, len)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001476 __field(int, resv)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001477 __field(int, haveleft)
1478 __field(int, haveright)
1479 ),
1480 TP_fast_assign(
1481 __entry->dev = mp->m_super->s_dev;
1482 __entry->agno = agno;
1483 __entry->agbno = agbno;
1484 __entry->len = len;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001485 __entry->resv = resv;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001486 __entry->haveleft = haveleft;
1487 __entry->haveright = haveright;
1488 ),
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001489 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001490 MAJOR(__entry->dev), MINOR(__entry->dev),
1491 __entry->agno,
1492 __entry->agbno,
1493 __entry->len,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001494 __entry->resv,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001495 __entry->haveleft ?
1496 (__entry->haveright ? "both" : "left") :
1497 (__entry->haveright ? "right" : "none"))
1498
1499);
1500
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001501DECLARE_EVENT_CLASS(xfs_alloc_class,
1502 TP_PROTO(struct xfs_alloc_arg *args),
1503 TP_ARGS(args),
1504 TP_STRUCT__entry(
1505 __field(dev_t, dev)
1506 __field(xfs_agnumber_t, agno)
1507 __field(xfs_agblock_t, agbno)
1508 __field(xfs_extlen_t, minlen)
1509 __field(xfs_extlen_t, maxlen)
1510 __field(xfs_extlen_t, mod)
1511 __field(xfs_extlen_t, prod)
1512 __field(xfs_extlen_t, minleft)
1513 __field(xfs_extlen_t, total)
1514 __field(xfs_extlen_t, alignment)
1515 __field(xfs_extlen_t, minalignslop)
1516 __field(xfs_extlen_t, len)
1517 __field(short, type)
1518 __field(short, otype)
1519 __field(char, wasdel)
1520 __field(char, wasfromfl)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001521 __field(int, resv)
Dave Chinner292378e2016-09-26 08:21:28 +10001522 __field(int, datatype)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001523 __field(xfs_fsblock_t, firstblock)
1524 ),
1525 TP_fast_assign(
1526 __entry->dev = args->mp->m_super->s_dev;
1527 __entry->agno = args->agno;
1528 __entry->agbno = args->agbno;
1529 __entry->minlen = args->minlen;
1530 __entry->maxlen = args->maxlen;
1531 __entry->mod = args->mod;
1532 __entry->prod = args->prod;
1533 __entry->minleft = args->minleft;
1534 __entry->total = args->total;
1535 __entry->alignment = args->alignment;
1536 __entry->minalignslop = args->minalignslop;
1537 __entry->len = args->len;
1538 __entry->type = args->type;
1539 __entry->otype = args->otype;
1540 __entry->wasdel = args->wasdel;
1541 __entry->wasfromfl = args->wasfromfl;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001542 __entry->resv = args->resv;
Dave Chinner292378e2016-09-26 08:21:28 +10001543 __entry->datatype = args->datatype;
Brian Foster64396ff2018-07-11 22:26:30 -07001544 __entry->firstblock = args->tp->t_firstblock;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001545 ),
1546 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1547 "prod %u minleft %u total %u alignment %u minalignslop %u "
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001548 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
Dave Chinner292378e2016-09-26 08:21:28 +10001549 "datatype 0x%x firstblock 0x%llx",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001550 MAJOR(__entry->dev), MINOR(__entry->dev),
1551 __entry->agno,
1552 __entry->agbno,
1553 __entry->minlen,
1554 __entry->maxlen,
1555 __entry->mod,
1556 __entry->prod,
1557 __entry->minleft,
1558 __entry->total,
1559 __entry->alignment,
1560 __entry->minalignslop,
1561 __entry->len,
1562 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1563 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1564 __entry->wasdel,
1565 __entry->wasfromfl,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001566 __entry->resv,
Dave Chinner292378e2016-09-26 08:21:28 +10001567 __entry->datatype,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001568 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001569)
1570
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001571#define DEFINE_ALLOC_EVENT(name) \
1572DEFINE_EVENT(xfs_alloc_class, name, \
1573 TP_PROTO(struct xfs_alloc_arg *args), \
1574 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001575DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001576DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001577DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1578DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1579DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
Brian Fosterd2968822019-10-13 17:10:35 -07001580DEFINE_ALLOC_EVENT(xfs_alloc_cur);
Brian Fosterfec0afd2019-10-13 17:10:33 -07001581DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
1582DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001583DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001584DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1585DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001586DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1587DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1588DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1589DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1590DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001591DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001592DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1593DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1594DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1595DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1596DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1597DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1598DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1599DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1600DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1601
Brian Foster396bbf32019-10-13 17:10:33 -07001602TRACE_EVENT(xfs_alloc_cur_check,
1603 TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
1604 xfs_extlen_t len, xfs_extlen_t diff, bool new),
1605 TP_ARGS(mp, btnum, bno, len, diff, new),
1606 TP_STRUCT__entry(
1607 __field(dev_t, dev)
1608 __field(xfs_btnum_t, btnum)
1609 __field(xfs_agblock_t, bno)
1610 __field(xfs_extlen_t, len)
1611 __field(xfs_extlen_t, diff)
1612 __field(bool, new)
1613 ),
1614 TP_fast_assign(
1615 __entry->dev = mp->m_super->s_dev;
1616 __entry->btnum = btnum;
1617 __entry->bno = bno;
1618 __entry->len = len;
1619 __entry->diff = diff;
1620 __entry->new = new;
1621 ),
1622 TP_printk("dev %d:%d btree %s bno 0x%x len 0x%x diff 0x%x new %d",
1623 MAJOR(__entry->dev), MINOR(__entry->dev),
1624 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
1625 __entry->bno, __entry->len, __entry->diff, __entry->new)
1626)
1627
Dave Chinner5a5881c2012-03-22 05:15:13 +00001628DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001629 TP_PROTO(struct xfs_da_args *args),
1630 TP_ARGS(args),
1631 TP_STRUCT__entry(
1632 __field(dev_t, dev)
1633 __field(xfs_ino_t, ino)
1634 __dynamic_array(char, name, args->namelen)
1635 __field(int, namelen)
1636 __field(xfs_dahash_t, hashval)
1637 __field(xfs_ino_t, inumber)
1638 __field(int, op_flags)
1639 ),
1640 TP_fast_assign(
1641 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1642 __entry->ino = args->dp->i_ino;
1643 if (args->namelen)
1644 memcpy(__get_str(name), args->name, args->namelen);
1645 __entry->namelen = args->namelen;
1646 __entry->hashval = args->hashval;
1647 __entry->inumber = args->inumber;
1648 __entry->op_flags = args->op_flags;
1649 ),
1650 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1651 "inumber 0x%llx op_flags %s",
1652 MAJOR(__entry->dev), MINOR(__entry->dev),
1653 __entry->ino,
1654 __entry->namelen,
1655 __entry->namelen ? __get_str(name) : NULL,
1656 __entry->namelen,
1657 __entry->hashval,
1658 __entry->inumber,
1659 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001660)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001661
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001662#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001663DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001664 TP_PROTO(struct xfs_da_args *args), \
1665 TP_ARGS(args))
1666DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1667DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1668DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1669DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1670DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1671DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1672DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1673DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1674DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1675DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1676DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1677DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1678DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1679DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1680DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1681DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1682DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1683DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1684DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1685DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1686DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1687DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1688DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1689DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1690DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1691
Dave Chinneree732592012-11-12 22:53:53 +11001692DECLARE_EVENT_CLASS(xfs_attr_class,
1693 TP_PROTO(struct xfs_da_args *args),
1694 TP_ARGS(args),
1695 TP_STRUCT__entry(
1696 __field(dev_t, dev)
1697 __field(xfs_ino_t, ino)
1698 __dynamic_array(char, name, args->namelen)
1699 __field(int, namelen)
1700 __field(int, valuelen)
1701 __field(xfs_dahash_t, hashval)
Eric Sandeene4435232018-04-17 17:17:35 -07001702 __field(int, flags)
Dave Chinneree732592012-11-12 22:53:53 +11001703 __field(int, op_flags)
1704 ),
1705 TP_fast_assign(
1706 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1707 __entry->ino = args->dp->i_ino;
1708 if (args->namelen)
1709 memcpy(__get_str(name), args->name, args->namelen);
1710 __entry->namelen = args->namelen;
1711 __entry->valuelen = args->valuelen;
1712 __entry->hashval = args->hashval;
Eric Sandeene4435232018-04-17 17:17:35 -07001713 __entry->flags = args->flags;
Dave Chinneree732592012-11-12 22:53:53 +11001714 __entry->op_flags = args->op_flags;
1715 ),
1716 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
Eric Sandeene4435232018-04-17 17:17:35 -07001717 "hashval 0x%x flags %s op_flags %s",
Dave Chinneree732592012-11-12 22:53:53 +11001718 MAJOR(__entry->dev), MINOR(__entry->dev),
1719 __entry->ino,
1720 __entry->namelen,
1721 __entry->namelen ? __get_str(name) : NULL,
1722 __entry->namelen,
1723 __entry->valuelen,
1724 __entry->hashval,
Eric Sandeene4435232018-04-17 17:17:35 -07001725 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
Dave Chinneree732592012-11-12 22:53:53 +11001726 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1727)
1728
Dave Chinner5a5881c2012-03-22 05:15:13 +00001729#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001730DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001731 TP_PROTO(struct xfs_da_args *args), \
1732 TP_ARGS(args))
1733DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1734DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1735DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1736DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1737DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001738DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1739
1740DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1741DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1742DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001743DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001744DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1745DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001746DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1747DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001748DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1749DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001750DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001751DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1752DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1753DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1754DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1755DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1756DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1757DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1758DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1759DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1760DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1761DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001762DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001763
1764DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001765DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001766DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1767DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1768
Dave Chinneree732592012-11-12 22:53:53 +11001769DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1770DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1771
1772DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1773DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1774DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1775
Dave Chinner5a5881c2012-03-22 05:15:13 +00001776#define DEFINE_DA_EVENT(name) \
1777DEFINE_EVENT(xfs_da_class, name, \
1778 TP_PROTO(struct xfs_da_args *args), \
1779 TP_ARGS(args))
1780DEFINE_DA_EVENT(xfs_da_split);
1781DEFINE_DA_EVENT(xfs_da_join);
1782DEFINE_DA_EVENT(xfs_da_link_before);
1783DEFINE_DA_EVENT(xfs_da_link_after);
1784DEFINE_DA_EVENT(xfs_da_unlink_back);
1785DEFINE_DA_EVENT(xfs_da_unlink_forward);
1786DEFINE_DA_EVENT(xfs_da_root_split);
1787DEFINE_DA_EVENT(xfs_da_root_join);
1788DEFINE_DA_EVENT(xfs_da_node_add);
1789DEFINE_DA_EVENT(xfs_da_node_create);
1790DEFINE_DA_EVENT(xfs_da_node_split);
1791DEFINE_DA_EVENT(xfs_da_node_remove);
1792DEFINE_DA_EVENT(xfs_da_node_rebalance);
1793DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001794DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001795DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1796DEFINE_DA_EVENT(xfs_da_grow_inode);
1797DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001798DEFINE_DA_EVENT(xfs_da_fixhashpath);
1799DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001800
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001801DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1802 TP_PROTO(struct xfs_da_args *args, int idx),
1803 TP_ARGS(args, idx),
1804 TP_STRUCT__entry(
1805 __field(dev_t, dev)
1806 __field(xfs_ino_t, ino)
1807 __field(int, op_flags)
1808 __field(int, idx)
1809 ),
1810 TP_fast_assign(
1811 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1812 __entry->ino = args->dp->i_ino;
1813 __entry->op_flags = args->op_flags;
1814 __entry->idx = idx;
1815 ),
1816 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1817 MAJOR(__entry->dev), MINOR(__entry->dev),
1818 __entry->ino,
1819 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1820 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001821)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001822
1823#define DEFINE_DIR2_SPACE_EVENT(name) \
1824DEFINE_EVENT(xfs_dir2_space_class, name, \
1825 TP_PROTO(struct xfs_da_args *args, int idx), \
1826 TP_ARGS(args, idx))
1827DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1828DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1829DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1830DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001831
1832TRACE_EVENT(xfs_dir2_leafn_moveents,
1833 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1834 TP_ARGS(args, src_idx, dst_idx, count),
1835 TP_STRUCT__entry(
1836 __field(dev_t, dev)
1837 __field(xfs_ino_t, ino)
1838 __field(int, op_flags)
1839 __field(int, src_idx)
1840 __field(int, dst_idx)
1841 __field(int, count)
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->src_idx = src_idx;
1848 __entry->dst_idx = dst_idx;
1849 __entry->count = count;
1850 ),
1851 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1852 "src_idx %d dst_idx %d count %d",
1853 MAJOR(__entry->dev), MINOR(__entry->dev),
1854 __entry->ino,
1855 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1856 __entry->src_idx,
1857 __entry->dst_idx,
1858 __entry->count)
1859);
1860
Dave Chinner3a85cd92010-01-14 01:33:55 +00001861#define XFS_SWAPEXT_INODES \
1862 { 0, "target" }, \
1863 { 1, "temp" }
1864
Darrick J. Wong0357d212018-12-18 14:32:30 -08001865TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
1866TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
1867TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
1868TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
1869TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
Dave Chinner3a85cd92010-01-14 01:33:55 +00001870
1871DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1872 TP_PROTO(struct xfs_inode *ip, int which),
1873 TP_ARGS(ip, which),
1874 TP_STRUCT__entry(
1875 __field(dev_t, dev)
1876 __field(int, which)
1877 __field(xfs_ino_t, ino)
1878 __field(int, format)
1879 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001880 __field(int, broot_size)
1881 __field(int, fork_off)
1882 ),
1883 TP_fast_assign(
1884 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1885 __entry->which = which;
1886 __entry->ino = ip->i_ino;
1887 __entry->format = ip->i_d.di_format;
1888 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001889 __entry->broot_size = ip->i_df.if_broot_bytes;
1890 __entry->fork_off = XFS_IFORK_BOFF(ip);
1891 ),
1892 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001893 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001894 MAJOR(__entry->dev), MINOR(__entry->dev),
1895 __entry->ino,
1896 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1897 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1898 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001899 __entry->broot_size,
1900 __entry->fork_off)
1901)
1902
1903#define DEFINE_SWAPEXT_EVENT(name) \
1904DEFINE_EVENT(xfs_swap_extent_class, name, \
1905 TP_PROTO(struct xfs_inode *ip, int which), \
1906 TP_ARGS(ip, which))
1907
1908DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1909DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1910
Brian Fostere67d3d42017-08-08 18:21:53 -07001911TRACE_EVENT(xfs_log_recover,
1912 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
1913 TP_ARGS(log, headblk, tailblk),
1914 TP_STRUCT__entry(
1915 __field(dev_t, dev)
1916 __field(xfs_daddr_t, headblk)
1917 __field(xfs_daddr_t, tailblk)
1918 ),
1919 TP_fast_assign(
1920 __entry->dev = log->l_mp->m_super->s_dev;
1921 __entry->headblk = headblk;
1922 __entry->tailblk = tailblk;
1923 ),
1924 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
1925 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
1926 __entry->tailblk)
1927)
1928
Brian Foster5cd9cee2016-09-26 08:34:52 +10001929TRACE_EVENT(xfs_log_recover_record,
1930 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
1931 TP_ARGS(log, rhead, pass),
1932 TP_STRUCT__entry(
1933 __field(dev_t, dev)
1934 __field(xfs_lsn_t, lsn)
1935 __field(int, len)
1936 __field(int, num_logops)
1937 __field(int, pass)
1938 ),
1939 TP_fast_assign(
1940 __entry->dev = log->l_mp->m_super->s_dev;
1941 __entry->lsn = be64_to_cpu(rhead->h_lsn);
1942 __entry->len = be32_to_cpu(rhead->h_len);
1943 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
1944 __entry->pass = pass;
1945 ),
1946 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
1947 MAJOR(__entry->dev), MINOR(__entry->dev),
1948 __entry->lsn, __entry->len, __entry->num_logops,
1949 __entry->pass)
1950)
1951
Dave Chinner9abbc532010-04-13 15:06:46 +10001952DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001953 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10001954 struct xlog_recover_item *item, int pass),
1955 TP_ARGS(log, trans, item, pass),
1956 TP_STRUCT__entry(
1957 __field(dev_t, dev)
1958 __field(unsigned long, item)
1959 __field(xlog_tid_t, tid)
Brian Foster5cd9cee2016-09-26 08:34:52 +10001960 __field(xfs_lsn_t, lsn)
Dave Chinner9abbc532010-04-13 15:06:46 +10001961 __field(int, type)
1962 __field(int, pass)
1963 __field(int, count)
1964 __field(int, total)
1965 ),
1966 TP_fast_assign(
1967 __entry->dev = log->l_mp->m_super->s_dev;
1968 __entry->item = (unsigned long)item;
1969 __entry->tid = trans->r_log_tid;
Brian Foster5cd9cee2016-09-26 08:34:52 +10001970 __entry->lsn = trans->r_lsn;
Dave Chinner9abbc532010-04-13 15:06:46 +10001971 __entry->type = ITEM_TYPE(item);
1972 __entry->pass = pass;
1973 __entry->count = item->ri_cnt;
1974 __entry->total = item->ri_total;
1975 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001976 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
Brian Foster5cd9cee2016-09-26 08:34:52 +10001977 "item type %s item region count/total %d/%d",
Dave Chinner9abbc532010-04-13 15:06:46 +10001978 MAJOR(__entry->dev), MINOR(__entry->dev),
1979 __entry->tid,
Brian Foster5cd9cee2016-09-26 08:34:52 +10001980 __entry->lsn,
Dave Chinner9abbc532010-04-13 15:06:46 +10001981 __entry->pass,
1982 (void *)__entry->item,
1983 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1984 __entry->count,
1985 __entry->total)
1986)
1987
1988#define DEFINE_LOG_RECOVER_ITEM(name) \
1989DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001990 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10001991 struct xlog_recover_item *item, int pass), \
1992 TP_ARGS(log, trans, item, pass))
1993
1994DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1995DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1996DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1997DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1998DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1999
2000DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002001 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002002 TP_ARGS(log, buf_f),
2003 TP_STRUCT__entry(
2004 __field(dev_t, dev)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002005 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002006 __field(unsigned short, len)
2007 __field(unsigned short, flags)
2008 __field(unsigned short, size)
2009 __field(unsigned int, map_size)
2010 ),
2011 TP_fast_assign(
2012 __entry->dev = log->l_mp->m_super->s_dev;
2013 __entry->blkno = buf_f->blf_blkno;
2014 __entry->len = buf_f->blf_len;
2015 __entry->flags = buf_f->blf_flags;
2016 __entry->size = buf_f->blf_size;
2017 __entry->map_size = buf_f->blf_map_size;
2018 ),
2019 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2020 "map_size %d",
2021 MAJOR(__entry->dev), MINOR(__entry->dev),
2022 __entry->blkno,
2023 __entry->len,
2024 __entry->flags,
2025 __entry->size,
2026 __entry->map_size)
2027)
2028
2029#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2030DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002031 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002032 TP_ARGS(log, buf_f))
2033
2034DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2035DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2036DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2037DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2038DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
Brian Foster5cd9cee2016-09-26 08:34:52 +10002039DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
Dave Chinner9abbc532010-04-13 15:06:46 +10002040DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2041DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2042DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2043
2044DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002045 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002046 TP_ARGS(log, in_f),
2047 TP_STRUCT__entry(
2048 __field(dev_t, dev)
2049 __field(xfs_ino_t, ino)
2050 __field(unsigned short, size)
2051 __field(int, fields)
2052 __field(unsigned short, asize)
2053 __field(unsigned short, dsize)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002054 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002055 __field(int, len)
2056 __field(int, boffset)
2057 ),
2058 TP_fast_assign(
2059 __entry->dev = log->l_mp->m_super->s_dev;
2060 __entry->ino = in_f->ilf_ino;
2061 __entry->size = in_f->ilf_size;
2062 __entry->fields = in_f->ilf_fields;
2063 __entry->asize = in_f->ilf_asize;
2064 __entry->dsize = in_f->ilf_dsize;
2065 __entry->blkno = in_f->ilf_blkno;
2066 __entry->len = in_f->ilf_len;
2067 __entry->boffset = in_f->ilf_boffset;
2068 ),
2069 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2070 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2071 MAJOR(__entry->dev), MINOR(__entry->dev),
2072 __entry->ino,
2073 __entry->size,
2074 __entry->fields,
2075 __entry->asize,
2076 __entry->dsize,
2077 __entry->blkno,
2078 __entry->len,
2079 __entry->boffset)
2080)
2081#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2082DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002083 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002084 TP_ARGS(log, in_f))
2085
2086DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2087DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2088DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2089
Brian Foster78d57e42015-08-19 09:58:48 +10002090DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2091 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2092 TP_ARGS(log, in_f),
2093 TP_STRUCT__entry(
2094 __field(dev_t, dev)
2095 __field(xfs_agnumber_t, agno)
2096 __field(xfs_agblock_t, agbno)
2097 __field(unsigned int, count)
2098 __field(unsigned int, isize)
2099 __field(xfs_agblock_t, length)
2100 __field(unsigned int, gen)
2101 ),
2102 TP_fast_assign(
2103 __entry->dev = log->l_mp->m_super->s_dev;
2104 __entry->agno = be32_to_cpu(in_f->icl_ag);
2105 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2106 __entry->count = be32_to_cpu(in_f->icl_count);
2107 __entry->isize = be32_to_cpu(in_f->icl_isize);
2108 __entry->length = be32_to_cpu(in_f->icl_length);
2109 __entry->gen = be32_to_cpu(in_f->icl_gen);
2110 ),
2111 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2112 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2113 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2114 __entry->length, __entry->gen)
2115)
2116#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2117DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2118 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2119 TP_ARGS(log, in_f))
2120
2121DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2122DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2123
Christoph Hellwiga46db602011-01-07 13:02:04 +00002124DECLARE_EVENT_CLASS(xfs_discard_class,
2125 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2126 xfs_agblock_t agbno, xfs_extlen_t len),
2127 TP_ARGS(mp, agno, agbno, len),
2128 TP_STRUCT__entry(
2129 __field(dev_t, dev)
2130 __field(xfs_agnumber_t, agno)
2131 __field(xfs_agblock_t, agbno)
2132 __field(xfs_extlen_t, len)
2133 ),
2134 TP_fast_assign(
2135 __entry->dev = mp->m_super->s_dev;
2136 __entry->agno = agno;
2137 __entry->agbno = agbno;
2138 __entry->len = len;
2139 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002140 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwiga46db602011-01-07 13:02:04 +00002141 MAJOR(__entry->dev), MINOR(__entry->dev),
2142 __entry->agno,
2143 __entry->agbno,
2144 __entry->len)
2145)
2146
2147#define DEFINE_DISCARD_EVENT(name) \
2148DEFINE_EVENT(xfs_discard_class, name, \
2149 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2150 xfs_agblock_t agbno, xfs_extlen_t len), \
2151 TP_ARGS(mp, agno, agbno, len))
2152DEFINE_DISCARD_EVENT(xfs_discard_extent);
2153DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2154DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2155DEFINE_DISCARD_EVENT(xfs_discard_busy);
2156
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002157/* btree cursor events */
Darrick J. Wongc4942132018-12-18 14:32:31 -08002158TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2159TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2160TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2161TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2162TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2163TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2164TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2165
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002166DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2167 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2168 TP_ARGS(cur, level, bp),
2169 TP_STRUCT__entry(
2170 __field(dev_t, dev)
2171 __field(xfs_btnum_t, btnum)
2172 __field(int, level)
2173 __field(int, nlevels)
2174 __field(int, ptr)
2175 __field(xfs_daddr_t, daddr)
2176 ),
2177 TP_fast_assign(
2178 __entry->dev = cur->bc_mp->m_super->s_dev;
2179 __entry->btnum = cur->bc_btnum;
2180 __entry->level = level;
2181 __entry->nlevels = cur->bc_nlevels;
2182 __entry->ptr = cur->bc_ptrs[level];
2183 __entry->daddr = bp ? bp->b_bn : -1;
2184 ),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002185 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002186 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002187 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002188 __entry->level,
2189 __entry->nlevels,
2190 __entry->ptr,
2191 (unsigned long long)__entry->daddr)
2192)
2193
2194#define DEFINE_BTREE_CUR_EVENT(name) \
2195DEFINE_EVENT(xfs_btree_cur_class, name, \
2196 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2197 TP_ARGS(cur, level, bp))
2198DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
Darrick J. Wong105f7d82016-08-03 11:10:21 +10002199DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002200
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002201/* deferred ops */
2202struct xfs_defer_pending;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002203
2204DECLARE_EVENT_CLASS(xfs_defer_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002205 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2206 TP_ARGS(tp, caller_ip),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002207 TP_STRUCT__entry(
2208 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002209 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002210 __field(char, committed)
Dave Chinnere632a562018-05-09 07:48:52 -07002211 __field(unsigned long, caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002212 ),
2213 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002214 __entry->dev = tp->t_mountp->m_super->s_dev;
2215 __entry->tp = tp;
Dave Chinnere632a562018-05-09 07:48:52 -07002216 __entry->caller_ip = caller_ip;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002217 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002218 TP_printk("dev %d:%d tp %p caller %pS",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002219 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002220 __entry->tp,
Dave Chinnere632a562018-05-09 07:48:52 -07002221 (char *)__entry->caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002222)
2223#define DEFINE_DEFER_EVENT(name) \
2224DEFINE_EVENT(xfs_defer_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002225 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2226 TP_ARGS(tp, caller_ip))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002227
2228DECLARE_EVENT_CLASS(xfs_defer_error_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002229 TP_PROTO(struct xfs_trans *tp, int error),
2230 TP_ARGS(tp, error),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002231 TP_STRUCT__entry(
2232 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002233 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002234 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002235 __field(int, error)
2236 ),
2237 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002238 __entry->dev = tp->t_mountp->m_super->s_dev;
2239 __entry->tp = tp;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002240 __entry->error = error;
2241 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002242 TP_printk("dev %d:%d tp %p err %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002243 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002244 __entry->tp,
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002245 __entry->error)
2246)
2247#define DEFINE_DEFER_ERROR_EVENT(name) \
2248DEFINE_EVENT(xfs_defer_error_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002249 TP_PROTO(struct xfs_trans *tp, int error), \
2250 TP_ARGS(tp, error))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002251
2252DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2253 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2254 TP_ARGS(mp, dfp),
2255 TP_STRUCT__entry(
2256 __field(dev_t, dev)
2257 __field(int, type)
2258 __field(void *, intent)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002259 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002260 __field(int, nr)
2261 ),
2262 TP_fast_assign(
2263 __entry->dev = mp ? mp->m_super->s_dev : 0;
Darrick J. Wong02b100f2018-12-12 08:46:22 -08002264 __entry->type = dfp->dfp_type;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002265 __entry->intent = dfp->dfp_intent;
Darrick J. Wongea78d802016-08-30 13:51:39 +10002266 __entry->committed = dfp->dfp_done != NULL;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002267 __entry->nr = dfp->dfp_count;
2268 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002269 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002270 MAJOR(__entry->dev), MINOR(__entry->dev),
2271 __entry->type,
2272 __entry->intent,
2273 __entry->committed,
2274 __entry->nr)
2275)
2276#define DEFINE_DEFER_PENDING_EVENT(name) \
2277DEFINE_EVENT(xfs_defer_pending_class, name, \
2278 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2279 TP_ARGS(mp, dfp))
2280
2281DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2282 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2283 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2284 TP_ARGS(mp, agno, type, agbno, len),
2285 TP_STRUCT__entry(
2286 __field(dev_t, dev)
2287 __field(xfs_agnumber_t, agno)
2288 __field(int, type)
2289 __field(xfs_agblock_t, agbno)
2290 __field(xfs_extlen_t, len)
2291 ),
2292 TP_fast_assign(
2293 __entry->dev = mp->m_super->s_dev;
2294 __entry->agno = agno;
2295 __entry->type = type;
2296 __entry->agbno = agbno;
2297 __entry->len = len;
2298 ),
2299 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2300 MAJOR(__entry->dev), MINOR(__entry->dev),
2301 __entry->type,
2302 __entry->agno,
2303 __entry->agbno,
2304 __entry->len)
2305);
2306#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2307DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2308 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2309 int type, \
2310 xfs_agblock_t bno, \
2311 xfs_extlen_t len), \
2312 TP_ARGS(mp, agno, type, bno, len))
2313
2314DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2315 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2316 int op,
2317 xfs_agblock_t agbno,
2318 xfs_ino_t ino,
2319 int whichfork,
2320 xfs_fileoff_t offset,
2321 xfs_filblks_t len,
2322 xfs_exntst_t state),
2323 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2324 TP_STRUCT__entry(
2325 __field(dev_t, dev)
2326 __field(xfs_agnumber_t, agno)
2327 __field(xfs_ino_t, ino)
2328 __field(xfs_agblock_t, agbno)
2329 __field(int, whichfork)
2330 __field(xfs_fileoff_t, l_loff)
2331 __field(xfs_filblks_t, l_len)
2332 __field(xfs_exntst_t, l_state)
2333 __field(int, op)
2334 ),
2335 TP_fast_assign(
2336 __entry->dev = mp->m_super->s_dev;
2337 __entry->agno = agno;
2338 __entry->ino = ino;
2339 __entry->agbno = agbno;
2340 __entry->whichfork = whichfork;
2341 __entry->l_loff = offset;
2342 __entry->l_len = len;
2343 __entry->l_state = state;
2344 __entry->op = op;
2345 ),
2346 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2347 MAJOR(__entry->dev), MINOR(__entry->dev),
2348 __entry->op,
2349 __entry->agno,
2350 __entry->agbno,
2351 __entry->ino,
2352 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2353 __entry->l_loff,
2354 __entry->l_len,
2355 __entry->l_state)
2356);
2357#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2358DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2359 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2360 int op, \
2361 xfs_agblock_t agbno, \
2362 xfs_ino_t ino, \
2363 int whichfork, \
2364 xfs_fileoff_t offset, \
2365 xfs_filblks_t len, \
2366 xfs_exntst_t state), \
2367 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2368
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002369DEFINE_DEFER_EVENT(xfs_defer_cancel);
2370DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2371DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2372DEFINE_DEFER_EVENT(xfs_defer_finish);
2373DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2374
2375DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2376DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002377
Brian Foster1ae093cb2018-08-01 07:20:34 -07002378DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2379DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002380DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2381DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2382
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002383#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2384DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2385DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
Brian Fosterf8f28352018-05-07 17:38:47 -07002386DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2387DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002388
Darrick J. Wong673930c2016-08-03 11:33:43 +10002389/* rmap tracepoints */
2390DECLARE_EVENT_CLASS(xfs_rmap_class,
2391 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2392 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
Darrick J. Wong66e32372018-12-12 08:46:23 -08002393 const struct xfs_owner_info *oinfo),
Darrick J. Wong673930c2016-08-03 11:33:43 +10002394 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2395 TP_STRUCT__entry(
2396 __field(dev_t, dev)
2397 __field(xfs_agnumber_t, agno)
2398 __field(xfs_agblock_t, agbno)
2399 __field(xfs_extlen_t, len)
2400 __field(uint64_t, owner)
2401 __field(uint64_t, offset)
2402 __field(unsigned long, flags)
2403 ),
2404 TP_fast_assign(
2405 __entry->dev = mp->m_super->s_dev;
2406 __entry->agno = agno;
2407 __entry->agbno = agbno;
2408 __entry->len = len;
2409 __entry->owner = oinfo->oi_owner;
2410 __entry->offset = oinfo->oi_offset;
2411 __entry->flags = oinfo->oi_flags;
Darrick J. Wong035e00a2016-08-03 11:36:07 +10002412 if (unwritten)
2413 __entry->flags |= XFS_RMAP_UNWRITTEN;
Darrick J. Wong673930c2016-08-03 11:33:43 +10002414 ),
2415 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2416 MAJOR(__entry->dev), MINOR(__entry->dev),
2417 __entry->agno,
2418 __entry->agbno,
2419 __entry->len,
2420 __entry->owner,
2421 __entry->offset,
2422 __entry->flags)
2423);
2424#define DEFINE_RMAP_EVENT(name) \
2425DEFINE_EVENT(xfs_rmap_class, name, \
2426 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2427 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
Darrick J. Wong66e32372018-12-12 08:46:23 -08002428 const struct xfs_owner_info *oinfo), \
Darrick J. Wong673930c2016-08-03 11:33:43 +10002429 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2430
2431/* simple AG-based error/%ip tracepoint class */
2432DECLARE_EVENT_CLASS(xfs_ag_error_class,
2433 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2434 unsigned long caller_ip),
2435 TP_ARGS(mp, agno, error, caller_ip),
2436 TP_STRUCT__entry(
2437 __field(dev_t, dev)
2438 __field(xfs_agnumber_t, agno)
2439 __field(int, error)
2440 __field(unsigned long, caller_ip)
2441 ),
2442 TP_fast_assign(
2443 __entry->dev = mp->m_super->s_dev;
2444 __entry->agno = agno;
2445 __entry->error = error;
2446 __entry->caller_ip = caller_ip;
2447 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08002448 TP_printk("dev %d:%d agno %u error %d caller %pS",
Darrick J. Wong673930c2016-08-03 11:33:43 +10002449 MAJOR(__entry->dev), MINOR(__entry->dev),
2450 __entry->agno,
2451 __entry->error,
2452 (char *)__entry->caller_ip)
2453);
2454
2455#define DEFINE_AG_ERROR_EVENT(name) \
2456DEFINE_EVENT(xfs_ag_error_class, name, \
2457 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2458 unsigned long caller_ip), \
2459 TP_ARGS(mp, agno, error, caller_ip))
2460
2461DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2462DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2463DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2464DEFINE_RMAP_EVENT(xfs_rmap_map);
2465DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2466DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002467DEFINE_RMAP_EVENT(xfs_rmap_convert);
2468DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2469DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2470DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
Darrick J. Wong673930c2016-08-03 11:33:43 +10002471
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002472DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2473 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2474 xfs_agblock_t agbno, xfs_extlen_t len,
2475 uint64_t owner, uint64_t offset, unsigned int flags),
2476 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2477 TP_STRUCT__entry(
2478 __field(dev_t, dev)
2479 __field(xfs_agnumber_t, agno)
2480 __field(xfs_agblock_t, agbno)
2481 __field(xfs_extlen_t, len)
2482 __field(uint64_t, owner)
2483 __field(uint64_t, offset)
2484 __field(unsigned int, flags)
2485 ),
2486 TP_fast_assign(
2487 __entry->dev = mp->m_super->s_dev;
2488 __entry->agno = agno;
2489 __entry->agbno = agbno;
2490 __entry->len = len;
2491 __entry->owner = owner;
2492 __entry->offset = offset;
2493 __entry->flags = flags;
2494 ),
2495 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2496 MAJOR(__entry->dev), MINOR(__entry->dev),
2497 __entry->agno,
2498 __entry->agbno,
2499 __entry->len,
2500 __entry->owner,
2501 __entry->offset,
2502 __entry->flags)
2503);
2504#define DEFINE_RMAPBT_EVENT(name) \
2505DEFINE_EVENT(xfs_rmapbt_class, name, \
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
2511#define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2512DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2513DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2514
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002515DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2516DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002517DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2518DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2519DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2520DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2521DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2522DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
Darrick J. Wongceeb9c82016-10-03 09:11:48 -07002523
2524DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2525DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2526DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2527DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
Darrick J. Wong0a1b0b32016-08-03 11:44:21 +10002528DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2529DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002530DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002531
Darrick J. Wong9f3afb52016-10-03 09:11:28 -07002532/* deferred bmbt updates */
2533#define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2534DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2535DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2536
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002537/* per-AG reservation */
2538DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2539 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2540 xfs_extlen_t len),
2541 TP_ARGS(pag, resv, len),
2542 TP_STRUCT__entry(
2543 __field(dev_t, dev)
2544 __field(xfs_agnumber_t, agno)
2545 __field(int, resv)
2546 __field(xfs_extlen_t, freeblks)
2547 __field(xfs_extlen_t, flcount)
2548 __field(xfs_extlen_t, reserved)
2549 __field(xfs_extlen_t, asked)
2550 __field(xfs_extlen_t, len)
2551 ),
2552 TP_fast_assign(
2553 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2554
2555 __entry->dev = pag->pag_mount->m_super->s_dev;
2556 __entry->agno = pag->pag_agno;
2557 __entry->resv = resv;
2558 __entry->freeblks = pag->pagf_freeblks;
2559 __entry->flcount = pag->pagf_flcount;
2560 __entry->reserved = r ? r->ar_reserved : 0;
2561 __entry->asked = r ? r->ar_asked : 0;
2562 __entry->len = len;
2563 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002564 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u "
2565 "resv %u ask %u len %u",
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002566 MAJOR(__entry->dev), MINOR(__entry->dev),
2567 __entry->agno,
2568 __entry->resv,
2569 __entry->freeblks,
2570 __entry->flcount,
2571 __entry->reserved,
2572 __entry->asked,
2573 __entry->len)
2574)
2575#define DEFINE_AG_RESV_EVENT(name) \
2576DEFINE_EVENT(xfs_ag_resv_class, name, \
2577 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2578 xfs_extlen_t len), \
2579 TP_ARGS(pag, type, len))
2580
2581/* per-AG reservation tracepoints */
2582DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2583DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2584DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2585DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2586DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2587DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2588
2589DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2590DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2591
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002592/* refcount tracepoint classes */
2593
2594/* reuse the discard trace class for agbno/aglen-based traces */
2595#define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2596
2597/* ag btree lookup tracepoint class */
Darrick J. Wong85f8dff2018-12-18 14:32:29 -08002598TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2599TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2600TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002601DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2602 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2603 xfs_agblock_t agbno, xfs_lookup_t dir),
2604 TP_ARGS(mp, agno, agbno, dir),
2605 TP_STRUCT__entry(
2606 __field(dev_t, dev)
2607 __field(xfs_agnumber_t, agno)
2608 __field(xfs_agblock_t, agbno)
2609 __field(xfs_lookup_t, dir)
2610 ),
2611 TP_fast_assign(
2612 __entry->dev = mp->m_super->s_dev;
2613 __entry->agno = agno;
2614 __entry->agbno = agbno;
2615 __entry->dir = dir;
2616 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002617 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002618 MAJOR(__entry->dev), MINOR(__entry->dev),
2619 __entry->agno,
2620 __entry->agbno,
2621 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2622 __entry->dir)
2623)
2624
2625#define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2626DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2627 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2628 xfs_agblock_t agbno, xfs_lookup_t dir), \
2629 TP_ARGS(mp, agno, agbno, dir))
2630
2631/* single-rcext tracepoint class */
2632DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2633 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2634 struct xfs_refcount_irec *irec),
2635 TP_ARGS(mp, agno, irec),
2636 TP_STRUCT__entry(
2637 __field(dev_t, dev)
2638 __field(xfs_agnumber_t, agno)
2639 __field(xfs_agblock_t, startblock)
2640 __field(xfs_extlen_t, blockcount)
2641 __field(xfs_nlink_t, refcount)
2642 ),
2643 TP_fast_assign(
2644 __entry->dev = mp->m_super->s_dev;
2645 __entry->agno = agno;
2646 __entry->startblock = irec->rc_startblock;
2647 __entry->blockcount = irec->rc_blockcount;
2648 __entry->refcount = irec->rc_refcount;
2649 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002650 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002651 MAJOR(__entry->dev), MINOR(__entry->dev),
2652 __entry->agno,
2653 __entry->startblock,
2654 __entry->blockcount,
2655 __entry->refcount)
2656)
2657
2658#define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2659DEFINE_EVENT(xfs_refcount_extent_class, name, \
2660 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2661 struct xfs_refcount_irec *irec), \
2662 TP_ARGS(mp, agno, irec))
2663
2664/* single-rcext and an agbno tracepoint class */
2665DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2666 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2667 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2668 TP_ARGS(mp, agno, irec, agbno),
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 __field(xfs_agblock_t, agbno)
2676 ),
2677 TP_fast_assign(
2678 __entry->dev = mp->m_super->s_dev;
2679 __entry->agno = agno;
2680 __entry->startblock = irec->rc_startblock;
2681 __entry->blockcount = irec->rc_blockcount;
2682 __entry->refcount = irec->rc_refcount;
2683 __entry->agbno = agbno;
2684 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002685 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002686 MAJOR(__entry->dev), MINOR(__entry->dev),
2687 __entry->agno,
2688 __entry->startblock,
2689 __entry->blockcount,
2690 __entry->refcount,
2691 __entry->agbno)
2692)
2693
2694#define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2695DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2696 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2697 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2698 TP_ARGS(mp, agno, irec, agbno))
2699
2700/* double-rcext tracepoint class */
2701DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2702 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2703 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2704 TP_ARGS(mp, agno, i1, i2),
2705 TP_STRUCT__entry(
2706 __field(dev_t, dev)
2707 __field(xfs_agnumber_t, agno)
2708 __field(xfs_agblock_t, i1_startblock)
2709 __field(xfs_extlen_t, i1_blockcount)
2710 __field(xfs_nlink_t, i1_refcount)
2711 __field(xfs_agblock_t, i2_startblock)
2712 __field(xfs_extlen_t, i2_blockcount)
2713 __field(xfs_nlink_t, i2_refcount)
2714 ),
2715 TP_fast_assign(
2716 __entry->dev = mp->m_super->s_dev;
2717 __entry->agno = agno;
2718 __entry->i1_startblock = i1->rc_startblock;
2719 __entry->i1_blockcount = i1->rc_blockcount;
2720 __entry->i1_refcount = i1->rc_refcount;
2721 __entry->i2_startblock = i2->rc_startblock;
2722 __entry->i2_blockcount = i2->rc_blockcount;
2723 __entry->i2_refcount = i2->rc_refcount;
2724 ),
2725 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002726 "agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002727 MAJOR(__entry->dev), MINOR(__entry->dev),
2728 __entry->agno,
2729 __entry->i1_startblock,
2730 __entry->i1_blockcount,
2731 __entry->i1_refcount,
2732 __entry->i2_startblock,
2733 __entry->i2_blockcount,
2734 __entry->i2_refcount)
2735)
2736
2737#define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2738DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2739 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2740 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2741 TP_ARGS(mp, agno, i1, i2))
2742
2743/* double-rcext and an agbno tracepoint class */
2744DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
2745 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2746 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2747 xfs_agblock_t agbno),
2748 TP_ARGS(mp, agno, i1, i2, agbno),
2749 TP_STRUCT__entry(
2750 __field(dev_t, dev)
2751 __field(xfs_agnumber_t, agno)
2752 __field(xfs_agblock_t, i1_startblock)
2753 __field(xfs_extlen_t, i1_blockcount)
2754 __field(xfs_nlink_t, i1_refcount)
2755 __field(xfs_agblock_t, i2_startblock)
2756 __field(xfs_extlen_t, i2_blockcount)
2757 __field(xfs_nlink_t, i2_refcount)
2758 __field(xfs_agblock_t, agbno)
2759 ),
2760 TP_fast_assign(
2761 __entry->dev = mp->m_super->s_dev;
2762 __entry->agno = agno;
2763 __entry->i1_startblock = i1->rc_startblock;
2764 __entry->i1_blockcount = i1->rc_blockcount;
2765 __entry->i1_refcount = i1->rc_refcount;
2766 __entry->i2_startblock = i2->rc_startblock;
2767 __entry->i2_blockcount = i2->rc_blockcount;
2768 __entry->i2_refcount = i2->rc_refcount;
2769 __entry->agbno = agbno;
2770 ),
2771 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002772 "agbno %u len %u refcount %u @ agbno %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002773 MAJOR(__entry->dev), MINOR(__entry->dev),
2774 __entry->agno,
2775 __entry->i1_startblock,
2776 __entry->i1_blockcount,
2777 __entry->i1_refcount,
2778 __entry->i2_startblock,
2779 __entry->i2_blockcount,
2780 __entry->i2_refcount,
2781 __entry->agbno)
2782)
2783
2784#define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2785DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2786 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2787 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2788 xfs_agblock_t agbno), \
2789 TP_ARGS(mp, agno, i1, i2, agbno))
2790
2791/* triple-rcext tracepoint class */
2792DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
2793 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2794 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2795 struct xfs_refcount_irec *i3),
2796 TP_ARGS(mp, agno, i1, i2, i3),
2797 TP_STRUCT__entry(
2798 __field(dev_t, dev)
2799 __field(xfs_agnumber_t, agno)
2800 __field(xfs_agblock_t, i1_startblock)
2801 __field(xfs_extlen_t, i1_blockcount)
2802 __field(xfs_nlink_t, i1_refcount)
2803 __field(xfs_agblock_t, i2_startblock)
2804 __field(xfs_extlen_t, i2_blockcount)
2805 __field(xfs_nlink_t, i2_refcount)
2806 __field(xfs_agblock_t, i3_startblock)
2807 __field(xfs_extlen_t, i3_blockcount)
2808 __field(xfs_nlink_t, i3_refcount)
2809 ),
2810 TP_fast_assign(
2811 __entry->dev = mp->m_super->s_dev;
2812 __entry->agno = agno;
2813 __entry->i1_startblock = i1->rc_startblock;
2814 __entry->i1_blockcount = i1->rc_blockcount;
2815 __entry->i1_refcount = i1->rc_refcount;
2816 __entry->i2_startblock = i2->rc_startblock;
2817 __entry->i2_blockcount = i2->rc_blockcount;
2818 __entry->i2_refcount = i2->rc_refcount;
2819 __entry->i3_startblock = i3->rc_startblock;
2820 __entry->i3_blockcount = i3->rc_blockcount;
2821 __entry->i3_refcount = i3->rc_refcount;
2822 ),
2823 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2824 "agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002825 "agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002826 MAJOR(__entry->dev), MINOR(__entry->dev),
2827 __entry->agno,
2828 __entry->i1_startblock,
2829 __entry->i1_blockcount,
2830 __entry->i1_refcount,
2831 __entry->i2_startblock,
2832 __entry->i2_blockcount,
2833 __entry->i2_refcount,
2834 __entry->i3_startblock,
2835 __entry->i3_blockcount,
2836 __entry->i3_refcount)
2837);
2838
2839#define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2840DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
2841 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2842 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2843 struct xfs_refcount_irec *i3), \
2844 TP_ARGS(mp, agno, i1, i2, i3))
2845
2846/* refcount btree tracepoints */
2847DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
2848DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
2849DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
2850DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
2851DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
2852DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
2853DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
2854DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
2855DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
2856DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
2857
2858/* refcount adjustment tracepoints */
2859DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
2860DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
Darrick J. Wong174edb02016-10-03 09:11:39 -07002861DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
2862DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002863DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
2864DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
Darrick J. Wong174edb02016-10-03 09:11:39 -07002865DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002866DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
2867DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
2868DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
2869DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
2870DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
2871DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
Darrick J. Wong174edb02016-10-03 09:11:39 -07002872DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002873DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
2874DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
2875DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
2876DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
2877DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
2878DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
2879DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
2880
2881/* reflink helpers */
2882DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
2883DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
2884DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
Darrick J. Wong33ba61292016-10-03 09:11:22 -07002885#define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2886DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
2887DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002888
Darrick J. Wongf997ee22016-10-03 09:11:21 -07002889TRACE_EVENT(xfs_refcount_finish_one_leftover,
2890 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2891 int type, xfs_agblock_t agbno, xfs_extlen_t len,
2892 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
2893 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
2894 TP_STRUCT__entry(
2895 __field(dev_t, dev)
2896 __field(xfs_agnumber_t, agno)
2897 __field(int, type)
2898 __field(xfs_agblock_t, agbno)
2899 __field(xfs_extlen_t, len)
2900 __field(xfs_agblock_t, new_agbno)
2901 __field(xfs_extlen_t, new_len)
2902 ),
2903 TP_fast_assign(
2904 __entry->dev = mp->m_super->s_dev;
2905 __entry->agno = agno;
2906 __entry->type = type;
2907 __entry->agbno = agbno;
2908 __entry->len = len;
2909 __entry->new_agbno = new_agbno;
2910 __entry->new_len = new_len;
2911 ),
2912 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
2913 MAJOR(__entry->dev), MINOR(__entry->dev),
2914 __entry->type,
2915 __entry->agno,
2916 __entry->agbno,
2917 __entry->len,
2918 __entry->new_agbno,
2919 __entry->new_len)
2920);
2921
Darrick J. Wongf65306e2016-10-03 09:11:27 -07002922/* simple inode-based error/%ip tracepoint class */
2923DECLARE_EVENT_CLASS(xfs_inode_error_class,
2924 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
2925 TP_ARGS(ip, error, caller_ip),
2926 TP_STRUCT__entry(
2927 __field(dev_t, dev)
2928 __field(xfs_ino_t, ino)
2929 __field(int, error)
2930 __field(unsigned long, caller_ip)
2931 ),
2932 TP_fast_assign(
2933 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2934 __entry->ino = ip->i_ino;
2935 __entry->error = error;
2936 __entry->caller_ip = caller_ip;
2937 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08002938 TP_printk("dev %d:%d ino %llx error %d caller %pS",
Darrick J. Wongf65306e2016-10-03 09:11:27 -07002939 MAJOR(__entry->dev), MINOR(__entry->dev),
2940 __entry->ino,
2941 __entry->error,
2942 (char *)__entry->caller_ip)
2943);
2944
2945#define DEFINE_INODE_ERROR_EVENT(name) \
2946DEFINE_EVENT(xfs_inode_error_class, name, \
2947 TP_PROTO(struct xfs_inode *ip, int error, \
2948 unsigned long caller_ip), \
2949 TP_ARGS(ip, error, caller_ip))
2950
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07002951/* reflink tracepoint classes */
2952
2953/* two-file io tracepoint class */
2954DECLARE_EVENT_CLASS(xfs_double_io_class,
2955 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
2956 struct xfs_inode *dest, xfs_off_t doffset),
2957 TP_ARGS(src, soffset, len, dest, doffset),
2958 TP_STRUCT__entry(
2959 __field(dev_t, dev)
2960 __field(xfs_ino_t, src_ino)
2961 __field(loff_t, src_isize)
2962 __field(loff_t, src_disize)
2963 __field(loff_t, src_offset)
2964 __field(size_t, len)
2965 __field(xfs_ino_t, dest_ino)
2966 __field(loff_t, dest_isize)
2967 __field(loff_t, dest_disize)
2968 __field(loff_t, dest_offset)
2969 ),
2970 TP_fast_assign(
2971 __entry->dev = VFS_I(src)->i_sb->s_dev;
2972 __entry->src_ino = src->i_ino;
2973 __entry->src_isize = VFS_I(src)->i_size;
2974 __entry->src_disize = src->i_d.di_size;
2975 __entry->src_offset = soffset;
2976 __entry->len = len;
2977 __entry->dest_ino = dest->i_ino;
2978 __entry->dest_isize = VFS_I(dest)->i_size;
2979 __entry->dest_disize = dest->i_d.di_size;
2980 __entry->dest_offset = doffset;
2981 ),
2982 TP_printk("dev %d:%d count %zd "
2983 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
2984 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
2985 MAJOR(__entry->dev), MINOR(__entry->dev),
2986 __entry->len,
2987 __entry->src_ino,
2988 __entry->src_isize,
2989 __entry->src_disize,
2990 __entry->src_offset,
2991 __entry->dest_ino,
2992 __entry->dest_isize,
2993 __entry->dest_disize,
2994 __entry->dest_offset)
2995)
2996
2997#define DEFINE_DOUBLE_IO_EVENT(name) \
2998DEFINE_EVENT(xfs_double_io_class, name, \
2999 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3000 struct xfs_inode *dest, xfs_off_t doffset), \
3001 TP_ARGS(src, soffset, len, dest, doffset))
3002
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003003/* inode/irec events */
3004DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3005 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3006 TP_ARGS(ip, irec),
3007 TP_STRUCT__entry(
3008 __field(dev_t, dev)
3009 __field(xfs_ino_t, ino)
3010 __field(xfs_fileoff_t, lblk)
3011 __field(xfs_extlen_t, len)
3012 __field(xfs_fsblock_t, pblk)
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003013 __field(int, state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003014 ),
3015 TP_fast_assign(
3016 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3017 __entry->ino = ip->i_ino;
3018 __entry->lblk = irec->br_startoff;
3019 __entry->len = irec->br_blockcount;
3020 __entry->pblk = irec->br_startblock;
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003021 __entry->state = irec->br_state;
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003022 ),
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003023 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 -07003024 MAJOR(__entry->dev), MINOR(__entry->dev),
3025 __entry->ino,
3026 __entry->lblk,
3027 __entry->len,
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003028 __entry->pblk,
3029 __entry->state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003030);
3031#define DEFINE_INODE_IREC_EVENT(name) \
3032DEFINE_EVENT(xfs_inode_irec_class, name, \
3033 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3034 TP_ARGS(ip, irec))
3035
3036/* refcount/reflink tracepoint definitions */
3037
3038/* reflink tracepoints */
3039DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3040DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3041DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08003042DEFINE_IMAP_EVENT(xfs_reflink_remap_imap);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003043TRACE_EVENT(xfs_reflink_remap_blocks_loop,
3044 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3045 xfs_filblks_t len, struct xfs_inode *dest,
3046 xfs_fileoff_t doffset),
3047 TP_ARGS(src, soffset, len, dest, doffset),
3048 TP_STRUCT__entry(
3049 __field(dev_t, dev)
3050 __field(xfs_ino_t, src_ino)
3051 __field(xfs_fileoff_t, src_lblk)
3052 __field(xfs_filblks_t, len)
3053 __field(xfs_ino_t, dest_ino)
3054 __field(xfs_fileoff_t, dest_lblk)
3055 ),
3056 TP_fast_assign(
3057 __entry->dev = VFS_I(src)->i_sb->s_dev;
3058 __entry->src_ino = src->i_ino;
3059 __entry->src_lblk = soffset;
3060 __entry->len = len;
3061 __entry->dest_ino = dest->i_ino;
3062 __entry->dest_lblk = doffset;
3063 ),
3064 TP_printk("dev %d:%d len 0x%llx "
3065 "ino 0x%llx offset 0x%llx blocks -> "
3066 "ino 0x%llx offset 0x%llx blocks",
3067 MAJOR(__entry->dev), MINOR(__entry->dev),
3068 __entry->len,
3069 __entry->src_ino,
3070 __entry->src_lblk,
3071 __entry->dest_ino,
3072 __entry->dest_lblk)
3073);
3074TRACE_EVENT(xfs_reflink_punch_range,
3075 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3076 xfs_extlen_t len),
3077 TP_ARGS(ip, lblk, len),
3078 TP_STRUCT__entry(
3079 __field(dev_t, dev)
3080 __field(xfs_ino_t, ino)
3081 __field(xfs_fileoff_t, lblk)
3082 __field(xfs_extlen_t, len)
3083 ),
3084 TP_fast_assign(
3085 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3086 __entry->ino = ip->i_ino;
3087 __entry->lblk = lblk;
3088 __entry->len = len;
3089 ),
3090 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x",
3091 MAJOR(__entry->dev), MINOR(__entry->dev),
3092 __entry->ino,
3093 __entry->lblk,
3094 __entry->len)
3095);
3096TRACE_EVENT(xfs_reflink_remap,
3097 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3098 xfs_extlen_t len, xfs_fsblock_t new_pblk),
3099 TP_ARGS(ip, lblk, len, new_pblk),
3100 TP_STRUCT__entry(
3101 __field(dev_t, dev)
3102 __field(xfs_ino_t, ino)
3103 __field(xfs_fileoff_t, lblk)
3104 __field(xfs_extlen_t, len)
3105 __field(xfs_fsblock_t, new_pblk)
3106 ),
3107 TP_fast_assign(
3108 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3109 __entry->ino = ip->i_ino;
3110 __entry->lblk = lblk;
3111 __entry->len = len;
3112 __entry->new_pblk = new_pblk;
3113 ),
3114 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu",
3115 MAJOR(__entry->dev), MINOR(__entry->dev),
3116 __entry->ino,
3117 __entry->lblk,
3118 __entry->len,
3119 __entry->new_pblk)
3120);
3121DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3122DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3123DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3124DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003125DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3126DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3127
3128/* dedupe tracepoints */
3129DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3130DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3131
3132/* ioctl tracepoints */
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003133TRACE_EVENT(xfs_ioctl_clone,
3134 TP_PROTO(struct inode *src, struct inode *dest),
3135 TP_ARGS(src, dest),
3136 TP_STRUCT__entry(
3137 __field(dev_t, dev)
3138 __field(unsigned long, src_ino)
3139 __field(loff_t, src_isize)
3140 __field(unsigned long, dest_ino)
3141 __field(loff_t, dest_isize)
3142 ),
3143 TP_fast_assign(
3144 __entry->dev = src->i_sb->s_dev;
3145 __entry->src_ino = src->i_ino;
3146 __entry->src_isize = i_size_read(src);
3147 __entry->dest_ino = dest->i_ino;
3148 __entry->dest_isize = i_size_read(dest);
3149 ),
3150 TP_printk("dev %d:%d "
3151 "ino 0x%lx isize 0x%llx -> "
Hou Tao42bf9db2017-04-14 11:43:27 -07003152 "ino 0x%lx isize 0x%llx",
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003153 MAJOR(__entry->dev), MINOR(__entry->dev),
3154 __entry->src_ino,
3155 __entry->src_isize,
3156 __entry->dest_ino,
3157 __entry->dest_isize)
3158);
3159
3160/* unshare tracepoints */
3161DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003162DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003163
3164/* copy on write */
3165DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
Darrick J. Wongbe51f812016-10-03 09:11:32 -07003166DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3167DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003168DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003169
Christoph Hellwig54a4ef82017-02-06 13:00:54 -08003170DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003171
3172DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3173DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3174DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003175
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003176DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3177DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3178
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003179
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003180DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003181
Darrick J. Wong1f08af52016-10-03 09:11:53 -07003182/* rmap swapext tracepoints */
3183DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3184DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3185DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3186
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003187/* fsmap traces */
3188DECLARE_EVENT_CLASS(xfs_fsmap_class,
3189 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3190 struct xfs_rmap_irec *rmap),
3191 TP_ARGS(mp, keydev, agno, rmap),
3192 TP_STRUCT__entry(
3193 __field(dev_t, dev)
3194 __field(dev_t, keydev)
3195 __field(xfs_agnumber_t, agno)
3196 __field(xfs_fsblock_t, bno)
3197 __field(xfs_filblks_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003198 __field(uint64_t, owner)
3199 __field(uint64_t, offset)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003200 __field(unsigned int, flags)
3201 ),
3202 TP_fast_assign(
3203 __entry->dev = mp->m_super->s_dev;
3204 __entry->keydev = new_decode_dev(keydev);
3205 __entry->agno = agno;
3206 __entry->bno = rmap->rm_startblock;
3207 __entry->len = rmap->rm_blockcount;
3208 __entry->owner = rmap->rm_owner;
3209 __entry->offset = rmap->rm_offset;
3210 __entry->flags = rmap->rm_flags;
3211 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07003212 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 -07003213 MAJOR(__entry->dev), MINOR(__entry->dev),
3214 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3215 __entry->agno,
3216 __entry->bno,
3217 __entry->len,
3218 __entry->owner,
3219 __entry->offset,
3220 __entry->flags)
3221)
3222#define DEFINE_FSMAP_EVENT(name) \
3223DEFINE_EVENT(xfs_fsmap_class, name, \
3224 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3225 struct xfs_rmap_irec *rmap), \
3226 TP_ARGS(mp, keydev, agno, rmap))
3227DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3228DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3229DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3230
3231DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3232 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3233 TP_ARGS(mp, fsmap),
3234 TP_STRUCT__entry(
3235 __field(dev_t, dev)
3236 __field(dev_t, keydev)
3237 __field(xfs_daddr_t, block)
3238 __field(xfs_daddr_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003239 __field(uint64_t, owner)
3240 __field(uint64_t, offset)
3241 __field(uint64_t, flags)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003242 ),
3243 TP_fast_assign(
3244 __entry->dev = mp->m_super->s_dev;
3245 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3246 __entry->block = fsmap->fmr_physical;
3247 __entry->len = fsmap->fmr_length;
3248 __entry->owner = fsmap->fmr_owner;
3249 __entry->offset = fsmap->fmr_offset;
3250 __entry->flags = fsmap->fmr_flags;
3251 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07003252 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 -07003253 MAJOR(__entry->dev), MINOR(__entry->dev),
3254 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3255 __entry->block,
3256 __entry->len,
3257 __entry->owner,
3258 __entry->offset,
3259 __entry->flags)
3260)
3261#define DEFINE_GETFSMAP_EVENT(name) \
3262DEFINE_EVENT(xfs_getfsmap_class, name, \
3263 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3264 TP_ARGS(mp, fsmap))
3265DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3266DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3267DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3268
Darrick J. Wongb872af22018-01-08 10:51:26 -08003269TRACE_EVENT(xfs_trans_resv_calc,
3270 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3271 struct xfs_trans_res *res),
3272 TP_ARGS(mp, type, res),
3273 TP_STRUCT__entry(
3274 __field(dev_t, dev)
3275 __field(int, type)
3276 __field(uint, logres)
3277 __field(int, logcount)
3278 __field(int, logflags)
3279 ),
3280 TP_fast_assign(
3281 __entry->dev = mp->m_super->s_dev;
3282 __entry->type = type;
3283 __entry->logres = res->tr_logres;
3284 __entry->logcount = res->tr_logcount;
3285 __entry->logflags = res->tr_logflags;
3286 ),
3287 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3288 MAJOR(__entry->dev), MINOR(__entry->dev),
3289 __entry->type,
3290 __entry->logres,
3291 __entry->logcount,
3292 __entry->logflags)
3293);
3294
Dave Chinnerba187812018-05-09 07:47:57 -07003295DECLARE_EVENT_CLASS(xfs_trans_class,
3296 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3297 TP_ARGS(tp, caller_ip),
3298 TP_STRUCT__entry(
3299 __field(dev_t, dev)
3300 __field(uint32_t, tid)
3301 __field(uint32_t, flags)
3302 __field(unsigned long, caller_ip)
3303 ),
3304 TP_fast_assign(
3305 __entry->dev = tp->t_mountp->m_super->s_dev;
3306 __entry->tid = 0;
3307 if (tp->t_ticket)
3308 __entry->tid = tp->t_ticket->t_tid;
3309 __entry->flags = tp->t_flags;
3310 __entry->caller_ip = caller_ip;
3311 ),
3312 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3313 MAJOR(__entry->dev), MINOR(__entry->dev),
3314 __entry->tid,
3315 __entry->flags,
3316 (char *)__entry->caller_ip)
3317)
3318
3319#define DEFINE_TRANS_EVENT(name) \
3320DEFINE_EVENT(xfs_trans_class, name, \
3321 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3322 TP_ARGS(tp, caller_ip))
3323DEFINE_TRANS_EVENT(xfs_trans_alloc);
3324DEFINE_TRANS_EVENT(xfs_trans_cancel);
3325DEFINE_TRANS_EVENT(xfs_trans_commit);
3326DEFINE_TRANS_EVENT(xfs_trans_dup);
3327DEFINE_TRANS_EVENT(xfs_trans_free);
3328DEFINE_TRANS_EVENT(xfs_trans_roll);
3329DEFINE_TRANS_EVENT(xfs_trans_add_item);
Christoph Hellwig195cd832019-06-28 19:27:31 -07003330DEFINE_TRANS_EVENT(xfs_trans_commit_items);
Dave Chinnerba187812018-05-09 07:47:57 -07003331DEFINE_TRANS_EVENT(xfs_trans_free_items);
3332
Darrick J. Wong9a4a5112019-02-07 10:37:14 -08003333TRACE_EVENT(xfs_iunlink_update_bucket,
3334 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3335 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3336 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3337 TP_STRUCT__entry(
3338 __field(dev_t, dev)
3339 __field(xfs_agnumber_t, agno)
3340 __field(unsigned int, bucket)
3341 __field(xfs_agino_t, old_ptr)
3342 __field(xfs_agino_t, new_ptr)
3343 ),
3344 TP_fast_assign(
3345 __entry->dev = mp->m_super->s_dev;
3346 __entry->agno = agno;
3347 __entry->bucket = bucket;
3348 __entry->old_ptr = old_ptr;
3349 __entry->new_ptr = new_ptr;
3350 ),
3351 TP_printk("dev %d:%d agno %u bucket %u old 0x%x new 0x%x",
3352 MAJOR(__entry->dev), MINOR(__entry->dev),
3353 __entry->agno,
3354 __entry->bucket,
3355 __entry->old_ptr,
3356 __entry->new_ptr)
3357);
3358
Darrick J. Wongf2fc16a2019-02-07 10:37:15 -08003359TRACE_EVENT(xfs_iunlink_update_dinode,
3360 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3361 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3362 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3363 TP_STRUCT__entry(
3364 __field(dev_t, dev)
3365 __field(xfs_agnumber_t, agno)
3366 __field(xfs_agino_t, agino)
3367 __field(xfs_agino_t, old_ptr)
3368 __field(xfs_agino_t, new_ptr)
3369 ),
3370 TP_fast_assign(
3371 __entry->dev = mp->m_super->s_dev;
3372 __entry->agno = agno;
3373 __entry->agino = agino;
3374 __entry->old_ptr = old_ptr;
3375 __entry->new_ptr = new_ptr;
3376 ),
3377 TP_printk("dev %d:%d agno %u agino 0x%x old 0x%x new 0x%x",
3378 MAJOR(__entry->dev), MINOR(__entry->dev),
3379 __entry->agno,
3380 __entry->agino,
3381 __entry->old_ptr,
3382 __entry->new_ptr)
3383);
3384
Darrick J. Wong4664c662019-02-07 10:37:16 -08003385DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3386 TP_PROTO(struct xfs_inode *ip),
3387 TP_ARGS(ip),
3388 TP_STRUCT__entry(
3389 __field(dev_t, dev)
3390 __field(xfs_agnumber_t, agno)
3391 __field(xfs_agino_t, agino)
3392 ),
3393 TP_fast_assign(
3394 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3395 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3396 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3397 ),
3398 TP_printk("dev %d:%d agno %u agino %u",
3399 MAJOR(__entry->dev), MINOR(__entry->dev),
3400 __entry->agno, __entry->agino)
3401)
3402
3403#define DEFINE_AGINODE_EVENT(name) \
3404DEFINE_EVENT(xfs_ag_inode_class, name, \
3405 TP_PROTO(struct xfs_inode *ip), \
3406 TP_ARGS(ip))
3407DEFINE_AGINODE_EVENT(xfs_iunlink);
3408DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
Darrick J. Wong9b247172019-02-07 10:37:16 -08003409DEFINE_AG_EVENT(xfs_iunlink_map_prev_fallback);
Darrick J. Wong4664c662019-02-07 10:37:16 -08003410
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003411DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3412 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3413 TP_ARGS(mp, flags),
3414 TP_STRUCT__entry(
3415 __field(dev_t, dev)
3416 __field(unsigned int, flags)
3417 ),
3418 TP_fast_assign(
3419 __entry->dev = mp->m_super->s_dev;
3420 __entry->flags = flags;
3421 ),
3422 TP_printk("dev %d:%d flags 0x%x",
3423 MAJOR(__entry->dev), MINOR(__entry->dev),
3424 __entry->flags)
3425);
3426#define DEFINE_FS_CORRUPT_EVENT(name) \
3427DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3428 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3429 TP_ARGS(mp, flags))
3430DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3431DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003432DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003433DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3434DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003435DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003436
3437DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3438 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3439 TP_ARGS(mp, agno, flags),
3440 TP_STRUCT__entry(
3441 __field(dev_t, dev)
3442 __field(xfs_agnumber_t, agno)
3443 __field(unsigned int, flags)
3444 ),
3445 TP_fast_assign(
3446 __entry->dev = mp->m_super->s_dev;
3447 __entry->agno = agno;
3448 __entry->flags = flags;
3449 ),
3450 TP_printk("dev %d:%d agno %u flags 0x%x",
3451 MAJOR(__entry->dev), MINOR(__entry->dev),
3452 __entry->agno, __entry->flags)
3453);
3454#define DEFINE_AG_CORRUPT_EVENT(name) \
3455DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3456 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3457 unsigned int flags), \
3458 TP_ARGS(mp, agno, flags))
3459DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3460DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003461DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003462
3463DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3464 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3465 TP_ARGS(ip, flags),
3466 TP_STRUCT__entry(
3467 __field(dev_t, dev)
3468 __field(xfs_ino_t, ino)
3469 __field(unsigned int, flags)
3470 ),
3471 TP_fast_assign(
3472 __entry->dev = ip->i_mount->m_super->s_dev;
3473 __entry->ino = ip->i_ino;
3474 __entry->flags = flags;
3475 ),
3476 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3477 MAJOR(__entry->dev), MINOR(__entry->dev),
3478 __entry->ino, __entry->flags)
3479);
3480#define DEFINE_INODE_CORRUPT_EVENT(name) \
3481DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3482 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3483 TP_ARGS(ip, flags))
3484DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3485DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3486
Darrick J. Wonga2114322019-07-02 09:39:38 -07003487TRACE_EVENT(xfs_iwalk_ag,
3488 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3489 xfs_agino_t startino),
3490 TP_ARGS(mp, agno, startino),
3491 TP_STRUCT__entry(
3492 __field(dev_t, dev)
3493 __field(xfs_agnumber_t, agno)
3494 __field(xfs_agino_t, startino)
3495 ),
3496 TP_fast_assign(
3497 __entry->dev = mp->m_super->s_dev;
3498 __entry->agno = agno;
3499 __entry->startino = startino;
3500 ),
3501 TP_printk("dev %d:%d agno %d startino %u",
3502 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3503 __entry->startino)
3504)
3505
3506TRACE_EVENT(xfs_iwalk_ag_rec,
3507 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3508 struct xfs_inobt_rec_incore *irec),
3509 TP_ARGS(mp, agno, irec),
3510 TP_STRUCT__entry(
3511 __field(dev_t, dev)
3512 __field(xfs_agnumber_t, agno)
3513 __field(xfs_agino_t, startino)
3514 __field(uint64_t, freemask)
3515 ),
3516 TP_fast_assign(
3517 __entry->dev = mp->m_super->s_dev;
3518 __entry->agno = agno;
3519 __entry->startino = irec->ir_startino;
3520 __entry->freemask = irec->ir_free;
3521 ),
3522 TP_printk("dev %d:%d agno %d startino %u freemask 0x%llx",
3523 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3524 __entry->startino, __entry->freemask)
3525)
3526
Darrick J. Wong40786712019-07-03 07:33:26 -07003527TRACE_EVENT(xfs_pwork_init,
3528 TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
3529 TP_ARGS(mp, nr_threads, pid),
3530 TP_STRUCT__entry(
3531 __field(dev_t, dev)
3532 __field(unsigned int, nr_threads)
3533 __field(pid_t, pid)
3534 ),
3535 TP_fast_assign(
3536 __entry->dev = mp->m_super->s_dev;
3537 __entry->nr_threads = nr_threads;
3538 __entry->pid = pid;
3539 ),
3540 TP_printk("dev %d:%d nr_threads %u pid %u",
3541 MAJOR(__entry->dev), MINOR(__entry->dev),
3542 __entry->nr_threads, __entry->pid)
3543)
3544
Dave Chinner0ad95682019-08-26 12:08:10 -07003545DECLARE_EVENT_CLASS(xfs_kmem_class,
3546 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
3547 TP_ARGS(size, flags, caller_ip),
3548 TP_STRUCT__entry(
3549 __field(ssize_t, size)
3550 __field(int, flags)
3551 __field(unsigned long, caller_ip)
3552 ),
3553 TP_fast_assign(
3554 __entry->size = size;
3555 __entry->flags = flags;
3556 __entry->caller_ip = caller_ip;
3557 ),
3558 TP_printk("size %zd flags 0x%x caller %pS",
3559 __entry->size,
3560 __entry->flags,
3561 (char *)__entry->caller_ip)
3562)
3563
3564#define DEFINE_KMEM_EVENT(name) \
3565DEFINE_EVENT(xfs_kmem_class, name, \
3566 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
3567 TP_ARGS(size, flags, caller_ip))
3568DEFINE_KMEM_EVENT(kmem_alloc);
Dave Chinnerf8f9ee42019-08-26 12:08:39 -07003569DEFINE_KMEM_EVENT(kmem_alloc_io);
Dave Chinner0ad95682019-08-26 12:08:10 -07003570DEFINE_KMEM_EVENT(kmem_alloc_large);
3571DEFINE_KMEM_EVENT(kmem_realloc);
3572DEFINE_KMEM_EVENT(kmem_zone_alloc);
3573
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00003574#endif /* _TRACE_XFS_H */
3575
3576#undef TRACE_INCLUDE_PATH
3577#define TRACE_INCLUDE_PATH .
3578#define TRACE_INCLUDE_FILE xfs_trace
3579#include <trace/define_trace.h>