blob: 86951652d3ed66601f0d44c4ae14a9e11dc9dc90 [file] [log] [blame]
Dave Chinner0b61f8a2018-06-05 19:42:14 -07001// SPDX-License-Identifier: GPL-2.0
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00002/*
3 * Copyright (c) 2009, Christoph Hellwig
4 * All Rights Reserved.
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00005 */
6#undef TRACE_SYSTEM
7#define TRACE_SYSTEM xfs
8
9#if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
10#define _TRACE_XFS_H
11
12#include <linux/tracepoint.h>
13
14struct xfs_agf;
15struct xfs_alloc_arg;
16struct xfs_attr_list_context;
17struct xfs_buf_log_item;
18struct xfs_da_args;
19struct xfs_da_node_entry;
20struct xfs_dquot;
Christoph Hellwig9e4c1092011-10-11 15:14:11 +000021struct xfs_log_item;
Mark Tinguelyad223e62012-06-14 09:22:15 -050022struct xlog;
Dave Chinner750b9c92013-11-01 15:27:18 +110023struct xlog_ticket;
Dave Chinner9abbc532010-04-13 15:06:46 +100024struct xlog_recover;
25struct xlog_recover_item;
Dave Chinner0ad95682019-08-26 12:08:10 -070026struct xlog_rec_header;
Dave Chinner9abbc532010-04-13 15:06:46 +100027struct xfs_buf_log_format;
28struct xfs_inode_log_format;
Alex Elder1ed845d2012-08-01 09:56:49 -050029struct xfs_bmbt_irec;
Darrick J. Wong2c813ad2016-08-03 11:08:36 +100030struct xfs_btree_cur;
Darrick J. Wong1946b912016-10-03 09:11:18 -070031struct xfs_refcount_irec;
Darrick J. Wonge89c0412017-03-28 14:56:37 -070032struct xfs_fsmap;
33struct xfs_rmap_irec;
Dave Chinner0ad95682019-08-26 12:08:10 -070034struct xfs_icreate_log;
35struct xfs_owner_info;
36struct xfs_trans_res;
37struct xfs_inobt_rec_incore;
Darrick J. Wong60e3d702020-03-11 10:51:50 -070038union xfs_btree_ptr;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -070039struct xfs_dqtrx;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000040
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080041#define XFS_ATTR_FILTER_FLAGS \
42 { XFS_ATTR_ROOT, "ROOT" }, \
Christoph Hellwig254f8002020-02-26 17:30:43 -080043 { XFS_ATTR_SECURE, "SECURE" }, \
44 { XFS_ATTR_INCOMPLETE, "INCOMPLETE" }
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080045
Christoph Hellwigea9a4882009-12-21 14:03:03 +000046DECLARE_EVENT_CLASS(xfs_attr_list_class,
47 TP_PROTO(struct xfs_attr_list_context *ctx),
48 TP_ARGS(ctx),
49 TP_STRUCT__entry(
50 __field(dev_t, dev)
51 __field(xfs_ino_t, ino)
52 __field(u32, hashval)
53 __field(u32, blkno)
54 __field(u32, offset)
Christoph Hellwiga9c8c692020-02-26 17:30:37 -080055 __field(void *, buffer)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000056 __field(int, bufsize)
57 __field(int, count)
58 __field(int, firstu)
59 __field(int, dupcnt)
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080060 __field(unsigned int, attr_filter)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000061 ),
62 TP_fast_assign(
63 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
64 __entry->ino = ctx->dp->i_ino;
Christoph Hellwige3a19cd2020-02-26 17:30:43 -080065 __entry->hashval = ctx->cursor.hashval;
66 __entry->blkno = ctx->cursor.blkno;
67 __entry->offset = ctx->cursor.offset;
Christoph Hellwiga9c8c692020-02-26 17:30:37 -080068 __entry->buffer = ctx->buffer;
Christoph Hellwigea9a4882009-12-21 14:03:03 +000069 __entry->bufsize = ctx->bufsize;
70 __entry->count = ctx->count;
71 __entry->firstu = ctx->firstu;
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080072 __entry->attr_filter = ctx->attr_filter;
Christoph Hellwigea9a4882009-12-21 14:03:03 +000073 ),
74 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080075 "buffer %p size %u count %u firstu %u filter %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +000076 MAJOR(__entry->dev), MINOR(__entry->dev),
77 __entry->ino,
78 __entry->hashval,
79 __entry->blkno,
80 __entry->offset,
81 __entry->dupcnt,
Christoph Hellwiga9c8c692020-02-26 17:30:37 -080082 __entry->buffer,
Christoph Hellwigea9a4882009-12-21 14:03:03 +000083 __entry->bufsize,
84 __entry->count,
85 __entry->firstu,
Christoph Hellwigd5f0f492020-02-26 17:30:42 -080086 __print_flags(__entry->attr_filter, "|",
87 XFS_ATTR_FILTER_FLAGS)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000088 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000089)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000090
91#define DEFINE_ATTR_LIST_EVENT(name) \
92DEFINE_EVENT(xfs_attr_list_class, name, \
93 TP_PROTO(struct xfs_attr_list_context *ctx), \
94 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000095DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
96DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
98DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
99DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
100DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
101DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
102DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +1100103DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
104DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000105
Li Zefanf8adb4d2010-05-24 08:25:57 +0000106DECLARE_EVENT_CLASS(xfs_perag_class,
107 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
108 unsigned long caller_ip),
109 TP_ARGS(mp, agno, refcount, caller_ip),
110 TP_STRUCT__entry(
111 __field(dev_t, dev)
112 __field(xfs_agnumber_t, agno)
113 __field(int, refcount)
114 __field(unsigned long, caller_ip)
115 ),
116 TP_fast_assign(
117 __entry->dev = mp->m_super->s_dev;
118 __entry->agno = agno;
119 __entry->refcount = refcount;
120 __entry->caller_ip = caller_ip;
121 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800122 TP_printk("dev %d:%d agno %u refcount %d caller %pS",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000123 MAJOR(__entry->dev), MINOR(__entry->dev),
124 __entry->agno,
125 __entry->refcount,
126 (char *)__entry->caller_ip)
127);
128
129#define DEFINE_PERAG_REF_EVENT(name) \
130DEFINE_EVENT(xfs_perag_class, name, \
131 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
132 unsigned long caller_ip), \
133 TP_ARGS(mp, agno, refcount, caller_ip))
134DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000135DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000136DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000137DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
138DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Brian Foster27b52862012-11-06 09:50:38 -0500139DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
140DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700141DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks);
142DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000143
Dave Chinnerd1230312013-11-01 15:27:19 +1100144DECLARE_EVENT_CLASS(xfs_ag_class,
145 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
146 TP_ARGS(mp, agno),
147 TP_STRUCT__entry(
148 __field(dev_t, dev)
149 __field(xfs_agnumber_t, agno)
150 ),
151 TP_fast_assign(
152 __entry->dev = mp->m_super->s_dev;
153 __entry->agno = agno;
154 ),
155 TP_printk("dev %d:%d agno %u",
156 MAJOR(__entry->dev), MINOR(__entry->dev),
157 __entry->agno)
158);
159#define DEFINE_AG_EVENT(name) \
160DEFINE_EVENT(xfs_ag_class, name, \
161 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
162 TP_ARGS(mp, agno))
163
164DEFINE_AG_EVENT(xfs_read_agf);
165DEFINE_AG_EVENT(xfs_alloc_read_agf);
166DEFINE_AG_EVENT(xfs_read_agi);
167DEFINE_AG_EVENT(xfs_ialloc_read_agi);
168
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000169TRACE_EVENT(xfs_attr_list_node_descend,
170 TP_PROTO(struct xfs_attr_list_context *ctx,
171 struct xfs_da_node_entry *btree),
172 TP_ARGS(ctx, btree),
173 TP_STRUCT__entry(
174 __field(dev_t, dev)
175 __field(xfs_ino_t, ino)
176 __field(u32, hashval)
177 __field(u32, blkno)
178 __field(u32, offset)
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800179 __field(void *, buffer)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000180 __field(int, bufsize)
181 __field(int, count)
182 __field(int, firstu)
183 __field(int, dupcnt)
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800184 __field(unsigned int, attr_filter)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000185 __field(u32, bt_hashval)
186 __field(u32, bt_before)
187 ),
188 TP_fast_assign(
189 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
190 __entry->ino = ctx->dp->i_ino;
Christoph Hellwige3a19cd2020-02-26 17:30:43 -0800191 __entry->hashval = ctx->cursor.hashval;
192 __entry->blkno = ctx->cursor.blkno;
193 __entry->offset = ctx->cursor.offset;
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800194 __entry->buffer = ctx->buffer;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000195 __entry->bufsize = ctx->bufsize;
196 __entry->count = ctx->count;
197 __entry->firstu = ctx->firstu;
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800198 __entry->attr_filter = ctx->attr_filter;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000199 __entry->bt_hashval = be32_to_cpu(btree->hashval);
200 __entry->bt_before = be32_to_cpu(btree->before);
201 ),
202 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800203 "buffer %p size %u count %u firstu %u filter %s "
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000204 "node hashval %u, node before %u",
205 MAJOR(__entry->dev), MINOR(__entry->dev),
206 __entry->ino,
207 __entry->hashval,
208 __entry->blkno,
209 __entry->offset,
210 __entry->dupcnt,
Christoph Hellwiga9c8c692020-02-26 17:30:37 -0800211 __entry->buffer,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000212 __entry->bufsize,
213 __entry->count,
214 __entry->firstu,
Christoph Hellwigd5f0f492020-02-26 17:30:42 -0800215 __print_flags(__entry->attr_filter, "|",
216 XFS_ATTR_FILTER_FLAGS),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000217 __entry->bt_hashval,
218 __entry->bt_before)
219);
220
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000221DECLARE_EVENT_CLASS(xfs_bmap_class,
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700222 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000223 unsigned long caller_ip),
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700224 TP_ARGS(ip, cur, state, caller_ip),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000225 TP_STRUCT__entry(
226 __field(dev_t, dev)
227 __field(xfs_ino_t, ino)
Peter Zijlstra04ae87a2019-10-24 22:26:59 +0200228 __field(void *, leaf)
229 __field(int, pos)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000230 __field(xfs_fileoff_t, startoff)
231 __field(xfs_fsblock_t, startblock)
232 __field(xfs_filblks_t, blockcount)
233 __field(xfs_exntst_t, state)
234 __field(int, bmap_state)
235 __field(unsigned long, caller_ip)
236 ),
237 TP_fast_assign(
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700238 struct xfs_ifork *ifp;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000239 struct xfs_bmbt_irec r;
240
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700241 ifp = xfs_iext_state_to_fork(ip, state);
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700242 xfs_iext_get_extent(ifp, cur, &r);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000243 __entry->dev = VFS_I(ip)->i_sb->s_dev;
244 __entry->ino = ip->i_ino;
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700245 __entry->leaf = cur->leaf;
246 __entry->pos = cur->pos;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000247 __entry->startoff = r.br_startoff;
248 __entry->startblock = r.br_startblock;
249 __entry->blockcount = r.br_blockcount;
250 __entry->state = r.br_state;
251 __entry->bmap_state = state;
252 __entry->caller_ip = caller_ip;
253 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -0800254 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800255 "offset %lld block %lld count %lld flag %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000256 MAJOR(__entry->dev), MINOR(__entry->dev),
257 __entry->ino,
258 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700259 __entry->leaf,
260 __entry->pos,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000261 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -0700262 (int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000263 __entry->blockcount,
264 __entry->state,
265 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000266)
267
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000268#define DEFINE_BMAP_EVENT(name) \
269DEFINE_EVENT(xfs_bmap_class, name, \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700270 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000271 unsigned long caller_ip), \
Christoph Hellwigb2b17122017-11-03 10:34:43 -0700272 TP_ARGS(ip, cur, state, caller_ip))
Christoph Hellwig6bdcf262017-11-03 10:34:46 -0700273DEFINE_BMAP_EVENT(xfs_iext_insert);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000274DEFINE_BMAP_EVENT(xfs_iext_remove);
275DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
276DEFINE_BMAP_EVENT(xfs_bmap_post_update);
Christoph Hellwige8e0e172017-10-19 11:06:29 -0700277DEFINE_BMAP_EVENT(xfs_read_extent);
278DEFINE_BMAP_EVENT(xfs_write_extent);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000279
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000280DECLARE_EVENT_CLASS(xfs_buf_class,
281 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
282 TP_ARGS(bp, caller_ip),
283 TP_STRUCT__entry(
284 __field(dev_t, dev)
285 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000286 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000287 __field(int, hold)
288 __field(int, pincount)
289 __field(unsigned, lockval)
290 __field(unsigned, flags)
291 __field(unsigned long, caller_ip)
292 ),
293 TP_fast_assign(
294 __entry->dev = bp->b_target->bt_dev;
Dave Chinnerd61fa8c2018-11-19 13:31:07 -0800295 if (bp->b_bn == XFS_BUF_DADDR_NULL)
296 __entry->bno = bp->b_maps[0].bm_bn;
297 else
298 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000299 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000300 __entry->hold = atomic_read(&bp->b_hold);
301 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200302 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000303 __entry->flags = bp->b_flags;
304 __entry->caller_ip = caller_ip;
305 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000306 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800307 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000308 MAJOR(__entry->dev), MINOR(__entry->dev),
309 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000310 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000311 __entry->hold,
312 __entry->pincount,
313 __entry->lockval,
314 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
315 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000316)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000317
318#define DEFINE_BUF_EVENT(name) \
319DEFINE_EVENT(xfs_buf_class, name, \
320 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
321 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000322DEFINE_BUF_EVENT(xfs_buf_init);
323DEFINE_BUF_EVENT(xfs_buf_free);
324DEFINE_BUF_EVENT(xfs_buf_hold);
325DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000326DEFINE_BUF_EVENT(xfs_buf_iodone);
Dave Chinner595bff72014-10-02 09:05:14 +1000327DEFINE_BUF_EVENT(xfs_buf_submit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000328DEFINE_BUF_EVENT(xfs_buf_lock);
329DEFINE_BUF_EVENT(xfs_buf_lock_done);
Darrick J. Wong479c6412016-06-21 11:53:28 +1000330DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200331DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000332DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000333DEFINE_BUF_EVENT(xfs_buf_iowait);
334DEFINE_BUF_EVENT(xfs_buf_iowait_done);
335DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000336DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000337DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Brian Foster7912e7f2017-06-14 21:21:45 -0700338DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
Dave Chinner686865f2010-09-24 20:07:47 +1000339DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000340DEFINE_BUF_EVENT(xfs_buf_item_relse);
Christoph Hellwig664ffb82020-09-01 10:55:29 -0700341DEFINE_BUF_EVENT(xfs_buf_iodone_async);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000342DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100343DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000344DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
345
346/* not really buffer traces, but the buf provides useful information */
347DEFINE_BUF_EVENT(xfs_btree_corrupt);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000348DEFINE_BUF_EVENT(xfs_reset_dqcounts);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000349
350/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000351DECLARE_EVENT_CLASS(xfs_buf_flags_class,
352 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
353 TP_ARGS(bp, flags, caller_ip),
354 TP_STRUCT__entry(
355 __field(dev_t, dev)
356 __field(xfs_daddr_t, bno)
357 __field(size_t, buffer_length)
358 __field(int, hold)
359 __field(int, pincount)
360 __field(unsigned, lockval)
361 __field(unsigned, flags)
362 __field(unsigned long, caller_ip)
363 ),
364 TP_fast_assign(
365 __entry->dev = bp->b_target->bt_dev;
366 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000367 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000368 __entry->flags = flags;
369 __entry->hold = atomic_read(&bp->b_hold);
370 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200371 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000372 __entry->caller_ip = caller_ip;
373 ),
374 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800375 "lock %d flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000376 MAJOR(__entry->dev), MINOR(__entry->dev),
377 (unsigned long long)__entry->bno,
378 __entry->buffer_length,
379 __entry->hold,
380 __entry->pincount,
381 __entry->lockval,
382 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
383 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000384)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000385
386#define DEFINE_BUF_FLAGS_EVENT(name) \
387DEFINE_EVENT(xfs_buf_flags_class, name, \
388 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
389 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000390DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
391DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
392DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
393
394TRACE_EVENT(xfs_buf_ioerror,
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800395 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000396 TP_ARGS(bp, error, caller_ip),
397 TP_STRUCT__entry(
398 __field(dev_t, dev)
399 __field(xfs_daddr_t, bno)
400 __field(size_t, buffer_length)
401 __field(unsigned, flags)
402 __field(int, hold)
403 __field(int, pincount)
404 __field(unsigned, lockval)
405 __field(int, error)
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800406 __field(xfs_failaddr_t, caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000407 ),
408 TP_fast_assign(
409 __entry->dev = bp->b_target->bt_dev;
410 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000411 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000412 __entry->hold = atomic_read(&bp->b_hold);
413 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200414 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000415 __entry->error = error;
416 __entry->flags = bp->b_flags;
417 __entry->caller_ip = caller_ip;
418 ),
419 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Darrick J. Wong31ca03c2018-01-08 10:51:02 -0800420 "lock %d error %d flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000421 MAJOR(__entry->dev), MINOR(__entry->dev),
422 (unsigned long long)__entry->bno,
423 __entry->buffer_length,
424 __entry->hold,
425 __entry->pincount,
426 __entry->lockval,
427 __entry->error,
428 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
429 (void *)__entry->caller_ip)
430);
431
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000432DECLARE_EVENT_CLASS(xfs_buf_item_class,
433 TP_PROTO(struct xfs_buf_log_item *bip),
434 TP_ARGS(bip),
435 TP_STRUCT__entry(
436 __field(dev_t, dev)
437 __field(xfs_daddr_t, buf_bno)
438 __field(size_t, buf_len)
439 __field(int, buf_hold)
440 __field(int, buf_pincount)
441 __field(int, buf_lockval)
442 __field(unsigned, buf_flags)
443 __field(unsigned, bli_recur)
444 __field(int, bli_refcount)
445 __field(unsigned, bli_flags)
Dave Chinner22525c12018-05-09 07:47:34 -0700446 __field(unsigned long, li_flags)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000447 ),
448 TP_fast_assign(
449 __entry->dev = bip->bli_buf->b_target->bt_dev;
450 __entry->bli_flags = bip->bli_flags;
451 __entry->bli_recur = bip->bli_recur;
452 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
453 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000454 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000455 __entry->buf_flags = bip->bli_buf->b_flags;
456 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
457 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200458 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000459 __entry->li_flags = bip->bli_item.li_flags;
460 ),
461 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
462 "lock %d flags %s recur %d refcount %d bliflags %s "
Dave Chinnere6631f82018-05-09 07:49:37 -0700463 "liflags %s",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000464 MAJOR(__entry->dev), MINOR(__entry->dev),
465 (unsigned long long)__entry->buf_bno,
466 __entry->buf_len,
467 __entry->buf_hold,
468 __entry->buf_pincount,
469 __entry->buf_lockval,
470 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
471 __entry->bli_recur,
472 __entry->bli_refcount,
473 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000474 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000475)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000476
477#define DEFINE_BUF_ITEM_EVENT(name) \
478DEFINE_EVENT(xfs_buf_item_class, name, \
479 TP_PROTO(struct xfs_buf_log_item *bip), \
480 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000481DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000482DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000483DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
484DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
485DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000486DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000487DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
488DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
489DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwigddf92052019-06-28 19:27:32 -0700490DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000491DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
492DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
493DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
494DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
495DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
496DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
497DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
498DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
499DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
500DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
501DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
502DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
503DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
504DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
505
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000506DECLARE_EVENT_CLASS(xfs_filestream_class,
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700507 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno),
508 TP_ARGS(mp, ino, agno),
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000509 TP_STRUCT__entry(
510 __field(dev_t, dev)
511 __field(xfs_ino_t, ino)
512 __field(xfs_agnumber_t, agno)
513 __field(int, streams)
514 ),
515 TP_fast_assign(
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700516 __entry->dev = mp->m_super->s_dev;
517 __entry->ino = ino;
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000518 __entry->agno = agno;
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700519 __entry->streams = xfs_filestream_peek_ag(mp, agno);
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000520 ),
521 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
522 MAJOR(__entry->dev), MINOR(__entry->dev),
523 __entry->ino,
524 __entry->agno,
525 __entry->streams)
526)
527#define DEFINE_FILESTREAM_EVENT(name) \
528DEFINE_EVENT(xfs_filestream_class, name, \
Christoph Hellwig7fcd3ef2018-04-09 10:23:39 -0700529 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \
530 TP_ARGS(mp, ino, agno))
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000531DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
532DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
533DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
534
535TRACE_EVENT(xfs_filestream_pick,
536 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
537 xfs_extlen_t free, int nscan),
538 TP_ARGS(ip, agno, free, nscan),
539 TP_STRUCT__entry(
540 __field(dev_t, dev)
541 __field(xfs_ino_t, ino)
542 __field(xfs_agnumber_t, agno)
543 __field(int, streams)
544 __field(xfs_extlen_t, free)
545 __field(int, nscan)
546 ),
547 TP_fast_assign(
548 __entry->dev = VFS_I(ip)->i_sb->s_dev;
549 __entry->ino = ip->i_ino;
550 __entry->agno = agno;
551 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
552 __entry->free = free;
553 __entry->nscan = nscan;
554 ),
555 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
556 MAJOR(__entry->dev), MINOR(__entry->dev),
557 __entry->ino,
558 __entry->agno,
559 __entry->streams,
560 __entry->free,
561 __entry->nscan)
562);
563
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000564DECLARE_EVENT_CLASS(xfs_lock_class,
565 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
566 unsigned long caller_ip),
567 TP_ARGS(ip, lock_flags, caller_ip),
568 TP_STRUCT__entry(
569 __field(dev_t, dev)
570 __field(xfs_ino_t, ino)
571 __field(int, lock_flags)
572 __field(unsigned long, caller_ip)
573 ),
574 TP_fast_assign(
575 __entry->dev = VFS_I(ip)->i_sb->s_dev;
576 __entry->ino = ip->i_ino;
577 __entry->lock_flags = lock_flags;
578 __entry->caller_ip = caller_ip;
579 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800580 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000581 MAJOR(__entry->dev), MINOR(__entry->dev),
582 __entry->ino,
583 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
584 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000585)
586
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000587#define DEFINE_LOCK_EVENT(name) \
588DEFINE_EVENT(xfs_lock_class, name, \
589 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
590 unsigned long caller_ip), \
591 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000592DEFINE_LOCK_EVENT(xfs_ilock);
593DEFINE_LOCK_EVENT(xfs_ilock_nowait);
594DEFINE_LOCK_EVENT(xfs_ilock_demote);
595DEFINE_LOCK_EVENT(xfs_iunlock);
596
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000597DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000598 TP_PROTO(struct xfs_inode *ip),
599 TP_ARGS(ip),
600 TP_STRUCT__entry(
601 __field(dev_t, dev)
602 __field(xfs_ino_t, ino)
603 ),
604 TP_fast_assign(
605 __entry->dev = VFS_I(ip)->i_sb->s_dev;
606 __entry->ino = ip->i_ino;
607 ),
608 TP_printk("dev %d:%d ino 0x%llx",
609 MAJOR(__entry->dev), MINOR(__entry->dev),
610 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000611)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000612
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000613#define DEFINE_INODE_EVENT(name) \
614DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000615 TP_PROTO(struct xfs_inode *ip), \
616 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000617DEFINE_INODE_EVENT(xfs_iget_skip);
618DEFINE_INODE_EVENT(xfs_iget_reclaim);
619DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
620DEFINE_INODE_EVENT(xfs_iget_hit);
621DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000622
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000623DEFINE_INODE_EVENT(xfs_getattr);
624DEFINE_INODE_EVENT(xfs_setattr);
625DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500626DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000627DEFINE_INODE_EVENT(xfs_alloc_file_space);
628DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000629DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100630DEFINE_INODE_EVENT(xfs_collapse_file_space);
Namjae Jeona904b1c2015-03-25 15:08:56 +1100631DEFINE_INODE_EVENT(xfs_insert_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000632DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000633#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200634DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000635#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000636DEFINE_INODE_EVENT(xfs_vm_bmap);
637DEFINE_INODE_EVENT(xfs_file_ioctl);
638DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
639DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000640DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000641DEFINE_INODE_EVENT(xfs_file_fsync);
642DEFINE_INODE_EVENT(xfs_destroy_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400643DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000644
645DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
646DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
647
Brian Foster27b52862012-11-06 09:50:38 -0500648DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
649DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500650DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700651DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
652DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
653DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500654
Darrick J. Wong85f8dff2018-12-18 14:32:29 -0800655/*
656 * ftrace's __print_symbolic requires that all enum values be wrapped in the
657 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
658 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
659 * code.
660 */
661TRACE_DEFINE_ENUM(PE_SIZE_PTE);
662TRACE_DEFINE_ENUM(PE_SIZE_PMD);
663TRACE_DEFINE_ENUM(PE_SIZE_PUD);
664
Christoph Hellwigd522d562017-08-29 10:08:41 -0700665TRACE_EVENT(xfs_filemap_fault,
666 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
667 bool write_fault),
668 TP_ARGS(ip, pe_size, write_fault),
669 TP_STRUCT__entry(
670 __field(dev_t, dev)
671 __field(xfs_ino_t, ino)
672 __field(enum page_entry_size, pe_size)
673 __field(bool, write_fault)
674 ),
675 TP_fast_assign(
676 __entry->dev = VFS_I(ip)->i_sb->s_dev;
677 __entry->ino = ip->i_ino;
678 __entry->pe_size = pe_size;
679 __entry->write_fault = write_fault;
680 ),
681 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
682 MAJOR(__entry->dev), MINOR(__entry->dev),
683 __entry->ino,
684 __print_symbolic(__entry->pe_size,
685 { PE_SIZE_PTE, "PTE" },
686 { PE_SIZE_PMD, "PMD" },
687 { PE_SIZE_PUD, "PUD" }),
688 __entry->write_fault)
689)
690
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000691DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000692 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
693 TP_ARGS(ip, caller_ip),
694 TP_STRUCT__entry(
695 __field(dev_t, dev)
696 __field(xfs_ino_t, ino)
697 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100698 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000699 __field(unsigned long, caller_ip)
700 ),
701 TP_fast_assign(
702 __entry->dev = VFS_I(ip)->i_sb->s_dev;
703 __entry->ino = ip->i_ino;
704 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100705 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000706 __entry->caller_ip = caller_ip;
707 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -0800708 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000709 MAJOR(__entry->dev), MINOR(__entry->dev),
710 __entry->ino,
711 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100712 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000713 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000714)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000715
Brian Foster19cb7e32013-03-18 10:51:48 -0400716TRACE_EVENT(xfs_iomap_prealloc_size,
717 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
718 unsigned int writeio_blocks),
719 TP_ARGS(ip, blocks, shift, writeio_blocks),
720 TP_STRUCT__entry(
721 __field(dev_t, dev)
722 __field(xfs_ino_t, ino)
723 __field(xfs_fsblock_t, blocks)
724 __field(int, shift)
725 __field(unsigned int, writeio_blocks)
726 ),
727 TP_fast_assign(
728 __entry->dev = VFS_I(ip)->i_sb->s_dev;
729 __entry->ino = ip->i_ino;
730 __entry->blocks = blocks;
731 __entry->shift = shift;
732 __entry->writeio_blocks = writeio_blocks;
733 ),
734 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
Christoph Hellwig5da8a072019-10-28 08:41:44 -0700735 "m_allocsize_blocks %u",
Brian Foster19cb7e32013-03-18 10:51:48 -0400736 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
737 __entry->blocks, __entry->shift, __entry->writeio_blocks)
738)
739
Brian Foster56d11152015-05-29 09:18:32 +1000740TRACE_EVENT(xfs_irec_merge_pre,
741 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
742 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
743 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
744 TP_STRUCT__entry(
745 __field(dev_t, dev)
746 __field(xfs_agnumber_t, agno)
747 __field(xfs_agino_t, agino)
748 __field(uint16_t, holemask)
749 __field(xfs_agino_t, nagino)
750 __field(uint16_t, nholemask)
751 ),
752 TP_fast_assign(
753 __entry->dev = mp->m_super->s_dev;
754 __entry->agno = agno;
755 __entry->agino = agino;
756 __entry->holemask = holemask;
757 __entry->nagino = nagino;
758 __entry->nholemask = holemask;
759 ),
760 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
761 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
762 __entry->agino, __entry->holemask, __entry->nagino,
763 __entry->nholemask)
764)
765
766TRACE_EVENT(xfs_irec_merge_post,
767 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
768 uint16_t holemask),
769 TP_ARGS(mp, agno, agino, holemask),
770 TP_STRUCT__entry(
771 __field(dev_t, dev)
772 __field(xfs_agnumber_t, agno)
773 __field(xfs_agino_t, agino)
774 __field(uint16_t, holemask)
775 ),
776 TP_fast_assign(
777 __entry->dev = mp->m_super->s_dev;
778 __entry->agno = agno;
779 __entry->agino = agino;
780 __entry->holemask = holemask;
781 ),
782 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
783 MINOR(__entry->dev), __entry->agno, __entry->agino,
784 __entry->holemask)
785)
786
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000787#define DEFINE_IREF_EVENT(name) \
788DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000789 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
790 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000791DEFINE_IREF_EVENT(xfs_irele);
792DEFINE_IREF_EVENT(xfs_inode_pin);
793DEFINE_IREF_EVENT(xfs_inode_unpin);
794DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100795
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000796DECLARE_EVENT_CLASS(xfs_namespace_class,
797 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
798 TP_ARGS(dp, name),
799 TP_STRUCT__entry(
800 __field(dev_t, dev)
801 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000802 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000803 __dynamic_array(char, name, name->len)
804 ),
805 TP_fast_assign(
806 __entry->dev = VFS_I(dp)->i_sb->s_dev;
807 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000808 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000809 memcpy(__get_str(name), name->name, name->len);
810 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000811 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000812 MAJOR(__entry->dev), MINOR(__entry->dev),
813 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000814 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000815 __get_str(name))
816)
817
818#define DEFINE_NAMESPACE_EVENT(name) \
819DEFINE_EVENT(xfs_namespace_class, name, \
820 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
821 TP_ARGS(dp, name))
822DEFINE_NAMESPACE_EVENT(xfs_remove);
823DEFINE_NAMESPACE_EVENT(xfs_link);
824DEFINE_NAMESPACE_EVENT(xfs_lookup);
825DEFINE_NAMESPACE_EVENT(xfs_create);
826DEFINE_NAMESPACE_EVENT(xfs_symlink);
827
828TRACE_EVENT(xfs_rename,
829 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
830 struct xfs_name *src_name, struct xfs_name *target_name),
831 TP_ARGS(src_dp, target_dp, src_name, target_name),
832 TP_STRUCT__entry(
833 __field(dev_t, dev)
834 __field(xfs_ino_t, src_dp_ino)
835 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000836 __field(int, src_namelen)
837 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000838 __dynamic_array(char, src_name, src_name->len)
839 __dynamic_array(char, target_name, target_name->len)
840 ),
841 TP_fast_assign(
842 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
843 __entry->src_dp_ino = src_dp->i_ino;
844 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000845 __entry->src_namelen = src_name->len;
846 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000847 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000848 memcpy(__get_str(target_name), target_name->name,
849 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000850 ),
851 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000852 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000853 MAJOR(__entry->dev), MINOR(__entry->dev),
854 __entry->src_dp_ino,
855 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000856 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000857 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000858 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000859 __get_str(target_name))
860)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000861
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000862DECLARE_EVENT_CLASS(xfs_dquot_class,
863 TP_PROTO(struct xfs_dquot *dqp),
864 TP_ARGS(dqp),
865 TP_STRUCT__entry(
866 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000867 __field(u32, id)
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700868 __field(xfs_dqtype_t, type)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000869 __field(unsigned, flags)
870 __field(unsigned, nrefs)
871 __field(unsigned long long, res_bcount)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700872 __field(unsigned long long, res_rtbcount)
873 __field(unsigned long long, res_icount)
874
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000875 __field(unsigned long long, bcount)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700876 __field(unsigned long long, rtbcount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000877 __field(unsigned long long, icount)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700878
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000879 __field(unsigned long long, blk_hardlimit)
880 __field(unsigned long long, blk_softlimit)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700881 __field(unsigned long long, rtb_hardlimit)
882 __field(unsigned long long, rtb_softlimit)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000883 __field(unsigned long long, ino_hardlimit)
884 __field(unsigned long long, ino_softlimit)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700885 ),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000886 TP_fast_assign(
887 __entry->dev = dqp->q_mount->m_super->s_dev;
Darrick J. Wongc51df732020-07-14 10:37:30 -0700888 __entry->id = dqp->q_id;
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700889 __entry->type = dqp->q_type;
890 __entry->flags = dqp->q_flags;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000891 __entry->nrefs = dqp->q_nrefs;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700892
Darrick J. Wong784e80f2020-07-14 10:37:30 -0700893 __entry->res_bcount = dqp->q_blk.reserved;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700894 __entry->res_rtbcount = dqp->q_rtb.reserved;
895 __entry->res_icount = dqp->q_ino.reserved;
896
Darrick J. Wongbe37d402020-07-14 10:37:31 -0700897 __entry->bcount = dqp->q_blk.count;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700898 __entry->rtbcount = dqp->q_rtb.count;
Darrick J. Wongbe37d402020-07-14 10:37:31 -0700899 __entry->icount = dqp->q_ino.count;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700900
Darrick J. Wongd3537cf2020-07-14 10:37:31 -0700901 __entry->blk_hardlimit = dqp->q_blk.hardlimit;
902 __entry->blk_softlimit = dqp->q_blk.softlimit;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700903 __entry->rtb_hardlimit = dqp->q_rtb.hardlimit;
904 __entry->rtb_softlimit = dqp->q_rtb.softlimit;
Darrick J. Wongd3537cf2020-07-14 10:37:31 -0700905 __entry->ino_hardlimit = dqp->q_ino.hardlimit;
906 __entry->ino_softlimit = dqp->q_ino.softlimit;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000907 ),
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700908 TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u "
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700909 "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000910 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700911 "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000912 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000913 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000914 __entry->id,
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700915 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
Darrick J. Wong985a78f2020-07-14 10:37:13 -0700916 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000917 __entry->nrefs,
918 __entry->res_bcount,
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700919 __entry->res_rtbcount,
920 __entry->res_icount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000921 __entry->bcount,
922 __entry->blk_hardlimit,
923 __entry->blk_softlimit,
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700924 __entry->rtbcount,
925 __entry->rtb_hardlimit,
926 __entry->rtb_softlimit,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000927 __entry->icount,
928 __entry->ino_hardlimit,
929 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000930)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000931
932#define DEFINE_DQUOT_EVENT(name) \
933DEFINE_EVENT(xfs_dquot_class, name, \
934 TP_PROTO(struct xfs_dquot *dqp), \
935 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000936DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000937DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
938DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000939DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
940DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000941DEFINE_DQUOT_EVENT(xfs_dqattach_found);
942DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000943DEFINE_DQUOT_EVENT(xfs_dqalloc);
944DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
945DEFINE_DQUOT_EVENT(xfs_dqread);
946DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000947DEFINE_DQUOT_EVENT(xfs_dqget_hit);
948DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000949DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
950DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000951DEFINE_DQUOT_EVENT(xfs_dqput);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000952DEFINE_DQUOT_EVENT(xfs_dqput_free);
953DEFINE_DQUOT_EVENT(xfs_dqrele);
954DEFINE_DQUOT_EVENT(xfs_dqflush);
955DEFINE_DQUOT_EVENT(xfs_dqflush_force);
956DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700957DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
958DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
959
960#define XFS_QMOPT_FLAGS \
961 { XFS_QMOPT_UQUOTA, "UQUOTA" }, \
962 { XFS_QMOPT_PQUOTA, "PQUOTA" }, \
963 { XFS_QMOPT_FORCE_RES, "FORCE_RES" }, \
964 { XFS_QMOPT_SBVERSION, "SBVERSION" }, \
965 { XFS_QMOPT_GQUOTA, "GQUOTA" }, \
966 { XFS_QMOPT_INHERIT, "INHERIT" }, \
967 { XFS_QMOPT_RES_REGBLKS, "RES_REGBLKS" }, \
968 { XFS_QMOPT_RES_RTBLKS, "RES_RTBLKS" }, \
969 { XFS_QMOPT_BCOUNT, "BCOUNT" }, \
970 { XFS_QMOPT_ICOUNT, "ICOUNT" }, \
971 { XFS_QMOPT_RTBCOUNT, "RTBCOUNT" }, \
972 { XFS_QMOPT_DELBCOUNT, "DELBCOUNT" }, \
973 { XFS_QMOPT_DELRTBCOUNT, "DELRTBCOUNT" }, \
974 { XFS_QMOPT_RES_INOS, "RES_INOS" }
975
976TRACE_EVENT(xfs_trans_mod_dquot,
977 TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
978 unsigned int field, int64_t delta),
979 TP_ARGS(tp, dqp, field, delta),
980 TP_STRUCT__entry(
981 __field(dev_t, dev)
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700982 __field(xfs_dqtype_t, type)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700983 __field(unsigned int, flags)
984 __field(unsigned int, dqid)
985 __field(unsigned int, field)
986 __field(int64_t, delta)
987 ),
988 TP_fast_assign(
989 __entry->dev = tp->t_mountp->m_super->s_dev;
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700990 __entry->type = dqp->q_type;
991 __entry->flags = dqp->q_flags;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700992 __entry->dqid = dqp->q_id;
993 __entry->field = field;
994 __entry->delta = delta;
995 ),
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700996 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s field %s delta %lld",
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -0700997 MAJOR(__entry->dev), MINOR(__entry->dev),
998 __entry->dqid,
Darrick J. Wong1a7ed272020-07-15 17:53:43 -0700999 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001000 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1001 __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS),
1002 __entry->delta)
1003);
1004
1005DECLARE_EVENT_CLASS(xfs_dqtrx_class,
1006 TP_PROTO(struct xfs_dqtrx *qtrx),
1007 TP_ARGS(qtrx),
1008 TP_STRUCT__entry(
1009 __field(dev_t, dev)
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001010 __field(xfs_dqtype_t, type)
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001011 __field(unsigned int, flags)
1012 __field(u32, dqid)
1013
1014 __field(uint64_t, blk_res)
1015 __field(int64_t, bcount_delta)
1016 __field(int64_t, delbcnt_delta)
1017
1018 __field(uint64_t, rtblk_res)
1019 __field(uint64_t, rtblk_res_used)
1020 __field(int64_t, rtbcount_delta)
1021 __field(int64_t, delrtb_delta)
1022
1023 __field(uint64_t, ino_res)
1024 __field(uint64_t, ino_res_used)
1025 __field(int64_t, icount_delta)
1026 ),
1027 TP_fast_assign(
1028 __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev;
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001029 __entry->type = qtrx->qt_dquot->q_type;
1030 __entry->flags = qtrx->qt_dquot->q_flags;
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001031 __entry->dqid = qtrx->qt_dquot->q_id;
1032
1033 __entry->blk_res = qtrx->qt_blk_res;
1034 __entry->bcount_delta = qtrx->qt_bcount_delta;
1035 __entry->delbcnt_delta = qtrx->qt_delbcnt_delta;
1036
1037 __entry->rtblk_res = qtrx->qt_rtblk_res;
1038 __entry->rtblk_res_used = qtrx->qt_rtblk_res_used;
1039 __entry->rtbcount_delta = qtrx->qt_rtbcount_delta;
1040 __entry->delrtb_delta = qtrx->qt_delrtb_delta;
1041
1042 __entry->ino_res = qtrx->qt_ino_res;
1043 __entry->ino_res_used = qtrx->qt_ino_res_used;
1044 __entry->icount_delta = qtrx->qt_icount_delta;
1045 ),
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001046 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s"
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001047 "blk_res %llu bcount_delta %lld delbcnt_delta %lld "
1048 "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld "
1049 "ino_res %llu ino_res_used %llu icount_delta %lld",
1050 MAJOR(__entry->dev), MINOR(__entry->dev),
1051 __entry->dqid,
Darrick J. Wong1a7ed272020-07-15 17:53:43 -07001052 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
Darrick J. Wong2cb91ba2020-07-14 10:37:35 -07001053 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1054
1055 __entry->blk_res,
1056 __entry->bcount_delta,
1057 __entry->delbcnt_delta,
1058
1059 __entry->rtblk_res,
1060 __entry->rtblk_res_used,
1061 __entry->rtbcount_delta,
1062 __entry->delrtb_delta,
1063
1064 __entry->ino_res,
1065 __entry->ino_res_used,
1066 __entry->icount_delta)
1067)
1068
1069#define DEFINE_DQTRX_EVENT(name) \
1070DEFINE_EVENT(xfs_dqtrx_class, name, \
1071 TP_PROTO(struct xfs_dqtrx *qtrx), \
1072 TP_ARGS(qtrx))
1073DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas);
1074DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before);
1075DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001076
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001077DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05001078 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001079 TP_ARGS(log, tic),
1080 TP_STRUCT__entry(
1081 __field(dev_t, dev)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001082 __field(char, ocnt)
1083 __field(char, cnt)
1084 __field(int, curr_res)
1085 __field(int, unit_res)
1086 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +11001087 __field(int, reserveq)
1088 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001089 __field(int, grant_reserve_cycle)
1090 __field(int, grant_reserve_bytes)
1091 __field(int, grant_write_cycle)
1092 __field(int, grant_write_bytes)
1093 __field(int, curr_cycle)
1094 __field(int, curr_block)
1095 __field(xfs_lsn_t, tail_lsn)
1096 ),
1097 TP_fast_assign(
1098 __entry->dev = log->l_mp->m_super->s_dev;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001099 __entry->ocnt = tic->t_ocnt;
1100 __entry->cnt = tic->t_cnt;
1101 __entry->curr_res = tic->t_curr_res;
1102 __entry->unit_res = tic->t_unit_res;
1103 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +00001104 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
1105 __entry->writeq = list_empty(&log->l_write_head.waiters);
1106 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +11001107 &__entry->grant_reserve_cycle,
1108 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +00001109 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +11001110 &__entry->grant_write_cycle,
1111 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001112 __entry->curr_cycle = log->l_curr_cycle;
1113 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +11001114 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001115 ),
Christoph Hellwig710b1e22016-04-06 09:20:36 +10001116 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +11001117 "t_unit_res %u t_flags %s reserveq %s "
1118 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001119 "grant_reserve_bytes %d grant_write_cycle %d "
1120 "grant_write_bytes %d curr_cycle %d curr_block %d "
1121 "tail_cycle %d tail_block %d",
1122 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001123 __entry->ocnt,
1124 __entry->cnt,
1125 __entry->curr_res,
1126 __entry->unit_res,
1127 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +11001128 __entry->reserveq ? "empty" : "active",
1129 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001130 __entry->grant_reserve_cycle,
1131 __entry->grant_reserve_bytes,
1132 __entry->grant_write_cycle,
1133 __entry->grant_write_bytes,
1134 __entry->curr_cycle,
1135 __entry->curr_block,
1136 CYCLE_LSN(__entry->tail_lsn),
1137 BLOCK_LSN(__entry->tail_lsn)
1138 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001139)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001140
1141#define DEFINE_LOGGRANT_EVENT(name) \
1142DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001143 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001144 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001145DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +00001146DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1147DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +11001148DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +00001149DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1150DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1151DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1152DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig8b41e3f2020-03-25 18:18:23 -07001153DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant);
1154DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit);
1155DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub);
1156DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant);
1157DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub);
1158DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit);
Dave Chinner0e7ab7e2020-03-24 20:10:27 -07001159DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001160
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001161DECLARE_EVENT_CLASS(xfs_log_item_class,
1162 TP_PROTO(struct xfs_log_item *lip),
1163 TP_ARGS(lip),
1164 TP_STRUCT__entry(
1165 __field(dev_t, dev)
1166 __field(void *, lip)
1167 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001168 __field(unsigned long, flags)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001169 __field(xfs_lsn_t, lsn)
1170 ),
1171 TP_fast_assign(
1172 __entry->dev = lip->li_mountp->m_super->s_dev;
1173 __entry->lip = lip;
1174 __entry->type = lip->li_type;
1175 __entry->flags = lip->li_flags;
1176 __entry->lsn = lip->li_lsn;
1177 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001178 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001179 MAJOR(__entry->dev), MINOR(__entry->dev),
1180 __entry->lip,
1181 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1182 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1183 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1184)
1185
Dave Chinner14c26c62012-04-24 16:33:31 +10001186TRACE_EVENT(xfs_log_force,
Carlos Maiolino9f278892016-04-06 09:46:30 +10001187 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1188 TP_ARGS(mp, lsn, caller_ip),
Dave Chinner14c26c62012-04-24 16:33:31 +10001189 TP_STRUCT__entry(
1190 __field(dev_t, dev)
1191 __field(xfs_lsn_t, lsn)
Carlos Maiolino9f278892016-04-06 09:46:30 +10001192 __field(unsigned long, caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001193 ),
1194 TP_fast_assign(
1195 __entry->dev = mp->m_super->s_dev;
1196 __entry->lsn = lsn;
Carlos Maiolino9f278892016-04-06 09:46:30 +10001197 __entry->caller_ip = caller_ip;
Dave Chinner14c26c62012-04-24 16:33:31 +10001198 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001199 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
Dave Chinner14c26c62012-04-24 16:33:31 +10001200 MAJOR(__entry->dev), MINOR(__entry->dev),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001201 __entry->lsn, (void *)__entry->caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001202)
1203
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001204#define DEFINE_LOG_ITEM_EVENT(name) \
1205DEFINE_EVENT(xfs_log_item_class, name, \
1206 TP_PROTO(struct xfs_log_item *lip), \
1207 TP_ARGS(lip))
1208DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001209DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1210DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001211DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001212
Dave Chinner750b9c92013-11-01 15:27:18 +11001213DECLARE_EVENT_CLASS(xfs_ail_class,
1214 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1215 TP_ARGS(lip, old_lsn, new_lsn),
1216 TP_STRUCT__entry(
1217 __field(dev_t, dev)
1218 __field(void *, lip)
1219 __field(uint, type)
Dave Chinner22525c12018-05-09 07:47:34 -07001220 __field(unsigned long, flags)
Dave Chinner750b9c92013-11-01 15:27:18 +11001221 __field(xfs_lsn_t, old_lsn)
1222 __field(xfs_lsn_t, new_lsn)
1223 ),
1224 TP_fast_assign(
1225 __entry->dev = lip->li_mountp->m_super->s_dev;
1226 __entry->lip = lip;
1227 __entry->type = lip->li_type;
1228 __entry->flags = lip->li_flags;
1229 __entry->old_lsn = old_lsn;
1230 __entry->new_lsn = new_lsn;
1231 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08001232 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 +11001233 MAJOR(__entry->dev), MINOR(__entry->dev),
1234 __entry->lip,
1235 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1236 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1237 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1238 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1239)
1240
1241#define DEFINE_AIL_EVENT(name) \
1242DEFINE_EVENT(xfs_ail_class, name, \
1243 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1244 TP_ARGS(lip, old_lsn, new_lsn))
1245DEFINE_AIL_EVENT(xfs_ail_insert);
1246DEFINE_AIL_EVENT(xfs_ail_move);
1247DEFINE_AIL_EVENT(xfs_ail_delete);
1248
1249TRACE_EVENT(xfs_log_assign_tail_lsn,
1250 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1251 TP_ARGS(log, new_lsn),
1252 TP_STRUCT__entry(
1253 __field(dev_t, dev)
1254 __field(xfs_lsn_t, new_lsn)
1255 __field(xfs_lsn_t, old_lsn)
1256 __field(xfs_lsn_t, last_sync_lsn)
1257 ),
1258 TP_fast_assign(
1259 __entry->dev = log->l_mp->m_super->s_dev;
1260 __entry->new_lsn = new_lsn;
1261 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1262 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1263 ),
1264 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1265 MAJOR(__entry->dev), MINOR(__entry->dev),
1266 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1267 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1268 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1269)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001270
Li Zefanf8adb4d2010-05-24 08:25:57 +00001271DECLARE_EVENT_CLASS(xfs_file_class,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001272 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1273 TP_ARGS(ip, count, offset),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001274 TP_STRUCT__entry(
1275 __field(dev_t, dev)
1276 __field(xfs_ino_t, ino)
1277 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001278 __field(loff_t, offset)
1279 __field(size_t, count)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001280 ),
1281 TP_fast_assign(
1282 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1283 __entry->ino = ip->i_ino;
1284 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001285 __entry->offset = offset;
1286 __entry->count = count;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001287 ),
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001288 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001289 MAJOR(__entry->dev), MINOR(__entry->dev),
1290 __entry->ino,
1291 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001292 __entry->offset,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001293 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001294)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001295
1296#define DEFINE_RW_EVENT(name) \
1297DEFINE_EVENT(xfs_file_class, name, \
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001298 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1299 TP_ARGS(ip, count, offset))
1300DEFINE_RW_EVENT(xfs_file_buffered_read);
1301DEFINE_RW_EVENT(xfs_file_direct_read);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001302DEFINE_RW_EVENT(xfs_file_dax_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001303DEFINE_RW_EVENT(xfs_file_buffered_write);
1304DEFINE_RW_EVENT(xfs_file_direct_write);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001305DEFINE_RW_EVENT(xfs_file_dax_write);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001306
Christoph Hellwiga206c812010-12-10 08:42:20 +00001307DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001308 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001309 int whichfork, struct xfs_bmbt_irec *irec),
1310 TP_ARGS(ip, offset, count, whichfork, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001311 TP_STRUCT__entry(
1312 __field(dev_t, dev)
1313 __field(xfs_ino_t, ino)
1314 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001315 __field(loff_t, offset)
1316 __field(size_t, count)
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001317 __field(int, whichfork)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001318 __field(xfs_fileoff_t, startoff)
1319 __field(xfs_fsblock_t, startblock)
1320 __field(xfs_filblks_t, blockcount)
1321 ),
1322 TP_fast_assign(
1323 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1324 __entry->ino = ip->i_ino;
1325 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001326 __entry->offset = offset;
1327 __entry->count = count;
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001328 __entry->whichfork = whichfork;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001329 __entry->startoff = irec ? irec->br_startoff : 0;
1330 __entry->startblock = irec ? irec->br_startblock : 0;
1331 __entry->blockcount = irec ? irec->br_blockcount : 0;
1332 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001333 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001334 "fork %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001335 MAJOR(__entry->dev), MINOR(__entry->dev),
1336 __entry->ino,
1337 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001338 __entry->offset,
1339 __entry->count,
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001340 __entry->whichfork == XFS_COW_FORK ? "cow" : "data",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001341 __entry->startoff,
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07001342 (int64_t)__entry->startblock,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001343 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001344)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001345
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001346#define DEFINE_IMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001347DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001348 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwigbe225fe2019-02-15 08:02:46 -08001349 int whichfork, struct xfs_bmbt_irec *irec), \
1350 TP_ARGS(ip, offset, count, whichfork, irec))
1351DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1352DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1353DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1354DEFINE_IMAP_EVENT(xfs_iomap_found);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001355
Li Zefanf8adb4d2010-05-24 08:25:57 +00001356DECLARE_EVENT_CLASS(xfs_simple_io_class,
1357 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1358 TP_ARGS(ip, offset, count),
1359 TP_STRUCT__entry(
1360 __field(dev_t, dev)
1361 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001362 __field(loff_t, isize)
1363 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001364 __field(loff_t, offset)
1365 __field(size_t, count)
1366 ),
1367 TP_fast_assign(
1368 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1369 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001370 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001371 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001372 __entry->offset = offset;
1373 __entry->count = count;
1374 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001375 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001376 "offset 0x%llx count %zd",
1377 MAJOR(__entry->dev), MINOR(__entry->dev),
1378 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001379 __entry->isize,
1380 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001381 __entry->offset,
1382 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001383);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001384
1385#define DEFINE_SIMPLE_IO_EVENT(name) \
1386DEFINE_EVENT(xfs_simple_io_class, name, \
1387 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1388 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001389DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1390DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001391DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Brian Foster0a50f162015-10-12 16:02:08 +11001392DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001393DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1394DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1395DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001396
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001397DECLARE_EVENT_CLASS(xfs_itrunc_class,
1398 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1399 TP_ARGS(ip, new_size),
1400 TP_STRUCT__entry(
1401 __field(dev_t, dev)
1402 __field(xfs_ino_t, ino)
1403 __field(xfs_fsize_t, size)
1404 __field(xfs_fsize_t, new_size)
1405 ),
1406 TP_fast_assign(
1407 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1408 __entry->ino = ip->i_ino;
1409 __entry->size = ip->i_d.di_size;
1410 __entry->new_size = new_size;
1411 ),
1412 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1413 MAJOR(__entry->dev), MINOR(__entry->dev),
1414 __entry->ino,
1415 __entry->size,
1416 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001417)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001418
1419#define DEFINE_ITRUNC_EVENT(name) \
1420DEFINE_EVENT(xfs_itrunc_class, name, \
1421 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1422 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001423DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1424DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001425
1426TRACE_EVENT(xfs_pagecache_inval,
1427 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1428 TP_ARGS(ip, start, finish),
1429 TP_STRUCT__entry(
1430 __field(dev_t, dev)
1431 __field(xfs_ino_t, ino)
1432 __field(xfs_fsize_t, size)
1433 __field(xfs_off_t, start)
1434 __field(xfs_off_t, finish)
1435 ),
1436 TP_fast_assign(
1437 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1438 __entry->ino = ip->i_ino;
1439 __entry->size = ip->i_d.di_size;
1440 __entry->start = start;
1441 __entry->finish = finish;
1442 ),
1443 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1444 MAJOR(__entry->dev), MINOR(__entry->dev),
1445 __entry->ino,
1446 __entry->size,
1447 __entry->start,
1448 __entry->finish)
1449);
1450
1451TRACE_EVENT(xfs_bunmap,
1452 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1453 int flags, unsigned long caller_ip),
1454 TP_ARGS(ip, bno, len, flags, caller_ip),
1455 TP_STRUCT__entry(
1456 __field(dev_t, dev)
1457 __field(xfs_ino_t, ino)
1458 __field(xfs_fsize_t, size)
1459 __field(xfs_fileoff_t, bno)
1460 __field(xfs_filblks_t, len)
1461 __field(unsigned long, caller_ip)
1462 __field(int, flags)
1463 ),
1464 TP_fast_assign(
1465 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1466 __entry->ino = ip->i_ino;
1467 __entry->size = ip->i_d.di_size;
1468 __entry->bno = bno;
1469 __entry->len = len;
1470 __entry->caller_ip = caller_ip;
1471 __entry->flags = flags;
1472 ),
1473 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 -08001474 "flags %s caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001475 MAJOR(__entry->dev), MINOR(__entry->dev),
1476 __entry->ino,
1477 __entry->size,
1478 __entry->bno,
1479 __entry->len,
1480 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1481 (void *)__entry->caller_ip)
1482
1483);
1484
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001485DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001486 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1487 xfs_agblock_t agbno, xfs_extlen_t len),
1488 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001489 TP_STRUCT__entry(
1490 __field(dev_t, dev)
1491 __field(xfs_agnumber_t, agno)
1492 __field(xfs_agblock_t, agbno)
1493 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001494 ),
1495 TP_fast_assign(
1496 __entry->dev = mp->m_super->s_dev;
1497 __entry->agno = agno;
1498 __entry->agbno = agbno;
1499 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001500 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001501 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001502 MAJOR(__entry->dev), MINOR(__entry->dev),
1503 __entry->agno,
1504 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001505 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001506);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001507#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001508DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001509 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1510 xfs_agblock_t agbno, xfs_extlen_t len), \
1511 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001512DEFINE_BUSY_EVENT(xfs_extent_busy);
1513DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1514DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1515DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1516DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001517
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001518TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001519 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1520 xfs_agblock_t agbno, xfs_extlen_t len,
1521 xfs_agblock_t tbno, xfs_extlen_t tlen),
1522 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1523 TP_STRUCT__entry(
1524 __field(dev_t, dev)
1525 __field(xfs_agnumber_t, agno)
1526 __field(xfs_agblock_t, agbno)
1527 __field(xfs_extlen_t, len)
1528 __field(xfs_agblock_t, tbno)
1529 __field(xfs_extlen_t, tlen)
1530 ),
1531 TP_fast_assign(
1532 __entry->dev = mp->m_super->s_dev;
1533 __entry->agno = agno;
1534 __entry->agbno = agbno;
1535 __entry->len = len;
1536 __entry->tbno = tbno;
1537 __entry->tlen = tlen;
1538 ),
1539 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1540 MAJOR(__entry->dev), MINOR(__entry->dev),
1541 __entry->agno,
1542 __entry->agbno,
1543 __entry->len,
1544 __entry->tbno,
1545 __entry->tlen)
1546);
1547
Brian Fostera27ba262018-03-15 10:51:58 -07001548DECLARE_EVENT_CLASS(xfs_agf_class,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001549 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1550 unsigned long caller_ip),
1551 TP_ARGS(mp, agf, flags, caller_ip),
1552 TP_STRUCT__entry(
1553 __field(dev_t, dev)
1554 __field(xfs_agnumber_t, agno)
1555 __field(int, flags)
1556 __field(__u32, length)
1557 __field(__u32, bno_root)
1558 __field(__u32, cnt_root)
1559 __field(__u32, bno_level)
1560 __field(__u32, cnt_level)
1561 __field(__u32, flfirst)
1562 __field(__u32, fllast)
1563 __field(__u32, flcount)
1564 __field(__u32, freeblks)
1565 __field(__u32, longest)
1566 __field(unsigned long, caller_ip)
1567 ),
1568 TP_fast_assign(
1569 __entry->dev = mp->m_super->s_dev;
1570 __entry->agno = be32_to_cpu(agf->agf_seqno),
1571 __entry->flags = flags;
1572 __entry->length = be32_to_cpu(agf->agf_length),
1573 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1574 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1575 __entry->bno_level =
1576 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1577 __entry->cnt_level =
1578 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1579 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1580 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1581 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1582 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1583 __entry->longest = be32_to_cpu(agf->agf_longest);
1584 __entry->caller_ip = caller_ip;
1585 ),
1586 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1587 "levels b %u c %u flfirst %u fllast %u flcount %u "
Darrick J. Wongaff68a552018-01-09 11:46:05 -08001588 "freeblks %u longest %u caller %pS",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001589 MAJOR(__entry->dev), MINOR(__entry->dev),
1590 __entry->agno,
1591 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1592 __entry->length,
1593 __entry->bno_root,
1594 __entry->cnt_root,
1595 __entry->bno_level,
1596 __entry->cnt_level,
1597 __entry->flfirst,
1598 __entry->fllast,
1599 __entry->flcount,
1600 __entry->freeblks,
1601 __entry->longest,
1602 (void *)__entry->caller_ip)
1603);
Brian Fostera27ba262018-03-15 10:51:58 -07001604#define DEFINE_AGF_EVENT(name) \
1605DEFINE_EVENT(xfs_agf_class, name, \
1606 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1607 unsigned long caller_ip), \
1608 TP_ARGS(mp, agf, flags, caller_ip))
1609DEFINE_AGF_EVENT(xfs_agf);
1610DEFINE_AGF_EVENT(xfs_agfl_reset);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001611
1612TRACE_EVENT(xfs_free_extent,
1613 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001614 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1615 int haveright),
1616 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001617 TP_STRUCT__entry(
1618 __field(dev_t, dev)
1619 __field(xfs_agnumber_t, agno)
1620 __field(xfs_agblock_t, agbno)
1621 __field(xfs_extlen_t, len)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001622 __field(int, resv)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001623 __field(int, haveleft)
1624 __field(int, haveright)
1625 ),
1626 TP_fast_assign(
1627 __entry->dev = mp->m_super->s_dev;
1628 __entry->agno = agno;
1629 __entry->agbno = agbno;
1630 __entry->len = len;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001631 __entry->resv = resv;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001632 __entry->haveleft = haveleft;
1633 __entry->haveright = haveright;
1634 ),
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001635 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001636 MAJOR(__entry->dev), MINOR(__entry->dev),
1637 __entry->agno,
1638 __entry->agbno,
1639 __entry->len,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001640 __entry->resv,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001641 __entry->haveleft ?
1642 (__entry->haveright ? "both" : "left") :
1643 (__entry->haveright ? "right" : "none"))
1644
1645);
1646
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001647DECLARE_EVENT_CLASS(xfs_alloc_class,
1648 TP_PROTO(struct xfs_alloc_arg *args),
1649 TP_ARGS(args),
1650 TP_STRUCT__entry(
1651 __field(dev_t, dev)
1652 __field(xfs_agnumber_t, agno)
1653 __field(xfs_agblock_t, agbno)
1654 __field(xfs_extlen_t, minlen)
1655 __field(xfs_extlen_t, maxlen)
1656 __field(xfs_extlen_t, mod)
1657 __field(xfs_extlen_t, prod)
1658 __field(xfs_extlen_t, minleft)
1659 __field(xfs_extlen_t, total)
1660 __field(xfs_extlen_t, alignment)
1661 __field(xfs_extlen_t, minalignslop)
1662 __field(xfs_extlen_t, len)
1663 __field(short, type)
1664 __field(short, otype)
1665 __field(char, wasdel)
1666 __field(char, wasfromfl)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001667 __field(int, resv)
Dave Chinner292378e2016-09-26 08:21:28 +10001668 __field(int, datatype)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001669 __field(xfs_fsblock_t, firstblock)
1670 ),
1671 TP_fast_assign(
1672 __entry->dev = args->mp->m_super->s_dev;
1673 __entry->agno = args->agno;
1674 __entry->agbno = args->agbno;
1675 __entry->minlen = args->minlen;
1676 __entry->maxlen = args->maxlen;
1677 __entry->mod = args->mod;
1678 __entry->prod = args->prod;
1679 __entry->minleft = args->minleft;
1680 __entry->total = args->total;
1681 __entry->alignment = args->alignment;
1682 __entry->minalignslop = args->minalignslop;
1683 __entry->len = args->len;
1684 __entry->type = args->type;
1685 __entry->otype = args->otype;
1686 __entry->wasdel = args->wasdel;
1687 __entry->wasfromfl = args->wasfromfl;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001688 __entry->resv = args->resv;
Dave Chinner292378e2016-09-26 08:21:28 +10001689 __entry->datatype = args->datatype;
Brian Foster64396ff2018-07-11 22:26:30 -07001690 __entry->firstblock = args->tp->t_firstblock;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001691 ),
1692 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1693 "prod %u minleft %u total %u alignment %u minalignslop %u "
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001694 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
Dave Chinner292378e2016-09-26 08:21:28 +10001695 "datatype 0x%x firstblock 0x%llx",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001696 MAJOR(__entry->dev), MINOR(__entry->dev),
1697 __entry->agno,
1698 __entry->agbno,
1699 __entry->minlen,
1700 __entry->maxlen,
1701 __entry->mod,
1702 __entry->prod,
1703 __entry->minleft,
1704 __entry->total,
1705 __entry->alignment,
1706 __entry->minalignslop,
1707 __entry->len,
1708 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1709 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1710 __entry->wasdel,
1711 __entry->wasfromfl,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001712 __entry->resv,
Dave Chinner292378e2016-09-26 08:21:28 +10001713 __entry->datatype,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001714 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001715)
1716
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001717#define DEFINE_ALLOC_EVENT(name) \
1718DEFINE_EVENT(xfs_alloc_class, name, \
1719 TP_PROTO(struct xfs_alloc_arg *args), \
1720 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001721DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001722DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001723DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1724DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1725DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
Brian Fosterd2968822019-10-13 17:10:35 -07001726DEFINE_ALLOC_EVENT(xfs_alloc_cur);
Brian Fosterfec0afd2019-10-13 17:10:33 -07001727DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
1728DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
Brian Fosterdc8e69b2019-10-13 17:10:36 -07001729DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
1730DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001731DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001732DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1733DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001734DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1735DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1736DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1737DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1738DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001739DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001740DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1741DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1742DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1743DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1744DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1745DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1746DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1747DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1748DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1749
Brian Foster396bbf32019-10-13 17:10:33 -07001750TRACE_EVENT(xfs_alloc_cur_check,
1751 TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
1752 xfs_extlen_t len, xfs_extlen_t diff, bool new),
1753 TP_ARGS(mp, btnum, bno, len, diff, new),
1754 TP_STRUCT__entry(
1755 __field(dev_t, dev)
1756 __field(xfs_btnum_t, btnum)
1757 __field(xfs_agblock_t, bno)
1758 __field(xfs_extlen_t, len)
1759 __field(xfs_extlen_t, diff)
1760 __field(bool, new)
1761 ),
1762 TP_fast_assign(
1763 __entry->dev = mp->m_super->s_dev;
1764 __entry->btnum = btnum;
1765 __entry->bno = bno;
1766 __entry->len = len;
1767 __entry->diff = diff;
1768 __entry->new = new;
1769 ),
1770 TP_printk("dev %d:%d btree %s bno 0x%x len 0x%x diff 0x%x new %d",
1771 MAJOR(__entry->dev), MINOR(__entry->dev),
1772 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
1773 __entry->bno, __entry->len, __entry->diff, __entry->new)
1774)
1775
Dave Chinner5a5881c2012-03-22 05:15:13 +00001776DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001777 TP_PROTO(struct xfs_da_args *args),
1778 TP_ARGS(args),
1779 TP_STRUCT__entry(
1780 __field(dev_t, dev)
1781 __field(xfs_ino_t, ino)
1782 __dynamic_array(char, name, args->namelen)
1783 __field(int, namelen)
1784 __field(xfs_dahash_t, hashval)
1785 __field(xfs_ino_t, inumber)
1786 __field(int, op_flags)
1787 ),
1788 TP_fast_assign(
1789 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1790 __entry->ino = args->dp->i_ino;
1791 if (args->namelen)
1792 memcpy(__get_str(name), args->name, args->namelen);
1793 __entry->namelen = args->namelen;
1794 __entry->hashval = args->hashval;
1795 __entry->inumber = args->inumber;
1796 __entry->op_flags = args->op_flags;
1797 ),
1798 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1799 "inumber 0x%llx op_flags %s",
1800 MAJOR(__entry->dev), MINOR(__entry->dev),
1801 __entry->ino,
1802 __entry->namelen,
1803 __entry->namelen ? __get_str(name) : NULL,
1804 __entry->namelen,
1805 __entry->hashval,
1806 __entry->inumber,
1807 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001808)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001809
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001810#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001811DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001812 TP_PROTO(struct xfs_da_args *args), \
1813 TP_ARGS(args))
1814DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1815DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1816DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1817DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1818DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1819DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1820DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1821DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1822DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1823DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1824DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1825DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1826DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1827DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1828DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1829DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1830DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1831DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1832DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1833DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1834DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1835DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1836DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1837DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1838DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1839
Dave Chinneree732592012-11-12 22:53:53 +11001840DECLARE_EVENT_CLASS(xfs_attr_class,
1841 TP_PROTO(struct xfs_da_args *args),
1842 TP_ARGS(args),
1843 TP_STRUCT__entry(
1844 __field(dev_t, dev)
1845 __field(xfs_ino_t, ino)
1846 __dynamic_array(char, name, args->namelen)
1847 __field(int, namelen)
1848 __field(int, valuelen)
1849 __field(xfs_dahash_t, hashval)
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08001850 __field(unsigned int, attr_filter)
1851 __field(unsigned int, attr_flags)
Dave Chinneree732592012-11-12 22:53:53 +11001852 __field(int, op_flags)
1853 ),
1854 TP_fast_assign(
1855 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1856 __entry->ino = args->dp->i_ino;
1857 if (args->namelen)
1858 memcpy(__get_str(name), args->name, args->namelen);
1859 __entry->namelen = args->namelen;
1860 __entry->valuelen = args->valuelen;
1861 __entry->hashval = args->hashval;
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08001862 __entry->attr_filter = args->attr_filter;
1863 __entry->attr_flags = args->attr_flags;
Dave Chinneree732592012-11-12 22:53:53 +11001864 __entry->op_flags = args->op_flags;
1865 ),
1866 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08001867 "hashval 0x%x filter %s flags %s op_flags %s",
Dave Chinneree732592012-11-12 22:53:53 +11001868 MAJOR(__entry->dev), MINOR(__entry->dev),
1869 __entry->ino,
1870 __entry->namelen,
1871 __entry->namelen ? __get_str(name) : NULL,
1872 __entry->namelen,
1873 __entry->valuelen,
1874 __entry->hashval,
Christoph Hellwigd5f0f492020-02-26 17:30:42 -08001875 __print_flags(__entry->attr_filter, "|",
1876 XFS_ATTR_FILTER_FLAGS),
1877 __print_flags(__entry->attr_flags, "|",
1878 { XATTR_CREATE, "CREATE" },
1879 { XATTR_REPLACE, "REPLACE" }),
Dave Chinneree732592012-11-12 22:53:53 +11001880 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1881)
1882
Dave Chinner5a5881c2012-03-22 05:15:13 +00001883#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001884DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001885 TP_PROTO(struct xfs_da_args *args), \
1886 TP_ARGS(args))
1887DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1888DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1889DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1890DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1891DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001892DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1893
1894DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1895DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1896DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001897DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001898DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1899DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001900DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1901DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001902DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1903DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001904DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001905DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1906DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1907DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1908DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1909DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1910DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1911DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1912DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1913DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1914DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1915DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001916DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001917
1918DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001919DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001920DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1921DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1922
Dave Chinneree732592012-11-12 22:53:53 +11001923DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1924DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1925
1926DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1927DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1928DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1929
Dave Chinner5a5881c2012-03-22 05:15:13 +00001930#define DEFINE_DA_EVENT(name) \
1931DEFINE_EVENT(xfs_da_class, name, \
1932 TP_PROTO(struct xfs_da_args *args), \
1933 TP_ARGS(args))
1934DEFINE_DA_EVENT(xfs_da_split);
1935DEFINE_DA_EVENT(xfs_da_join);
1936DEFINE_DA_EVENT(xfs_da_link_before);
1937DEFINE_DA_EVENT(xfs_da_link_after);
1938DEFINE_DA_EVENT(xfs_da_unlink_back);
1939DEFINE_DA_EVENT(xfs_da_unlink_forward);
1940DEFINE_DA_EVENT(xfs_da_root_split);
1941DEFINE_DA_EVENT(xfs_da_root_join);
1942DEFINE_DA_EVENT(xfs_da_node_add);
1943DEFINE_DA_EVENT(xfs_da_node_create);
1944DEFINE_DA_EVENT(xfs_da_node_split);
1945DEFINE_DA_EVENT(xfs_da_node_remove);
1946DEFINE_DA_EVENT(xfs_da_node_rebalance);
1947DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001948DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001949DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1950DEFINE_DA_EVENT(xfs_da_grow_inode);
1951DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001952DEFINE_DA_EVENT(xfs_da_fixhashpath);
1953DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001954
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001955DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1956 TP_PROTO(struct xfs_da_args *args, int idx),
1957 TP_ARGS(args, idx),
1958 TP_STRUCT__entry(
1959 __field(dev_t, dev)
1960 __field(xfs_ino_t, ino)
1961 __field(int, op_flags)
1962 __field(int, idx)
1963 ),
1964 TP_fast_assign(
1965 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1966 __entry->ino = args->dp->i_ino;
1967 __entry->op_flags = args->op_flags;
1968 __entry->idx = idx;
1969 ),
1970 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1971 MAJOR(__entry->dev), MINOR(__entry->dev),
1972 __entry->ino,
1973 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1974 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001975)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001976
1977#define DEFINE_DIR2_SPACE_EVENT(name) \
1978DEFINE_EVENT(xfs_dir2_space_class, name, \
1979 TP_PROTO(struct xfs_da_args *args, int idx), \
1980 TP_ARGS(args, idx))
1981DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1982DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1983DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1984DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001985
1986TRACE_EVENT(xfs_dir2_leafn_moveents,
1987 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1988 TP_ARGS(args, src_idx, dst_idx, count),
1989 TP_STRUCT__entry(
1990 __field(dev_t, dev)
1991 __field(xfs_ino_t, ino)
1992 __field(int, op_flags)
1993 __field(int, src_idx)
1994 __field(int, dst_idx)
1995 __field(int, count)
1996 ),
1997 TP_fast_assign(
1998 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1999 __entry->ino = args->dp->i_ino;
2000 __entry->op_flags = args->op_flags;
2001 __entry->src_idx = src_idx;
2002 __entry->dst_idx = dst_idx;
2003 __entry->count = count;
2004 ),
2005 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
2006 "src_idx %d dst_idx %d count %d",
2007 MAJOR(__entry->dev), MINOR(__entry->dev),
2008 __entry->ino,
2009 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2010 __entry->src_idx,
2011 __entry->dst_idx,
2012 __entry->count)
2013);
2014
Dave Chinner3a85cd92010-01-14 01:33:55 +00002015#define XFS_SWAPEXT_INODES \
2016 { 0, "target" }, \
2017 { 1, "temp" }
2018
Darrick J. Wong0357d212018-12-18 14:32:30 -08002019TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
2020TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
2021TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
2022TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
2023TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
Dave Chinner3a85cd92010-01-14 01:33:55 +00002024
2025DECLARE_EVENT_CLASS(xfs_swap_extent_class,
2026 TP_PROTO(struct xfs_inode *ip, int which),
2027 TP_ARGS(ip, which),
2028 TP_STRUCT__entry(
2029 __field(dev_t, dev)
2030 __field(int, which)
2031 __field(xfs_ino_t, ino)
2032 __field(int, format)
2033 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00002034 __field(int, broot_size)
2035 __field(int, fork_off)
2036 ),
2037 TP_fast_assign(
2038 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2039 __entry->which = which;
2040 __entry->ino = ip->i_ino;
Christoph Hellwigf7e67b22020-05-18 10:28:05 -07002041 __entry->format = ip->i_df.if_format;
Christoph Hellwigdaf83962020-05-18 10:27:22 -07002042 __entry->nex = ip->i_df.if_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00002043 __entry->broot_size = ip->i_df.if_broot_bytes;
2044 __entry->fork_off = XFS_IFORK_BOFF(ip);
2045 ),
2046 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00002047 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00002048 MAJOR(__entry->dev), MINOR(__entry->dev),
2049 __entry->ino,
2050 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
2051 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
2052 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00002053 __entry->broot_size,
2054 __entry->fork_off)
2055)
2056
2057#define DEFINE_SWAPEXT_EVENT(name) \
2058DEFINE_EVENT(xfs_swap_extent_class, name, \
2059 TP_PROTO(struct xfs_inode *ip, int which), \
2060 TP_ARGS(ip, which))
2061
2062DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
2063DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
2064
Brian Fostere67d3d42017-08-08 18:21:53 -07002065TRACE_EVENT(xfs_log_recover,
2066 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
2067 TP_ARGS(log, headblk, tailblk),
2068 TP_STRUCT__entry(
2069 __field(dev_t, dev)
2070 __field(xfs_daddr_t, headblk)
2071 __field(xfs_daddr_t, tailblk)
2072 ),
2073 TP_fast_assign(
2074 __entry->dev = log->l_mp->m_super->s_dev;
2075 __entry->headblk = headblk;
2076 __entry->tailblk = tailblk;
2077 ),
2078 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2079 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2080 __entry->tailblk)
2081)
2082
Brian Foster5cd9cee2016-09-26 08:34:52 +10002083TRACE_EVENT(xfs_log_recover_record,
2084 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2085 TP_ARGS(log, rhead, pass),
2086 TP_STRUCT__entry(
2087 __field(dev_t, dev)
2088 __field(xfs_lsn_t, lsn)
2089 __field(int, len)
2090 __field(int, num_logops)
2091 __field(int, pass)
2092 ),
2093 TP_fast_assign(
2094 __entry->dev = log->l_mp->m_super->s_dev;
2095 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2096 __entry->len = be32_to_cpu(rhead->h_len);
2097 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2098 __entry->pass = pass;
2099 ),
2100 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2101 MAJOR(__entry->dev), MINOR(__entry->dev),
2102 __entry->lsn, __entry->len, __entry->num_logops,
2103 __entry->pass)
2104)
2105
Dave Chinner9abbc532010-04-13 15:06:46 +10002106DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002107 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10002108 struct xlog_recover_item *item, int pass),
2109 TP_ARGS(log, trans, item, pass),
2110 TP_STRUCT__entry(
2111 __field(dev_t, dev)
2112 __field(unsigned long, item)
2113 __field(xlog_tid_t, tid)
Brian Foster5cd9cee2016-09-26 08:34:52 +10002114 __field(xfs_lsn_t, lsn)
Dave Chinner9abbc532010-04-13 15:06:46 +10002115 __field(int, type)
2116 __field(int, pass)
2117 __field(int, count)
2118 __field(int, total)
2119 ),
2120 TP_fast_assign(
2121 __entry->dev = log->l_mp->m_super->s_dev;
2122 __entry->item = (unsigned long)item;
2123 __entry->tid = trans->r_log_tid;
Brian Foster5cd9cee2016-09-26 08:34:52 +10002124 __entry->lsn = trans->r_lsn;
Dave Chinner9abbc532010-04-13 15:06:46 +10002125 __entry->type = ITEM_TYPE(item);
2126 __entry->pass = pass;
2127 __entry->count = item->ri_cnt;
2128 __entry->total = item->ri_total;
2129 ),
Darrick J. Wong3d170aa2018-01-09 11:43:36 -08002130 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
Brian Foster5cd9cee2016-09-26 08:34:52 +10002131 "item type %s item region count/total %d/%d",
Dave Chinner9abbc532010-04-13 15:06:46 +10002132 MAJOR(__entry->dev), MINOR(__entry->dev),
2133 __entry->tid,
Brian Foster5cd9cee2016-09-26 08:34:52 +10002134 __entry->lsn,
Dave Chinner9abbc532010-04-13 15:06:46 +10002135 __entry->pass,
2136 (void *)__entry->item,
2137 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2138 __entry->count,
2139 __entry->total)
2140)
2141
2142#define DEFINE_LOG_RECOVER_ITEM(name) \
2143DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002144 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10002145 struct xlog_recover_item *item, int pass), \
2146 TP_ARGS(log, trans, item, pass))
2147
2148DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2149DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2150DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2151DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2152DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2153
2154DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002155 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002156 TP_ARGS(log, buf_f),
2157 TP_STRUCT__entry(
2158 __field(dev_t, dev)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002159 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002160 __field(unsigned short, len)
2161 __field(unsigned short, flags)
2162 __field(unsigned short, size)
2163 __field(unsigned int, map_size)
2164 ),
2165 TP_fast_assign(
2166 __entry->dev = log->l_mp->m_super->s_dev;
2167 __entry->blkno = buf_f->blf_blkno;
2168 __entry->len = buf_f->blf_len;
2169 __entry->flags = buf_f->blf_flags;
2170 __entry->size = buf_f->blf_size;
2171 __entry->map_size = buf_f->blf_map_size;
2172 ),
2173 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2174 "map_size %d",
2175 MAJOR(__entry->dev), MINOR(__entry->dev),
2176 __entry->blkno,
2177 __entry->len,
2178 __entry->flags,
2179 __entry->size,
2180 __entry->map_size)
2181)
2182
2183#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2184DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002185 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002186 TP_ARGS(log, buf_f))
2187
2188DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2189DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2190DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2191DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2192DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
Brian Foster5cd9cee2016-09-26 08:34:52 +10002193DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
Dave Chinner9abbc532010-04-13 15:06:46 +10002194DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2195DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2196DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2197
2198DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002199 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002200 TP_ARGS(log, in_f),
2201 TP_STRUCT__entry(
2202 __field(dev_t, dev)
2203 __field(xfs_ino_t, ino)
2204 __field(unsigned short, size)
2205 __field(int, fields)
2206 __field(unsigned short, asize)
2207 __field(unsigned short, dsize)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07002208 __field(int64_t, blkno)
Dave Chinner9abbc532010-04-13 15:06:46 +10002209 __field(int, len)
2210 __field(int, boffset)
2211 ),
2212 TP_fast_assign(
2213 __entry->dev = log->l_mp->m_super->s_dev;
2214 __entry->ino = in_f->ilf_ino;
2215 __entry->size = in_f->ilf_size;
2216 __entry->fields = in_f->ilf_fields;
2217 __entry->asize = in_f->ilf_asize;
2218 __entry->dsize = in_f->ilf_dsize;
2219 __entry->blkno = in_f->ilf_blkno;
2220 __entry->len = in_f->ilf_len;
2221 __entry->boffset = in_f->ilf_boffset;
2222 ),
2223 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2224 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2225 MAJOR(__entry->dev), MINOR(__entry->dev),
2226 __entry->ino,
2227 __entry->size,
2228 __entry->fields,
2229 __entry->asize,
2230 __entry->dsize,
2231 __entry->blkno,
2232 __entry->len,
2233 __entry->boffset)
2234)
2235#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2236DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002237 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002238 TP_ARGS(log, in_f))
2239
2240DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2241DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2242DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2243
Brian Foster78d57e42015-08-19 09:58:48 +10002244DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2245 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2246 TP_ARGS(log, in_f),
2247 TP_STRUCT__entry(
2248 __field(dev_t, dev)
2249 __field(xfs_agnumber_t, agno)
2250 __field(xfs_agblock_t, agbno)
2251 __field(unsigned int, count)
2252 __field(unsigned int, isize)
2253 __field(xfs_agblock_t, length)
2254 __field(unsigned int, gen)
2255 ),
2256 TP_fast_assign(
2257 __entry->dev = log->l_mp->m_super->s_dev;
2258 __entry->agno = be32_to_cpu(in_f->icl_ag);
2259 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2260 __entry->count = be32_to_cpu(in_f->icl_count);
2261 __entry->isize = be32_to_cpu(in_f->icl_isize);
2262 __entry->length = be32_to_cpu(in_f->icl_length);
2263 __entry->gen = be32_to_cpu(in_f->icl_gen);
2264 ),
2265 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2266 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2267 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2268 __entry->length, __entry->gen)
2269)
2270#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2271DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2272 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2273 TP_ARGS(log, in_f))
2274
2275DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2276DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2277
Christoph Hellwiga46db602011-01-07 13:02:04 +00002278DECLARE_EVENT_CLASS(xfs_discard_class,
2279 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2280 xfs_agblock_t agbno, xfs_extlen_t len),
2281 TP_ARGS(mp, agno, agbno, len),
2282 TP_STRUCT__entry(
2283 __field(dev_t, dev)
2284 __field(xfs_agnumber_t, agno)
2285 __field(xfs_agblock_t, agbno)
2286 __field(xfs_extlen_t, len)
2287 ),
2288 TP_fast_assign(
2289 __entry->dev = mp->m_super->s_dev;
2290 __entry->agno = agno;
2291 __entry->agbno = agbno;
2292 __entry->len = len;
2293 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002294 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwiga46db602011-01-07 13:02:04 +00002295 MAJOR(__entry->dev), MINOR(__entry->dev),
2296 __entry->agno,
2297 __entry->agbno,
2298 __entry->len)
2299)
2300
2301#define DEFINE_DISCARD_EVENT(name) \
2302DEFINE_EVENT(xfs_discard_class, name, \
2303 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2304 xfs_agblock_t agbno, xfs_extlen_t len), \
2305 TP_ARGS(mp, agno, agbno, len))
2306DEFINE_DISCARD_EVENT(xfs_discard_extent);
2307DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2308DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2309DEFINE_DISCARD_EVENT(xfs_discard_busy);
2310
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002311/* btree cursor events */
Darrick J. Wongc4942132018-12-18 14:32:31 -08002312TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2313TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2314TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2315TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2316TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2317TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2318TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2319
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002320DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2321 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2322 TP_ARGS(cur, level, bp),
2323 TP_STRUCT__entry(
2324 __field(dev_t, dev)
2325 __field(xfs_btnum_t, btnum)
2326 __field(int, level)
2327 __field(int, nlevels)
2328 __field(int, ptr)
2329 __field(xfs_daddr_t, daddr)
2330 ),
2331 TP_fast_assign(
2332 __entry->dev = cur->bc_mp->m_super->s_dev;
2333 __entry->btnum = cur->bc_btnum;
2334 __entry->level = level;
2335 __entry->nlevels = cur->bc_nlevels;
2336 __entry->ptr = cur->bc_ptrs[level];
2337 __entry->daddr = bp ? bp->b_bn : -1;
2338 ),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002339 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002340 MAJOR(__entry->dev), MINOR(__entry->dev),
Darrick J. Wongc4942132018-12-18 14:32:31 -08002341 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002342 __entry->level,
2343 __entry->nlevels,
2344 __entry->ptr,
2345 (unsigned long long)__entry->daddr)
2346)
2347
2348#define DEFINE_BTREE_CUR_EVENT(name) \
2349DEFINE_EVENT(xfs_btree_cur_class, name, \
2350 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2351 TP_ARGS(cur, level, bp))
2352DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
Darrick J. Wong105f7d82016-08-03 11:10:21 +10002353DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002354
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002355/* deferred ops */
2356struct xfs_defer_pending;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002357
2358DECLARE_EVENT_CLASS(xfs_defer_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002359 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2360 TP_ARGS(tp, caller_ip),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002361 TP_STRUCT__entry(
2362 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002363 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002364 __field(char, committed)
Dave Chinnere632a562018-05-09 07:48:52 -07002365 __field(unsigned long, caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002366 ),
2367 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002368 __entry->dev = tp->t_mountp->m_super->s_dev;
2369 __entry->tp = tp;
Dave Chinnere632a562018-05-09 07:48:52 -07002370 __entry->caller_ip = caller_ip;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002371 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002372 TP_printk("dev %d:%d tp %p caller %pS",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002373 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002374 __entry->tp,
Dave Chinnere632a562018-05-09 07:48:52 -07002375 (char *)__entry->caller_ip)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002376)
2377#define DEFINE_DEFER_EVENT(name) \
2378DEFINE_EVENT(xfs_defer_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002379 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2380 TP_ARGS(tp, caller_ip))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002381
2382DECLARE_EVENT_CLASS(xfs_defer_error_class,
Brian Foster9d9e6232018-08-01 07:20:35 -07002383 TP_PROTO(struct xfs_trans *tp, int error),
2384 TP_ARGS(tp, error),
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002385 TP_STRUCT__entry(
2386 __field(dev_t, dev)
Brian Foster9d9e6232018-08-01 07:20:35 -07002387 __field(struct xfs_trans *, tp)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002388 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002389 __field(int, error)
2390 ),
2391 TP_fast_assign(
Brian Foster9d9e6232018-08-01 07:20:35 -07002392 __entry->dev = tp->t_mountp->m_super->s_dev;
2393 __entry->tp = tp;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002394 __entry->error = error;
2395 ),
Brian Foster9d9e6232018-08-01 07:20:35 -07002396 TP_printk("dev %d:%d tp %p err %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002397 MAJOR(__entry->dev), MINOR(__entry->dev),
Brian Foster9d9e6232018-08-01 07:20:35 -07002398 __entry->tp,
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002399 __entry->error)
2400)
2401#define DEFINE_DEFER_ERROR_EVENT(name) \
2402DEFINE_EVENT(xfs_defer_error_class, name, \
Brian Foster9d9e6232018-08-01 07:20:35 -07002403 TP_PROTO(struct xfs_trans *tp, int error), \
2404 TP_ARGS(tp, error))
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002405
2406DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2407 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2408 TP_ARGS(mp, dfp),
2409 TP_STRUCT__entry(
2410 __field(dev_t, dev)
2411 __field(int, type)
2412 __field(void *, intent)
Christoph Hellwig3f88a152017-04-21 11:24:42 -07002413 __field(char, committed)
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002414 __field(int, nr)
2415 ),
2416 TP_fast_assign(
2417 __entry->dev = mp ? mp->m_super->s_dev : 0;
Darrick J. Wong02b100f2018-12-12 08:46:22 -08002418 __entry->type = dfp->dfp_type;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002419 __entry->intent = dfp->dfp_intent;
Darrick J. Wongea78d802016-08-30 13:51:39 +10002420 __entry->committed = dfp->dfp_done != NULL;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002421 __entry->nr = dfp->dfp_count;
2422 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002423 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002424 MAJOR(__entry->dev), MINOR(__entry->dev),
2425 __entry->type,
2426 __entry->intent,
2427 __entry->committed,
2428 __entry->nr)
2429)
2430#define DEFINE_DEFER_PENDING_EVENT(name) \
2431DEFINE_EVENT(xfs_defer_pending_class, name, \
2432 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2433 TP_ARGS(mp, dfp))
2434
2435DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2436 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2437 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2438 TP_ARGS(mp, agno, type, agbno, len),
2439 TP_STRUCT__entry(
2440 __field(dev_t, dev)
2441 __field(xfs_agnumber_t, agno)
2442 __field(int, type)
2443 __field(xfs_agblock_t, agbno)
2444 __field(xfs_extlen_t, len)
2445 ),
2446 TP_fast_assign(
2447 __entry->dev = mp->m_super->s_dev;
2448 __entry->agno = agno;
2449 __entry->type = type;
2450 __entry->agbno = agbno;
2451 __entry->len = len;
2452 ),
2453 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2454 MAJOR(__entry->dev), MINOR(__entry->dev),
2455 __entry->type,
2456 __entry->agno,
2457 __entry->agbno,
2458 __entry->len)
2459);
2460#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2461DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2462 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2463 int type, \
2464 xfs_agblock_t bno, \
2465 xfs_extlen_t len), \
2466 TP_ARGS(mp, agno, type, bno, len))
2467
2468DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2469 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2470 int op,
2471 xfs_agblock_t agbno,
2472 xfs_ino_t ino,
2473 int whichfork,
2474 xfs_fileoff_t offset,
2475 xfs_filblks_t len,
2476 xfs_exntst_t state),
2477 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2478 TP_STRUCT__entry(
2479 __field(dev_t, dev)
2480 __field(xfs_agnumber_t, agno)
2481 __field(xfs_ino_t, ino)
2482 __field(xfs_agblock_t, agbno)
2483 __field(int, whichfork)
2484 __field(xfs_fileoff_t, l_loff)
2485 __field(xfs_filblks_t, l_len)
2486 __field(xfs_exntst_t, l_state)
2487 __field(int, op)
2488 ),
2489 TP_fast_assign(
2490 __entry->dev = mp->m_super->s_dev;
2491 __entry->agno = agno;
2492 __entry->ino = ino;
2493 __entry->agbno = agbno;
2494 __entry->whichfork = whichfork;
2495 __entry->l_loff = offset;
2496 __entry->l_len = len;
2497 __entry->l_state = state;
2498 __entry->op = op;
2499 ),
2500 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2501 MAJOR(__entry->dev), MINOR(__entry->dev),
2502 __entry->op,
2503 __entry->agno,
2504 __entry->agbno,
2505 __entry->ino,
2506 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2507 __entry->l_loff,
2508 __entry->l_len,
2509 __entry->l_state)
2510);
2511#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2512DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2513 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2514 int op, \
2515 xfs_agblock_t agbno, \
2516 xfs_ino_t ino, \
2517 int whichfork, \
2518 xfs_fileoff_t offset, \
2519 xfs_filblks_t len, \
2520 xfs_exntst_t state), \
2521 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2522
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002523DEFINE_DEFER_EVENT(xfs_defer_cancel);
2524DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2525DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2526DEFINE_DEFER_EVENT(xfs_defer_finish);
2527DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2528
2529DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2530DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002531
Brian Foster1ae093cb2018-08-01 07:20:34 -07002532DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2533DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002534DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2535DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
Darrick J. Wong4e919af2020-09-27 16:18:13 -07002536DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002537
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002538#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2539DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2540DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
Brian Fosterf8f28352018-05-07 17:38:47 -07002541DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2542DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002543
Darrick J. Wong673930c2016-08-03 11:33:43 +10002544/* rmap tracepoints */
2545DECLARE_EVENT_CLASS(xfs_rmap_class,
2546 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2547 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
Darrick J. Wong66e32372018-12-12 08:46:23 -08002548 const struct xfs_owner_info *oinfo),
Darrick J. Wong673930c2016-08-03 11:33:43 +10002549 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2550 TP_STRUCT__entry(
2551 __field(dev_t, dev)
2552 __field(xfs_agnumber_t, agno)
2553 __field(xfs_agblock_t, agbno)
2554 __field(xfs_extlen_t, len)
2555 __field(uint64_t, owner)
2556 __field(uint64_t, offset)
2557 __field(unsigned long, flags)
2558 ),
2559 TP_fast_assign(
2560 __entry->dev = mp->m_super->s_dev;
2561 __entry->agno = agno;
2562 __entry->agbno = agbno;
2563 __entry->len = len;
2564 __entry->owner = oinfo->oi_owner;
2565 __entry->offset = oinfo->oi_offset;
2566 __entry->flags = oinfo->oi_flags;
Darrick J. Wong035e00a2016-08-03 11:36:07 +10002567 if (unwritten)
2568 __entry->flags |= XFS_RMAP_UNWRITTEN;
Darrick J. Wong673930c2016-08-03 11:33:43 +10002569 ),
2570 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2571 MAJOR(__entry->dev), MINOR(__entry->dev),
2572 __entry->agno,
2573 __entry->agbno,
2574 __entry->len,
2575 __entry->owner,
2576 __entry->offset,
2577 __entry->flags)
2578);
2579#define DEFINE_RMAP_EVENT(name) \
2580DEFINE_EVENT(xfs_rmap_class, name, \
2581 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2582 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
Darrick J. Wong66e32372018-12-12 08:46:23 -08002583 const struct xfs_owner_info *oinfo), \
Darrick J. Wong673930c2016-08-03 11:33:43 +10002584 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2585
2586/* simple AG-based error/%ip tracepoint class */
2587DECLARE_EVENT_CLASS(xfs_ag_error_class,
2588 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2589 unsigned long caller_ip),
2590 TP_ARGS(mp, agno, error, caller_ip),
2591 TP_STRUCT__entry(
2592 __field(dev_t, dev)
2593 __field(xfs_agnumber_t, agno)
2594 __field(int, error)
2595 __field(unsigned long, caller_ip)
2596 ),
2597 TP_fast_assign(
2598 __entry->dev = mp->m_super->s_dev;
2599 __entry->agno = agno;
2600 __entry->error = error;
2601 __entry->caller_ip = caller_ip;
2602 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08002603 TP_printk("dev %d:%d agno %u error %d caller %pS",
Darrick J. Wong673930c2016-08-03 11:33:43 +10002604 MAJOR(__entry->dev), MINOR(__entry->dev),
2605 __entry->agno,
2606 __entry->error,
2607 (char *)__entry->caller_ip)
2608);
2609
2610#define DEFINE_AG_ERROR_EVENT(name) \
2611DEFINE_EVENT(xfs_ag_error_class, name, \
2612 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2613 unsigned long caller_ip), \
2614 TP_ARGS(mp, agno, error, caller_ip))
2615
2616DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2617DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2618DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2619DEFINE_RMAP_EVENT(xfs_rmap_map);
2620DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2621DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002622DEFINE_RMAP_EVENT(xfs_rmap_convert);
2623DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2624DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2625DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
Darrick J. Wong673930c2016-08-03 11:33:43 +10002626
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002627DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2628 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2629 xfs_agblock_t agbno, xfs_extlen_t len,
2630 uint64_t owner, uint64_t offset, unsigned int flags),
2631 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2632 TP_STRUCT__entry(
2633 __field(dev_t, dev)
2634 __field(xfs_agnumber_t, agno)
2635 __field(xfs_agblock_t, agbno)
2636 __field(xfs_extlen_t, len)
2637 __field(uint64_t, owner)
2638 __field(uint64_t, offset)
2639 __field(unsigned int, flags)
2640 ),
2641 TP_fast_assign(
2642 __entry->dev = mp->m_super->s_dev;
2643 __entry->agno = agno;
2644 __entry->agbno = agbno;
2645 __entry->len = len;
2646 __entry->owner = owner;
2647 __entry->offset = offset;
2648 __entry->flags = flags;
2649 ),
2650 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2651 MAJOR(__entry->dev), MINOR(__entry->dev),
2652 __entry->agno,
2653 __entry->agbno,
2654 __entry->len,
2655 __entry->owner,
2656 __entry->offset,
2657 __entry->flags)
2658);
2659#define DEFINE_RMAPBT_EVENT(name) \
2660DEFINE_EVENT(xfs_rmapbt_class, name, \
2661 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2662 xfs_agblock_t agbno, xfs_extlen_t len, \
2663 uint64_t owner, uint64_t offset, unsigned int flags), \
2664 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2665
2666#define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2667DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2668DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2669
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002670DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2671DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002672DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2673DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2674DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2675DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2676DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2677DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
Darrick J. Wongceeb9c82016-10-03 09:11:48 -07002678
2679DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2680DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2681DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2682DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
Darrick J. Wong0a1b0b32016-08-03 11:44:21 +10002683DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2684DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002685DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002686
Darrick J. Wong9f3afb52016-10-03 09:11:28 -07002687/* deferred bmbt updates */
2688#define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2689DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2690DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2691
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002692/* per-AG reservation */
2693DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2694 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2695 xfs_extlen_t len),
2696 TP_ARGS(pag, resv, len),
2697 TP_STRUCT__entry(
2698 __field(dev_t, dev)
2699 __field(xfs_agnumber_t, agno)
2700 __field(int, resv)
2701 __field(xfs_extlen_t, freeblks)
2702 __field(xfs_extlen_t, flcount)
2703 __field(xfs_extlen_t, reserved)
2704 __field(xfs_extlen_t, asked)
2705 __field(xfs_extlen_t, len)
2706 ),
2707 TP_fast_assign(
2708 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2709
2710 __entry->dev = pag->pag_mount->m_super->s_dev;
2711 __entry->agno = pag->pag_agno;
2712 __entry->resv = resv;
2713 __entry->freeblks = pag->pagf_freeblks;
2714 __entry->flcount = pag->pagf_flcount;
2715 __entry->reserved = r ? r->ar_reserved : 0;
2716 __entry->asked = r ? r->ar_asked : 0;
2717 __entry->len = len;
2718 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002719 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u "
2720 "resv %u ask %u len %u",
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002721 MAJOR(__entry->dev), MINOR(__entry->dev),
2722 __entry->agno,
2723 __entry->resv,
2724 __entry->freeblks,
2725 __entry->flcount,
2726 __entry->reserved,
2727 __entry->asked,
2728 __entry->len)
2729)
2730#define DEFINE_AG_RESV_EVENT(name) \
2731DEFINE_EVENT(xfs_ag_resv_class, name, \
2732 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2733 xfs_extlen_t len), \
2734 TP_ARGS(pag, type, len))
2735
2736/* per-AG reservation tracepoints */
2737DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2738DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2739DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2740DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2741DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2742DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2743
2744DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2745DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2746
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002747/* refcount tracepoint classes */
2748
2749/* reuse the discard trace class for agbno/aglen-based traces */
2750#define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2751
2752/* ag btree lookup tracepoint class */
Darrick J. Wong85f8dff2018-12-18 14:32:29 -08002753TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2754TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2755TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002756DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2757 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2758 xfs_agblock_t agbno, xfs_lookup_t dir),
2759 TP_ARGS(mp, agno, agbno, dir),
2760 TP_STRUCT__entry(
2761 __field(dev_t, dev)
2762 __field(xfs_agnumber_t, agno)
2763 __field(xfs_agblock_t, agbno)
2764 __field(xfs_lookup_t, dir)
2765 ),
2766 TP_fast_assign(
2767 __entry->dev = mp->m_super->s_dev;
2768 __entry->agno = agno;
2769 __entry->agbno = agbno;
2770 __entry->dir = dir;
2771 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002772 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002773 MAJOR(__entry->dev), MINOR(__entry->dev),
2774 __entry->agno,
2775 __entry->agbno,
2776 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2777 __entry->dir)
2778)
2779
2780#define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2781DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2782 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2783 xfs_agblock_t agbno, xfs_lookup_t dir), \
2784 TP_ARGS(mp, agno, agbno, dir))
2785
2786/* single-rcext tracepoint class */
2787DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2788 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2789 struct xfs_refcount_irec *irec),
2790 TP_ARGS(mp, agno, irec),
2791 TP_STRUCT__entry(
2792 __field(dev_t, dev)
2793 __field(xfs_agnumber_t, agno)
2794 __field(xfs_agblock_t, startblock)
2795 __field(xfs_extlen_t, blockcount)
2796 __field(xfs_nlink_t, refcount)
2797 ),
2798 TP_fast_assign(
2799 __entry->dev = mp->m_super->s_dev;
2800 __entry->agno = agno;
2801 __entry->startblock = irec->rc_startblock;
2802 __entry->blockcount = irec->rc_blockcount;
2803 __entry->refcount = irec->rc_refcount;
2804 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002805 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002806 MAJOR(__entry->dev), MINOR(__entry->dev),
2807 __entry->agno,
2808 __entry->startblock,
2809 __entry->blockcount,
2810 __entry->refcount)
2811)
2812
2813#define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2814DEFINE_EVENT(xfs_refcount_extent_class, name, \
2815 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2816 struct xfs_refcount_irec *irec), \
2817 TP_ARGS(mp, agno, irec))
2818
2819/* single-rcext and an agbno tracepoint class */
2820DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2821 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2822 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2823 TP_ARGS(mp, agno, irec, agbno),
2824 TP_STRUCT__entry(
2825 __field(dev_t, dev)
2826 __field(xfs_agnumber_t, agno)
2827 __field(xfs_agblock_t, startblock)
2828 __field(xfs_extlen_t, blockcount)
2829 __field(xfs_nlink_t, refcount)
2830 __field(xfs_agblock_t, agbno)
2831 ),
2832 TP_fast_assign(
2833 __entry->dev = mp->m_super->s_dev;
2834 __entry->agno = agno;
2835 __entry->startblock = irec->rc_startblock;
2836 __entry->blockcount = irec->rc_blockcount;
2837 __entry->refcount = irec->rc_refcount;
2838 __entry->agbno = agbno;
2839 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07002840 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002841 MAJOR(__entry->dev), MINOR(__entry->dev),
2842 __entry->agno,
2843 __entry->startblock,
2844 __entry->blockcount,
2845 __entry->refcount,
2846 __entry->agbno)
2847)
2848
2849#define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2850DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2851 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2852 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2853 TP_ARGS(mp, agno, irec, agbno))
2854
2855/* double-rcext tracepoint class */
2856DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2857 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2858 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2859 TP_ARGS(mp, agno, i1, i2),
2860 TP_STRUCT__entry(
2861 __field(dev_t, dev)
2862 __field(xfs_agnumber_t, agno)
2863 __field(xfs_agblock_t, i1_startblock)
2864 __field(xfs_extlen_t, i1_blockcount)
2865 __field(xfs_nlink_t, i1_refcount)
2866 __field(xfs_agblock_t, i2_startblock)
2867 __field(xfs_extlen_t, i2_blockcount)
2868 __field(xfs_nlink_t, i2_refcount)
2869 ),
2870 TP_fast_assign(
2871 __entry->dev = mp->m_super->s_dev;
2872 __entry->agno = agno;
2873 __entry->i1_startblock = i1->rc_startblock;
2874 __entry->i1_blockcount = i1->rc_blockcount;
2875 __entry->i1_refcount = i1->rc_refcount;
2876 __entry->i2_startblock = i2->rc_startblock;
2877 __entry->i2_blockcount = i2->rc_blockcount;
2878 __entry->i2_refcount = i2->rc_refcount;
2879 ),
2880 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002881 "agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002882 MAJOR(__entry->dev), MINOR(__entry->dev),
2883 __entry->agno,
2884 __entry->i1_startblock,
2885 __entry->i1_blockcount,
2886 __entry->i1_refcount,
2887 __entry->i2_startblock,
2888 __entry->i2_blockcount,
2889 __entry->i2_refcount)
2890)
2891
2892#define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2893DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2894 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2895 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2896 TP_ARGS(mp, agno, i1, i2))
2897
2898/* double-rcext and an agbno tracepoint class */
2899DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
2900 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2901 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2902 xfs_agblock_t agbno),
2903 TP_ARGS(mp, agno, i1, i2, agbno),
2904 TP_STRUCT__entry(
2905 __field(dev_t, dev)
2906 __field(xfs_agnumber_t, agno)
2907 __field(xfs_agblock_t, i1_startblock)
2908 __field(xfs_extlen_t, i1_blockcount)
2909 __field(xfs_nlink_t, i1_refcount)
2910 __field(xfs_agblock_t, i2_startblock)
2911 __field(xfs_extlen_t, i2_blockcount)
2912 __field(xfs_nlink_t, i2_refcount)
2913 __field(xfs_agblock_t, agbno)
2914 ),
2915 TP_fast_assign(
2916 __entry->dev = mp->m_super->s_dev;
2917 __entry->agno = agno;
2918 __entry->i1_startblock = i1->rc_startblock;
2919 __entry->i1_blockcount = i1->rc_blockcount;
2920 __entry->i1_refcount = i1->rc_refcount;
2921 __entry->i2_startblock = i2->rc_startblock;
2922 __entry->i2_blockcount = i2->rc_blockcount;
2923 __entry->i2_refcount = i2->rc_refcount;
2924 __entry->agbno = agbno;
2925 ),
2926 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002927 "agbno %u len %u refcount %u @ agbno %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002928 MAJOR(__entry->dev), MINOR(__entry->dev),
2929 __entry->agno,
2930 __entry->i1_startblock,
2931 __entry->i1_blockcount,
2932 __entry->i1_refcount,
2933 __entry->i2_startblock,
2934 __entry->i2_blockcount,
2935 __entry->i2_refcount,
2936 __entry->agbno)
2937)
2938
2939#define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2940DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2941 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2942 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2943 xfs_agblock_t agbno), \
2944 TP_ARGS(mp, agno, i1, i2, agbno))
2945
2946/* triple-rcext tracepoint class */
2947DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
2948 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2949 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2950 struct xfs_refcount_irec *i3),
2951 TP_ARGS(mp, agno, i1, i2, i3),
2952 TP_STRUCT__entry(
2953 __field(dev_t, dev)
2954 __field(xfs_agnumber_t, agno)
2955 __field(xfs_agblock_t, i1_startblock)
2956 __field(xfs_extlen_t, i1_blockcount)
2957 __field(xfs_nlink_t, i1_refcount)
2958 __field(xfs_agblock_t, i2_startblock)
2959 __field(xfs_extlen_t, i2_blockcount)
2960 __field(xfs_nlink_t, i2_refcount)
2961 __field(xfs_agblock_t, i3_startblock)
2962 __field(xfs_extlen_t, i3_blockcount)
2963 __field(xfs_nlink_t, i3_refcount)
2964 ),
2965 TP_fast_assign(
2966 __entry->dev = mp->m_super->s_dev;
2967 __entry->agno = agno;
2968 __entry->i1_startblock = i1->rc_startblock;
2969 __entry->i1_blockcount = i1->rc_blockcount;
2970 __entry->i1_refcount = i1->rc_refcount;
2971 __entry->i2_startblock = i2->rc_startblock;
2972 __entry->i2_blockcount = i2->rc_blockcount;
2973 __entry->i2_refcount = i2->rc_refcount;
2974 __entry->i3_startblock = i3->rc_startblock;
2975 __entry->i3_blockcount = i3->rc_blockcount;
2976 __entry->i3_refcount = i3->rc_refcount;
2977 ),
2978 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2979 "agbno %u len %u refcount %u -- "
Hou Tao42bf9db2017-04-14 11:43:27 -07002980 "agbno %u len %u refcount %u",
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002981 MAJOR(__entry->dev), MINOR(__entry->dev),
2982 __entry->agno,
2983 __entry->i1_startblock,
2984 __entry->i1_blockcount,
2985 __entry->i1_refcount,
2986 __entry->i2_startblock,
2987 __entry->i2_blockcount,
2988 __entry->i2_refcount,
2989 __entry->i3_startblock,
2990 __entry->i3_blockcount,
2991 __entry->i3_refcount)
2992);
2993
2994#define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2995DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
2996 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2997 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2998 struct xfs_refcount_irec *i3), \
2999 TP_ARGS(mp, agno, i1, i2, i3))
3000
3001/* refcount btree tracepoints */
3002DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
3003DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
3004DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
3005DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
3006DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
3007DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
3008DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
3009DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
3010DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
3011DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
3012
3013/* refcount adjustment tracepoints */
3014DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
3015DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
Darrick J. Wong174edb02016-10-03 09:11:39 -07003016DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
3017DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003018DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
3019DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
Darrick J. Wong174edb02016-10-03 09:11:39 -07003020DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003021DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
3022DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
3023DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
3024DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
3025DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
3026DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
Darrick J. Wong174edb02016-10-03 09:11:39 -07003027DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003028DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
3029DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
3030DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
3031DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
3032DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
3033DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
3034DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
3035
3036/* reflink helpers */
3037DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
3038DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
3039DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
Darrick J. Wong33ba61292016-10-03 09:11:22 -07003040#define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
3041DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
3042DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07003043
Darrick J. Wongf997ee22016-10-03 09:11:21 -07003044TRACE_EVENT(xfs_refcount_finish_one_leftover,
3045 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3046 int type, xfs_agblock_t agbno, xfs_extlen_t len,
3047 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
3048 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
3049 TP_STRUCT__entry(
3050 __field(dev_t, dev)
3051 __field(xfs_agnumber_t, agno)
3052 __field(int, type)
3053 __field(xfs_agblock_t, agbno)
3054 __field(xfs_extlen_t, len)
3055 __field(xfs_agblock_t, new_agbno)
3056 __field(xfs_extlen_t, new_len)
3057 ),
3058 TP_fast_assign(
3059 __entry->dev = mp->m_super->s_dev;
3060 __entry->agno = agno;
3061 __entry->type = type;
3062 __entry->agbno = agbno;
3063 __entry->len = len;
3064 __entry->new_agbno = new_agbno;
3065 __entry->new_len = new_len;
3066 ),
3067 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
3068 MAJOR(__entry->dev), MINOR(__entry->dev),
3069 __entry->type,
3070 __entry->agno,
3071 __entry->agbno,
3072 __entry->len,
3073 __entry->new_agbno,
3074 __entry->new_len)
3075);
3076
Darrick J. Wongf65306e2016-10-03 09:11:27 -07003077/* simple inode-based error/%ip tracepoint class */
3078DECLARE_EVENT_CLASS(xfs_inode_error_class,
3079 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3080 TP_ARGS(ip, error, caller_ip),
3081 TP_STRUCT__entry(
3082 __field(dev_t, dev)
3083 __field(xfs_ino_t, ino)
3084 __field(int, error)
3085 __field(unsigned long, caller_ip)
3086 ),
3087 TP_fast_assign(
3088 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3089 __entry->ino = ip->i_ino;
3090 __entry->error = error;
3091 __entry->caller_ip = caller_ip;
3092 ),
Darrick J. Wongaff68a552018-01-09 11:46:05 -08003093 TP_printk("dev %d:%d ino %llx error %d caller %pS",
Darrick J. Wongf65306e2016-10-03 09:11:27 -07003094 MAJOR(__entry->dev), MINOR(__entry->dev),
3095 __entry->ino,
3096 __entry->error,
3097 (char *)__entry->caller_ip)
3098);
3099
3100#define DEFINE_INODE_ERROR_EVENT(name) \
3101DEFINE_EVENT(xfs_inode_error_class, name, \
3102 TP_PROTO(struct xfs_inode *ip, int error, \
3103 unsigned long caller_ip), \
3104 TP_ARGS(ip, error, caller_ip))
3105
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003106/* reflink tracepoint classes */
3107
3108/* two-file io tracepoint class */
3109DECLARE_EVENT_CLASS(xfs_double_io_class,
3110 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3111 struct xfs_inode *dest, xfs_off_t doffset),
3112 TP_ARGS(src, soffset, len, dest, doffset),
3113 TP_STRUCT__entry(
3114 __field(dev_t, dev)
3115 __field(xfs_ino_t, src_ino)
3116 __field(loff_t, src_isize)
3117 __field(loff_t, src_disize)
3118 __field(loff_t, src_offset)
3119 __field(size_t, len)
3120 __field(xfs_ino_t, dest_ino)
3121 __field(loff_t, dest_isize)
3122 __field(loff_t, dest_disize)
3123 __field(loff_t, dest_offset)
3124 ),
3125 TP_fast_assign(
3126 __entry->dev = VFS_I(src)->i_sb->s_dev;
3127 __entry->src_ino = src->i_ino;
3128 __entry->src_isize = VFS_I(src)->i_size;
3129 __entry->src_disize = src->i_d.di_size;
3130 __entry->src_offset = soffset;
3131 __entry->len = len;
3132 __entry->dest_ino = dest->i_ino;
3133 __entry->dest_isize = VFS_I(dest)->i_size;
3134 __entry->dest_disize = dest->i_d.di_size;
3135 __entry->dest_offset = doffset;
3136 ),
3137 TP_printk("dev %d:%d count %zd "
3138 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
3139 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
3140 MAJOR(__entry->dev), MINOR(__entry->dev),
3141 __entry->len,
3142 __entry->src_ino,
3143 __entry->src_isize,
3144 __entry->src_disize,
3145 __entry->src_offset,
3146 __entry->dest_ino,
3147 __entry->dest_isize,
3148 __entry->dest_disize,
3149 __entry->dest_offset)
3150)
3151
3152#define DEFINE_DOUBLE_IO_EVENT(name) \
3153DEFINE_EVENT(xfs_double_io_class, name, \
3154 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3155 struct xfs_inode *dest, xfs_off_t doffset), \
3156 TP_ARGS(src, soffset, len, dest, doffset))
3157
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003158/* inode/irec events */
3159DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3160 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3161 TP_ARGS(ip, irec),
3162 TP_STRUCT__entry(
3163 __field(dev_t, dev)
3164 __field(xfs_ino_t, ino)
3165 __field(xfs_fileoff_t, lblk)
3166 __field(xfs_extlen_t, len)
3167 __field(xfs_fsblock_t, pblk)
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003168 __field(int, state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003169 ),
3170 TP_fast_assign(
3171 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3172 __entry->ino = ip->i_ino;
3173 __entry->lblk = irec->br_startoff;
3174 __entry->len = irec->br_blockcount;
3175 __entry->pblk = irec->br_startblock;
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003176 __entry->state = irec->br_state;
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003177 ),
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003178 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 -07003179 MAJOR(__entry->dev), MINOR(__entry->dev),
3180 __entry->ino,
3181 __entry->lblk,
3182 __entry->len,
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003183 __entry->pblk,
3184 __entry->state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003185);
3186#define DEFINE_INODE_IREC_EVENT(name) \
3187DEFINE_EVENT(xfs_inode_irec_class, name, \
3188 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3189 TP_ARGS(ip, irec))
3190
3191/* refcount/reflink tracepoint definitions */
3192
3193/* reflink tracepoints */
3194DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3195DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3196DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
Darrick J. Wong00fd1d52020-06-29 14:47:18 -07003197TRACE_EVENT(xfs_reflink_remap_blocks,
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003198 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3199 xfs_filblks_t len, struct xfs_inode *dest,
3200 xfs_fileoff_t doffset),
3201 TP_ARGS(src, soffset, len, dest, doffset),
3202 TP_STRUCT__entry(
3203 __field(dev_t, dev)
3204 __field(xfs_ino_t, src_ino)
3205 __field(xfs_fileoff_t, src_lblk)
3206 __field(xfs_filblks_t, len)
3207 __field(xfs_ino_t, dest_ino)
3208 __field(xfs_fileoff_t, dest_lblk)
3209 ),
3210 TP_fast_assign(
3211 __entry->dev = VFS_I(src)->i_sb->s_dev;
3212 __entry->src_ino = src->i_ino;
3213 __entry->src_lblk = soffset;
3214 __entry->len = len;
3215 __entry->dest_ino = dest->i_ino;
3216 __entry->dest_lblk = doffset;
3217 ),
3218 TP_printk("dev %d:%d len 0x%llx "
3219 "ino 0x%llx offset 0x%llx blocks -> "
3220 "ino 0x%llx offset 0x%llx blocks",
3221 MAJOR(__entry->dev), MINOR(__entry->dev),
3222 __entry->len,
3223 __entry->src_ino,
3224 __entry->src_lblk,
3225 __entry->dest_ino,
3226 __entry->dest_lblk)
3227);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003228DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3229DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3230DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3231DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003232DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3233DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
Darrick J. Wong00fd1d52020-06-29 14:47:18 -07003234DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
3235DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003236
3237/* dedupe tracepoints */
3238DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3239DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3240
3241/* ioctl tracepoints */
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003242TRACE_EVENT(xfs_ioctl_clone,
3243 TP_PROTO(struct inode *src, struct inode *dest),
3244 TP_ARGS(src, dest),
3245 TP_STRUCT__entry(
3246 __field(dev_t, dev)
3247 __field(unsigned long, src_ino)
3248 __field(loff_t, src_isize)
3249 __field(unsigned long, dest_ino)
3250 __field(loff_t, dest_isize)
3251 ),
3252 TP_fast_assign(
3253 __entry->dev = src->i_sb->s_dev;
3254 __entry->src_ino = src->i_ino;
3255 __entry->src_isize = i_size_read(src);
3256 __entry->dest_ino = dest->i_ino;
3257 __entry->dest_isize = i_size_read(dest);
3258 ),
3259 TP_printk("dev %d:%d "
3260 "ino 0x%lx isize 0x%llx -> "
Hou Tao42bf9db2017-04-14 11:43:27 -07003261 "ino 0x%lx isize 0x%llx",
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003262 MAJOR(__entry->dev), MINOR(__entry->dev),
3263 __entry->src_ino,
3264 __entry->src_isize,
3265 __entry->dest_ino,
3266 __entry->dest_isize)
3267);
3268
3269/* unshare tracepoints */
3270DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003271DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003272
3273/* copy on write */
3274DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
Darrick J. Wongbe51f812016-10-03 09:11:32 -07003275DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3276DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003277DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003278
Christoph Hellwig54a4ef82017-02-06 13:00:54 -08003279DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003280
3281DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3282DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3283DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003284
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003285DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3286DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3287
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003288
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003289DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003290
Darrick J. Wong1f08af52016-10-03 09:11:53 -07003291/* rmap swapext tracepoints */
3292DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3293DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3294DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3295
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003296/* fsmap traces */
3297DECLARE_EVENT_CLASS(xfs_fsmap_class,
3298 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3299 struct xfs_rmap_irec *rmap),
3300 TP_ARGS(mp, keydev, agno, rmap),
3301 TP_STRUCT__entry(
3302 __field(dev_t, dev)
3303 __field(dev_t, keydev)
3304 __field(xfs_agnumber_t, agno)
3305 __field(xfs_fsblock_t, bno)
3306 __field(xfs_filblks_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003307 __field(uint64_t, owner)
3308 __field(uint64_t, offset)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003309 __field(unsigned int, flags)
3310 ),
3311 TP_fast_assign(
3312 __entry->dev = mp->m_super->s_dev;
3313 __entry->keydev = new_decode_dev(keydev);
3314 __entry->agno = agno;
3315 __entry->bno = rmap->rm_startblock;
3316 __entry->len = rmap->rm_blockcount;
3317 __entry->owner = rmap->rm_owner;
3318 __entry->offset = rmap->rm_offset;
3319 __entry->flags = rmap->rm_flags;
3320 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07003321 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 -07003322 MAJOR(__entry->dev), MINOR(__entry->dev),
3323 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3324 __entry->agno,
3325 __entry->bno,
3326 __entry->len,
3327 __entry->owner,
3328 __entry->offset,
3329 __entry->flags)
3330)
3331#define DEFINE_FSMAP_EVENT(name) \
3332DEFINE_EVENT(xfs_fsmap_class, name, \
3333 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3334 struct xfs_rmap_irec *rmap), \
3335 TP_ARGS(mp, keydev, agno, rmap))
3336DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3337DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3338DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3339
3340DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3341 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3342 TP_ARGS(mp, fsmap),
3343 TP_STRUCT__entry(
3344 __field(dev_t, dev)
3345 __field(dev_t, keydev)
3346 __field(xfs_daddr_t, block)
3347 __field(xfs_daddr_t, len)
Darrick J. Wongc8ce5402017-06-16 11:00:05 -07003348 __field(uint64_t, owner)
3349 __field(uint64_t, offset)
3350 __field(uint64_t, flags)
Darrick J. Wonge89c0412017-03-28 14:56:37 -07003351 ),
3352 TP_fast_assign(
3353 __entry->dev = mp->m_super->s_dev;
3354 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3355 __entry->block = fsmap->fmr_physical;
3356 __entry->len = fsmap->fmr_length;
3357 __entry->owner = fsmap->fmr_owner;
3358 __entry->offset = fsmap->fmr_offset;
3359 __entry->flags = fsmap->fmr_flags;
3360 ),
Hou Tao42bf9db2017-04-14 11:43:27 -07003361 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 -07003362 MAJOR(__entry->dev), MINOR(__entry->dev),
3363 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3364 __entry->block,
3365 __entry->len,
3366 __entry->owner,
3367 __entry->offset,
3368 __entry->flags)
3369)
3370#define DEFINE_GETFSMAP_EVENT(name) \
3371DEFINE_EVENT(xfs_getfsmap_class, name, \
3372 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3373 TP_ARGS(mp, fsmap))
3374DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3375DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3376DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3377
Darrick J. Wongb872af22018-01-08 10:51:26 -08003378TRACE_EVENT(xfs_trans_resv_calc,
3379 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3380 struct xfs_trans_res *res),
3381 TP_ARGS(mp, type, res),
3382 TP_STRUCT__entry(
3383 __field(dev_t, dev)
3384 __field(int, type)
3385 __field(uint, logres)
3386 __field(int, logcount)
3387 __field(int, logflags)
3388 ),
3389 TP_fast_assign(
3390 __entry->dev = mp->m_super->s_dev;
3391 __entry->type = type;
3392 __entry->logres = res->tr_logres;
3393 __entry->logcount = res->tr_logcount;
3394 __entry->logflags = res->tr_logflags;
3395 ),
3396 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3397 MAJOR(__entry->dev), MINOR(__entry->dev),
3398 __entry->type,
3399 __entry->logres,
3400 __entry->logcount,
3401 __entry->logflags)
3402);
3403
Dave Chinnerba187812018-05-09 07:47:57 -07003404DECLARE_EVENT_CLASS(xfs_trans_class,
3405 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3406 TP_ARGS(tp, caller_ip),
3407 TP_STRUCT__entry(
3408 __field(dev_t, dev)
3409 __field(uint32_t, tid)
3410 __field(uint32_t, flags)
3411 __field(unsigned long, caller_ip)
3412 ),
3413 TP_fast_assign(
3414 __entry->dev = tp->t_mountp->m_super->s_dev;
3415 __entry->tid = 0;
3416 if (tp->t_ticket)
3417 __entry->tid = tp->t_ticket->t_tid;
3418 __entry->flags = tp->t_flags;
3419 __entry->caller_ip = caller_ip;
3420 ),
3421 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3422 MAJOR(__entry->dev), MINOR(__entry->dev),
3423 __entry->tid,
3424 __entry->flags,
3425 (char *)__entry->caller_ip)
3426)
3427
3428#define DEFINE_TRANS_EVENT(name) \
3429DEFINE_EVENT(xfs_trans_class, name, \
3430 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3431 TP_ARGS(tp, caller_ip))
3432DEFINE_TRANS_EVENT(xfs_trans_alloc);
3433DEFINE_TRANS_EVENT(xfs_trans_cancel);
3434DEFINE_TRANS_EVENT(xfs_trans_commit);
3435DEFINE_TRANS_EVENT(xfs_trans_dup);
3436DEFINE_TRANS_EVENT(xfs_trans_free);
3437DEFINE_TRANS_EVENT(xfs_trans_roll);
3438DEFINE_TRANS_EVENT(xfs_trans_add_item);
Christoph Hellwig195cd832019-06-28 19:27:31 -07003439DEFINE_TRANS_EVENT(xfs_trans_commit_items);
Dave Chinnerba187812018-05-09 07:47:57 -07003440DEFINE_TRANS_EVENT(xfs_trans_free_items);
3441
Darrick J. Wong9a4a5112019-02-07 10:37:14 -08003442TRACE_EVENT(xfs_iunlink_update_bucket,
3443 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3444 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3445 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3446 TP_STRUCT__entry(
3447 __field(dev_t, dev)
3448 __field(xfs_agnumber_t, agno)
3449 __field(unsigned int, bucket)
3450 __field(xfs_agino_t, old_ptr)
3451 __field(xfs_agino_t, new_ptr)
3452 ),
3453 TP_fast_assign(
3454 __entry->dev = mp->m_super->s_dev;
3455 __entry->agno = agno;
3456 __entry->bucket = bucket;
3457 __entry->old_ptr = old_ptr;
3458 __entry->new_ptr = new_ptr;
3459 ),
3460 TP_printk("dev %d:%d agno %u bucket %u old 0x%x new 0x%x",
3461 MAJOR(__entry->dev), MINOR(__entry->dev),
3462 __entry->agno,
3463 __entry->bucket,
3464 __entry->old_ptr,
3465 __entry->new_ptr)
3466);
3467
Darrick J. Wongf2fc16a2019-02-07 10:37:15 -08003468TRACE_EVENT(xfs_iunlink_update_dinode,
3469 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3470 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3471 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3472 TP_STRUCT__entry(
3473 __field(dev_t, dev)
3474 __field(xfs_agnumber_t, agno)
3475 __field(xfs_agino_t, agino)
3476 __field(xfs_agino_t, old_ptr)
3477 __field(xfs_agino_t, new_ptr)
3478 ),
3479 TP_fast_assign(
3480 __entry->dev = mp->m_super->s_dev;
3481 __entry->agno = agno;
3482 __entry->agino = agino;
3483 __entry->old_ptr = old_ptr;
3484 __entry->new_ptr = new_ptr;
3485 ),
3486 TP_printk("dev %d:%d agno %u agino 0x%x old 0x%x new 0x%x",
3487 MAJOR(__entry->dev), MINOR(__entry->dev),
3488 __entry->agno,
3489 __entry->agino,
3490 __entry->old_ptr,
3491 __entry->new_ptr)
3492);
3493
Darrick J. Wong4664c662019-02-07 10:37:16 -08003494DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3495 TP_PROTO(struct xfs_inode *ip),
3496 TP_ARGS(ip),
3497 TP_STRUCT__entry(
3498 __field(dev_t, dev)
3499 __field(xfs_agnumber_t, agno)
3500 __field(xfs_agino_t, agino)
3501 ),
3502 TP_fast_assign(
3503 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3504 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3505 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3506 ),
3507 TP_printk("dev %d:%d agno %u agino %u",
3508 MAJOR(__entry->dev), MINOR(__entry->dev),
3509 __entry->agno, __entry->agino)
3510)
3511
3512#define DEFINE_AGINODE_EVENT(name) \
3513DEFINE_EVENT(xfs_ag_inode_class, name, \
3514 TP_PROTO(struct xfs_inode *ip), \
3515 TP_ARGS(ip))
3516DEFINE_AGINODE_EVENT(xfs_iunlink);
3517DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
Darrick J. Wong9b247172019-02-07 10:37:16 -08003518DEFINE_AG_EVENT(xfs_iunlink_map_prev_fallback);
Darrick J. Wong4664c662019-02-07 10:37:16 -08003519
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003520DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3521 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3522 TP_ARGS(mp, flags),
3523 TP_STRUCT__entry(
3524 __field(dev_t, dev)
3525 __field(unsigned int, flags)
3526 ),
3527 TP_fast_assign(
3528 __entry->dev = mp->m_super->s_dev;
3529 __entry->flags = flags;
3530 ),
3531 TP_printk("dev %d:%d flags 0x%x",
3532 MAJOR(__entry->dev), MINOR(__entry->dev),
3533 __entry->flags)
3534);
3535#define DEFINE_FS_CORRUPT_EVENT(name) \
3536DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3537 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3538 TP_ARGS(mp, flags))
3539DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3540DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003541DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003542DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3543DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003544DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003545
3546DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3547 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3548 TP_ARGS(mp, agno, flags),
3549 TP_STRUCT__entry(
3550 __field(dev_t, dev)
3551 __field(xfs_agnumber_t, agno)
3552 __field(unsigned int, flags)
3553 ),
3554 TP_fast_assign(
3555 __entry->dev = mp->m_super->s_dev;
3556 __entry->agno = agno;
3557 __entry->flags = flags;
3558 ),
3559 TP_printk("dev %d:%d agno %u flags 0x%x",
3560 MAJOR(__entry->dev), MINOR(__entry->dev),
3561 __entry->agno, __entry->flags)
3562);
3563#define DEFINE_AG_CORRUPT_EVENT(name) \
3564DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3565 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3566 unsigned int flags), \
3567 TP_ARGS(mp, agno, flags))
3568DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3569DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
Darrick J. Wong519841c2019-04-12 07:41:16 -07003570DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
Darrick J. Wong6772c1f2019-04-12 07:40:25 -07003571
3572DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3573 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3574 TP_ARGS(ip, flags),
3575 TP_STRUCT__entry(
3576 __field(dev_t, dev)
3577 __field(xfs_ino_t, ino)
3578 __field(unsigned int, flags)
3579 ),
3580 TP_fast_assign(
3581 __entry->dev = ip->i_mount->m_super->s_dev;
3582 __entry->ino = ip->i_ino;
3583 __entry->flags = flags;
3584 ),
3585 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3586 MAJOR(__entry->dev), MINOR(__entry->dev),
3587 __entry->ino, __entry->flags)
3588);
3589#define DEFINE_INODE_CORRUPT_EVENT(name) \
3590DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3591 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3592 TP_ARGS(ip, flags))
3593DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3594DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3595
Darrick J. Wonga2114322019-07-02 09:39:38 -07003596TRACE_EVENT(xfs_iwalk_ag,
3597 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3598 xfs_agino_t startino),
3599 TP_ARGS(mp, agno, startino),
3600 TP_STRUCT__entry(
3601 __field(dev_t, dev)
3602 __field(xfs_agnumber_t, agno)
3603 __field(xfs_agino_t, startino)
3604 ),
3605 TP_fast_assign(
3606 __entry->dev = mp->m_super->s_dev;
3607 __entry->agno = agno;
3608 __entry->startino = startino;
3609 ),
3610 TP_printk("dev %d:%d agno %d startino %u",
3611 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3612 __entry->startino)
3613)
3614
3615TRACE_EVENT(xfs_iwalk_ag_rec,
3616 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3617 struct xfs_inobt_rec_incore *irec),
3618 TP_ARGS(mp, agno, irec),
3619 TP_STRUCT__entry(
3620 __field(dev_t, dev)
3621 __field(xfs_agnumber_t, agno)
3622 __field(xfs_agino_t, startino)
3623 __field(uint64_t, freemask)
3624 ),
3625 TP_fast_assign(
3626 __entry->dev = mp->m_super->s_dev;
3627 __entry->agno = agno;
3628 __entry->startino = irec->ir_startino;
3629 __entry->freemask = irec->ir_free;
3630 ),
3631 TP_printk("dev %d:%d agno %d startino %u freemask 0x%llx",
3632 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3633 __entry->startino, __entry->freemask)
3634)
3635
Darrick J. Wong40786712019-07-03 07:33:26 -07003636TRACE_EVENT(xfs_pwork_init,
3637 TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
3638 TP_ARGS(mp, nr_threads, pid),
3639 TP_STRUCT__entry(
3640 __field(dev_t, dev)
3641 __field(unsigned int, nr_threads)
3642 __field(pid_t, pid)
3643 ),
3644 TP_fast_assign(
3645 __entry->dev = mp->m_super->s_dev;
3646 __entry->nr_threads = nr_threads;
3647 __entry->pid = pid;
3648 ),
3649 TP_printk("dev %d:%d nr_threads %u pid %u",
3650 MAJOR(__entry->dev), MINOR(__entry->dev),
3651 __entry->nr_threads, __entry->pid)
3652)
3653
Dave Chinner0ad95682019-08-26 12:08:10 -07003654DECLARE_EVENT_CLASS(xfs_kmem_class,
3655 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
3656 TP_ARGS(size, flags, caller_ip),
3657 TP_STRUCT__entry(
3658 __field(ssize_t, size)
3659 __field(int, flags)
3660 __field(unsigned long, caller_ip)
3661 ),
3662 TP_fast_assign(
3663 __entry->size = size;
3664 __entry->flags = flags;
3665 __entry->caller_ip = caller_ip;
3666 ),
3667 TP_printk("size %zd flags 0x%x caller %pS",
3668 __entry->size,
3669 __entry->flags,
3670 (char *)__entry->caller_ip)
3671)
3672
3673#define DEFINE_KMEM_EVENT(name) \
3674DEFINE_EVENT(xfs_kmem_class, name, \
3675 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
3676 TP_ARGS(size, flags, caller_ip))
3677DEFINE_KMEM_EVENT(kmem_alloc);
Dave Chinnerf8f9ee42019-08-26 12:08:39 -07003678DEFINE_KMEM_EVENT(kmem_alloc_io);
Dave Chinner0ad95682019-08-26 12:08:10 -07003679DEFINE_KMEM_EVENT(kmem_alloc_large);
Dave Chinner0ad95682019-08-26 12:08:10 -07003680
Darrick J. Wong13eaec42019-12-11 13:19:06 -08003681TRACE_EVENT(xfs_check_new_dalign,
3682 TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
3683 TP_ARGS(mp, new_dalign, calc_rootino),
3684 TP_STRUCT__entry(
3685 __field(dev_t, dev)
3686 __field(int, new_dalign)
3687 __field(xfs_ino_t, sb_rootino)
3688 __field(xfs_ino_t, calc_rootino)
3689 ),
3690 TP_fast_assign(
3691 __entry->dev = mp->m_super->s_dev;
3692 __entry->new_dalign = new_dalign;
3693 __entry->sb_rootino = mp->m_sb.sb_rootino;
3694 __entry->calc_rootino = calc_rootino;
3695 ),
3696 TP_printk("dev %d:%d new_dalign %d sb_rootino %llu calc_rootino %llu",
3697 MAJOR(__entry->dev), MINOR(__entry->dev),
3698 __entry->new_dalign, __entry->sb_rootino,
3699 __entry->calc_rootino)
3700)
3701
Darrick J. Wonge06536a2020-03-11 10:40:26 -07003702TRACE_EVENT(xfs_btree_commit_afakeroot,
3703 TP_PROTO(struct xfs_btree_cur *cur),
3704 TP_ARGS(cur),
3705 TP_STRUCT__entry(
3706 __field(dev_t, dev)
3707 __field(xfs_btnum_t, btnum)
3708 __field(xfs_agnumber_t, agno)
3709 __field(xfs_agblock_t, agbno)
3710 __field(unsigned int, levels)
3711 __field(unsigned int, blocks)
3712 ),
3713 TP_fast_assign(
3714 __entry->dev = cur->bc_mp->m_super->s_dev;
3715 __entry->btnum = cur->bc_btnum;
3716 __entry->agno = cur->bc_ag.agno;
3717 __entry->agbno = cur->bc_ag.afake->af_root;
3718 __entry->levels = cur->bc_ag.afake->af_levels;
3719 __entry->blocks = cur->bc_ag.afake->af_blocks;
3720 ),
3721 TP_printk("dev %d:%d btree %s ag %u levels %u blocks %u root %u",
3722 MAJOR(__entry->dev), MINOR(__entry->dev),
3723 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3724 __entry->agno,
3725 __entry->levels,
3726 __entry->blocks,
3727 __entry->agbno)
3728)
3729
Darrick J. Wong349e1c02020-03-11 10:42:34 -07003730TRACE_EVENT(xfs_btree_commit_ifakeroot,
3731 TP_PROTO(struct xfs_btree_cur *cur),
3732 TP_ARGS(cur),
3733 TP_STRUCT__entry(
3734 __field(dev_t, dev)
3735 __field(xfs_btnum_t, btnum)
3736 __field(xfs_agnumber_t, agno)
3737 __field(xfs_agino_t, agino)
3738 __field(unsigned int, levels)
3739 __field(unsigned int, blocks)
3740 __field(int, whichfork)
3741 ),
3742 TP_fast_assign(
3743 __entry->dev = cur->bc_mp->m_super->s_dev;
3744 __entry->btnum = cur->bc_btnum;
3745 __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp,
3746 cur->bc_ino.ip->i_ino);
3747 __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp,
3748 cur->bc_ino.ip->i_ino);
3749 __entry->levels = cur->bc_ino.ifake->if_levels;
3750 __entry->blocks = cur->bc_ino.ifake->if_blocks;
3751 __entry->whichfork = cur->bc_ino.whichfork;
3752 ),
3753 TP_printk("dev %d:%d btree %s ag %u agino %u whichfork %s levels %u blocks %u",
3754 MAJOR(__entry->dev), MINOR(__entry->dev),
3755 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3756 __entry->agno,
3757 __entry->agino,
3758 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
3759 __entry->levels,
3760 __entry->blocks)
3761)
3762
Darrick J. Wong60e3d702020-03-11 10:51:50 -07003763TRACE_EVENT(xfs_btree_bload_level_geometry,
3764 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3765 uint64_t nr_this_level, unsigned int nr_per_block,
3766 unsigned int desired_npb, uint64_t blocks,
3767 uint64_t blocks_with_extra),
3768 TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks,
3769 blocks_with_extra),
3770 TP_STRUCT__entry(
3771 __field(dev_t, dev)
3772 __field(xfs_btnum_t, btnum)
3773 __field(unsigned int, level)
3774 __field(unsigned int, nlevels)
3775 __field(uint64_t, nr_this_level)
3776 __field(unsigned int, nr_per_block)
3777 __field(unsigned int, desired_npb)
3778 __field(unsigned long long, blocks)
3779 __field(unsigned long long, blocks_with_extra)
3780 ),
3781 TP_fast_assign(
3782 __entry->dev = cur->bc_mp->m_super->s_dev;
3783 __entry->btnum = cur->bc_btnum;
3784 __entry->level = level;
3785 __entry->nlevels = cur->bc_nlevels;
3786 __entry->nr_this_level = nr_this_level;
3787 __entry->nr_per_block = nr_per_block;
3788 __entry->desired_npb = desired_npb;
3789 __entry->blocks = blocks;
3790 __entry->blocks_with_extra = blocks_with_extra;
3791 ),
3792 TP_printk("dev %d:%d btree %s level %u/%u nr_this_level %llu nr_per_block %u desired_npb %u blocks %llu blocks_with_extra %llu",
3793 MAJOR(__entry->dev), MINOR(__entry->dev),
3794 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3795 __entry->level,
3796 __entry->nlevels,
3797 __entry->nr_this_level,
3798 __entry->nr_per_block,
3799 __entry->desired_npb,
3800 __entry->blocks,
3801 __entry->blocks_with_extra)
3802)
3803
3804TRACE_EVENT(xfs_btree_bload_block,
3805 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
3806 uint64_t block_idx, uint64_t nr_blocks,
3807 union xfs_btree_ptr *ptr, unsigned int nr_records),
3808 TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records),
3809 TP_STRUCT__entry(
3810 __field(dev_t, dev)
3811 __field(xfs_btnum_t, btnum)
3812 __field(unsigned int, level)
3813 __field(unsigned long long, block_idx)
3814 __field(unsigned long long, nr_blocks)
3815 __field(xfs_agnumber_t, agno)
3816 __field(xfs_agblock_t, agbno)
3817 __field(unsigned int, nr_records)
3818 ),
3819 TP_fast_assign(
3820 __entry->dev = cur->bc_mp->m_super->s_dev;
3821 __entry->btnum = cur->bc_btnum;
3822 __entry->level = level;
3823 __entry->block_idx = block_idx;
3824 __entry->nr_blocks = nr_blocks;
3825 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
3826 xfs_fsblock_t fsb = be64_to_cpu(ptr->l);
3827
3828 __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb);
3829 __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb);
3830 } else {
3831 __entry->agno = cur->bc_ag.agno;
3832 __entry->agbno = be32_to_cpu(ptr->s);
3833 }
3834 __entry->nr_records = nr_records;
3835 ),
3836 TP_printk("dev %d:%d btree %s level %u block %llu/%llu fsb (%u/%u) recs %u",
3837 MAJOR(__entry->dev), MINOR(__entry->dev),
3838 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3839 __entry->level,
3840 __entry->block_idx,
3841 __entry->nr_blocks,
3842 __entry->agno,
3843 __entry->agbno,
3844 __entry->nr_records)
3845)
3846
Darrick J. Wong06dbf822020-08-24 11:58:01 -07003847DECLARE_EVENT_CLASS(xfs_timestamp_range_class,
3848 TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max),
3849 TP_ARGS(mp, min, max),
3850 TP_STRUCT__entry(
3851 __field(dev_t, dev)
3852 __field(long long, min)
3853 __field(long long, max)
3854 ),
3855 TP_fast_assign(
3856 __entry->dev = mp->m_super->s_dev;
3857 __entry->min = min;
3858 __entry->max = max;
3859 ),
3860 TP_printk("dev %d:%d min %lld max %lld",
3861 MAJOR(__entry->dev), MINOR(__entry->dev),
3862 __entry->min,
3863 __entry->max)
3864)
3865
3866#define DEFINE_TIMESTAMP_RANGE_EVENT(name) \
3867DEFINE_EVENT(xfs_timestamp_range_class, name, \
3868 TP_PROTO(struct xfs_mount *mp, long long min, long long max), \
3869 TP_ARGS(mp, min, max))
3870DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range);
3871DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range);
3872
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00003873#endif /* _TRACE_XFS_H */
3874
3875#undef TRACE_INCLUDE_PATH
3876#define TRACE_INCLUDE_PATH .
3877#define TRACE_INCLUDE_FILE xfs_trace
3878#include <trace/define_trace.h>