xref: /openbmc/linux/fs/xfs/xfs_trace.h (revision 4f6cce39)
1 /*
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 
26 struct xfs_agf;
27 struct xfs_alloc_arg;
28 struct xfs_attr_list_context;
29 struct xfs_buf_log_item;
30 struct xfs_da_args;
31 struct xfs_da_node_entry;
32 struct xfs_dquot;
33 struct xfs_log_item;
34 struct xlog;
35 struct xlog_ticket;
36 struct xlog_recover;
37 struct xlog_recover_item;
38 struct xfs_buf_log_format;
39 struct xfs_inode_log_format;
40 struct xfs_bmbt_irec;
41 struct xfs_btree_cur;
42 struct xfs_refcount_irec;
43 
44 DECLARE_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 	)
87 )
88 
89 #define DEFINE_ATTR_LIST_EVENT(name) \
90 DEFINE_EVENT(xfs_attr_list_class, name, \
91 	TP_PROTO(struct xfs_attr_list_context *ctx), \
92 	TP_ARGS(ctx))
93 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
94 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
95 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
96 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
97 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
98 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
99 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
100 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
101 DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
102 DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
103 
104 DECLARE_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 	),
120 	TP_printk("dev %d:%d agno %u refcount %d caller %ps",
121 		  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)	\
128 DEFINE_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))
132 DEFINE_PERAG_REF_EVENT(xfs_perag_get);
133 DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
134 DEFINE_PERAG_REF_EVENT(xfs_perag_put);
135 DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
136 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
137 DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
138 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
139 DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks);
140 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks);
141 
142 DECLARE_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)	\
158 DEFINE_EVENT(xfs_ag_class, name,	\
159 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),	\
160 	TP_ARGS(mp, agno))
161 
162 DEFINE_AG_EVENT(xfs_read_agf);
163 DEFINE_AG_EVENT(xfs_alloc_read_agf);
164 DEFINE_AG_EVENT(xfs_read_agi);
165 DEFINE_AG_EVENT(xfs_ialloc_read_agi);
166 
167 TRACE_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 
219 TRACE_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 "
246 		  "offset %lld block %lld count %lld flag %d caller %ps",
247 		  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,
252 		  (__int64_t)__entry->startblock,
253 		  __entry->blockcount,
254 		  __entry->state,
255 		  (char *)__entry->caller_ip)
256 );
257 
258 DECLARE_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(
274 		struct xfs_ifork	*ifp;
275 		struct xfs_bmbt_irec	r;
276 
277 		ifp = xfs_iext_state_to_fork(ip, state);
278 		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 "
290 		  "offset %lld block %lld count %lld flag %d caller %ps",
291 		  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,
296 		  (__int64_t)__entry->startblock,
297 		  __entry->blockcount,
298 		  __entry->state,
299 		  (char *)__entry->caller_ip)
300 )
301 
302 #define DEFINE_BMAP_EVENT(name) \
303 DEFINE_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))
307 DEFINE_BMAP_EVENT(xfs_iext_remove);
308 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
309 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
310 DEFINE_BMAP_EVENT(xfs_extlist);
311 
312 DECLARE_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)
318 		__field(int, nblks)
319 		__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;
328 		__entry->nblks = bp->b_length;
329 		__entry->hold = atomic_read(&bp->b_hold);
330 		__entry->pincount = atomic_read(&bp->b_pin_count);
331 		__entry->lockval = bp->b_sema.count;
332 		__entry->flags = bp->b_flags;
333 		__entry->caller_ip = caller_ip;
334 	),
335 	TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
336 		  "lock %d flags %s caller %ps",
337 		  MAJOR(__entry->dev), MINOR(__entry->dev),
338 		  (unsigned long long)__entry->bno,
339 		  __entry->nblks,
340 		  __entry->hold,
341 		  __entry->pincount,
342 		  __entry->lockval,
343 		  __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
344 		  (void *)__entry->caller_ip)
345 )
346 
347 #define DEFINE_BUF_EVENT(name) \
348 DEFINE_EVENT(xfs_buf_class, name, \
349 	TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
350 	TP_ARGS(bp, caller_ip))
351 DEFINE_BUF_EVENT(xfs_buf_init);
352 DEFINE_BUF_EVENT(xfs_buf_free);
353 DEFINE_BUF_EVENT(xfs_buf_hold);
354 DEFINE_BUF_EVENT(xfs_buf_rele);
355 DEFINE_BUF_EVENT(xfs_buf_iodone);
356 DEFINE_BUF_EVENT(xfs_buf_submit);
357 DEFINE_BUF_EVENT(xfs_buf_submit_wait);
358 DEFINE_BUF_EVENT(xfs_buf_lock);
359 DEFINE_BUF_EVENT(xfs_buf_lock_done);
360 DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
361 DEFINE_BUF_EVENT(xfs_buf_trylock);
362 DEFINE_BUF_EVENT(xfs_buf_unlock);
363 DEFINE_BUF_EVENT(xfs_buf_iowait);
364 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
365 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
366 DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
367 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
368 DEFINE_BUF_EVENT(xfs_buf_get_uncached);
369 DEFINE_BUF_EVENT(xfs_buf_item_relse);
370 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
371 DEFINE_BUF_EVENT(xfs_buf_error_relse);
372 DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
373 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
374 
375 /* not really buffer traces, but the buf provides useful information */
376 DEFINE_BUF_EVENT(xfs_btree_corrupt);
377 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
378 
379 /* pass flags explicitly */
380 DECLARE_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;
396 		__entry->buffer_length = BBTOB(bp->b_length);
397 		__entry->flags = flags;
398 		__entry->hold = atomic_read(&bp->b_hold);
399 		__entry->pincount = atomic_read(&bp->b_pin_count);
400 		__entry->lockval = bp->b_sema.count;
401 		__entry->caller_ip = caller_ip;
402 	),
403 	TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
404 		  "lock %d flags %s caller %ps",
405 		  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)
413 )
414 
415 #define DEFINE_BUF_FLAGS_EVENT(name) \
416 DEFINE_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))
419 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
420 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
421 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
422 
423 TRACE_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;
440 		__entry->buffer_length = BBTOB(bp->b_length);
441 		__entry->hold = atomic_read(&bp->b_hold);
442 		__entry->pincount = atomic_read(&bp->b_pin_count);
443 		__entry->lockval = bp->b_sema.count;
444 		__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 "
449 		  "lock %d error %d flags %s caller %ps",
450 		  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 
461 DECLARE_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;
484 		__entry->buf_len = BBTOB(bip->bli_buf->b_length);
485 		__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);
488 		__entry->buf_lockval = bip->bli_buf->b_sema.count;
489 		__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))
507 )
508 
509 #define DEFINE_BUF_ITEM_EVENT(name) \
510 DEFINE_EVENT(xfs_buf_item_class, name, \
511 	TP_PROTO(struct xfs_buf_log_item *bip), \
512 	TP_ARGS(bip))
513 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
514 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
515 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
516 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
517 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
518 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
519 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
520 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
521 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
522 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
523 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
524 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
525 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
526 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
527 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
528 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
529 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
530 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
531 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
532 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
533 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
534 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
535 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
536 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
537 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
538 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
539 
540 DECLARE_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) \
562 DEFINE_EVENT(xfs_filestream_class, name, \
563 	TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
564 	TP_ARGS(ip, agno))
565 DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
566 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
567 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
568 
569 TRACE_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 
598 DECLARE_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 	),
614 	TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
615 		  MAJOR(__entry->dev), MINOR(__entry->dev),
616 		  __entry->ino,
617 		  __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
618 		  (void *)__entry->caller_ip)
619 )
620 
621 #define DEFINE_LOCK_EVENT(name) \
622 DEFINE_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))
626 DEFINE_LOCK_EVENT(xfs_ilock);
627 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
628 DEFINE_LOCK_EVENT(xfs_ilock_demote);
629 DEFINE_LOCK_EVENT(xfs_iunlock);
630 
631 DECLARE_EVENT_CLASS(xfs_inode_class,
632 	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)
645 )
646 
647 #define DEFINE_INODE_EVENT(name) \
648 DEFINE_EVENT(xfs_inode_class, name, \
649 	TP_PROTO(struct xfs_inode *ip), \
650 	TP_ARGS(ip))
651 DEFINE_INODE_EVENT(xfs_iget_skip);
652 DEFINE_INODE_EVENT(xfs_iget_reclaim);
653 DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
654 DEFINE_INODE_EVENT(xfs_iget_hit);
655 DEFINE_INODE_EVENT(xfs_iget_miss);
656 
657 DEFINE_INODE_EVENT(xfs_getattr);
658 DEFINE_INODE_EVENT(xfs_setattr);
659 DEFINE_INODE_EVENT(xfs_readlink);
660 DEFINE_INODE_EVENT(xfs_inactive_symlink);
661 DEFINE_INODE_EVENT(xfs_alloc_file_space);
662 DEFINE_INODE_EVENT(xfs_free_file_space);
663 DEFINE_INODE_EVENT(xfs_zero_file_space);
664 DEFINE_INODE_EVENT(xfs_collapse_file_space);
665 DEFINE_INODE_EVENT(xfs_insert_file_space);
666 DEFINE_INODE_EVENT(xfs_readdir);
667 #ifdef CONFIG_XFS_POSIX_ACL
668 DEFINE_INODE_EVENT(xfs_get_acl);
669 #endif
670 DEFINE_INODE_EVENT(xfs_vm_bmap);
671 DEFINE_INODE_EVENT(xfs_file_ioctl);
672 DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
673 DEFINE_INODE_EVENT(xfs_ioctl_setattr);
674 DEFINE_INODE_EVENT(xfs_dir_fsync);
675 DEFINE_INODE_EVENT(xfs_file_fsync);
676 DEFINE_INODE_EVENT(xfs_destroy_inode);
677 DEFINE_INODE_EVENT(xfs_update_time);
678 
679 DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
680 DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
681 
682 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
683 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
684 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
685 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
686 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
687 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
688 
689 DEFINE_INODE_EVENT(xfs_filemap_fault);
690 DEFINE_INODE_EVENT(xfs_filemap_huge_fault);
691 DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
692 DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
693 
694 DECLARE_EVENT_CLASS(xfs_iref_class,
695 	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)
701 		__field(int, pincount)
702 		__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);
708 		__entry->pincount = atomic_read(&ip->i_pincount);
709 		__entry->caller_ip = caller_ip;
710 	),
711 	TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
712 		  MAJOR(__entry->dev), MINOR(__entry->dev),
713 		  __entry->ino,
714 		  __entry->count,
715 		  __entry->pincount,
716 		  (char *)__entry->caller_ip)
717 )
718 
719 TRACE_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 
743 TRACE_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 
769 TRACE_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 
790 #define DEFINE_IREF_EVENT(name) \
791 DEFINE_EVENT(xfs_iref_class, name, \
792 	TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
793 	TP_ARGS(ip, caller_ip))
794 DEFINE_IREF_EVENT(xfs_irele);
795 DEFINE_IREF_EVENT(xfs_inode_pin);
796 DEFINE_IREF_EVENT(xfs_inode_unpin);
797 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
798 
799 DECLARE_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)
805 		__field(int, namelen)
806 		__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;
811 		__entry->namelen = name->len;
812 		memcpy(__get_str(name), name->name, name->len);
813 	),
814 	TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
815 		  MAJOR(__entry->dev), MINOR(__entry->dev),
816 		  __entry->dp_ino,
817 		  __entry->namelen,
818 		  __get_str(name))
819 )
820 
821 #define DEFINE_NAMESPACE_EVENT(name) \
822 DEFINE_EVENT(xfs_namespace_class, name, \
823 	TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
824 	TP_ARGS(dp, name))
825 DEFINE_NAMESPACE_EVENT(xfs_remove);
826 DEFINE_NAMESPACE_EVENT(xfs_link);
827 DEFINE_NAMESPACE_EVENT(xfs_lookup);
828 DEFINE_NAMESPACE_EVENT(xfs_create);
829 DEFINE_NAMESPACE_EVENT(xfs_symlink);
830 
831 TRACE_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)
839 		__field(int, src_namelen)
840 		__field(int, target_namelen)
841 		__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;
848 		__entry->src_namelen = src_name->len;
849 		__entry->target_namelen = target_name->len;
850 		memcpy(__get_str(src_name), src_name->name, src_name->len);
851 		memcpy(__get_str(target_name), target_name->name,
852 			target_name->len);
853 	),
854 	TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
855 		  " src name %.*s target name %.*s",
856 		  MAJOR(__entry->dev), MINOR(__entry->dev),
857 		  __entry->src_dp_ino,
858 		  __entry->target_dp_ino,
859 		  __entry->src_namelen,
860 		  __get_str(src_name),
861 		  __entry->target_namelen,
862 		  __get_str(target_name))
863 )
864 
865 DECLARE_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)
870 		__field(u32, id)
871 		__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)
880 	), \
881 	TP_fast_assign(
882 		__entry->dev = dqp->q_mount->m_super->s_dev;
883 		__entry->id = be32_to_cpu(dqp->q_core.d_id);
884 		__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 "
899 		  "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
900 		  "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
901 		  MAJOR(__entry->dev), MINOR(__entry->dev),
902 		  __entry->id,
903 		  __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)
912 )
913 
914 #define DEFINE_DQUOT_EVENT(name) \
915 DEFINE_EVENT(xfs_dquot_class, name, \
916 	TP_PROTO(struct xfs_dquot *dqp), \
917 	TP_ARGS(dqp))
918 DEFINE_DQUOT_EVENT(xfs_dqadjust);
919 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
920 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
921 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
922 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
923 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
924 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
925 DEFINE_DQUOT_EVENT(xfs_dqalloc);
926 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
927 DEFINE_DQUOT_EVENT(xfs_dqread);
928 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
929 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
930 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
931 DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
932 DEFINE_DQUOT_EVENT(xfs_dqget_dup);
933 DEFINE_DQUOT_EVENT(xfs_dqput);
934 DEFINE_DQUOT_EVENT(xfs_dqput_free);
935 DEFINE_DQUOT_EVENT(xfs_dqrele);
936 DEFINE_DQUOT_EVENT(xfs_dqflush);
937 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
938 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
939 
940 DECLARE_EVENT_CLASS(xfs_loggrant_class,
941 	TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
942 	TP_ARGS(log, tic),
943 	TP_STRUCT__entry(
944 		__field(dev_t, dev)
945 		__field(char, ocnt)
946 		__field(char, cnt)
947 		__field(int, curr_res)
948 		__field(int, unit_res)
949 		__field(unsigned int, flags)
950 		__field(int, reserveq)
951 		__field(int, writeq)
952 		__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;
962 		__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;
967 		__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,
970 				&__entry->grant_reserve_cycle,
971 				&__entry->grant_reserve_bytes);
972 		xlog_crack_grant_head(&log->l_write_head.grant,
973 				&__entry->grant_write_cycle,
974 				&__entry->grant_write_bytes);
975 		__entry->curr_cycle = log->l_curr_cycle;
976 		__entry->curr_block = log->l_curr_block;
977 		__entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
978 	),
979 	TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
980 		  "t_unit_res %u t_flags %s reserveq %s "
981 		  "writeq %s grant_reserve_cycle %d "
982 		  "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),
986 		  __entry->ocnt,
987 		  __entry->cnt,
988 		  __entry->curr_res,
989 		  __entry->unit_res,
990 		  __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
991 		  __entry->reserveq ? "empty" : "active",
992 		  __entry->writeq ? "empty" : "active",
993 		  __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 	)
1002 )
1003 
1004 #define DEFINE_LOGGRANT_EVENT(name) \
1005 DEFINE_EVENT(xfs_loggrant_class, name, \
1006 	TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1007 	TP_ARGS(log, tic))
1008 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1009 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
1010 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1011 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1012 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1013 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1014 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1015 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1016 DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1017 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1018 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1019 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1020 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1021 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1022 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1023 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1024 
1025 DECLARE_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 
1050 TRACE_EVENT(xfs_log_force,
1051 	TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1052 	TP_ARGS(mp, lsn, caller_ip),
1053 	TP_STRUCT__entry(
1054 		__field(dev_t, dev)
1055 		__field(xfs_lsn_t, lsn)
1056 		__field(unsigned long, caller_ip)
1057 	),
1058 	TP_fast_assign(
1059 		__entry->dev = mp->m_super->s_dev;
1060 		__entry->lsn = lsn;
1061 		__entry->caller_ip = caller_ip;
1062 	),
1063 	TP_printk("dev %d:%d lsn 0x%llx caller %ps",
1064 		  MAJOR(__entry->dev), MINOR(__entry->dev),
1065 		  __entry->lsn, (void *)__entry->caller_ip)
1066 )
1067 
1068 #define DEFINE_LOG_ITEM_EVENT(name) \
1069 DEFINE_EVENT(xfs_log_item_class, name, \
1070 	TP_PROTO(struct xfs_log_item *lip), \
1071 	TP_ARGS(lip))
1072 DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1073 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1074 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1075 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1076 
1077 DECLARE_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) \
1106 DEFINE_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))
1109 DEFINE_AIL_EVENT(xfs_ail_insert);
1110 DEFINE_AIL_EVENT(xfs_ail_move);
1111 DEFINE_AIL_EVENT(xfs_ail_delete);
1112 
1113 TRACE_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 )
1134 
1135 DECLARE_EVENT_CLASS(xfs_file_class,
1136 	TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1137 	TP_ARGS(ip, count, offset),
1138 	TP_STRUCT__entry(
1139 		__field(dev_t, dev)
1140 		__field(xfs_ino_t, ino)
1141 		__field(xfs_fsize_t, size)
1142 		__field(loff_t, offset)
1143 		__field(size_t, count)
1144 	),
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;
1149 		__entry->offset = offset;
1150 		__entry->count = count;
1151 	),
1152 	TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
1153 		  MAJOR(__entry->dev), MINOR(__entry->dev),
1154 		  __entry->ino,
1155 		  __entry->size,
1156 		  __entry->offset,
1157 		  __entry->count)
1158 )
1159 
1160 #define DEFINE_RW_EVENT(name)		\
1161 DEFINE_EVENT(xfs_file_class, name,	\
1162 	TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),	\
1163 	TP_ARGS(ip, count, offset))
1164 DEFINE_RW_EVENT(xfs_file_buffered_read);
1165 DEFINE_RW_EVENT(xfs_file_direct_read);
1166 DEFINE_RW_EVENT(xfs_file_dax_read);
1167 DEFINE_RW_EVENT(xfs_file_buffered_write);
1168 DEFINE_RW_EVENT(xfs_file_direct_write);
1169 DEFINE_RW_EVENT(xfs_file_dax_write);
1170 
1171 DECLARE_EVENT_CLASS(xfs_page_class,
1172 	TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1173 		 unsigned int len),
1174 	TP_ARGS(inode, page, off, len),
1175 	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)
1181 		__field(unsigned int, length)
1182 		__field(int, delalloc)
1183 		__field(int, unwritten)
1184 	),
1185 	TP_fast_assign(
1186 		int delalloc = -1, unwritten = -1;
1187 
1188 		if (page_has_buffers(page))
1189 			xfs_count_page_state(page, &delalloc, &unwritten);
1190 		__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;
1195 		__entry->length = len;
1196 		__entry->delalloc = delalloc;
1197 		__entry->unwritten = unwritten;
1198 	),
1199 	TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
1200 		  "length %x delalloc %d unwritten %d",
1201 		  MAJOR(__entry->dev), MINOR(__entry->dev),
1202 		  __entry->ino,
1203 		  __entry->pgoff,
1204 		  __entry->size,
1205 		  __entry->offset,
1206 		  __entry->length,
1207 		  __entry->delalloc,
1208 		  __entry->unwritten)
1209 )
1210 
1211 #define DEFINE_PAGE_EVENT(name)		\
1212 DEFINE_EVENT(xfs_page_class, name,	\
1213 	TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1214 		 unsigned int len),	\
1215 	TP_ARGS(inode, page, off, len))
1216 DEFINE_PAGE_EVENT(xfs_writepage);
1217 DEFINE_PAGE_EVENT(xfs_releasepage);
1218 DEFINE_PAGE_EVENT(xfs_invalidatepage);
1219 
1220 DECLARE_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)		\
1240 DEFINE_EVENT(xfs_readpage_class, name,	\
1241 	TP_PROTO(struct inode *inode, int nr_pages), \
1242 	TP_ARGS(inode, nr_pages))
1243 DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1244 DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1245 
1246 DECLARE_EVENT_CLASS(xfs_imap_class,
1247 	TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1248 		 int type, struct xfs_bmbt_irec *irec),
1249 	TP_ARGS(ip, offset, count, type, irec),
1250 	TP_STRUCT__entry(
1251 		__field(dev_t, dev)
1252 		__field(xfs_ino_t, ino)
1253 		__field(loff_t, size)
1254 		__field(loff_t, offset)
1255 		__field(size_t, count)
1256 		__field(int, type)
1257 		__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;
1265 		__entry->offset = offset;
1266 		__entry->count = count;
1267 		__entry->type = type;
1268 		__entry->startoff = irec ? irec->br_startoff : 0;
1269 		__entry->startblock = irec ? irec->br_startblock : 0;
1270 		__entry->blockcount = irec ? irec->br_blockcount : 0;
1271 	),
1272 	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",
1274 		  MAJOR(__entry->dev), MINOR(__entry->dev),
1275 		  __entry->ino,
1276 		  __entry->size,
1277 		  __entry->offset,
1278 		  __entry->count,
1279 		  __print_symbolic(__entry->type, XFS_IO_TYPES),
1280 		  __entry->startoff,
1281 		  (__int64_t)__entry->startblock,
1282 		  __entry->blockcount)
1283 )
1284 
1285 #define DEFINE_IOMAP_EVENT(name)	\
1286 DEFINE_EVENT(xfs_imap_class, name,	\
1287 	TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,	\
1288 		 int type, struct xfs_bmbt_irec *irec),		\
1289 	TP_ARGS(ip, offset, count, type, irec))
1290 DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1291 DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1292 DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1293 DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
1294 DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
1295 DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
1296 DEFINE_IOMAP_EVENT(xfs_iomap_found);
1297 
1298 DECLARE_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)
1304 		__field(loff_t, isize)
1305 		__field(loff_t, disize)
1306 		__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;
1312 		__entry->isize = VFS_I(ip)->i_size;
1313 		__entry->disize = ip->i_d.di_size;
1314 		__entry->offset = offset;
1315 		__entry->count = count;
1316 	),
1317 	TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1318 		  "offset 0x%llx count %zd",
1319 		  MAJOR(__entry->dev), MINOR(__entry->dev),
1320 		  __entry->ino,
1321 		  __entry->isize,
1322 		  __entry->disize,
1323 		  __entry->offset,
1324 		  __entry->count)
1325 );
1326 
1327 #define DEFINE_SIMPLE_IO_EVENT(name)	\
1328 DEFINE_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))
1331 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1332 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1333 DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
1334 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1335 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1336 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1337 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1338 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1339 
1340 DECLARE_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)
1360 )
1361 
1362 #define DEFINE_ITRUNC_EVENT(name) \
1363 DEFINE_EVENT(xfs_itrunc_class, name, \
1364 	TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1365 	TP_ARGS(ip, new_size))
1366 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1367 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1368 
1369 TRACE_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 
1394 TRACE_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"
1417 		  "flags %s caller %ps",
1418 		  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 
1428 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1429 	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),
1432 	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)
1437 	),
1438 	TP_fast_assign(
1439 		__entry->dev = mp->m_super->s_dev;
1440 		__entry->agno = agno;
1441 		__entry->agbno = agbno;
1442 		__entry->len = len;
1443 	),
1444 	TP_printk("dev %d:%d agno %u agbno %u len %u",
1445 		  MAJOR(__entry->dev), MINOR(__entry->dev),
1446 		  __entry->agno,
1447 		  __entry->agbno,
1448 		  __entry->len)
1449 );
1450 #define DEFINE_BUSY_EVENT(name) \
1451 DEFINE_EVENT(xfs_extent_busy_class, name, \
1452 	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))
1455 DEFINE_BUSY_EVENT(xfs_extent_busy);
1456 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1457 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1458 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1459 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1460 
1461 TRACE_EVENT(xfs_extent_busy_trim,
1462 	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 
1491 TRACE_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,
1507 		  __entry->lsn)
1508 );
1509 
1510 TRACE_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 "
1550 		  "freeblks %u longest %u caller %ps",
1551 		  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 
1567 TRACE_EVENT(xfs_free_extent,
1568 	TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1569 		 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),
1572 	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)
1577 		__field(int, resv)
1578 		__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;
1586 		__entry->resv = resv;
1587 		__entry->haveleft = haveleft;
1588 		__entry->haveright = haveright;
1589 	),
1590 	TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
1591 		  MAJOR(__entry->dev), MINOR(__entry->dev),
1592 		  __entry->agno,
1593 		  __entry->agbno,
1594 		  __entry->len,
1595 		  __entry->resv,
1596 		  __entry->haveleft ?
1597 			(__entry->haveright ? "both" : "left") :
1598 			(__entry->haveright ? "right" : "none"))
1599 
1600 );
1601 
1602 DECLARE_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)
1622 		__field(int, resv)
1623 		__field(int, datatype)
1624 		__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;
1643 		__entry->resv = args->resv;
1644 		__entry->datatype = args->datatype;
1645 		__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 "
1649 		  "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1650 		  "datatype 0x%x firstblock 0x%llx",
1651 		  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,
1667 		  __entry->resv,
1668 		  __entry->datatype,
1669 		  (unsigned long long)__entry->firstblock)
1670 )
1671 
1672 #define DEFINE_ALLOC_EVENT(name) \
1673 DEFINE_EVENT(xfs_alloc_class, name, \
1674 	TP_PROTO(struct xfs_alloc_arg *args), \
1675 	TP_ARGS(args))
1676 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1677 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1678 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1679 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1680 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1681 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1682 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1683 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1684 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1685 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1686 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1687 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1688 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1689 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1690 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1691 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1692 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1693 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1694 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1695 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1696 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1697 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1698 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1699 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1700 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1701 
1702 DECLARE_EVENT_CLASS(xfs_da_class,
1703 	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))
1734 )
1735 
1736 #define DEFINE_DIR2_EVENT(name) \
1737 DEFINE_EVENT(xfs_da_class, name, \
1738 	TP_PROTO(struct xfs_da_args *args), \
1739 	TP_ARGS(args))
1740 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1741 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1742 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1743 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1744 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1745 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1746 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1747 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1748 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1749 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1750 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1751 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1752 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1753 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1754 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1755 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1756 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1757 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1758 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1759 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1760 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1761 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1762 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1763 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1764 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1765 
1766 DECLARE_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 
1800 #define DEFINE_ATTR_EVENT(name) \
1801 DEFINE_EVENT(xfs_attr_class, name, \
1802 	TP_PROTO(struct xfs_da_args *args), \
1803 	TP_ARGS(args))
1804 DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1805 DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1806 DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1807 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1808 DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1809 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1810 
1811 DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1812 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1813 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
1814 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
1815 DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1816 DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
1817 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1818 DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
1819 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1820 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
1821 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
1822 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1823 DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1824 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1825 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1826 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1827 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1828 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1829 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1830 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1831 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1832 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
1833 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
1834 
1835 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
1836 DEFINE_ATTR_EVENT(xfs_attr_node_get);
1837 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1838 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1839 
1840 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1841 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1842 
1843 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1844 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1845 DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1846 
1847 #define DEFINE_DA_EVENT(name) \
1848 DEFINE_EVENT(xfs_da_class, name, \
1849 	TP_PROTO(struct xfs_da_args *args), \
1850 	TP_ARGS(args))
1851 DEFINE_DA_EVENT(xfs_da_split);
1852 DEFINE_DA_EVENT(xfs_da_join);
1853 DEFINE_DA_EVENT(xfs_da_link_before);
1854 DEFINE_DA_EVENT(xfs_da_link_after);
1855 DEFINE_DA_EVENT(xfs_da_unlink_back);
1856 DEFINE_DA_EVENT(xfs_da_unlink_forward);
1857 DEFINE_DA_EVENT(xfs_da_root_split);
1858 DEFINE_DA_EVENT(xfs_da_root_join);
1859 DEFINE_DA_EVENT(xfs_da_node_add);
1860 DEFINE_DA_EVENT(xfs_da_node_create);
1861 DEFINE_DA_EVENT(xfs_da_node_split);
1862 DEFINE_DA_EVENT(xfs_da_node_remove);
1863 DEFINE_DA_EVENT(xfs_da_node_rebalance);
1864 DEFINE_DA_EVENT(xfs_da_node_unbalance);
1865 DEFINE_DA_EVENT(xfs_da_node_toosmall);
1866 DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1867 DEFINE_DA_EVENT(xfs_da_grow_inode);
1868 DEFINE_DA_EVENT(xfs_da_shrink_inode);
1869 DEFINE_DA_EVENT(xfs_da_fixhashpath);
1870 DEFINE_DA_EVENT(xfs_da_path_shift);
1871 
1872 DECLARE_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)
1892 )
1893 
1894 #define DEFINE_DIR2_SPACE_EVENT(name) \
1895 DEFINE_EVENT(xfs_dir2_space_class, name, \
1896 	TP_PROTO(struct xfs_da_args *args, int idx), \
1897 	TP_ARGS(args, idx))
1898 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1899 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1900 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1901 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1902 
1903 TRACE_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 
1932 #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 
1942 DECLARE_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)
1951 		__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;
1960 		__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, "
1964 		  "broot size %d, fork offset %d",
1965 		  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,
1970 		  __entry->broot_size,
1971 		  __entry->fork_off)
1972 )
1973 
1974 #define DEFINE_SWAPEXT_EVENT(name) \
1975 DEFINE_EVENT(xfs_swap_extent_class, name, \
1976 	TP_PROTO(struct xfs_inode *ip, int which), \
1977 	TP_ARGS(ip, which))
1978 
1979 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1980 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1981 
1982 TRACE_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 
2005 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2006 	TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2007 		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)
2013 		__field(xfs_lsn_t, lsn)
2014 		__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;
2023 		__entry->lsn = trans->r_lsn;
2024 		__entry->type = ITEM_TYPE(item);
2025 		__entry->pass = pass;
2026 		__entry->count = item->ri_cnt;
2027 		__entry->total = item->ri_total;
2028 	),
2029 	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",
2031 		  MAJOR(__entry->dev), MINOR(__entry->dev),
2032 		  __entry->tid,
2033 		  __entry->lsn,
2034 		  __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) \
2042 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2043 	TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2044 		struct xlog_recover_item *item, int pass), \
2045 	TP_ARGS(log, trans, item, pass))
2046 
2047 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2048 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2049 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2050 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2051 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2052 
2053 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2054 	TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2055 	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) \
2083 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2084 	TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2085 	TP_ARGS(log, buf_f))
2086 
2087 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2088 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2089 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2090 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2091 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2092 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2093 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2094 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2095 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2096 
2097 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2098 	TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2099 	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) \
2135 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2136 	TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2137 	TP_ARGS(log, in_f))
2138 
2139 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2140 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2141 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2142 
2143 DECLARE_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) \
2170 DEFINE_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 
2174 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2175 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2176 
2177 DECLARE_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) \
2201 DEFINE_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))
2205 DEFINE_DISCARD_EVENT(xfs_discard_extent);
2206 DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2207 DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2208 DEFINE_DISCARD_EVENT(xfs_discard_busy);
2209 
2210 /* btree cursor events */
2211 DECLARE_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) \
2240 DEFINE_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))
2243 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2244 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2245 
2246 /* deferred ops */
2247 struct xfs_defer_pending;
2248 struct xfs_defer_ops;
2249 
2250 DECLARE_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) \
2272 DEFINE_EVENT(xfs_defer_class, name, \
2273 	TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2274 	TP_ARGS(mp, dop))
2275 
2276 DECLARE_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) \
2301 DEFINE_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 
2305 DECLARE_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;
2319 		__entry->committed = dfp->dfp_done != NULL;
2320 		__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) \
2330 DEFINE_EVENT(xfs_defer_pending_class, name, \
2331 	TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2332 	TP_ARGS(mp, dfp))
2333 
2334 DECLARE_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) \
2360 DEFINE_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 
2367 DECLARE_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) \
2411 DEFINE_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 
2422 DEFINE_DEFER_EVENT(xfs_defer_init);
2423 DEFINE_DEFER_EVENT(xfs_defer_cancel);
2424 DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2425 DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2426 DEFINE_DEFER_EVENT(xfs_defer_finish);
2427 DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2428 
2429 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2430 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2431 
2432 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
2433 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
2434 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
2435 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2436 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2437 
2438 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2439 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2440 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2441 
2442 /* rmap tracepoints */
2443 DECLARE_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;
2465 		if (unwritten)
2466 			__entry->flags |= XFS_RMAP_UNWRITTEN;
2467 	),
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) \
2478 DEFINE_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 */
2485 DECLARE_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) \
2509 DEFINE_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 
2514 DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2515 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2516 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2517 DEFINE_RMAP_EVENT(xfs_rmap_map);
2518 DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2519 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2520 DEFINE_RMAP_EVENT(xfs_rmap_convert);
2521 DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2522 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2523 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
2524 
2525 DECLARE_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) \
2558 DEFINE_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
2565 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2566 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2567 
2568 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2569 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
2570 DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2571 DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2572 DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2573 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2574 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2575 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
2576 
2577 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2578 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2579 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2580 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
2581 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2582 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
2583 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
2584 
2585 /* deferred bmbt updates */
2586 #define DEFINE_BMAP_DEFERRED_EVENT	DEFINE_RMAP_DEFERRED_EVENT
2587 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2588 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2589 
2590 /* per-AG reservation */
2591 DECLARE_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) \
2628 DEFINE_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 */
2634 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2635 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2636 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2637 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2638 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2639 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2640 
2641 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2642 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2643 
2644 /* 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" }
2654 DECLARE_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) \
2679 DEFINE_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 */
2685 DECLARE_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) \
2712 DEFINE_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 */
2718 DECLARE_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) \
2748 DEFINE_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 */
2754 DECLARE_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) \
2791 DEFINE_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 */
2797 DECLARE_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) \
2838 DEFINE_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 */
2845 DECLARE_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) \
2893 DEFINE_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 */
2900 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
2901 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
2902 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
2903 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
2904 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
2905 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
2906 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
2907 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
2908 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
2909 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
2910 
2911 /* refcount adjustment tracepoints */
2912 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
2913 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
2914 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
2915 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
2916 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
2917 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
2918 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
2919 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
2920 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
2921 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
2922 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
2923 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
2924 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
2925 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
2926 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
2927 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
2928 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
2929 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
2930 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
2931 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
2932 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
2933 
2934 /* reflink helpers */
2935 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
2936 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
2937 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
2938 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2939 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
2940 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
2941 
2942 TRACE_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 
2975 /* simple inode-based error/%ip tracepoint class */
2976 DECLARE_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) \
2999 DEFINE_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 */
3005 TRACE_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 );
3027 DEFINE_INODE_ERROR_EVENT(xfs_bmap_remap_alloc_error);
3028 
3029 /* reflink tracepoint classes */
3030 
3031 /* two-file io tracepoint class */
3032 DECLARE_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)	\
3076 DEFINE_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 
3081 /* inode/irec events */
3082 DECLARE_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)
3091 		__field(int, state)
3092 	),
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;
3099 		__entry->state = irec->br_state;
3100 	),
3101 	TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d",
3102 		  MAJOR(__entry->dev), MINOR(__entry->dev),
3103 		  __entry->ino,
3104 		  __entry->lblk,
3105 		  __entry->len,
3106 		  __entry->pblk,
3107 		  __entry->state)
3108 );
3109 #define DEFINE_INODE_IREC_EVENT(name) \
3110 DEFINE_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 */
3117 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3118 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3119 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3120 DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap);
3121 TRACE_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 );
3152 TRACE_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 );
3174 TRACE_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 );
3199 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3200 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3201 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3202 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
3203 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3204 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3205 
3206 /* dedupe tracepoints */
3207 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3208 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3209 
3210 /* ioctl tracepoints */
3211 TRACE_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 */
3239 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
3240 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
3241 
3242 /* copy on write */
3243 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
3244 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc);
3245 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3246 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
3247 DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
3248 
3249 DEFINE_RW_EVENT(xfs_reflink_reserve_cow);
3250 
3251 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write);
3252 DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping);
3253 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec);
3254 
3255 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3256 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3257 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
3258 
3259 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3260 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3261 
3262 
3263 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
3264 
3265 /* rmap swapext tracepoints */
3266 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3267 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3268 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3269 
3270 #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>
3276