blob: 383ac227ce2c324cee29b5e8a209fa6b98583192 [file] [log] [blame]
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001/*
2 * Copyright (c) 2009, Christoph Hellwig
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#undef TRACE_SYSTEM
19#define TRACE_SYSTEM xfs
20
21#if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
22#define _TRACE_XFS_H
23
24#include <linux/tracepoint.h>
25
26struct xfs_agf;
27struct xfs_alloc_arg;
28struct xfs_attr_list_context;
29struct xfs_buf_log_item;
30struct xfs_da_args;
31struct xfs_da_node_entry;
32struct xfs_dquot;
Christoph Hellwig9e4c1092011-10-11 15:14:11 +000033struct xfs_log_item;
Mark Tinguelyad223e62012-06-14 09:22:15 -050034struct xlog;
Dave Chinner750b9c92013-11-01 15:27:18 +110035struct xlog_ticket;
Dave Chinner9abbc532010-04-13 15:06:46 +100036struct xlog_recover;
37struct xlog_recover_item;
38struct xfs_buf_log_format;
39struct xfs_inode_log_format;
Alex Elder1ed845d2012-08-01 09:56:49 -050040struct xfs_bmbt_irec;
Darrick J. Wong2c813ad2016-08-03 11:08:36 +100041struct xfs_btree_cur;
Darrick J. Wong1946b912016-10-03 09:11:18 -070042struct xfs_refcount_irec;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000043
Christoph Hellwigea9a4882009-12-21 14:03:03 +000044DECLARE_EVENT_CLASS(xfs_attr_list_class,
45 TP_PROTO(struct xfs_attr_list_context *ctx),
46 TP_ARGS(ctx),
47 TP_STRUCT__entry(
48 __field(dev_t, dev)
49 __field(xfs_ino_t, ino)
50 __field(u32, hashval)
51 __field(u32, blkno)
52 __field(u32, offset)
53 __field(void *, alist)
54 __field(int, bufsize)
55 __field(int, count)
56 __field(int, firstu)
57 __field(int, dupcnt)
58 __field(int, flags)
59 ),
60 TP_fast_assign(
61 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
62 __entry->ino = ctx->dp->i_ino;
63 __entry->hashval = ctx->cursor->hashval;
64 __entry->blkno = ctx->cursor->blkno;
65 __entry->offset = ctx->cursor->offset;
66 __entry->alist = ctx->alist;
67 __entry->bufsize = ctx->bufsize;
68 __entry->count = ctx->count;
69 __entry->firstu = ctx->firstu;
70 __entry->flags = ctx->flags;
71 ),
72 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
73 "alist 0x%p size %u count %u firstu %u flags %d %s",
74 MAJOR(__entry->dev), MINOR(__entry->dev),
75 __entry->ino,
76 __entry->hashval,
77 __entry->blkno,
78 __entry->offset,
79 __entry->dupcnt,
80 __entry->alist,
81 __entry->bufsize,
82 __entry->count,
83 __entry->firstu,
84 __entry->flags,
85 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
86 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000087)
Christoph Hellwigea9a4882009-12-21 14:03:03 +000088
89#define DEFINE_ATTR_LIST_EVENT(name) \
90DEFINE_EVENT(xfs_attr_list_class, name, \
91 TP_PROTO(struct xfs_attr_list_context *ctx), \
92 TP_ARGS(ctx))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +000093DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
94DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
95DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
96DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
98DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
99DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
100DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
Dave Chinneree732592012-11-12 22:53:53 +1100101DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
102DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000103
Li Zefanf8adb4d2010-05-24 08:25:57 +0000104DECLARE_EVENT_CLASS(xfs_perag_class,
105 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
106 unsigned long caller_ip),
107 TP_ARGS(mp, agno, refcount, caller_ip),
108 TP_STRUCT__entry(
109 __field(dev_t, dev)
110 __field(xfs_agnumber_t, agno)
111 __field(int, refcount)
112 __field(unsigned long, caller_ip)
113 ),
114 TP_fast_assign(
115 __entry->dev = mp->m_super->s_dev;
116 __entry->agno = agno;
117 __entry->refcount = refcount;
118 __entry->caller_ip = caller_ip;
119 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100120 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
Li Zefanf8adb4d2010-05-24 08:25:57 +0000121 MAJOR(__entry->dev), MINOR(__entry->dev),
122 __entry->agno,
123 __entry->refcount,
124 (char *)__entry->caller_ip)
125);
126
127#define DEFINE_PERAG_REF_EVENT(name) \
128DEFINE_EVENT(xfs_perag_class, name, \
129 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
130 unsigned long caller_ip), \
131 TP_ARGS(mp, agno, refcount, caller_ip))
132DEFINE_PERAG_REF_EVENT(xfs_perag_get);
Dave Chinner65d0f202010-09-24 18:40:15 +1000133DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000134DEFINE_PERAG_REF_EVENT(xfs_perag_put);
Dave Chinner16fd5362010-07-20 09:43:39 +1000135DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
136DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
Brian Foster27b52862012-11-06 09:50:38 -0500137DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
138DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700139DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks);
140DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks);
Li Zefanf8adb4d2010-05-24 08:25:57 +0000141
Dave Chinnerd1230312013-11-01 15:27:19 +1100142DECLARE_EVENT_CLASS(xfs_ag_class,
143 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
144 TP_ARGS(mp, agno),
145 TP_STRUCT__entry(
146 __field(dev_t, dev)
147 __field(xfs_agnumber_t, agno)
148 ),
149 TP_fast_assign(
150 __entry->dev = mp->m_super->s_dev;
151 __entry->agno = agno;
152 ),
153 TP_printk("dev %d:%d agno %u",
154 MAJOR(__entry->dev), MINOR(__entry->dev),
155 __entry->agno)
156);
157#define DEFINE_AG_EVENT(name) \
158DEFINE_EVENT(xfs_ag_class, name, \
159 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
160 TP_ARGS(mp, agno))
161
162DEFINE_AG_EVENT(xfs_read_agf);
163DEFINE_AG_EVENT(xfs_alloc_read_agf);
164DEFINE_AG_EVENT(xfs_read_agi);
165DEFINE_AG_EVENT(xfs_ialloc_read_agi);
166
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000167TRACE_EVENT(xfs_attr_list_node_descend,
168 TP_PROTO(struct xfs_attr_list_context *ctx,
169 struct xfs_da_node_entry *btree),
170 TP_ARGS(ctx, btree),
171 TP_STRUCT__entry(
172 __field(dev_t, dev)
173 __field(xfs_ino_t, ino)
174 __field(u32, hashval)
175 __field(u32, blkno)
176 __field(u32, offset)
177 __field(void *, alist)
178 __field(int, bufsize)
179 __field(int, count)
180 __field(int, firstu)
181 __field(int, dupcnt)
182 __field(int, flags)
183 __field(u32, bt_hashval)
184 __field(u32, bt_before)
185 ),
186 TP_fast_assign(
187 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
188 __entry->ino = ctx->dp->i_ino;
189 __entry->hashval = ctx->cursor->hashval;
190 __entry->blkno = ctx->cursor->blkno;
191 __entry->offset = ctx->cursor->offset;
192 __entry->alist = ctx->alist;
193 __entry->bufsize = ctx->bufsize;
194 __entry->count = ctx->count;
195 __entry->firstu = ctx->firstu;
196 __entry->flags = ctx->flags;
197 __entry->bt_hashval = be32_to_cpu(btree->hashval);
198 __entry->bt_before = be32_to_cpu(btree->before);
199 ),
200 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
201 "alist 0x%p size %u count %u firstu %u flags %d %s "
202 "node hashval %u, node before %u",
203 MAJOR(__entry->dev), MINOR(__entry->dev),
204 __entry->ino,
205 __entry->hashval,
206 __entry->blkno,
207 __entry->offset,
208 __entry->dupcnt,
209 __entry->alist,
210 __entry->bufsize,
211 __entry->count,
212 __entry->firstu,
213 __entry->flags,
214 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
215 __entry->bt_hashval,
216 __entry->bt_before)
217);
218
219TRACE_EVENT(xfs_iext_insert,
220 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
221 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
222 TP_ARGS(ip, idx, r, state, caller_ip),
223 TP_STRUCT__entry(
224 __field(dev_t, dev)
225 __field(xfs_ino_t, ino)
226 __field(xfs_extnum_t, idx)
227 __field(xfs_fileoff_t, startoff)
228 __field(xfs_fsblock_t, startblock)
229 __field(xfs_filblks_t, blockcount)
230 __field(xfs_exntst_t, state)
231 __field(int, bmap_state)
232 __field(unsigned long, caller_ip)
233 ),
234 TP_fast_assign(
235 __entry->dev = VFS_I(ip)->i_sb->s_dev;
236 __entry->ino = ip->i_ino;
237 __entry->idx = idx;
238 __entry->startoff = r->br_startoff;
239 __entry->startblock = r->br_startblock;
240 __entry->blockcount = r->br_blockcount;
241 __entry->state = r->br_state;
242 __entry->bmap_state = state;
243 __entry->caller_ip = caller_ip;
244 ),
245 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Scott Wood65dd2972015-03-25 14:56:21 +1100246 "offset %lld block %lld count %lld flag %d caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000247 MAJOR(__entry->dev), MINOR(__entry->dev),
248 __entry->ino,
249 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
250 (long)__entry->idx,
251 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000252 (__int64_t)__entry->startblock,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000253 __entry->blockcount,
254 __entry->state,
255 (char *)__entry->caller_ip)
256);
257
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000258DECLARE_EVENT_CLASS(xfs_bmap_class,
259 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
260 unsigned long caller_ip),
261 TP_ARGS(ip, idx, state, caller_ip),
262 TP_STRUCT__entry(
263 __field(dev_t, dev)
264 __field(xfs_ino_t, ino)
265 __field(xfs_extnum_t, idx)
266 __field(xfs_fileoff_t, startoff)
267 __field(xfs_fsblock_t, startblock)
268 __field(xfs_filblks_t, blockcount)
269 __field(xfs_exntst_t, state)
270 __field(int, bmap_state)
271 __field(unsigned long, caller_ip)
272 ),
273 TP_fast_assign(
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700274 struct xfs_ifork *ifp;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000275 struct xfs_bmbt_irec r;
276
Darrick J. Wong3993bae2016-10-03 09:11:32 -0700277 ifp = xfs_iext_state_to_fork(ip, state);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000278 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
279 __entry->dev = VFS_I(ip)->i_sb->s_dev;
280 __entry->ino = ip->i_ino;
281 __entry->idx = idx;
282 __entry->startoff = r.br_startoff;
283 __entry->startblock = r.br_startblock;
284 __entry->blockcount = r.br_blockcount;
285 __entry->state = r.br_state;
286 __entry->bmap_state = state;
287 __entry->caller_ip = caller_ip;
288 ),
289 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
Scott Wood65dd2972015-03-25 14:56:21 +1100290 "offset %lld block %lld count %lld flag %d caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000291 MAJOR(__entry->dev), MINOR(__entry->dev),
292 __entry->ino,
293 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
294 (long)__entry->idx,
295 __entry->startoff,
Christoph Hellwigf7008d02010-02-15 22:02:19 +0000296 (__int64_t)__entry->startblock,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000297 __entry->blockcount,
298 __entry->state,
299 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000300)
301
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000302#define DEFINE_BMAP_EVENT(name) \
303DEFINE_EVENT(xfs_bmap_class, name, \
304 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
305 unsigned long caller_ip), \
306 TP_ARGS(ip, idx, state, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000307DEFINE_BMAP_EVENT(xfs_iext_remove);
308DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
309DEFINE_BMAP_EVENT(xfs_bmap_post_update);
310DEFINE_BMAP_EVENT(xfs_extlist);
311
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000312DECLARE_EVENT_CLASS(xfs_buf_class,
313 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
314 TP_ARGS(bp, caller_ip),
315 TP_STRUCT__entry(
316 __field(dev_t, dev)
317 __field(xfs_daddr_t, bno)
Dave Chinner4e94b712012-04-23 15:58:51 +1000318 __field(int, nblks)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000319 __field(int, hold)
320 __field(int, pincount)
321 __field(unsigned, lockval)
322 __field(unsigned, flags)
323 __field(unsigned long, caller_ip)
324 ),
325 TP_fast_assign(
326 __entry->dev = bp->b_target->bt_dev;
327 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000328 __entry->nblks = bp->b_length;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000329 __entry->hold = atomic_read(&bp->b_hold);
330 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200331 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000332 __entry->flags = bp->b_flags;
333 __entry->caller_ip = caller_ip;
334 ),
Dave Chinner4e94b712012-04-23 15:58:51 +1000335 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100336 "lock %d flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000337 MAJOR(__entry->dev), MINOR(__entry->dev),
338 (unsigned long long)__entry->bno,
Dave Chinner4e94b712012-04-23 15:58:51 +1000339 __entry->nblks,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000340 __entry->hold,
341 __entry->pincount,
342 __entry->lockval,
343 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
344 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000345)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000346
347#define DEFINE_BUF_EVENT(name) \
348DEFINE_EVENT(xfs_buf_class, name, \
349 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
350 TP_ARGS(bp, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000351DEFINE_BUF_EVENT(xfs_buf_init);
352DEFINE_BUF_EVENT(xfs_buf_free);
353DEFINE_BUF_EVENT(xfs_buf_hold);
354DEFINE_BUF_EVENT(xfs_buf_rele);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000355DEFINE_BUF_EVENT(xfs_buf_iodone);
Dave Chinner595bff72014-10-02 09:05:14 +1000356DEFINE_BUF_EVENT(xfs_buf_submit);
357DEFINE_BUF_EVENT(xfs_buf_submit_wait);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000358DEFINE_BUF_EVENT(xfs_buf_lock);
359DEFINE_BUF_EVENT(xfs_buf_lock_done);
Darrick J. Wong479c6412016-06-21 11:53:28 +1000360DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200361DEFINE_BUF_EVENT(xfs_buf_trylock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000362DEFINE_BUF_EVENT(xfs_buf_unlock);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000363DEFINE_BUF_EVENT(xfs_buf_iowait);
364DEFINE_BUF_EVENT(xfs_buf_iowait_done);
365DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
Christoph Hellwig43ff2122012-04-23 15:58:39 +1000366DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000367DEFINE_BUF_EVENT(xfs_buf_delwri_split);
Dave Chinner686865f2010-09-24 20:07:47 +1000368DEFINE_BUF_EVENT(xfs_buf_get_uncached);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000369DEFINE_BUF_EVENT(xfs_buf_item_relse);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000370DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
371DEFINE_BUF_EVENT(xfs_buf_error_relse);
Dave Chinner9f878322013-01-21 23:53:55 +1100372DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000373DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
374
375/* not really buffer traces, but the buf provides useful information */
376DEFINE_BUF_EVENT(xfs_btree_corrupt);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000377DEFINE_BUF_EVENT(xfs_reset_dqcounts);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000378
379/* pass flags explicitly */
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000380DECLARE_EVENT_CLASS(xfs_buf_flags_class,
381 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
382 TP_ARGS(bp, flags, caller_ip),
383 TP_STRUCT__entry(
384 __field(dev_t, dev)
385 __field(xfs_daddr_t, bno)
386 __field(size_t, buffer_length)
387 __field(int, hold)
388 __field(int, pincount)
389 __field(unsigned, lockval)
390 __field(unsigned, flags)
391 __field(unsigned long, caller_ip)
392 ),
393 TP_fast_assign(
394 __entry->dev = bp->b_target->bt_dev;
395 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000396 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000397 __entry->flags = flags;
398 __entry->hold = atomic_read(&bp->b_hold);
399 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200400 __entry->lockval = bp->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000401 __entry->caller_ip = caller_ip;
402 ),
403 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100404 "lock %d flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000405 MAJOR(__entry->dev), MINOR(__entry->dev),
406 (unsigned long long)__entry->bno,
407 __entry->buffer_length,
408 __entry->hold,
409 __entry->pincount,
410 __entry->lockval,
411 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
412 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000413)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000414
415#define DEFINE_BUF_FLAGS_EVENT(name) \
416DEFINE_EVENT(xfs_buf_flags_class, name, \
417 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
418 TP_ARGS(bp, flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000419DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
420DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
421DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
422
423TRACE_EVENT(xfs_buf_ioerror,
424 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
425 TP_ARGS(bp, error, caller_ip),
426 TP_STRUCT__entry(
427 __field(dev_t, dev)
428 __field(xfs_daddr_t, bno)
429 __field(size_t, buffer_length)
430 __field(unsigned, flags)
431 __field(int, hold)
432 __field(int, pincount)
433 __field(unsigned, lockval)
434 __field(int, error)
435 __field(unsigned long, caller_ip)
436 ),
437 TP_fast_assign(
438 __entry->dev = bp->b_target->bt_dev;
439 __entry->bno = bp->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000440 __entry->buffer_length = BBTOB(bp->b_length);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000441 __entry->hold = atomic_read(&bp->b_hold);
442 __entry->pincount = atomic_read(&bp->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200443 __entry->lockval = bp->b_sema.count;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000444 __entry->error = error;
445 __entry->flags = bp->b_flags;
446 __entry->caller_ip = caller_ip;
447 ),
448 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
Scott Wood65dd2972015-03-25 14:56:21 +1100449 "lock %d error %d flags %s caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000450 MAJOR(__entry->dev), MINOR(__entry->dev),
451 (unsigned long long)__entry->bno,
452 __entry->buffer_length,
453 __entry->hold,
454 __entry->pincount,
455 __entry->lockval,
456 __entry->error,
457 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
458 (void *)__entry->caller_ip)
459);
460
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000461DECLARE_EVENT_CLASS(xfs_buf_item_class,
462 TP_PROTO(struct xfs_buf_log_item *bip),
463 TP_ARGS(bip),
464 TP_STRUCT__entry(
465 __field(dev_t, dev)
466 __field(xfs_daddr_t, buf_bno)
467 __field(size_t, buf_len)
468 __field(int, buf_hold)
469 __field(int, buf_pincount)
470 __field(int, buf_lockval)
471 __field(unsigned, buf_flags)
472 __field(unsigned, bli_recur)
473 __field(int, bli_refcount)
474 __field(unsigned, bli_flags)
475 __field(void *, li_desc)
476 __field(unsigned, li_flags)
477 ),
478 TP_fast_assign(
479 __entry->dev = bip->bli_buf->b_target->bt_dev;
480 __entry->bli_flags = bip->bli_flags;
481 __entry->bli_recur = bip->bli_recur;
482 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
483 __entry->buf_bno = bip->bli_buf->b_bn;
Dave Chinner4e94b712012-04-23 15:58:51 +1000484 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000485 __entry->buf_flags = bip->bli_buf->b_flags;
486 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
487 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
Christoph Hellwig0c842ad2011-07-08 14:36:19 +0200488 __entry->buf_lockval = bip->bli_buf->b_sema.count;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000489 __entry->li_desc = bip->bli_item.li_desc;
490 __entry->li_flags = bip->bli_item.li_flags;
491 ),
492 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
493 "lock %d flags %s recur %d refcount %d bliflags %s "
494 "lidesc 0x%p liflags %s",
495 MAJOR(__entry->dev), MINOR(__entry->dev),
496 (unsigned long long)__entry->buf_bno,
497 __entry->buf_len,
498 __entry->buf_hold,
499 __entry->buf_pincount,
500 __entry->buf_lockval,
501 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
502 __entry->bli_recur,
503 __entry->bli_refcount,
504 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
505 __entry->li_desc,
506 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000507)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000508
509#define DEFINE_BUF_ITEM_EVENT(name) \
510DEFINE_EVENT(xfs_buf_item_class, name, \
511 TP_PROTO(struct xfs_buf_log_item *bip), \
512 TP_ARGS(bip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000513DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000514DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000515DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
516DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000517DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000518DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
Dave Chinner5f6bed72013-06-27 16:04:52 +1000519DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000520DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
521DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
522DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000523DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
524DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
525DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
526DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
527DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
528DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
529DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
530DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
531DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
532DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
533DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
534DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
535DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
536DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
537DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
538DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
539
Christoph Hellwigb94acd42014-04-23 07:11:52 +1000540DECLARE_EVENT_CLASS(xfs_filestream_class,
541 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
542 TP_ARGS(ip, agno),
543 TP_STRUCT__entry(
544 __field(dev_t, dev)
545 __field(xfs_ino_t, ino)
546 __field(xfs_agnumber_t, agno)
547 __field(int, streams)
548 ),
549 TP_fast_assign(
550 __entry->dev = VFS_I(ip)->i_sb->s_dev;
551 __entry->ino = ip->i_ino;
552 __entry->agno = agno;
553 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
554 ),
555 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
556 MAJOR(__entry->dev), MINOR(__entry->dev),
557 __entry->ino,
558 __entry->agno,
559 __entry->streams)
560)
561#define DEFINE_FILESTREAM_EVENT(name) \
562DEFINE_EVENT(xfs_filestream_class, name, \
563 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
564 TP_ARGS(ip, agno))
565DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
566DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
567DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
568
569TRACE_EVENT(xfs_filestream_pick,
570 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
571 xfs_extlen_t free, int nscan),
572 TP_ARGS(ip, agno, free, nscan),
573 TP_STRUCT__entry(
574 __field(dev_t, dev)
575 __field(xfs_ino_t, ino)
576 __field(xfs_agnumber_t, agno)
577 __field(int, streams)
578 __field(xfs_extlen_t, free)
579 __field(int, nscan)
580 ),
581 TP_fast_assign(
582 __entry->dev = VFS_I(ip)->i_sb->s_dev;
583 __entry->ino = ip->i_ino;
584 __entry->agno = agno;
585 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
586 __entry->free = free;
587 __entry->nscan = nscan;
588 ),
589 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
590 MAJOR(__entry->dev), MINOR(__entry->dev),
591 __entry->ino,
592 __entry->agno,
593 __entry->streams,
594 __entry->free,
595 __entry->nscan)
596);
597
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000598DECLARE_EVENT_CLASS(xfs_lock_class,
599 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
600 unsigned long caller_ip),
601 TP_ARGS(ip, lock_flags, caller_ip),
602 TP_STRUCT__entry(
603 __field(dev_t, dev)
604 __field(xfs_ino_t, ino)
605 __field(int, lock_flags)
606 __field(unsigned long, caller_ip)
607 ),
608 TP_fast_assign(
609 __entry->dev = VFS_I(ip)->i_sb->s_dev;
610 __entry->ino = ip->i_ino;
611 __entry->lock_flags = lock_flags;
612 __entry->caller_ip = caller_ip;
613 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100614 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000615 MAJOR(__entry->dev), MINOR(__entry->dev),
616 __entry->ino,
617 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
618 (void *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000619)
620
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000621#define DEFINE_LOCK_EVENT(name) \
622DEFINE_EVENT(xfs_lock_class, name, \
623 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
624 unsigned long caller_ip), \
625 TP_ARGS(ip, lock_flags, caller_ip))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000626DEFINE_LOCK_EVENT(xfs_ilock);
627DEFINE_LOCK_EVENT(xfs_ilock_nowait);
628DEFINE_LOCK_EVENT(xfs_ilock_demote);
629DEFINE_LOCK_EVENT(xfs_iunlock);
630
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000631DECLARE_EVENT_CLASS(xfs_inode_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000632 TP_PROTO(struct xfs_inode *ip),
633 TP_ARGS(ip),
634 TP_STRUCT__entry(
635 __field(dev_t, dev)
636 __field(xfs_ino_t, ino)
637 ),
638 TP_fast_assign(
639 __entry->dev = VFS_I(ip)->i_sb->s_dev;
640 __entry->ino = ip->i_ino;
641 ),
642 TP_printk("dev %d:%d ino 0x%llx",
643 MAJOR(__entry->dev), MINOR(__entry->dev),
644 __entry->ino)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000645)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000646
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000647#define DEFINE_INODE_EVENT(name) \
648DEFINE_EVENT(xfs_inode_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000649 TP_PROTO(struct xfs_inode *ip), \
650 TP_ARGS(ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000651DEFINE_INODE_EVENT(xfs_iget_skip);
652DEFINE_INODE_EVENT(xfs_iget_reclaim);
653DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
654DEFINE_INODE_EVENT(xfs_iget_hit);
655DEFINE_INODE_EVENT(xfs_iget_miss);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000656
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000657DEFINE_INODE_EVENT(xfs_getattr);
658DEFINE_INODE_EVENT(xfs_setattr);
659DEFINE_INODE_EVENT(xfs_readlink);
Mark Tinguely725eb1e2013-06-17 15:35:57 -0500660DEFINE_INODE_EVENT(xfs_inactive_symlink);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000661DEFINE_INODE_EVENT(xfs_alloc_file_space);
662DEFINE_INODE_EVENT(xfs_free_file_space);
Dave Chinner897b73b2014-04-14 18:15:11 +1000663DEFINE_INODE_EVENT(xfs_zero_file_space);
Namjae Jeone1d8fb82014-02-24 10:58:19 +1100664DEFINE_INODE_EVENT(xfs_collapse_file_space);
Namjae Jeona904b1c2015-03-25 15:08:56 +1100665DEFINE_INODE_EVENT(xfs_insert_file_space);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000666DEFINE_INODE_EVENT(xfs_readdir);
Tony Luck0f1a9322010-07-20 17:54:41 +1000667#ifdef CONFIG_XFS_POSIX_ACL
Christoph Hellwig4e34e712011-07-23 17:37:31 +0200668DEFINE_INODE_EVENT(xfs_get_acl);
Tony Luck0f1a9322010-07-20 17:54:41 +1000669#endif
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000670DEFINE_INODE_EVENT(xfs_vm_bmap);
671DEFINE_INODE_EVENT(xfs_file_ioctl);
672DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
673DEFINE_INODE_EVENT(xfs_ioctl_setattr);
Christoph Hellwig1da2f2d2011-10-02 14:25:16 +0000674DEFINE_INODE_EVENT(xfs_dir_fsync);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000675DEFINE_INODE_EVENT(xfs_file_fsync);
676DEFINE_INODE_EVENT(xfs_destroy_inode);
Christoph Hellwig69ff2822012-06-06 17:01:28 -0400677DEFINE_INODE_EVENT(xfs_update_time);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000678
679DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
680DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
681
Brian Foster27b52862012-11-06 09:50:38 -0500682DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
683DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
Brian Foster41176a62012-11-06 09:50:42 -0500684DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
Darrick J. Wong83104d42016-10-03 09:11:46 -0700685DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
686DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
687DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
Brian Foster27b52862012-11-06 09:50:38 -0500688
Dave Chinnerde0e8c22015-02-23 21:44:19 +1100689DEFINE_INODE_EVENT(xfs_filemap_fault);
Dave Jianga2d58162017-02-24 14:56:59 -0800690DEFINE_INODE_EVENT(xfs_filemap_huge_fault);
Dave Chinner075a9242015-02-23 21:44:54 +1100691DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
Dave Chinner3af49282015-11-03 12:37:02 +1100692DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
Dave Chinnerde0e8c22015-02-23 21:44:19 +1100693
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000694DECLARE_EVENT_CLASS(xfs_iref_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000695 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
696 TP_ARGS(ip, caller_ip),
697 TP_STRUCT__entry(
698 __field(dev_t, dev)
699 __field(xfs_ino_t, ino)
700 __field(int, count)
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100701 __field(int, pincount)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000702 __field(unsigned long, caller_ip)
703 ),
704 TP_fast_assign(
705 __entry->dev = VFS_I(ip)->i_sb->s_dev;
706 __entry->ino = ip->i_ino;
707 __entry->count = atomic_read(&VFS_I(ip)->i_count);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100708 __entry->pincount = atomic_read(&ip->i_pincount);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000709 __entry->caller_ip = caller_ip;
710 ),
Scott Wood65dd2972015-03-25 14:56:21 +1100711 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000712 MAJOR(__entry->dev), MINOR(__entry->dev),
713 __entry->ino,
714 __entry->count,
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100715 __entry->pincount,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000716 (char *)__entry->caller_ip)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000717)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000718
Brian Foster19cb7e32013-03-18 10:51:48 -0400719TRACE_EVENT(xfs_iomap_prealloc_size,
720 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
721 unsigned int writeio_blocks),
722 TP_ARGS(ip, blocks, shift, writeio_blocks),
723 TP_STRUCT__entry(
724 __field(dev_t, dev)
725 __field(xfs_ino_t, ino)
726 __field(xfs_fsblock_t, blocks)
727 __field(int, shift)
728 __field(unsigned int, writeio_blocks)
729 ),
730 TP_fast_assign(
731 __entry->dev = VFS_I(ip)->i_sb->s_dev;
732 __entry->ino = ip->i_ino;
733 __entry->blocks = blocks;
734 __entry->shift = shift;
735 __entry->writeio_blocks = writeio_blocks;
736 ),
737 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
738 "m_writeio_blocks %u",
739 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
740 __entry->blocks, __entry->shift, __entry->writeio_blocks)
741)
742
Brian Foster56d11152015-05-29 09:18:32 +1000743TRACE_EVENT(xfs_irec_merge_pre,
744 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
745 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
746 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
747 TP_STRUCT__entry(
748 __field(dev_t, dev)
749 __field(xfs_agnumber_t, agno)
750 __field(xfs_agino_t, agino)
751 __field(uint16_t, holemask)
752 __field(xfs_agino_t, nagino)
753 __field(uint16_t, nholemask)
754 ),
755 TP_fast_assign(
756 __entry->dev = mp->m_super->s_dev;
757 __entry->agno = agno;
758 __entry->agino = agino;
759 __entry->holemask = holemask;
760 __entry->nagino = nagino;
761 __entry->nholemask = holemask;
762 ),
763 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
764 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
765 __entry->agino, __entry->holemask, __entry->nagino,
766 __entry->nholemask)
767)
768
769TRACE_EVENT(xfs_irec_merge_post,
770 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
771 uint16_t holemask),
772 TP_ARGS(mp, agno, agino, holemask),
773 TP_STRUCT__entry(
774 __field(dev_t, dev)
775 __field(xfs_agnumber_t, agno)
776 __field(xfs_agino_t, agino)
777 __field(uint16_t, holemask)
778 ),
779 TP_fast_assign(
780 __entry->dev = mp->m_super->s_dev;
781 __entry->agno = agno;
782 __entry->agino = agino;
783 __entry->holemask = holemask;
784 ),
785 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
786 MINOR(__entry->dev), __entry->agno, __entry->agino,
787 __entry->holemask)
788)
789
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000790#define DEFINE_IREF_EVENT(name) \
791DEFINE_EVENT(xfs_iref_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000792 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
793 TP_ARGS(ip, caller_ip))
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000794DEFINE_IREF_EVENT(xfs_irele);
795DEFINE_IREF_EVENT(xfs_inode_pin);
796DEFINE_IREF_EVENT(xfs_inode_unpin);
797DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
Dave Chinner4aaf15d2010-03-08 11:24:07 +1100798
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000799DECLARE_EVENT_CLASS(xfs_namespace_class,
800 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
801 TP_ARGS(dp, name),
802 TP_STRUCT__entry(
803 __field(dev_t, dev)
804 __field(xfs_ino_t, dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000805 __field(int, namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000806 __dynamic_array(char, name, name->len)
807 ),
808 TP_fast_assign(
809 __entry->dev = VFS_I(dp)->i_sb->s_dev;
810 __entry->dp_ino = dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000811 __entry->namelen = name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000812 memcpy(__get_str(name), name->name, name->len);
813 ),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000814 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000815 MAJOR(__entry->dev), MINOR(__entry->dev),
816 __entry->dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000817 __entry->namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000818 __get_str(name))
819)
820
821#define DEFINE_NAMESPACE_EVENT(name) \
822DEFINE_EVENT(xfs_namespace_class, name, \
823 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
824 TP_ARGS(dp, name))
825DEFINE_NAMESPACE_EVENT(xfs_remove);
826DEFINE_NAMESPACE_EVENT(xfs_link);
827DEFINE_NAMESPACE_EVENT(xfs_lookup);
828DEFINE_NAMESPACE_EVENT(xfs_create);
829DEFINE_NAMESPACE_EVENT(xfs_symlink);
830
831TRACE_EVENT(xfs_rename,
832 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
833 struct xfs_name *src_name, struct xfs_name *target_name),
834 TP_ARGS(src_dp, target_dp, src_name, target_name),
835 TP_STRUCT__entry(
836 __field(dev_t, dev)
837 __field(xfs_ino_t, src_dp_ino)
838 __field(xfs_ino_t, target_dp_ino)
Christoph Hellwigf6161372012-02-28 11:01:40 +0000839 __field(int, src_namelen)
840 __field(int, target_namelen)
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000841 __dynamic_array(char, src_name, src_name->len)
842 __dynamic_array(char, target_name, target_name->len)
843 ),
844 TP_fast_assign(
845 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
846 __entry->src_dp_ino = src_dp->i_ino;
847 __entry->target_dp_ino = target_dp->i_ino;
Christoph Hellwigf6161372012-02-28 11:01:40 +0000848 __entry->src_namelen = src_name->len;
849 __entry->target_namelen = target_name->len;
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000850 memcpy(__get_str(src_name), src_name->name, src_name->len);
Christoph Hellwigf6161372012-02-28 11:01:40 +0000851 memcpy(__get_str(target_name), target_name->name,
852 target_name->len);
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000853 ),
854 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
Christoph Hellwigf6161372012-02-28 11:01:40 +0000855 " src name %.*s target name %.*s",
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000856 MAJOR(__entry->dev), MINOR(__entry->dev),
857 __entry->src_dp_ino,
858 __entry->target_dp_ino,
Christoph Hellwigf6161372012-02-28 11:01:40 +0000859 __entry->src_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000860 __get_str(src_name),
Christoph Hellwigf6161372012-02-28 11:01:40 +0000861 __entry->target_namelen,
Christoph Hellwigcca28fb2010-06-24 11:57:09 +1000862 __get_str(target_name))
863)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000864
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000865DECLARE_EVENT_CLASS(xfs_dquot_class,
866 TP_PROTO(struct xfs_dquot *dqp),
867 TP_ARGS(dqp),
868 TP_STRUCT__entry(
869 __field(dev_t, dev)
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000870 __field(u32, id)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000871 __field(unsigned, flags)
872 __field(unsigned, nrefs)
873 __field(unsigned long long, res_bcount)
874 __field(unsigned long long, bcount)
875 __field(unsigned long long, icount)
876 __field(unsigned long long, blk_hardlimit)
877 __field(unsigned long long, blk_softlimit)
878 __field(unsigned long long, ino_hardlimit)
879 __field(unsigned long long, ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000880 ), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000881 TP_fast_assign(
882 __entry->dev = dqp->q_mount->m_super->s_dev;
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000883 __entry->id = be32_to_cpu(dqp->q_core.d_id);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000884 __entry->flags = dqp->dq_flags;
885 __entry->nrefs = dqp->q_nrefs;
886 __entry->res_bcount = dqp->q_res_bcount;
887 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
888 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
889 __entry->blk_hardlimit =
890 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
891 __entry->blk_softlimit =
892 be64_to_cpu(dqp->q_core.d_blk_softlimit);
893 __entry->ino_hardlimit =
894 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
895 __entry->ino_softlimit =
896 be64_to_cpu(dqp->q_core.d_ino_softlimit);
897 ),
898 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000899 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
900 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000901 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigb262e5d2010-02-14 22:01:45 +0000902 __entry->id,
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000903 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
904 __entry->nrefs,
905 __entry->res_bcount,
906 __entry->bcount,
907 __entry->blk_hardlimit,
908 __entry->blk_softlimit,
909 __entry->icount,
910 __entry->ino_hardlimit,
911 __entry->ino_softlimit)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000912)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000913
914#define DEFINE_DQUOT_EVENT(name) \
915DEFINE_EVENT(xfs_dquot_class, name, \
916 TP_PROTO(struct xfs_dquot *dqp), \
917 TP_ARGS(dqp))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000918DEFINE_DQUOT_EVENT(xfs_dqadjust);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000919DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
920DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
Christoph Hellwig92b2e5b2012-02-01 13:57:20 +0000921DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
922DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000923DEFINE_DQUOT_EVENT(xfs_dqattach_found);
924DEFINE_DQUOT_EVENT(xfs_dqattach_get);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000925DEFINE_DQUOT_EVENT(xfs_dqalloc);
926DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
927DEFINE_DQUOT_EVENT(xfs_dqread);
928DEFINE_DQUOT_EVENT(xfs_dqread_fail);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000929DEFINE_DQUOT_EVENT(xfs_dqget_hit);
930DEFINE_DQUOT_EVENT(xfs_dqget_miss);
Christoph Hellwig9f920f12012-03-13 08:52:35 +0000931DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
932DEFINE_DQUOT_EVENT(xfs_dqget_dup);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000933DEFINE_DQUOT_EVENT(xfs_dqput);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000934DEFINE_DQUOT_EVENT(xfs_dqput_free);
935DEFINE_DQUOT_EVENT(xfs_dqrele);
936DEFINE_DQUOT_EVENT(xfs_dqflush);
937DEFINE_DQUOT_EVENT(xfs_dqflush_force);
938DEFINE_DQUOT_EVENT(xfs_dqflush_done);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +0000939
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000940DECLARE_EVENT_CLASS(xfs_loggrant_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -0500941 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000942 TP_ARGS(log, tic),
943 TP_STRUCT__entry(
944 __field(dev_t, dev)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000945 __field(char, ocnt)
946 __field(char, cnt)
947 __field(int, curr_res)
948 __field(int, unit_res)
949 __field(unsigned int, flags)
Dave Chinner10547942010-12-21 12:02:25 +1100950 __field(int, reserveq)
951 __field(int, writeq)
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000952 __field(int, grant_reserve_cycle)
953 __field(int, grant_reserve_bytes)
954 __field(int, grant_write_cycle)
955 __field(int, grant_write_bytes)
956 __field(int, curr_cycle)
957 __field(int, curr_block)
958 __field(xfs_lsn_t, tail_lsn)
959 ),
960 TP_fast_assign(
961 __entry->dev = log->l_mp->m_super->s_dev;
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000962 __entry->ocnt = tic->t_ocnt;
963 __entry->cnt = tic->t_cnt;
964 __entry->curr_res = tic->t_curr_res;
965 __entry->unit_res = tic->t_unit_res;
966 __entry->flags = tic->t_flags;
Christoph Hellwig28496962012-02-20 02:31:25 +0000967 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
968 __entry->writeq = list_empty(&log->l_write_head.waiters);
969 xlog_crack_grant_head(&log->l_reserve_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100970 &__entry->grant_reserve_cycle,
971 &__entry->grant_reserve_bytes);
Christoph Hellwig28496962012-02-20 02:31:25 +0000972 xlog_crack_grant_head(&log->l_write_head.grant,
Dave Chinnera69ed032010-12-21 12:08:20 +1100973 &__entry->grant_write_cycle,
974 &__entry->grant_write_bytes);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000975 __entry->curr_cycle = log->l_curr_cycle;
976 __entry->curr_block = log->l_curr_block;
Dave Chinner1c3cb9e2010-12-21 12:28:39 +1100977 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000978 ),
Christoph Hellwig710b1e22016-04-06 09:20:36 +1000979 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
Dave Chinner10547942010-12-21 12:02:25 +1100980 "t_unit_res %u t_flags %s reserveq %s "
981 "writeq %s grant_reserve_cycle %d "
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000982 "grant_reserve_bytes %d grant_write_cycle %d "
983 "grant_write_bytes %d curr_cycle %d curr_block %d "
984 "tail_cycle %d tail_block %d",
985 MAJOR(__entry->dev), MINOR(__entry->dev),
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000986 __entry->ocnt,
987 __entry->cnt,
988 __entry->curr_res,
989 __entry->unit_res,
990 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
Dave Chinner10547942010-12-21 12:02:25 +1100991 __entry->reserveq ? "empty" : "active",
992 __entry->writeq ? "empty" : "active",
Christoph Hellwigea9a4882009-12-21 14:03:03 +0000993 __entry->grant_reserve_cycle,
994 __entry->grant_reserve_bytes,
995 __entry->grant_write_cycle,
996 __entry->grant_write_bytes,
997 __entry->curr_cycle,
998 __entry->curr_block,
999 CYCLE_LSN(__entry->tail_lsn),
1000 BLOCK_LSN(__entry->tail_lsn)
1001 )
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001002)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001003
1004#define DEFINE_LOGGRANT_EVENT(name) \
1005DEFINE_EVENT(xfs_loggrant_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05001006 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001007 TP_ARGS(log, tic))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001008DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1009DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001010DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
Christoph Hellwig9f9c19e2011-11-28 08:17:36 +00001011DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1012DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
Dave Chinner3f16b982010-12-21 12:29:01 +11001013DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
Christoph Hellwig9006fb92012-02-20 02:31:31 +00001014DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1015DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1016DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1017DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001018DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1019DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1020DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1021DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1022DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1023DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1024
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001025DECLARE_EVENT_CLASS(xfs_log_item_class,
1026 TP_PROTO(struct xfs_log_item *lip),
1027 TP_ARGS(lip),
1028 TP_STRUCT__entry(
1029 __field(dev_t, dev)
1030 __field(void *, lip)
1031 __field(uint, type)
1032 __field(uint, flags)
1033 __field(xfs_lsn_t, lsn)
1034 ),
1035 TP_fast_assign(
1036 __entry->dev = lip->li_mountp->m_super->s_dev;
1037 __entry->lip = lip;
1038 __entry->type = lip->li_type;
1039 __entry->flags = lip->li_flags;
1040 __entry->lsn = lip->li_lsn;
1041 ),
1042 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1043 MAJOR(__entry->dev), MINOR(__entry->dev),
1044 __entry->lip,
1045 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1046 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1047 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1048)
1049
Dave Chinner14c26c62012-04-24 16:33:31 +10001050TRACE_EVENT(xfs_log_force,
Carlos Maiolino9f278892016-04-06 09:46:30 +10001051 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1052 TP_ARGS(mp, lsn, caller_ip),
Dave Chinner14c26c62012-04-24 16:33:31 +10001053 TP_STRUCT__entry(
1054 __field(dev_t, dev)
1055 __field(xfs_lsn_t, lsn)
Carlos Maiolino9f278892016-04-06 09:46:30 +10001056 __field(unsigned long, caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001057 ),
1058 TP_fast_assign(
1059 __entry->dev = mp->m_super->s_dev;
1060 __entry->lsn = lsn;
Carlos Maiolino9f278892016-04-06 09:46:30 +10001061 __entry->caller_ip = caller_ip;
Dave Chinner14c26c62012-04-24 16:33:31 +10001062 ),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001063 TP_printk("dev %d:%d lsn 0x%llx caller %ps",
Dave Chinner14c26c62012-04-24 16:33:31 +10001064 MAJOR(__entry->dev), MINOR(__entry->dev),
Carlos Maiolino9f278892016-04-06 09:46:30 +10001065 __entry->lsn, (void *)__entry->caller_ip)
Dave Chinner14c26c62012-04-24 16:33:31 +10001066)
1067
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001068#define DEFINE_LOG_ITEM_EVENT(name) \
1069DEFINE_EVENT(xfs_log_item_class, name, \
1070 TP_PROTO(struct xfs_log_item *lip), \
1071 TP_ARGS(lip))
1072DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001073DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1074DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
Christoph Hellwig43ff2122012-04-23 15:58:39 +10001075DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001076
Dave Chinner750b9c92013-11-01 15:27:18 +11001077DECLARE_EVENT_CLASS(xfs_ail_class,
1078 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1079 TP_ARGS(lip, old_lsn, new_lsn),
1080 TP_STRUCT__entry(
1081 __field(dev_t, dev)
1082 __field(void *, lip)
1083 __field(uint, type)
1084 __field(uint, flags)
1085 __field(xfs_lsn_t, old_lsn)
1086 __field(xfs_lsn_t, new_lsn)
1087 ),
1088 TP_fast_assign(
1089 __entry->dev = lip->li_mountp->m_super->s_dev;
1090 __entry->lip = lip;
1091 __entry->type = lip->li_type;
1092 __entry->flags = lip->li_flags;
1093 __entry->old_lsn = old_lsn;
1094 __entry->new_lsn = new_lsn;
1095 ),
1096 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1097 MAJOR(__entry->dev), MINOR(__entry->dev),
1098 __entry->lip,
1099 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1100 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1101 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1102 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1103)
1104
1105#define DEFINE_AIL_EVENT(name) \
1106DEFINE_EVENT(xfs_ail_class, name, \
1107 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1108 TP_ARGS(lip, old_lsn, new_lsn))
1109DEFINE_AIL_EVENT(xfs_ail_insert);
1110DEFINE_AIL_EVENT(xfs_ail_move);
1111DEFINE_AIL_EVENT(xfs_ail_delete);
1112
1113TRACE_EVENT(xfs_log_assign_tail_lsn,
1114 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1115 TP_ARGS(log, new_lsn),
1116 TP_STRUCT__entry(
1117 __field(dev_t, dev)
1118 __field(xfs_lsn_t, new_lsn)
1119 __field(xfs_lsn_t, old_lsn)
1120 __field(xfs_lsn_t, last_sync_lsn)
1121 ),
1122 TP_fast_assign(
1123 __entry->dev = log->l_mp->m_super->s_dev;
1124 __entry->new_lsn = new_lsn;
1125 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1126 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1127 ),
1128 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1129 MAJOR(__entry->dev), MINOR(__entry->dev),
1130 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1131 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1132 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1133)
Christoph Hellwig9e4c1092011-10-11 15:14:11 +00001134
Li Zefanf8adb4d2010-05-24 08:25:57 +00001135DECLARE_EVENT_CLASS(xfs_file_class,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001136 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1137 TP_ARGS(ip, count, offset),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001138 TP_STRUCT__entry(
1139 __field(dev_t, dev)
1140 __field(xfs_ino_t, ino)
1141 __field(xfs_fsize_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001142 __field(loff_t, offset)
1143 __field(size_t, count)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001144 ),
1145 TP_fast_assign(
1146 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1147 __entry->ino = ip->i_ino;
1148 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001149 __entry->offset = offset;
1150 __entry->count = count;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001151 ),
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001152 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001153 MAJOR(__entry->dev), MINOR(__entry->dev),
1154 __entry->ino,
1155 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001156 __entry->offset,
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001157 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001158)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001159
1160#define DEFINE_RW_EVENT(name) \
1161DEFINE_EVENT(xfs_file_class, name, \
Christoph Hellwig3176c3e2016-07-20 11:31:42 +10001162 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1163 TP_ARGS(ip, count, offset))
1164DEFINE_RW_EVENT(xfs_file_buffered_read);
1165DEFINE_RW_EVENT(xfs_file_direct_read);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001166DEFINE_RW_EVENT(xfs_file_dax_read);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001167DEFINE_RW_EVENT(xfs_file_buffered_write);
1168DEFINE_RW_EVENT(xfs_file_direct_write);
Christoph Hellwig16d4d432016-07-20 11:38:55 +10001169DEFINE_RW_EVENT(xfs_file_dax_write);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001170
Li Zefanf8adb4d2010-05-24 08:25:57 +00001171DECLARE_EVENT_CLASS(xfs_page_class,
Lukas Czerner34097df2013-05-21 23:58:01 -04001172 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1173 unsigned int len),
1174 TP_ARGS(inode, page, off, len),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001175 TP_STRUCT__entry(
1176 __field(dev_t, dev)
1177 __field(xfs_ino_t, ino)
1178 __field(pgoff_t, pgoff)
1179 __field(loff_t, size)
1180 __field(unsigned long, offset)
Lukas Czerner34097df2013-05-21 23:58:01 -04001181 __field(unsigned int, length)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001182 __field(int, delalloc)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001183 __field(int, unwritten)
1184 ),
1185 TP_fast_assign(
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001186 int delalloc = -1, unwritten = -1;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001187
Li Zefanf8adb4d2010-05-24 08:25:57 +00001188 if (page_has_buffers(page))
Christoph Hellwig20cb52e2010-06-24 09:46:01 +10001189 xfs_count_page_state(page, &delalloc, &unwritten);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001190 __entry->dev = inode->i_sb->s_dev;
1191 __entry->ino = XFS_I(inode)->i_ino;
1192 __entry->pgoff = page_offset(page);
1193 __entry->size = i_size_read(inode);
1194 __entry->offset = off;
Lukas Czerner34097df2013-05-21 23:58:01 -04001195 __entry->length = len;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001196 __entry->delalloc = delalloc;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001197 __entry->unwritten = unwritten;
1198 ),
1199 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
Lukas Czerner34097df2013-05-21 23:58:01 -04001200 "length %x delalloc %d unwritten %d",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001201 MAJOR(__entry->dev), MINOR(__entry->dev),
1202 __entry->ino,
1203 __entry->pgoff,
1204 __entry->size,
1205 __entry->offset,
Lukas Czerner34097df2013-05-21 23:58:01 -04001206 __entry->length,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001207 __entry->delalloc,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001208 __entry->unwritten)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001209)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001210
1211#define DEFINE_PAGE_EVENT(name) \
1212DEFINE_EVENT(xfs_page_class, name, \
Lukas Czerner34097df2013-05-21 23:58:01 -04001213 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1214 unsigned int len), \
1215 TP_ARGS(inode, page, off, len))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001216DEFINE_PAGE_EVENT(xfs_writepage);
1217DEFINE_PAGE_EVENT(xfs_releasepage);
1218DEFINE_PAGE_EVENT(xfs_invalidatepage);
1219
Dave Chinner121e2132016-01-08 11:28:35 +11001220DECLARE_EVENT_CLASS(xfs_readpage_class,
1221 TP_PROTO(struct inode *inode, int nr_pages),
1222 TP_ARGS(inode, nr_pages),
1223 TP_STRUCT__entry(
1224 __field(dev_t, dev)
1225 __field(xfs_ino_t, ino)
1226 __field(int, nr_pages)
1227 ),
1228 TP_fast_assign(
1229 __entry->dev = inode->i_sb->s_dev;
1230 __entry->ino = inode->i_ino;
1231 __entry->nr_pages = nr_pages;
1232 ),
1233 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1234 MAJOR(__entry->dev), MINOR(__entry->dev),
1235 __entry->ino,
1236 __entry->nr_pages)
1237)
1238
1239#define DEFINE_READPAGE_EVENT(name) \
1240DEFINE_EVENT(xfs_readpage_class, name, \
1241 TP_PROTO(struct inode *inode, int nr_pages), \
1242 TP_ARGS(inode, nr_pages))
1243DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1244DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1245
Christoph Hellwiga206c812010-12-10 08:42:20 +00001246DECLARE_EVENT_CLASS(xfs_imap_class,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001247 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001248 int type, struct xfs_bmbt_irec *irec),
1249 TP_ARGS(ip, offset, count, type, irec),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001250 TP_STRUCT__entry(
1251 __field(dev_t, dev)
1252 __field(xfs_ino_t, ino)
1253 __field(loff_t, size)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001254 __field(loff_t, offset)
1255 __field(size_t, count)
Christoph Hellwiga206c812010-12-10 08:42:20 +00001256 __field(int, type)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001257 __field(xfs_fileoff_t, startoff)
1258 __field(xfs_fsblock_t, startblock)
1259 __field(xfs_filblks_t, blockcount)
1260 ),
1261 TP_fast_assign(
1262 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1263 __entry->ino = ip->i_ino;
1264 __entry->size = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001265 __entry->offset = offset;
1266 __entry->count = count;
Christoph Hellwiga206c812010-12-10 08:42:20 +00001267 __entry->type = type;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001268 __entry->startoff = irec ? irec->br_startoff : 0;
1269 __entry->startblock = irec ? irec->br_startblock : 0;
1270 __entry->blockcount = irec ? irec->br_blockcount : 0;
1271 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001272 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1273 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
Li Zefanf8adb4d2010-05-24 08:25:57 +00001274 MAJOR(__entry->dev), MINOR(__entry->dev),
1275 __entry->ino,
1276 __entry->size,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001277 __entry->offset,
1278 __entry->count,
Christoph Hellwiga206c812010-12-10 08:42:20 +00001279 __print_symbolic(__entry->type, XFS_IO_TYPES),
Li Zefanf8adb4d2010-05-24 08:25:57 +00001280 __entry->startoff,
1281 (__int64_t)__entry->startblock,
1282 __entry->blockcount)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001283)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001284
1285#define DEFINE_IOMAP_EVENT(name) \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001286DEFINE_EVENT(xfs_imap_class, name, \
Li Zefanf8adb4d2010-05-24 08:25:57 +00001287 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
Christoph Hellwiga206c812010-12-10 08:42:20 +00001288 int type, struct xfs_bmbt_irec *irec), \
1289 TP_ARGS(ip, offset, count, type, irec))
1290DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1291DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1292DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1293DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001294DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
Christoph Hellwig68a9f5e2016-06-21 09:53:44 +10001295DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
1296DEFINE_IOMAP_EVENT(xfs_iomap_found);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001297
Li Zefanf8adb4d2010-05-24 08:25:57 +00001298DECLARE_EVENT_CLASS(xfs_simple_io_class,
1299 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1300 TP_ARGS(ip, offset, count),
1301 TP_STRUCT__entry(
1302 __field(dev_t, dev)
1303 __field(xfs_ino_t, ino)
Dave Chinner55fb25d52011-07-18 03:40:19 +00001304 __field(loff_t, isize)
1305 __field(loff_t, disize)
Li Zefanf8adb4d2010-05-24 08:25:57 +00001306 __field(loff_t, offset)
1307 __field(size_t, count)
1308 ),
1309 TP_fast_assign(
1310 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1311 __entry->ino = ip->i_ino;
Christoph Hellwigce7ae1512011-12-18 20:00:11 +00001312 __entry->isize = VFS_I(ip)->i_size;
Dave Chinner55fb25d52011-07-18 03:40:19 +00001313 __entry->disize = ip->i_d.di_size;
Li Zefanf8adb4d2010-05-24 08:25:57 +00001314 __entry->offset = offset;
1315 __entry->count = count;
1316 ),
Christoph Hellwig2813d682011-12-18 20:00:12 +00001317 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
Li Zefanf8adb4d2010-05-24 08:25:57 +00001318 "offset 0x%llx count %zd",
1319 MAJOR(__entry->dev), MINOR(__entry->dev),
1320 __entry->ino,
Dave Chinner55fb25d52011-07-18 03:40:19 +00001321 __entry->isize,
1322 __entry->disize,
Li Zefanf8adb4d2010-05-24 08:25:57 +00001323 __entry->offset,
1324 __entry->count)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001325);
Li Zefanf8adb4d2010-05-24 08:25:57 +00001326
1327#define DEFINE_SIMPLE_IO_EVENT(name) \
1328DEFINE_EVENT(xfs_simple_io_class, name, \
1329 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1330 TP_ARGS(ip, offset, count))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001331DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1332DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
Christoph Hellwiga206c812010-12-10 08:42:20 +00001333DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
Dave Chinner55fb25d52011-07-18 03:40:19 +00001334DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
Brian Foster0a50f162015-10-12 16:02:08 +11001335DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
Christoph Hellwig273dda72016-02-08 14:40:51 +11001336DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1337DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1338DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001339
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001340DECLARE_EVENT_CLASS(xfs_itrunc_class,
1341 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1342 TP_ARGS(ip, new_size),
1343 TP_STRUCT__entry(
1344 __field(dev_t, dev)
1345 __field(xfs_ino_t, ino)
1346 __field(xfs_fsize_t, size)
1347 __field(xfs_fsize_t, new_size)
1348 ),
1349 TP_fast_assign(
1350 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1351 __entry->ino = ip->i_ino;
1352 __entry->size = ip->i_d.di_size;
1353 __entry->new_size = new_size;
1354 ),
1355 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1356 MAJOR(__entry->dev), MINOR(__entry->dev),
1357 __entry->ino,
1358 __entry->size,
1359 __entry->new_size)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001360)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001361
1362#define DEFINE_ITRUNC_EVENT(name) \
1363DEFINE_EVENT(xfs_itrunc_class, name, \
1364 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1365 TP_ARGS(ip, new_size))
Christoph Hellwig673e8e52011-12-18 20:00:04 +00001366DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1367DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001368
1369TRACE_EVENT(xfs_pagecache_inval,
1370 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1371 TP_ARGS(ip, start, finish),
1372 TP_STRUCT__entry(
1373 __field(dev_t, dev)
1374 __field(xfs_ino_t, ino)
1375 __field(xfs_fsize_t, size)
1376 __field(xfs_off_t, start)
1377 __field(xfs_off_t, finish)
1378 ),
1379 TP_fast_assign(
1380 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1381 __entry->ino = ip->i_ino;
1382 __entry->size = ip->i_d.di_size;
1383 __entry->start = start;
1384 __entry->finish = finish;
1385 ),
1386 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1387 MAJOR(__entry->dev), MINOR(__entry->dev),
1388 __entry->ino,
1389 __entry->size,
1390 __entry->start,
1391 __entry->finish)
1392);
1393
1394TRACE_EVENT(xfs_bunmap,
1395 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1396 int flags, unsigned long caller_ip),
1397 TP_ARGS(ip, bno, len, flags, caller_ip),
1398 TP_STRUCT__entry(
1399 __field(dev_t, dev)
1400 __field(xfs_ino_t, ino)
1401 __field(xfs_fsize_t, size)
1402 __field(xfs_fileoff_t, bno)
1403 __field(xfs_filblks_t, len)
1404 __field(unsigned long, caller_ip)
1405 __field(int, flags)
1406 ),
1407 TP_fast_assign(
1408 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1409 __entry->ino = ip->i_ino;
1410 __entry->size = ip->i_d.di_size;
1411 __entry->bno = bno;
1412 __entry->len = len;
1413 __entry->caller_ip = caller_ip;
1414 __entry->flags = flags;
1415 ),
1416 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
Scott Wood65dd2972015-03-25 14:56:21 +11001417 "flags %s caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001418 MAJOR(__entry->dev), MINOR(__entry->dev),
1419 __entry->ino,
1420 __entry->size,
1421 __entry->bno,
1422 __entry->len,
1423 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1424 (void *)__entry->caller_ip)
1425
1426);
1427
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001428DECLARE_EVENT_CLASS(xfs_extent_busy_class,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001429 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1430 xfs_agblock_t agbno, xfs_extlen_t len),
1431 TP_ARGS(mp, agno, agbno, len),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001432 TP_STRUCT__entry(
1433 __field(dev_t, dev)
1434 __field(xfs_agnumber_t, agno)
1435 __field(xfs_agblock_t, agbno)
1436 __field(xfs_extlen_t, len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001437 ),
1438 TP_fast_assign(
1439 __entry->dev = mp->m_super->s_dev;
1440 __entry->agno = agno;
1441 __entry->agbno = agbno;
1442 __entry->len = len;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001443 ),
Dave Chinnered3b4d62010-05-21 12:07:08 +10001444 TP_printk("dev %d:%d agno %u agbno %u len %u",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001445 MAJOR(__entry->dev), MINOR(__entry->dev),
1446 __entry->agno,
1447 __entry->agbno,
Dave Chinnered3b4d62010-05-21 12:07:08 +10001448 __entry->len)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001449);
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001450#define DEFINE_BUSY_EVENT(name) \
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001451DEFINE_EVENT(xfs_extent_busy_class, name, \
Christoph Hellwig97d3ac72011-04-24 19:06:16 +00001452 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1453 xfs_agblock_t agbno, xfs_extlen_t len), \
1454 TP_ARGS(mp, agno, agbno, len))
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001455DEFINE_BUSY_EVENT(xfs_extent_busy);
1456DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1457DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1458DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1459DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
Dave Chinnered3b4d62010-05-21 12:07:08 +10001460
Dave Chinner4ecbfe62012-04-29 10:41:10 +00001461TRACE_EVENT(xfs_extent_busy_trim,
Christoph Hellwige26f0502011-04-24 19:06:15 +00001462 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1463 xfs_agblock_t agbno, xfs_extlen_t len,
1464 xfs_agblock_t tbno, xfs_extlen_t tlen),
1465 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1466 TP_STRUCT__entry(
1467 __field(dev_t, dev)
1468 __field(xfs_agnumber_t, agno)
1469 __field(xfs_agblock_t, agbno)
1470 __field(xfs_extlen_t, len)
1471 __field(xfs_agblock_t, tbno)
1472 __field(xfs_extlen_t, tlen)
1473 ),
1474 TP_fast_assign(
1475 __entry->dev = mp->m_super->s_dev;
1476 __entry->agno = agno;
1477 __entry->agbno = agbno;
1478 __entry->len = len;
1479 __entry->tbno = tbno;
1480 __entry->tlen = tlen;
1481 ),
1482 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1483 MAJOR(__entry->dev), MINOR(__entry->dev),
1484 __entry->agno,
1485 __entry->agbno,
1486 __entry->len,
1487 __entry->tbno,
1488 __entry->tlen)
1489);
1490
Dave Chinnered3b4d62010-05-21 12:07:08 +10001491TRACE_EVENT(xfs_trans_commit_lsn,
1492 TP_PROTO(struct xfs_trans *trans),
1493 TP_ARGS(trans),
1494 TP_STRUCT__entry(
1495 __field(dev_t, dev)
1496 __field(struct xfs_trans *, tp)
1497 __field(xfs_lsn_t, lsn)
1498 ),
1499 TP_fast_assign(
1500 __entry->dev = trans->t_mountp->m_super->s_dev;
1501 __entry->tp = trans;
1502 __entry->lsn = trans->t_commit_lsn;
1503 ),
1504 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1505 MAJOR(__entry->dev), MINOR(__entry->dev),
1506 __entry->tp,
Dave Chinnerfd45e4782010-01-02 02:38:56 +00001507 __entry->lsn)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001508);
1509
1510TRACE_EVENT(xfs_agf,
1511 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1512 unsigned long caller_ip),
1513 TP_ARGS(mp, agf, flags, caller_ip),
1514 TP_STRUCT__entry(
1515 __field(dev_t, dev)
1516 __field(xfs_agnumber_t, agno)
1517 __field(int, flags)
1518 __field(__u32, length)
1519 __field(__u32, bno_root)
1520 __field(__u32, cnt_root)
1521 __field(__u32, bno_level)
1522 __field(__u32, cnt_level)
1523 __field(__u32, flfirst)
1524 __field(__u32, fllast)
1525 __field(__u32, flcount)
1526 __field(__u32, freeblks)
1527 __field(__u32, longest)
1528 __field(unsigned long, caller_ip)
1529 ),
1530 TP_fast_assign(
1531 __entry->dev = mp->m_super->s_dev;
1532 __entry->agno = be32_to_cpu(agf->agf_seqno),
1533 __entry->flags = flags;
1534 __entry->length = be32_to_cpu(agf->agf_length),
1535 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1536 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1537 __entry->bno_level =
1538 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1539 __entry->cnt_level =
1540 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1541 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1542 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1543 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1544 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1545 __entry->longest = be32_to_cpu(agf->agf_longest);
1546 __entry->caller_ip = caller_ip;
1547 ),
1548 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1549 "levels b %u c %u flfirst %u fllast %u flcount %u "
Scott Wood65dd2972015-03-25 14:56:21 +11001550 "freeblks %u longest %u caller %ps",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001551 MAJOR(__entry->dev), MINOR(__entry->dev),
1552 __entry->agno,
1553 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1554 __entry->length,
1555 __entry->bno_root,
1556 __entry->cnt_root,
1557 __entry->bno_level,
1558 __entry->cnt_level,
1559 __entry->flfirst,
1560 __entry->fllast,
1561 __entry->flcount,
1562 __entry->freeblks,
1563 __entry->longest,
1564 (void *)__entry->caller_ip)
1565);
1566
1567TRACE_EVENT(xfs_free_extent,
1568 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001569 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1570 int haveright),
1571 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001572 TP_STRUCT__entry(
1573 __field(dev_t, dev)
1574 __field(xfs_agnumber_t, agno)
1575 __field(xfs_agblock_t, agbno)
1576 __field(xfs_extlen_t, len)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001577 __field(int, resv)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001578 __field(int, haveleft)
1579 __field(int, haveright)
1580 ),
1581 TP_fast_assign(
1582 __entry->dev = mp->m_super->s_dev;
1583 __entry->agno = agno;
1584 __entry->agbno = agbno;
1585 __entry->len = len;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001586 __entry->resv = resv;
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001587 __entry->haveleft = haveleft;
1588 __entry->haveright = haveright;
1589 ),
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001590 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001591 MAJOR(__entry->dev), MINOR(__entry->dev),
1592 __entry->agno,
1593 __entry->agbno,
1594 __entry->len,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001595 __entry->resv,
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001596 __entry->haveleft ?
1597 (__entry->haveright ? "both" : "left") :
1598 (__entry->haveright ? "right" : "none"))
1599
1600);
1601
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001602DECLARE_EVENT_CLASS(xfs_alloc_class,
1603 TP_PROTO(struct xfs_alloc_arg *args),
1604 TP_ARGS(args),
1605 TP_STRUCT__entry(
1606 __field(dev_t, dev)
1607 __field(xfs_agnumber_t, agno)
1608 __field(xfs_agblock_t, agbno)
1609 __field(xfs_extlen_t, minlen)
1610 __field(xfs_extlen_t, maxlen)
1611 __field(xfs_extlen_t, mod)
1612 __field(xfs_extlen_t, prod)
1613 __field(xfs_extlen_t, minleft)
1614 __field(xfs_extlen_t, total)
1615 __field(xfs_extlen_t, alignment)
1616 __field(xfs_extlen_t, minalignslop)
1617 __field(xfs_extlen_t, len)
1618 __field(short, type)
1619 __field(short, otype)
1620 __field(char, wasdel)
1621 __field(char, wasfromfl)
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001622 __field(int, resv)
Dave Chinner292378e2016-09-26 08:21:28 +10001623 __field(int, datatype)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001624 __field(xfs_fsblock_t, firstblock)
1625 ),
1626 TP_fast_assign(
1627 __entry->dev = args->mp->m_super->s_dev;
1628 __entry->agno = args->agno;
1629 __entry->agbno = args->agbno;
1630 __entry->minlen = args->minlen;
1631 __entry->maxlen = args->maxlen;
1632 __entry->mod = args->mod;
1633 __entry->prod = args->prod;
1634 __entry->minleft = args->minleft;
1635 __entry->total = args->total;
1636 __entry->alignment = args->alignment;
1637 __entry->minalignslop = args->minalignslop;
1638 __entry->len = args->len;
1639 __entry->type = args->type;
1640 __entry->otype = args->otype;
1641 __entry->wasdel = args->wasdel;
1642 __entry->wasfromfl = args->wasfromfl;
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001643 __entry->resv = args->resv;
Dave Chinner292378e2016-09-26 08:21:28 +10001644 __entry->datatype = args->datatype;
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001645 __entry->firstblock = args->firstblock;
1646 ),
1647 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1648 "prod %u minleft %u total %u alignment %u minalignslop %u "
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001649 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
Dave Chinner292378e2016-09-26 08:21:28 +10001650 "datatype 0x%x firstblock 0x%llx",
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001651 MAJOR(__entry->dev), MINOR(__entry->dev),
1652 __entry->agno,
1653 __entry->agbno,
1654 __entry->minlen,
1655 __entry->maxlen,
1656 __entry->mod,
1657 __entry->prod,
1658 __entry->minleft,
1659 __entry->total,
1660 __entry->alignment,
1661 __entry->minalignslop,
1662 __entry->len,
1663 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1664 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1665 __entry->wasdel,
1666 __entry->wasfromfl,
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10001667 __entry->resv,
Dave Chinner292378e2016-09-26 08:21:28 +10001668 __entry->datatype,
Christoph Hellwig1a18a292011-04-24 19:02:58 +00001669 (unsigned long long)__entry->firstblock)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001670)
1671
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001672#define DEFINE_ALLOC_EVENT(name) \
1673DEFINE_EVENT(xfs_alloc_class, name, \
1674 TP_PROTO(struct xfs_alloc_arg *args), \
1675 TP_ARGS(args))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001676DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
Christoph Hellwig9f9baab2010-12-10 15:03:57 +00001677DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001678DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1679DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1680DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1681DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1682DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1683DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001684DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1685DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001686DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1687DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1688DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1689DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1690DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
Christoph Hellwige26f0502011-04-24 19:06:15 +00001691DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001692DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1693DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1694DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1695DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1696DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1697DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1698DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1699DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1700DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1701
Dave Chinner5a5881c2012-03-22 05:15:13 +00001702DECLARE_EVENT_CLASS(xfs_da_class,
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001703 TP_PROTO(struct xfs_da_args *args),
1704 TP_ARGS(args),
1705 TP_STRUCT__entry(
1706 __field(dev_t, dev)
1707 __field(xfs_ino_t, ino)
1708 __dynamic_array(char, name, args->namelen)
1709 __field(int, namelen)
1710 __field(xfs_dahash_t, hashval)
1711 __field(xfs_ino_t, inumber)
1712 __field(int, op_flags)
1713 ),
1714 TP_fast_assign(
1715 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1716 __entry->ino = args->dp->i_ino;
1717 if (args->namelen)
1718 memcpy(__get_str(name), args->name, args->namelen);
1719 __entry->namelen = args->namelen;
1720 __entry->hashval = args->hashval;
1721 __entry->inumber = args->inumber;
1722 __entry->op_flags = args->op_flags;
1723 ),
1724 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1725 "inumber 0x%llx op_flags %s",
1726 MAJOR(__entry->dev), MINOR(__entry->dev),
1727 __entry->ino,
1728 __entry->namelen,
1729 __entry->namelen ? __get_str(name) : NULL,
1730 __entry->namelen,
1731 __entry->hashval,
1732 __entry->inumber,
1733 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001734)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001735
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001736#define DEFINE_DIR2_EVENT(name) \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001737DEFINE_EVENT(xfs_da_class, name, \
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001738 TP_PROTO(struct xfs_da_args *args), \
1739 TP_ARGS(args))
1740DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1741DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1742DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1743DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1744DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1745DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1746DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1747DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1748DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1749DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1750DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1751DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1752DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1753DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1754DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1755DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1756DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1757DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1758DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1759DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1760DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1761DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1762DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1763DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1764DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1765
Dave Chinneree732592012-11-12 22:53:53 +11001766DECLARE_EVENT_CLASS(xfs_attr_class,
1767 TP_PROTO(struct xfs_da_args *args),
1768 TP_ARGS(args),
1769 TP_STRUCT__entry(
1770 __field(dev_t, dev)
1771 __field(xfs_ino_t, ino)
1772 __dynamic_array(char, name, args->namelen)
1773 __field(int, namelen)
1774 __field(int, valuelen)
1775 __field(xfs_dahash_t, hashval)
1776 __field(int, op_flags)
1777 ),
1778 TP_fast_assign(
1779 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1780 __entry->ino = args->dp->i_ino;
1781 if (args->namelen)
1782 memcpy(__get_str(name), args->name, args->namelen);
1783 __entry->namelen = args->namelen;
1784 __entry->valuelen = args->valuelen;
1785 __entry->hashval = args->hashval;
1786 __entry->op_flags = args->op_flags;
1787 ),
1788 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1789 "hashval 0x%x op_flags %s",
1790 MAJOR(__entry->dev), MINOR(__entry->dev),
1791 __entry->ino,
1792 __entry->namelen,
1793 __entry->namelen ? __get_str(name) : NULL,
1794 __entry->namelen,
1795 __entry->valuelen,
1796 __entry->hashval,
1797 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1798)
1799
Dave Chinner5a5881c2012-03-22 05:15:13 +00001800#define DEFINE_ATTR_EVENT(name) \
Dave Chinneree732592012-11-12 22:53:53 +11001801DEFINE_EVENT(xfs_attr_class, name, \
Dave Chinner5a5881c2012-03-22 05:15:13 +00001802 TP_PROTO(struct xfs_da_args *args), \
1803 TP_ARGS(args))
1804DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1805DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1806DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1807DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1808DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001809DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1810
1811DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1812DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1813DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
Dave Chinneree732592012-11-12 22:53:53 +11001814DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001815DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1816DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
Dave Chinneree732592012-11-12 22:53:53 +11001817DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1818DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001819DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1820DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
Dave Chinneree732592012-11-12 22:53:53 +11001821DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001822DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1823DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1824DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1825DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1826DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1827DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1828DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1829DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1830DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1831DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1832DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001833DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001834
1835DEFINE_ATTR_EVENT(xfs_attr_node_addname);
Dave Chinneree732592012-11-12 22:53:53 +11001836DEFINE_ATTR_EVENT(xfs_attr_node_get);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001837DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1838DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1839
Dave Chinneree732592012-11-12 22:53:53 +11001840DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1841DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1842
1843DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1844DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1845DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1846
Dave Chinner5a5881c2012-03-22 05:15:13 +00001847#define DEFINE_DA_EVENT(name) \
1848DEFINE_EVENT(xfs_da_class, name, \
1849 TP_PROTO(struct xfs_da_args *args), \
1850 TP_ARGS(args))
1851DEFINE_DA_EVENT(xfs_da_split);
1852DEFINE_DA_EVENT(xfs_da_join);
1853DEFINE_DA_EVENT(xfs_da_link_before);
1854DEFINE_DA_EVENT(xfs_da_link_after);
1855DEFINE_DA_EVENT(xfs_da_unlink_back);
1856DEFINE_DA_EVENT(xfs_da_unlink_forward);
1857DEFINE_DA_EVENT(xfs_da_root_split);
1858DEFINE_DA_EVENT(xfs_da_root_join);
1859DEFINE_DA_EVENT(xfs_da_node_add);
1860DEFINE_DA_EVENT(xfs_da_node_create);
1861DEFINE_DA_EVENT(xfs_da_node_split);
1862DEFINE_DA_EVENT(xfs_da_node_remove);
1863DEFINE_DA_EVENT(xfs_da_node_rebalance);
1864DEFINE_DA_EVENT(xfs_da_node_unbalance);
Dave Chinneree732592012-11-12 22:53:53 +11001865DEFINE_DA_EVENT(xfs_da_node_toosmall);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001866DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1867DEFINE_DA_EVENT(xfs_da_grow_inode);
1868DEFINE_DA_EVENT(xfs_da_shrink_inode);
Dave Chinneree732592012-11-12 22:53:53 +11001869DEFINE_DA_EVENT(xfs_da_fixhashpath);
1870DEFINE_DA_EVENT(xfs_da_path_shift);
Dave Chinner5a5881c2012-03-22 05:15:13 +00001871
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001872DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1873 TP_PROTO(struct xfs_da_args *args, int idx),
1874 TP_ARGS(args, idx),
1875 TP_STRUCT__entry(
1876 __field(dev_t, dev)
1877 __field(xfs_ino_t, ino)
1878 __field(int, op_flags)
1879 __field(int, idx)
1880 ),
1881 TP_fast_assign(
1882 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1883 __entry->ino = args->dp->i_ino;
1884 __entry->op_flags = args->op_flags;
1885 __entry->idx = idx;
1886 ),
1887 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1888 MAJOR(__entry->dev), MINOR(__entry->dev),
1889 __entry->ino,
1890 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1891 __entry->idx)
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001892)
Christoph Hellwigea9a4882009-12-21 14:03:03 +00001893
1894#define DEFINE_DIR2_SPACE_EVENT(name) \
1895DEFINE_EVENT(xfs_dir2_space_class, name, \
1896 TP_PROTO(struct xfs_da_args *args, int idx), \
1897 TP_ARGS(args, idx))
1898DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1899DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1900DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1901DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00001902
1903TRACE_EVENT(xfs_dir2_leafn_moveents,
1904 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1905 TP_ARGS(args, src_idx, dst_idx, count),
1906 TP_STRUCT__entry(
1907 __field(dev_t, dev)
1908 __field(xfs_ino_t, ino)
1909 __field(int, op_flags)
1910 __field(int, src_idx)
1911 __field(int, dst_idx)
1912 __field(int, count)
1913 ),
1914 TP_fast_assign(
1915 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1916 __entry->ino = args->dp->i_ino;
1917 __entry->op_flags = args->op_flags;
1918 __entry->src_idx = src_idx;
1919 __entry->dst_idx = dst_idx;
1920 __entry->count = count;
1921 ),
1922 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1923 "src_idx %d dst_idx %d count %d",
1924 MAJOR(__entry->dev), MINOR(__entry->dev),
1925 __entry->ino,
1926 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1927 __entry->src_idx,
1928 __entry->dst_idx,
1929 __entry->count)
1930);
1931
Dave Chinner3a85cd92010-01-14 01:33:55 +00001932#define XFS_SWAPEXT_INODES \
1933 { 0, "target" }, \
1934 { 1, "temp" }
1935
1936#define XFS_INODE_FORMAT_STR \
1937 { 0, "invalid" }, \
1938 { 1, "local" }, \
1939 { 2, "extent" }, \
1940 { 3, "btree" }
1941
1942DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1943 TP_PROTO(struct xfs_inode *ip, int which),
1944 TP_ARGS(ip, which),
1945 TP_STRUCT__entry(
1946 __field(dev_t, dev)
1947 __field(int, which)
1948 __field(xfs_ino_t, ino)
1949 __field(int, format)
1950 __field(int, nex)
Dave Chinner3a85cd92010-01-14 01:33:55 +00001951 __field(int, broot_size)
1952 __field(int, fork_off)
1953 ),
1954 TP_fast_assign(
1955 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1956 __entry->which = which;
1957 __entry->ino = ip->i_ino;
1958 __entry->format = ip->i_d.di_format;
1959 __entry->nex = ip->i_d.di_nextents;
Dave Chinner3a85cd92010-01-14 01:33:55 +00001960 __entry->broot_size = ip->i_df.if_broot_bytes;
1961 __entry->fork_off = XFS_IFORK_BOFF(ip);
1962 ),
1963 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
Christoph Hellwig8096b1e2011-12-18 20:00:07 +00001964 "broot size %d, fork offset %d",
Dave Chinner3a85cd92010-01-14 01:33:55 +00001965 MAJOR(__entry->dev), MINOR(__entry->dev),
1966 __entry->ino,
1967 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1968 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1969 __entry->nex,
Dave Chinner3a85cd92010-01-14 01:33:55 +00001970 __entry->broot_size,
1971 __entry->fork_off)
1972)
1973
1974#define DEFINE_SWAPEXT_EVENT(name) \
1975DEFINE_EVENT(xfs_swap_extent_class, name, \
1976 TP_PROTO(struct xfs_inode *ip, int which), \
1977 TP_ARGS(ip, which))
1978
1979DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1980DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1981
Brian Foster5cd9cee2016-09-26 08:34:52 +10001982TRACE_EVENT(xfs_log_recover_record,
1983 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
1984 TP_ARGS(log, rhead, pass),
1985 TP_STRUCT__entry(
1986 __field(dev_t, dev)
1987 __field(xfs_lsn_t, lsn)
1988 __field(int, len)
1989 __field(int, num_logops)
1990 __field(int, pass)
1991 ),
1992 TP_fast_assign(
1993 __entry->dev = log->l_mp->m_super->s_dev;
1994 __entry->lsn = be64_to_cpu(rhead->h_lsn);
1995 __entry->len = be32_to_cpu(rhead->h_len);
1996 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
1997 __entry->pass = pass;
1998 ),
1999 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2000 MAJOR(__entry->dev), MINOR(__entry->dev),
2001 __entry->lsn, __entry->len, __entry->num_logops,
2002 __entry->pass)
2003)
2004
Dave Chinner9abbc532010-04-13 15:06:46 +10002005DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002006 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
Dave Chinner9abbc532010-04-13 15:06:46 +10002007 struct xlog_recover_item *item, int pass),
2008 TP_ARGS(log, trans, item, pass),
2009 TP_STRUCT__entry(
2010 __field(dev_t, dev)
2011 __field(unsigned long, item)
2012 __field(xlog_tid_t, tid)
Brian Foster5cd9cee2016-09-26 08:34:52 +10002013 __field(xfs_lsn_t, lsn)
Dave Chinner9abbc532010-04-13 15:06:46 +10002014 __field(int, type)
2015 __field(int, pass)
2016 __field(int, count)
2017 __field(int, total)
2018 ),
2019 TP_fast_assign(
2020 __entry->dev = log->l_mp->m_super->s_dev;
2021 __entry->item = (unsigned long)item;
2022 __entry->tid = trans->r_log_tid;
Brian Foster5cd9cee2016-09-26 08:34:52 +10002023 __entry->lsn = trans->r_lsn;
Dave Chinner9abbc532010-04-13 15:06:46 +10002024 __entry->type = ITEM_TYPE(item);
2025 __entry->pass = pass;
2026 __entry->count = item->ri_cnt;
2027 __entry->total = item->ri_total;
2028 ),
Brian Foster5cd9cee2016-09-26 08:34:52 +10002029 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, "
2030 "item type %s item region count/total %d/%d",
Dave Chinner9abbc532010-04-13 15:06:46 +10002031 MAJOR(__entry->dev), MINOR(__entry->dev),
2032 __entry->tid,
Brian Foster5cd9cee2016-09-26 08:34:52 +10002033 __entry->lsn,
Dave Chinner9abbc532010-04-13 15:06:46 +10002034 __entry->pass,
2035 (void *)__entry->item,
2036 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2037 __entry->count,
2038 __entry->total)
2039)
2040
2041#define DEFINE_LOG_RECOVER_ITEM(name) \
2042DEFINE_EVENT(xfs_log_recover_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002043 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
Dave Chinner9abbc532010-04-13 15:06:46 +10002044 struct xlog_recover_item *item, int pass), \
2045 TP_ARGS(log, trans, item, pass))
2046
2047DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2048DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2049DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2050DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2051DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2052
2053DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002054 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002055 TP_ARGS(log, buf_f),
2056 TP_STRUCT__entry(
2057 __field(dev_t, dev)
2058 __field(__int64_t, blkno)
2059 __field(unsigned short, len)
2060 __field(unsigned short, flags)
2061 __field(unsigned short, size)
2062 __field(unsigned int, map_size)
2063 ),
2064 TP_fast_assign(
2065 __entry->dev = log->l_mp->m_super->s_dev;
2066 __entry->blkno = buf_f->blf_blkno;
2067 __entry->len = buf_f->blf_len;
2068 __entry->flags = buf_f->blf_flags;
2069 __entry->size = buf_f->blf_size;
2070 __entry->map_size = buf_f->blf_map_size;
2071 ),
2072 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2073 "map_size %d",
2074 MAJOR(__entry->dev), MINOR(__entry->dev),
2075 __entry->blkno,
2076 __entry->len,
2077 __entry->flags,
2078 __entry->size,
2079 __entry->map_size)
2080)
2081
2082#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2083DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002084 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002085 TP_ARGS(log, buf_f))
2086
2087DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2088DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2089DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2090DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2091DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
Brian Foster5cd9cee2016-09-26 08:34:52 +10002092DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
Dave Chinner9abbc532010-04-13 15:06:46 +10002093DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2094DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2095DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2096
2097DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
Mark Tinguelyad223e62012-06-14 09:22:15 -05002098 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
Dave Chinner9abbc532010-04-13 15:06:46 +10002099 TP_ARGS(log, in_f),
2100 TP_STRUCT__entry(
2101 __field(dev_t, dev)
2102 __field(xfs_ino_t, ino)
2103 __field(unsigned short, size)
2104 __field(int, fields)
2105 __field(unsigned short, asize)
2106 __field(unsigned short, dsize)
2107 __field(__int64_t, blkno)
2108 __field(int, len)
2109 __field(int, boffset)
2110 ),
2111 TP_fast_assign(
2112 __entry->dev = log->l_mp->m_super->s_dev;
2113 __entry->ino = in_f->ilf_ino;
2114 __entry->size = in_f->ilf_size;
2115 __entry->fields = in_f->ilf_fields;
2116 __entry->asize = in_f->ilf_asize;
2117 __entry->dsize = in_f->ilf_dsize;
2118 __entry->blkno = in_f->ilf_blkno;
2119 __entry->len = in_f->ilf_len;
2120 __entry->boffset = in_f->ilf_boffset;
2121 ),
2122 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2123 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2124 MAJOR(__entry->dev), MINOR(__entry->dev),
2125 __entry->ino,
2126 __entry->size,
2127 __entry->fields,
2128 __entry->asize,
2129 __entry->dsize,
2130 __entry->blkno,
2131 __entry->len,
2132 __entry->boffset)
2133)
2134#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2135DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
Mark Tinguelyad223e62012-06-14 09:22:15 -05002136 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
Dave Chinner9abbc532010-04-13 15:06:46 +10002137 TP_ARGS(log, in_f))
2138
2139DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2140DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2141DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2142
Brian Foster78d57e42015-08-19 09:58:48 +10002143DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2144 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2145 TP_ARGS(log, in_f),
2146 TP_STRUCT__entry(
2147 __field(dev_t, dev)
2148 __field(xfs_agnumber_t, agno)
2149 __field(xfs_agblock_t, agbno)
2150 __field(unsigned int, count)
2151 __field(unsigned int, isize)
2152 __field(xfs_agblock_t, length)
2153 __field(unsigned int, gen)
2154 ),
2155 TP_fast_assign(
2156 __entry->dev = log->l_mp->m_super->s_dev;
2157 __entry->agno = be32_to_cpu(in_f->icl_ag);
2158 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2159 __entry->count = be32_to_cpu(in_f->icl_count);
2160 __entry->isize = be32_to_cpu(in_f->icl_isize);
2161 __entry->length = be32_to_cpu(in_f->icl_length);
2162 __entry->gen = be32_to_cpu(in_f->icl_gen);
2163 ),
2164 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2165 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2166 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2167 __entry->length, __entry->gen)
2168)
2169#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2170DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2171 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2172 TP_ARGS(log, in_f))
2173
2174DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2175DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2176
Christoph Hellwiga46db602011-01-07 13:02:04 +00002177DECLARE_EVENT_CLASS(xfs_discard_class,
2178 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2179 xfs_agblock_t agbno, xfs_extlen_t len),
2180 TP_ARGS(mp, agno, agbno, len),
2181 TP_STRUCT__entry(
2182 __field(dev_t, dev)
2183 __field(xfs_agnumber_t, agno)
2184 __field(xfs_agblock_t, agbno)
2185 __field(xfs_extlen_t, len)
2186 ),
2187 TP_fast_assign(
2188 __entry->dev = mp->m_super->s_dev;
2189 __entry->agno = agno;
2190 __entry->agbno = agbno;
2191 __entry->len = len;
2192 ),
2193 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2194 MAJOR(__entry->dev), MINOR(__entry->dev),
2195 __entry->agno,
2196 __entry->agbno,
2197 __entry->len)
2198)
2199
2200#define DEFINE_DISCARD_EVENT(name) \
2201DEFINE_EVENT(xfs_discard_class, name, \
2202 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2203 xfs_agblock_t agbno, xfs_extlen_t len), \
2204 TP_ARGS(mp, agno, agbno, len))
2205DEFINE_DISCARD_EVENT(xfs_discard_extent);
2206DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2207DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2208DEFINE_DISCARD_EVENT(xfs_discard_busy);
2209
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002210/* btree cursor events */
2211DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2212 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2213 TP_ARGS(cur, level, bp),
2214 TP_STRUCT__entry(
2215 __field(dev_t, dev)
2216 __field(xfs_btnum_t, btnum)
2217 __field(int, level)
2218 __field(int, nlevels)
2219 __field(int, ptr)
2220 __field(xfs_daddr_t, daddr)
2221 ),
2222 TP_fast_assign(
2223 __entry->dev = cur->bc_mp->m_super->s_dev;
2224 __entry->btnum = cur->bc_btnum;
2225 __entry->level = level;
2226 __entry->nlevels = cur->bc_nlevels;
2227 __entry->ptr = cur->bc_ptrs[level];
2228 __entry->daddr = bp ? bp->b_bn : -1;
2229 ),
2230 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2231 MAJOR(__entry->dev), MINOR(__entry->dev),
2232 __entry->btnum,
2233 __entry->level,
2234 __entry->nlevels,
2235 __entry->ptr,
2236 (unsigned long long)__entry->daddr)
2237)
2238
2239#define DEFINE_BTREE_CUR_EVENT(name) \
2240DEFINE_EVENT(xfs_btree_cur_class, name, \
2241 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2242 TP_ARGS(cur, level, bp))
2243DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
Darrick J. Wong105f7d82016-08-03 11:10:21 +10002244DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
Darrick J. Wong2c813ad2016-08-03 11:08:36 +10002245
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002246/* deferred ops */
2247struct xfs_defer_pending;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002248struct xfs_defer_ops;
2249
2250DECLARE_EVENT_CLASS(xfs_defer_class,
2251 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop),
2252 TP_ARGS(mp, dop),
2253 TP_STRUCT__entry(
2254 __field(dev_t, dev)
2255 __field(void *, dop)
2256 __field(bool, committed)
2257 __field(bool, low)
2258 ),
2259 TP_fast_assign(
2260 __entry->dev = mp ? mp->m_super->s_dev : 0;
2261 __entry->dop = dop;
2262 __entry->committed = dop->dop_committed;
2263 __entry->low = dop->dop_low;
2264 ),
2265 TP_printk("dev %d:%d ops %p committed %d low %d\n",
2266 MAJOR(__entry->dev), MINOR(__entry->dev),
2267 __entry->dop,
2268 __entry->committed,
2269 __entry->low)
2270)
2271#define DEFINE_DEFER_EVENT(name) \
2272DEFINE_EVENT(xfs_defer_class, name, \
2273 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2274 TP_ARGS(mp, dop))
2275
2276DECLARE_EVENT_CLASS(xfs_defer_error_class,
2277 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
2278 TP_ARGS(mp, dop, error),
2279 TP_STRUCT__entry(
2280 __field(dev_t, dev)
2281 __field(void *, dop)
2282 __field(bool, committed)
2283 __field(bool, low)
2284 __field(int, error)
2285 ),
2286 TP_fast_assign(
2287 __entry->dev = mp ? mp->m_super->s_dev : 0;
2288 __entry->dop = dop;
2289 __entry->committed = dop->dop_committed;
2290 __entry->low = dop->dop_low;
2291 __entry->error = error;
2292 ),
2293 TP_printk("dev %d:%d ops %p committed %d low %d err %d\n",
2294 MAJOR(__entry->dev), MINOR(__entry->dev),
2295 __entry->dop,
2296 __entry->committed,
2297 __entry->low,
2298 __entry->error)
2299)
2300#define DEFINE_DEFER_ERROR_EVENT(name) \
2301DEFINE_EVENT(xfs_defer_error_class, name, \
2302 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2303 TP_ARGS(mp, dop, error))
2304
2305DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2306 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2307 TP_ARGS(mp, dfp),
2308 TP_STRUCT__entry(
2309 __field(dev_t, dev)
2310 __field(int, type)
2311 __field(void *, intent)
2312 __field(bool, committed)
2313 __field(int, nr)
2314 ),
2315 TP_fast_assign(
2316 __entry->dev = mp ? mp->m_super->s_dev : 0;
2317 __entry->type = dfp->dfp_type->type;
2318 __entry->intent = dfp->dfp_intent;
Darrick J. Wongea78d802016-08-30 13:51:39 +10002319 __entry->committed = dfp->dfp_done != NULL;
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002320 __entry->nr = dfp->dfp_count;
2321 ),
2322 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d\n",
2323 MAJOR(__entry->dev), MINOR(__entry->dev),
2324 __entry->type,
2325 __entry->intent,
2326 __entry->committed,
2327 __entry->nr)
2328)
2329#define DEFINE_DEFER_PENDING_EVENT(name) \
2330DEFINE_EVENT(xfs_defer_pending_class, name, \
2331 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2332 TP_ARGS(mp, dfp))
2333
2334DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2335 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2336 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2337 TP_ARGS(mp, agno, type, agbno, len),
2338 TP_STRUCT__entry(
2339 __field(dev_t, dev)
2340 __field(xfs_agnumber_t, agno)
2341 __field(int, type)
2342 __field(xfs_agblock_t, agbno)
2343 __field(xfs_extlen_t, len)
2344 ),
2345 TP_fast_assign(
2346 __entry->dev = mp->m_super->s_dev;
2347 __entry->agno = agno;
2348 __entry->type = type;
2349 __entry->agbno = agbno;
2350 __entry->len = len;
2351 ),
2352 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2353 MAJOR(__entry->dev), MINOR(__entry->dev),
2354 __entry->type,
2355 __entry->agno,
2356 __entry->agbno,
2357 __entry->len)
2358);
2359#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2360DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2361 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2362 int type, \
2363 xfs_agblock_t bno, \
2364 xfs_extlen_t len), \
2365 TP_ARGS(mp, agno, type, bno, len))
2366
2367DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2368 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2369 int op,
2370 xfs_agblock_t agbno,
2371 xfs_ino_t ino,
2372 int whichfork,
2373 xfs_fileoff_t offset,
2374 xfs_filblks_t len,
2375 xfs_exntst_t state),
2376 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2377 TP_STRUCT__entry(
2378 __field(dev_t, dev)
2379 __field(xfs_agnumber_t, agno)
2380 __field(xfs_ino_t, ino)
2381 __field(xfs_agblock_t, agbno)
2382 __field(int, whichfork)
2383 __field(xfs_fileoff_t, l_loff)
2384 __field(xfs_filblks_t, l_len)
2385 __field(xfs_exntst_t, l_state)
2386 __field(int, op)
2387 ),
2388 TP_fast_assign(
2389 __entry->dev = mp->m_super->s_dev;
2390 __entry->agno = agno;
2391 __entry->ino = ino;
2392 __entry->agbno = agbno;
2393 __entry->whichfork = whichfork;
2394 __entry->l_loff = offset;
2395 __entry->l_len = len;
2396 __entry->l_state = state;
2397 __entry->op = op;
2398 ),
2399 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2400 MAJOR(__entry->dev), MINOR(__entry->dev),
2401 __entry->op,
2402 __entry->agno,
2403 __entry->agbno,
2404 __entry->ino,
2405 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2406 __entry->l_loff,
2407 __entry->l_len,
2408 __entry->l_state)
2409);
2410#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2411DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2412 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2413 int op, \
2414 xfs_agblock_t agbno, \
2415 xfs_ino_t ino, \
2416 int whichfork, \
2417 xfs_fileoff_t offset, \
2418 xfs_filblks_t len, \
2419 xfs_exntst_t state), \
2420 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2421
2422DEFINE_DEFER_EVENT(xfs_defer_init);
2423DEFINE_DEFER_EVENT(xfs_defer_cancel);
2424DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2425DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2426DEFINE_DEFER_EVENT(xfs_defer_finish);
2427DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2428
2429DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2430DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002431
2432DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
2433DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
Darrick J. Wong3cd48ab2016-08-03 11:13:02 +10002434DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
2435DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2436DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2437
Darrick J. Wongba9e7802016-08-03 11:26:33 +10002438#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2439DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2440DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2441
Darrick J. Wong673930c2016-08-03 11:33:43 +10002442/* rmap tracepoints */
2443DECLARE_EVENT_CLASS(xfs_rmap_class,
2444 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2445 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2446 struct xfs_owner_info *oinfo),
2447 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2448 TP_STRUCT__entry(
2449 __field(dev_t, dev)
2450 __field(xfs_agnumber_t, agno)
2451 __field(xfs_agblock_t, agbno)
2452 __field(xfs_extlen_t, len)
2453 __field(uint64_t, owner)
2454 __field(uint64_t, offset)
2455 __field(unsigned long, flags)
2456 ),
2457 TP_fast_assign(
2458 __entry->dev = mp->m_super->s_dev;
2459 __entry->agno = agno;
2460 __entry->agbno = agbno;
2461 __entry->len = len;
2462 __entry->owner = oinfo->oi_owner;
2463 __entry->offset = oinfo->oi_offset;
2464 __entry->flags = oinfo->oi_flags;
Darrick J. Wong035e00a2016-08-03 11:36:07 +10002465 if (unwritten)
2466 __entry->flags |= XFS_RMAP_UNWRITTEN;
Darrick J. Wong673930c2016-08-03 11:33:43 +10002467 ),
2468 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2469 MAJOR(__entry->dev), MINOR(__entry->dev),
2470 __entry->agno,
2471 __entry->agbno,
2472 __entry->len,
2473 __entry->owner,
2474 __entry->offset,
2475 __entry->flags)
2476);
2477#define DEFINE_RMAP_EVENT(name) \
2478DEFINE_EVENT(xfs_rmap_class, name, \
2479 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2480 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2481 struct xfs_owner_info *oinfo), \
2482 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2483
2484/* simple AG-based error/%ip tracepoint class */
2485DECLARE_EVENT_CLASS(xfs_ag_error_class,
2486 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2487 unsigned long caller_ip),
2488 TP_ARGS(mp, agno, error, caller_ip),
2489 TP_STRUCT__entry(
2490 __field(dev_t, dev)
2491 __field(xfs_agnumber_t, agno)
2492 __field(int, error)
2493 __field(unsigned long, caller_ip)
2494 ),
2495 TP_fast_assign(
2496 __entry->dev = mp->m_super->s_dev;
2497 __entry->agno = agno;
2498 __entry->error = error;
2499 __entry->caller_ip = caller_ip;
2500 ),
2501 TP_printk("dev %d:%d agno %u error %d caller %ps",
2502 MAJOR(__entry->dev), MINOR(__entry->dev),
2503 __entry->agno,
2504 __entry->error,
2505 (char *)__entry->caller_ip)
2506);
2507
2508#define DEFINE_AG_ERROR_EVENT(name) \
2509DEFINE_EVENT(xfs_ag_error_class, name, \
2510 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2511 unsigned long caller_ip), \
2512 TP_ARGS(mp, agno, error, caller_ip))
2513
2514DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2515DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2516DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2517DEFINE_RMAP_EVENT(xfs_rmap_map);
2518DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2519DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002520DEFINE_RMAP_EVENT(xfs_rmap_convert);
2521DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2522DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2523DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
Darrick J. Wong673930c2016-08-03 11:33:43 +10002524
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002525DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2526 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2527 xfs_agblock_t agbno, xfs_extlen_t len,
2528 uint64_t owner, uint64_t offset, unsigned int flags),
2529 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2530 TP_STRUCT__entry(
2531 __field(dev_t, dev)
2532 __field(xfs_agnumber_t, agno)
2533 __field(xfs_agblock_t, agbno)
2534 __field(xfs_extlen_t, len)
2535 __field(uint64_t, owner)
2536 __field(uint64_t, offset)
2537 __field(unsigned int, flags)
2538 ),
2539 TP_fast_assign(
2540 __entry->dev = mp->m_super->s_dev;
2541 __entry->agno = agno;
2542 __entry->agbno = agbno;
2543 __entry->len = len;
2544 __entry->owner = owner;
2545 __entry->offset = offset;
2546 __entry->flags = flags;
2547 ),
2548 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2549 MAJOR(__entry->dev), MINOR(__entry->dev),
2550 __entry->agno,
2551 __entry->agbno,
2552 __entry->len,
2553 __entry->owner,
2554 __entry->offset,
2555 __entry->flags)
2556);
2557#define DEFINE_RMAPBT_EVENT(name) \
2558DEFINE_EVENT(xfs_rmapbt_class, name, \
2559 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2560 xfs_agblock_t agbno, xfs_extlen_t len, \
2561 uint64_t owner, uint64_t offset, unsigned int flags), \
2562 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2563
2564#define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2565DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2566DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2567
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002568DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2569DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
Darrick J. Wongaa966d82016-08-03 11:43:24 +10002570DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2571DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2572DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2573DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2574DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2575DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
Darrick J. Wongceeb9c82016-10-03 09:11:48 -07002576
2577DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2578DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2579DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2580DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
Darrick J. Wong0a1b0b32016-08-03 11:44:21 +10002581DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2582DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
Darrick J. Wongfb7d9262016-08-03 12:03:19 +10002583DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
Darrick J. Wong4b8ed672016-08-03 11:39:05 +10002584
Darrick J. Wong9f3afb52016-10-03 09:11:28 -07002585/* deferred bmbt updates */
2586#define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2587DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2588DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2589
Darrick J. Wong3fd129b2016-09-19 10:30:52 +10002590/* per-AG reservation */
2591DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2592 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2593 xfs_extlen_t len),
2594 TP_ARGS(pag, resv, len),
2595 TP_STRUCT__entry(
2596 __field(dev_t, dev)
2597 __field(xfs_agnumber_t, agno)
2598 __field(int, resv)
2599 __field(xfs_extlen_t, freeblks)
2600 __field(xfs_extlen_t, flcount)
2601 __field(xfs_extlen_t, reserved)
2602 __field(xfs_extlen_t, asked)
2603 __field(xfs_extlen_t, len)
2604 ),
2605 TP_fast_assign(
2606 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2607
2608 __entry->dev = pag->pag_mount->m_super->s_dev;
2609 __entry->agno = pag->pag_agno;
2610 __entry->resv = resv;
2611 __entry->freeblks = pag->pagf_freeblks;
2612 __entry->flcount = pag->pagf_flcount;
2613 __entry->reserved = r ? r->ar_reserved : 0;
2614 __entry->asked = r ? r->ar_asked : 0;
2615 __entry->len = len;
2616 ),
2617 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u resv %u ask %u len %u\n",
2618 MAJOR(__entry->dev), MINOR(__entry->dev),
2619 __entry->agno,
2620 __entry->resv,
2621 __entry->freeblks,
2622 __entry->flcount,
2623 __entry->reserved,
2624 __entry->asked,
2625 __entry->len)
2626)
2627#define DEFINE_AG_RESV_EVENT(name) \
2628DEFINE_EVENT(xfs_ag_resv_class, name, \
2629 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2630 xfs_extlen_t len), \
2631 TP_ARGS(pag, type, len))
2632
2633/* per-AG reservation tracepoints */
2634DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2635DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2636DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2637DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2638DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2639DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2640
2641DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2642DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2643
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002644/* refcount tracepoint classes */
2645
2646/* reuse the discard trace class for agbno/aglen-based traces */
2647#define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2648
2649/* ag btree lookup tracepoint class */
2650#define XFS_AG_BTREE_CMP_FORMAT_STR \
2651 { XFS_LOOKUP_EQ, "eq" }, \
2652 { XFS_LOOKUP_LE, "le" }, \
2653 { XFS_LOOKUP_GE, "ge" }
2654DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2655 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2656 xfs_agblock_t agbno, xfs_lookup_t dir),
2657 TP_ARGS(mp, agno, agbno, dir),
2658 TP_STRUCT__entry(
2659 __field(dev_t, dev)
2660 __field(xfs_agnumber_t, agno)
2661 __field(xfs_agblock_t, agbno)
2662 __field(xfs_lookup_t, dir)
2663 ),
2664 TP_fast_assign(
2665 __entry->dev = mp->m_super->s_dev;
2666 __entry->agno = agno;
2667 __entry->agbno = agbno;
2668 __entry->dir = dir;
2669 ),
2670 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)\n",
2671 MAJOR(__entry->dev), MINOR(__entry->dev),
2672 __entry->agno,
2673 __entry->agbno,
2674 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2675 __entry->dir)
2676)
2677
2678#define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2679DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2680 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2681 xfs_agblock_t agbno, xfs_lookup_t dir), \
2682 TP_ARGS(mp, agno, agbno, dir))
2683
2684/* single-rcext tracepoint class */
2685DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2686 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2687 struct xfs_refcount_irec *irec),
2688 TP_ARGS(mp, agno, irec),
2689 TP_STRUCT__entry(
2690 __field(dev_t, dev)
2691 __field(xfs_agnumber_t, agno)
2692 __field(xfs_agblock_t, startblock)
2693 __field(xfs_extlen_t, blockcount)
2694 __field(xfs_nlink_t, refcount)
2695 ),
2696 TP_fast_assign(
2697 __entry->dev = mp->m_super->s_dev;
2698 __entry->agno = agno;
2699 __entry->startblock = irec->rc_startblock;
2700 __entry->blockcount = irec->rc_blockcount;
2701 __entry->refcount = irec->rc_refcount;
2702 ),
2703 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u\n",
2704 MAJOR(__entry->dev), MINOR(__entry->dev),
2705 __entry->agno,
2706 __entry->startblock,
2707 __entry->blockcount,
2708 __entry->refcount)
2709)
2710
2711#define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2712DEFINE_EVENT(xfs_refcount_extent_class, name, \
2713 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2714 struct xfs_refcount_irec *irec), \
2715 TP_ARGS(mp, agno, irec))
2716
2717/* single-rcext and an agbno tracepoint class */
2718DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2719 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2720 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2721 TP_ARGS(mp, agno, irec, agbno),
2722 TP_STRUCT__entry(
2723 __field(dev_t, dev)
2724 __field(xfs_agnumber_t, agno)
2725 __field(xfs_agblock_t, startblock)
2726 __field(xfs_extlen_t, blockcount)
2727 __field(xfs_nlink_t, refcount)
2728 __field(xfs_agblock_t, agbno)
2729 ),
2730 TP_fast_assign(
2731 __entry->dev = mp->m_super->s_dev;
2732 __entry->agno = agno;
2733 __entry->startblock = irec->rc_startblock;
2734 __entry->blockcount = irec->rc_blockcount;
2735 __entry->refcount = irec->rc_refcount;
2736 __entry->agbno = agbno;
2737 ),
2738 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u\n",
2739 MAJOR(__entry->dev), MINOR(__entry->dev),
2740 __entry->agno,
2741 __entry->startblock,
2742 __entry->blockcount,
2743 __entry->refcount,
2744 __entry->agbno)
2745)
2746
2747#define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2748DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2749 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2750 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2751 TP_ARGS(mp, agno, irec, agbno))
2752
2753/* double-rcext tracepoint class */
2754DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2755 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2756 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2757 TP_ARGS(mp, agno, i1, i2),
2758 TP_STRUCT__entry(
2759 __field(dev_t, dev)
2760 __field(xfs_agnumber_t, agno)
2761 __field(xfs_agblock_t, i1_startblock)
2762 __field(xfs_extlen_t, i1_blockcount)
2763 __field(xfs_nlink_t, i1_refcount)
2764 __field(xfs_agblock_t, i2_startblock)
2765 __field(xfs_extlen_t, i2_blockcount)
2766 __field(xfs_nlink_t, i2_refcount)
2767 ),
2768 TP_fast_assign(
2769 __entry->dev = mp->m_super->s_dev;
2770 __entry->agno = agno;
2771 __entry->i1_startblock = i1->rc_startblock;
2772 __entry->i1_blockcount = i1->rc_blockcount;
2773 __entry->i1_refcount = i1->rc_refcount;
2774 __entry->i2_startblock = i2->rc_startblock;
2775 __entry->i2_blockcount = i2->rc_blockcount;
2776 __entry->i2_refcount = i2->rc_refcount;
2777 ),
2778 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2779 "agbno %u len %u refcount %u\n",
2780 MAJOR(__entry->dev), MINOR(__entry->dev),
2781 __entry->agno,
2782 __entry->i1_startblock,
2783 __entry->i1_blockcount,
2784 __entry->i1_refcount,
2785 __entry->i2_startblock,
2786 __entry->i2_blockcount,
2787 __entry->i2_refcount)
2788)
2789
2790#define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2791DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2792 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2793 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2794 TP_ARGS(mp, agno, i1, i2))
2795
2796/* double-rcext and an agbno tracepoint class */
2797DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
2798 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2799 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2800 xfs_agblock_t agbno),
2801 TP_ARGS(mp, agno, i1, i2, agbno),
2802 TP_STRUCT__entry(
2803 __field(dev_t, dev)
2804 __field(xfs_agnumber_t, agno)
2805 __field(xfs_agblock_t, i1_startblock)
2806 __field(xfs_extlen_t, i1_blockcount)
2807 __field(xfs_nlink_t, i1_refcount)
2808 __field(xfs_agblock_t, i2_startblock)
2809 __field(xfs_extlen_t, i2_blockcount)
2810 __field(xfs_nlink_t, i2_refcount)
2811 __field(xfs_agblock_t, agbno)
2812 ),
2813 TP_fast_assign(
2814 __entry->dev = mp->m_super->s_dev;
2815 __entry->agno = agno;
2816 __entry->i1_startblock = i1->rc_startblock;
2817 __entry->i1_blockcount = i1->rc_blockcount;
2818 __entry->i1_refcount = i1->rc_refcount;
2819 __entry->i2_startblock = i2->rc_startblock;
2820 __entry->i2_blockcount = i2->rc_blockcount;
2821 __entry->i2_refcount = i2->rc_refcount;
2822 __entry->agbno = agbno;
2823 ),
2824 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2825 "agbno %u len %u refcount %u @ agbno %u\n",
2826 MAJOR(__entry->dev), MINOR(__entry->dev),
2827 __entry->agno,
2828 __entry->i1_startblock,
2829 __entry->i1_blockcount,
2830 __entry->i1_refcount,
2831 __entry->i2_startblock,
2832 __entry->i2_blockcount,
2833 __entry->i2_refcount,
2834 __entry->agbno)
2835)
2836
2837#define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2838DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2839 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2840 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2841 xfs_agblock_t agbno), \
2842 TP_ARGS(mp, agno, i1, i2, agbno))
2843
2844/* triple-rcext tracepoint class */
2845DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
2846 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2847 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2848 struct xfs_refcount_irec *i3),
2849 TP_ARGS(mp, agno, i1, i2, i3),
2850 TP_STRUCT__entry(
2851 __field(dev_t, dev)
2852 __field(xfs_agnumber_t, agno)
2853 __field(xfs_agblock_t, i1_startblock)
2854 __field(xfs_extlen_t, i1_blockcount)
2855 __field(xfs_nlink_t, i1_refcount)
2856 __field(xfs_agblock_t, i2_startblock)
2857 __field(xfs_extlen_t, i2_blockcount)
2858 __field(xfs_nlink_t, i2_refcount)
2859 __field(xfs_agblock_t, i3_startblock)
2860 __field(xfs_extlen_t, i3_blockcount)
2861 __field(xfs_nlink_t, i3_refcount)
2862 ),
2863 TP_fast_assign(
2864 __entry->dev = mp->m_super->s_dev;
2865 __entry->agno = agno;
2866 __entry->i1_startblock = i1->rc_startblock;
2867 __entry->i1_blockcount = i1->rc_blockcount;
2868 __entry->i1_refcount = i1->rc_refcount;
2869 __entry->i2_startblock = i2->rc_startblock;
2870 __entry->i2_blockcount = i2->rc_blockcount;
2871 __entry->i2_refcount = i2->rc_refcount;
2872 __entry->i3_startblock = i3->rc_startblock;
2873 __entry->i3_blockcount = i3->rc_blockcount;
2874 __entry->i3_refcount = i3->rc_refcount;
2875 ),
2876 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2877 "agbno %u len %u refcount %u -- "
2878 "agbno %u len %u refcount %u\n",
2879 MAJOR(__entry->dev), MINOR(__entry->dev),
2880 __entry->agno,
2881 __entry->i1_startblock,
2882 __entry->i1_blockcount,
2883 __entry->i1_refcount,
2884 __entry->i2_startblock,
2885 __entry->i2_blockcount,
2886 __entry->i2_refcount,
2887 __entry->i3_startblock,
2888 __entry->i3_blockcount,
2889 __entry->i3_refcount)
2890);
2891
2892#define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2893DEFINE_EVENT(xfs_refcount_triple_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 struct xfs_refcount_irec *i3), \
2897 TP_ARGS(mp, agno, i1, i2, i3))
2898
2899/* refcount btree tracepoints */
2900DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
2901DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
2902DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
2903DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
2904DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
2905DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
2906DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
2907DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
2908DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
2909DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
2910
2911/* refcount adjustment tracepoints */
2912DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
2913DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
Darrick J. Wong174edb02016-10-03 09:11:39 -07002914DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
2915DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002916DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
2917DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
Darrick J. Wong174edb02016-10-03 09:11:39 -07002918DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002919DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
2920DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
2921DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
2922DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
2923DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
2924DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
Darrick J. Wong174edb02016-10-03 09:11:39 -07002925DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002926DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
2927DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
2928DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
2929DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
2930DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
2931DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
2932DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
2933
2934/* reflink helpers */
2935DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
2936DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
2937DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
Darrick J. Wong33ba6122016-10-03 09:11:22 -07002938#define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2939DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
2940DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
Darrick J. Wongc75c7522016-10-03 09:11:15 -07002941
Darrick J. Wongf997ee22016-10-03 09:11:21 -07002942TRACE_EVENT(xfs_refcount_finish_one_leftover,
2943 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2944 int type, xfs_agblock_t agbno, xfs_extlen_t len,
2945 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
2946 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
2947 TP_STRUCT__entry(
2948 __field(dev_t, dev)
2949 __field(xfs_agnumber_t, agno)
2950 __field(int, type)
2951 __field(xfs_agblock_t, agbno)
2952 __field(xfs_extlen_t, len)
2953 __field(xfs_agblock_t, new_agbno)
2954 __field(xfs_extlen_t, new_len)
2955 ),
2956 TP_fast_assign(
2957 __entry->dev = mp->m_super->s_dev;
2958 __entry->agno = agno;
2959 __entry->type = type;
2960 __entry->agbno = agbno;
2961 __entry->len = len;
2962 __entry->new_agbno = new_agbno;
2963 __entry->new_len = new_len;
2964 ),
2965 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
2966 MAJOR(__entry->dev), MINOR(__entry->dev),
2967 __entry->type,
2968 __entry->agno,
2969 __entry->agbno,
2970 __entry->len,
2971 __entry->new_agbno,
2972 __entry->new_len)
2973);
2974
Darrick J. Wongf65306e2016-10-03 09:11:27 -07002975/* simple inode-based error/%ip tracepoint class */
2976DECLARE_EVENT_CLASS(xfs_inode_error_class,
2977 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
2978 TP_ARGS(ip, error, caller_ip),
2979 TP_STRUCT__entry(
2980 __field(dev_t, dev)
2981 __field(xfs_ino_t, ino)
2982 __field(int, error)
2983 __field(unsigned long, caller_ip)
2984 ),
2985 TP_fast_assign(
2986 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2987 __entry->ino = ip->i_ino;
2988 __entry->error = error;
2989 __entry->caller_ip = caller_ip;
2990 ),
2991 TP_printk("dev %d:%d ino %llx error %d caller %ps",
2992 MAJOR(__entry->dev), MINOR(__entry->dev),
2993 __entry->ino,
2994 __entry->error,
2995 (char *)__entry->caller_ip)
2996);
2997
2998#define DEFINE_INODE_ERROR_EVENT(name) \
2999DEFINE_EVENT(xfs_inode_error_class, name, \
3000 TP_PROTO(struct xfs_inode *ip, int error, \
3001 unsigned long caller_ip), \
3002 TP_ARGS(ip, error, caller_ip))
3003
3004/* reflink allocator */
3005TRACE_EVENT(xfs_bmap_remap_alloc,
3006 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t fsbno,
3007 xfs_extlen_t len),
3008 TP_ARGS(ip, fsbno, len),
3009 TP_STRUCT__entry(
3010 __field(dev_t, dev)
3011 __field(xfs_ino_t, ino)
3012 __field(xfs_fsblock_t, fsbno)
3013 __field(xfs_extlen_t, len)
3014 ),
3015 TP_fast_assign(
3016 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3017 __entry->ino = ip->i_ino;
3018 __entry->fsbno = fsbno;
3019 __entry->len = len;
3020 ),
3021 TP_printk("dev %d:%d ino 0x%llx fsbno 0x%llx len %x",
3022 MAJOR(__entry->dev), MINOR(__entry->dev),
3023 __entry->ino,
3024 __entry->fsbno,
3025 __entry->len)
3026);
3027DEFINE_INODE_ERROR_EVENT(xfs_bmap_remap_alloc_error);
3028
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003029/* reflink tracepoint classes */
3030
3031/* two-file io tracepoint class */
3032DECLARE_EVENT_CLASS(xfs_double_io_class,
3033 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3034 struct xfs_inode *dest, xfs_off_t doffset),
3035 TP_ARGS(src, soffset, len, dest, doffset),
3036 TP_STRUCT__entry(
3037 __field(dev_t, dev)
3038 __field(xfs_ino_t, src_ino)
3039 __field(loff_t, src_isize)
3040 __field(loff_t, src_disize)
3041 __field(loff_t, src_offset)
3042 __field(size_t, len)
3043 __field(xfs_ino_t, dest_ino)
3044 __field(loff_t, dest_isize)
3045 __field(loff_t, dest_disize)
3046 __field(loff_t, dest_offset)
3047 ),
3048 TP_fast_assign(
3049 __entry->dev = VFS_I(src)->i_sb->s_dev;
3050 __entry->src_ino = src->i_ino;
3051 __entry->src_isize = VFS_I(src)->i_size;
3052 __entry->src_disize = src->i_d.di_size;
3053 __entry->src_offset = soffset;
3054 __entry->len = len;
3055 __entry->dest_ino = dest->i_ino;
3056 __entry->dest_isize = VFS_I(dest)->i_size;
3057 __entry->dest_disize = dest->i_d.di_size;
3058 __entry->dest_offset = doffset;
3059 ),
3060 TP_printk("dev %d:%d count %zd "
3061 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
3062 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
3063 MAJOR(__entry->dev), MINOR(__entry->dev),
3064 __entry->len,
3065 __entry->src_ino,
3066 __entry->src_isize,
3067 __entry->src_disize,
3068 __entry->src_offset,
3069 __entry->dest_ino,
3070 __entry->dest_isize,
3071 __entry->dest_disize,
3072 __entry->dest_offset)
3073)
3074
3075#define DEFINE_DOUBLE_IO_EVENT(name) \
3076DEFINE_EVENT(xfs_double_io_class, name, \
3077 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3078 struct xfs_inode *dest, xfs_off_t doffset), \
3079 TP_ARGS(src, soffset, len, dest, doffset))
3080
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003081/* inode/irec events */
3082DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3083 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3084 TP_ARGS(ip, irec),
3085 TP_STRUCT__entry(
3086 __field(dev_t, dev)
3087 __field(xfs_ino_t, ino)
3088 __field(xfs_fileoff_t, lblk)
3089 __field(xfs_extlen_t, len)
3090 __field(xfs_fsblock_t, pblk)
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003091 __field(int, state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003092 ),
3093 TP_fast_assign(
3094 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3095 __entry->ino = ip->i_ino;
3096 __entry->lblk = irec->br_startoff;
3097 __entry->len = irec->br_blockcount;
3098 __entry->pblk = irec->br_startblock;
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003099 __entry->state = irec->br_state;
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003100 ),
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003101 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 -07003102 MAJOR(__entry->dev), MINOR(__entry->dev),
3103 __entry->ino,
3104 __entry->lblk,
3105 __entry->len,
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003106 __entry->pblk,
3107 __entry->state)
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003108);
3109#define DEFINE_INODE_IREC_EVENT(name) \
3110DEFINE_EVENT(xfs_inode_irec_class, name, \
3111 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3112 TP_ARGS(ip, irec))
3113
3114/* refcount/reflink tracepoint definitions */
3115
3116/* reflink tracepoints */
3117DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3118DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3119DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3120DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap);
3121TRACE_EVENT(xfs_reflink_remap_blocks_loop,
3122 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3123 xfs_filblks_t len, struct xfs_inode *dest,
3124 xfs_fileoff_t doffset),
3125 TP_ARGS(src, soffset, len, dest, doffset),
3126 TP_STRUCT__entry(
3127 __field(dev_t, dev)
3128 __field(xfs_ino_t, src_ino)
3129 __field(xfs_fileoff_t, src_lblk)
3130 __field(xfs_filblks_t, len)
3131 __field(xfs_ino_t, dest_ino)
3132 __field(xfs_fileoff_t, dest_lblk)
3133 ),
3134 TP_fast_assign(
3135 __entry->dev = VFS_I(src)->i_sb->s_dev;
3136 __entry->src_ino = src->i_ino;
3137 __entry->src_lblk = soffset;
3138 __entry->len = len;
3139 __entry->dest_ino = dest->i_ino;
3140 __entry->dest_lblk = doffset;
3141 ),
3142 TP_printk("dev %d:%d len 0x%llx "
3143 "ino 0x%llx offset 0x%llx blocks -> "
3144 "ino 0x%llx offset 0x%llx blocks",
3145 MAJOR(__entry->dev), MINOR(__entry->dev),
3146 __entry->len,
3147 __entry->src_ino,
3148 __entry->src_lblk,
3149 __entry->dest_ino,
3150 __entry->dest_lblk)
3151);
3152TRACE_EVENT(xfs_reflink_punch_range,
3153 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3154 xfs_extlen_t len),
3155 TP_ARGS(ip, lblk, len),
3156 TP_STRUCT__entry(
3157 __field(dev_t, dev)
3158 __field(xfs_ino_t, ino)
3159 __field(xfs_fileoff_t, lblk)
3160 __field(xfs_extlen_t, len)
3161 ),
3162 TP_fast_assign(
3163 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3164 __entry->ino = ip->i_ino;
3165 __entry->lblk = lblk;
3166 __entry->len = len;
3167 ),
3168 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x",
3169 MAJOR(__entry->dev), MINOR(__entry->dev),
3170 __entry->ino,
3171 __entry->lblk,
3172 __entry->len)
3173);
3174TRACE_EVENT(xfs_reflink_remap,
3175 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3176 xfs_extlen_t len, xfs_fsblock_t new_pblk),
3177 TP_ARGS(ip, lblk, len, new_pblk),
3178 TP_STRUCT__entry(
3179 __field(dev_t, dev)
3180 __field(xfs_ino_t, ino)
3181 __field(xfs_fileoff_t, lblk)
3182 __field(xfs_extlen_t, len)
3183 __field(xfs_fsblock_t, new_pblk)
3184 ),
3185 TP_fast_assign(
3186 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3187 __entry->ino = ip->i_ino;
3188 __entry->lblk = lblk;
3189 __entry->len = len;
3190 __entry->new_pblk = new_pblk;
3191 ),
3192 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu",
3193 MAJOR(__entry->dev), MINOR(__entry->dev),
3194 __entry->ino,
3195 __entry->lblk,
3196 __entry->len,
3197 __entry->new_pblk)
3198);
3199DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3200DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3201DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3202DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003203DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3204DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3205
3206/* dedupe tracepoints */
3207DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3208DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3209
3210/* ioctl tracepoints */
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003211TRACE_EVENT(xfs_ioctl_clone,
3212 TP_PROTO(struct inode *src, struct inode *dest),
3213 TP_ARGS(src, dest),
3214 TP_STRUCT__entry(
3215 __field(dev_t, dev)
3216 __field(unsigned long, src_ino)
3217 __field(loff_t, src_isize)
3218 __field(unsigned long, dest_ino)
3219 __field(loff_t, dest_isize)
3220 ),
3221 TP_fast_assign(
3222 __entry->dev = src->i_sb->s_dev;
3223 __entry->src_ino = src->i_ino;
3224 __entry->src_isize = i_size_read(src);
3225 __entry->dest_ino = dest->i_ino;
3226 __entry->dest_isize = i_size_read(dest);
3227 ),
3228 TP_printk("dev %d:%d "
3229 "ino 0x%lx isize 0x%llx -> "
3230 "ino 0x%lx isize 0x%llx\n",
3231 MAJOR(__entry->dev), MINOR(__entry->dev),
3232 __entry->src_ino,
3233 __entry->src_isize,
3234 __entry->dest_ino,
3235 __entry->dest_isize)
3236);
3237
3238/* unshare tracepoints */
3239DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003240DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003241
3242/* copy on write */
3243DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
Darrick J. Wongbe51f812016-10-03 09:11:32 -07003244DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc);
3245DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3246DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
Darrick J. Wong5eda4302017-02-02 15:14:02 -08003247DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003248
Christoph Hellwig3ba020b2016-10-20 15:53:50 +11003249DEFINE_RW_EVENT(xfs_reflink_reserve_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003250
Christoph Hellwig54a4ef82017-02-06 13:00:54 -08003251DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003252DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping);
3253DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003254
3255DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3256DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3257DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003258
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003259DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3260DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3261
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003262
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003263DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
Darrick J. Wong53aa1c32016-10-03 09:11:30 -07003264
Darrick J. Wong1f08af52016-10-03 09:11:53 -07003265/* rmap swapext tracepoints */
3266DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3267DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3268DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3269
Christoph Hellwig0b1b2132009-12-14 23:14:59 +00003270#endif /* _TRACE_XFS_H */
3271
3272#undef TRACE_INCLUDE_PATH
3273#define TRACE_INCLUDE_PATH .
3274#define TRACE_INCLUDE_FILE xfs_trace
3275#include <trace/define_trace.h>