Linux 4.9.243
[linux/fpc-iii.git] / fs / xfs / xfs_trace.h
blob42a7c0da898f671e3d7482f3c7f1ed1e23c862ec
1 /*
2 * Copyright (c) 2009, Christoph Hellwig
3 * All Rights Reserved.
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.
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.
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
18 #undef TRACE_SYSTEM
19 #define TRACE_SYSTEM xfs
21 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
22 #define _TRACE_XFS_H
24 #include <linux/tracepoint.h>
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;
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)
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;
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)
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);
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)
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;
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)
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);
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)
149 TP_fast_assign(
150 __entry->dev = mp->m_super->s_dev;
151 __entry->agno = agno;
153 TP_printk("dev %d:%d agno %u",
154 MAJOR(__entry->dev), MINOR(__entry->dev),
155 __entry->agno)
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))
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);
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)
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);
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)
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)
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;
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)
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)
273 TP_fast_assign(
274 struct xfs_ifork *ifp;
275 struct xfs_bmbt_irec r;
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;
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)
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);
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)
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;
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)
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_bawrite);
359 DEFINE_BUF_EVENT(xfs_buf_lock);
360 DEFINE_BUF_EVENT(xfs_buf_lock_done);
361 DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
362 DEFINE_BUF_EVENT(xfs_buf_trylock);
363 DEFINE_BUF_EVENT(xfs_buf_unlock);
364 DEFINE_BUF_EVENT(xfs_buf_iowait);
365 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
366 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
367 DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
368 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
369 DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
370 DEFINE_BUF_EVENT(xfs_buf_get_uncached);
371 DEFINE_BUF_EVENT(xfs_bdstrat_shut);
372 DEFINE_BUF_EVENT(xfs_buf_item_relse);
373 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
374 DEFINE_BUF_EVENT(xfs_buf_error_relse);
375 DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
376 DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
377 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
379 /* not really buffer traces, but the buf provides useful information */
380 DEFINE_BUF_EVENT(xfs_btree_corrupt);
381 DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
382 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
383 DEFINE_BUF_EVENT(xfs_inode_item_push);
385 /* pass flags explicitly */
386 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
387 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
388 TP_ARGS(bp, flags, caller_ip),
389 TP_STRUCT__entry(
390 __field(dev_t, dev)
391 __field(xfs_daddr_t, bno)
392 __field(size_t, buffer_length)
393 __field(int, hold)
394 __field(int, pincount)
395 __field(unsigned, lockval)
396 __field(unsigned, flags)
397 __field(unsigned long, caller_ip)
399 TP_fast_assign(
400 __entry->dev = bp->b_target->bt_dev;
401 __entry->bno = bp->b_bn;
402 __entry->buffer_length = BBTOB(bp->b_length);
403 __entry->flags = flags;
404 __entry->hold = atomic_read(&bp->b_hold);
405 __entry->pincount = atomic_read(&bp->b_pin_count);
406 __entry->lockval = bp->b_sema.count;
407 __entry->caller_ip = caller_ip;
409 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
410 "lock %d flags %s caller %ps",
411 MAJOR(__entry->dev), MINOR(__entry->dev),
412 (unsigned long long)__entry->bno,
413 __entry->buffer_length,
414 __entry->hold,
415 __entry->pincount,
416 __entry->lockval,
417 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
418 (void *)__entry->caller_ip)
421 #define DEFINE_BUF_FLAGS_EVENT(name) \
422 DEFINE_EVENT(xfs_buf_flags_class, name, \
423 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
424 TP_ARGS(bp, flags, caller_ip))
425 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
426 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
427 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
429 TRACE_EVENT(xfs_buf_ioerror,
430 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
431 TP_ARGS(bp, error, caller_ip),
432 TP_STRUCT__entry(
433 __field(dev_t, dev)
434 __field(xfs_daddr_t, bno)
435 __field(size_t, buffer_length)
436 __field(unsigned, flags)
437 __field(int, hold)
438 __field(int, pincount)
439 __field(unsigned, lockval)
440 __field(int, error)
441 __field(unsigned long, caller_ip)
443 TP_fast_assign(
444 __entry->dev = bp->b_target->bt_dev;
445 __entry->bno = bp->b_bn;
446 __entry->buffer_length = BBTOB(bp->b_length);
447 __entry->hold = atomic_read(&bp->b_hold);
448 __entry->pincount = atomic_read(&bp->b_pin_count);
449 __entry->lockval = bp->b_sema.count;
450 __entry->error = error;
451 __entry->flags = bp->b_flags;
452 __entry->caller_ip = caller_ip;
454 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
455 "lock %d error %d flags %s caller %ps",
456 MAJOR(__entry->dev), MINOR(__entry->dev),
457 (unsigned long long)__entry->bno,
458 __entry->buffer_length,
459 __entry->hold,
460 __entry->pincount,
461 __entry->lockval,
462 __entry->error,
463 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
464 (void *)__entry->caller_ip)
467 DECLARE_EVENT_CLASS(xfs_buf_item_class,
468 TP_PROTO(struct xfs_buf_log_item *bip),
469 TP_ARGS(bip),
470 TP_STRUCT__entry(
471 __field(dev_t, dev)
472 __field(xfs_daddr_t, buf_bno)
473 __field(size_t, buf_len)
474 __field(int, buf_hold)
475 __field(int, buf_pincount)
476 __field(int, buf_lockval)
477 __field(unsigned, buf_flags)
478 __field(unsigned, bli_recur)
479 __field(int, bli_refcount)
480 __field(unsigned, bli_flags)
481 __field(void *, li_desc)
482 __field(unsigned, li_flags)
484 TP_fast_assign(
485 __entry->dev = bip->bli_buf->b_target->bt_dev;
486 __entry->bli_flags = bip->bli_flags;
487 __entry->bli_recur = bip->bli_recur;
488 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
489 __entry->buf_bno = bip->bli_buf->b_bn;
490 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
491 __entry->buf_flags = bip->bli_buf->b_flags;
492 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
493 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
494 __entry->buf_lockval = bip->bli_buf->b_sema.count;
495 __entry->li_desc = bip->bli_item.li_desc;
496 __entry->li_flags = bip->bli_item.li_flags;
498 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
499 "lock %d flags %s recur %d refcount %d bliflags %s "
500 "lidesc 0x%p liflags %s",
501 MAJOR(__entry->dev), MINOR(__entry->dev),
502 (unsigned long long)__entry->buf_bno,
503 __entry->buf_len,
504 __entry->buf_hold,
505 __entry->buf_pincount,
506 __entry->buf_lockval,
507 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
508 __entry->bli_recur,
509 __entry->bli_refcount,
510 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
511 __entry->li_desc,
512 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
515 #define DEFINE_BUF_ITEM_EVENT(name) \
516 DEFINE_EVENT(xfs_buf_item_class, name, \
517 TP_PROTO(struct xfs_buf_log_item *bip), \
518 TP_ARGS(bip))
519 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
520 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
521 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
522 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
523 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
524 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
525 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
526 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
527 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
528 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
529 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
530 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
531 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
532 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
533 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
534 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
535 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
536 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
537 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
538 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
539 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
540 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
541 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
542 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
543 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
544 DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
546 DECLARE_EVENT_CLASS(xfs_filestream_class,
547 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
548 TP_ARGS(ip, agno),
549 TP_STRUCT__entry(
550 __field(dev_t, dev)
551 __field(xfs_ino_t, ino)
552 __field(xfs_agnumber_t, agno)
553 __field(int, streams)
555 TP_fast_assign(
556 __entry->dev = VFS_I(ip)->i_sb->s_dev;
557 __entry->ino = ip->i_ino;
558 __entry->agno = agno;
559 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
561 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
562 MAJOR(__entry->dev), MINOR(__entry->dev),
563 __entry->ino,
564 __entry->agno,
565 __entry->streams)
567 #define DEFINE_FILESTREAM_EVENT(name) \
568 DEFINE_EVENT(xfs_filestream_class, name, \
569 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
570 TP_ARGS(ip, agno))
571 DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
572 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
573 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
575 TRACE_EVENT(xfs_filestream_pick,
576 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
577 xfs_extlen_t free, int nscan),
578 TP_ARGS(ip, agno, free, nscan),
579 TP_STRUCT__entry(
580 __field(dev_t, dev)
581 __field(xfs_ino_t, ino)
582 __field(xfs_agnumber_t, agno)
583 __field(int, streams)
584 __field(xfs_extlen_t, free)
585 __field(int, nscan)
587 TP_fast_assign(
588 __entry->dev = VFS_I(ip)->i_sb->s_dev;
589 __entry->ino = ip->i_ino;
590 __entry->agno = agno;
591 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
592 __entry->free = free;
593 __entry->nscan = nscan;
595 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
596 MAJOR(__entry->dev), MINOR(__entry->dev),
597 __entry->ino,
598 __entry->agno,
599 __entry->streams,
600 __entry->free,
601 __entry->nscan)
604 DECLARE_EVENT_CLASS(xfs_lock_class,
605 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
606 unsigned long caller_ip),
607 TP_ARGS(ip, lock_flags, caller_ip),
608 TP_STRUCT__entry(
609 __field(dev_t, dev)
610 __field(xfs_ino_t, ino)
611 __field(int, lock_flags)
612 __field(unsigned long, caller_ip)
614 TP_fast_assign(
615 __entry->dev = VFS_I(ip)->i_sb->s_dev;
616 __entry->ino = ip->i_ino;
617 __entry->lock_flags = lock_flags;
618 __entry->caller_ip = caller_ip;
620 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
621 MAJOR(__entry->dev), MINOR(__entry->dev),
622 __entry->ino,
623 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
624 (void *)__entry->caller_ip)
627 #define DEFINE_LOCK_EVENT(name) \
628 DEFINE_EVENT(xfs_lock_class, name, \
629 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
630 unsigned long caller_ip), \
631 TP_ARGS(ip, lock_flags, caller_ip))
632 DEFINE_LOCK_EVENT(xfs_ilock);
633 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
634 DEFINE_LOCK_EVENT(xfs_ilock_demote);
635 DEFINE_LOCK_EVENT(xfs_iunlock);
637 DECLARE_EVENT_CLASS(xfs_inode_class,
638 TP_PROTO(struct xfs_inode *ip),
639 TP_ARGS(ip),
640 TP_STRUCT__entry(
641 __field(dev_t, dev)
642 __field(xfs_ino_t, ino)
644 TP_fast_assign(
645 __entry->dev = VFS_I(ip)->i_sb->s_dev;
646 __entry->ino = ip->i_ino;
648 TP_printk("dev %d:%d ino 0x%llx",
649 MAJOR(__entry->dev), MINOR(__entry->dev),
650 __entry->ino)
653 #define DEFINE_INODE_EVENT(name) \
654 DEFINE_EVENT(xfs_inode_class, name, \
655 TP_PROTO(struct xfs_inode *ip), \
656 TP_ARGS(ip))
657 DEFINE_INODE_EVENT(xfs_iget_skip);
658 DEFINE_INODE_EVENT(xfs_iget_reclaim);
659 DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
660 DEFINE_INODE_EVENT(xfs_iget_hit);
661 DEFINE_INODE_EVENT(xfs_iget_miss);
663 DEFINE_INODE_EVENT(xfs_getattr);
664 DEFINE_INODE_EVENT(xfs_setattr);
665 DEFINE_INODE_EVENT(xfs_readlink);
666 DEFINE_INODE_EVENT(xfs_inactive_symlink);
667 DEFINE_INODE_EVENT(xfs_alloc_file_space);
668 DEFINE_INODE_EVENT(xfs_free_file_space);
669 DEFINE_INODE_EVENT(xfs_zero_file_space);
670 DEFINE_INODE_EVENT(xfs_collapse_file_space);
671 DEFINE_INODE_EVENT(xfs_insert_file_space);
672 DEFINE_INODE_EVENT(xfs_readdir);
673 #ifdef CONFIG_XFS_POSIX_ACL
674 DEFINE_INODE_EVENT(xfs_get_acl);
675 #endif
676 DEFINE_INODE_EVENT(xfs_vm_bmap);
677 DEFINE_INODE_EVENT(xfs_file_ioctl);
678 DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
679 DEFINE_INODE_EVENT(xfs_ioctl_setattr);
680 DEFINE_INODE_EVENT(xfs_dir_fsync);
681 DEFINE_INODE_EVENT(xfs_file_fsync);
682 DEFINE_INODE_EVENT(xfs_destroy_inode);
683 DEFINE_INODE_EVENT(xfs_evict_inode);
684 DEFINE_INODE_EVENT(xfs_update_time);
686 DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
687 DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
689 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
690 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
691 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
692 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
693 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
694 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
696 DEFINE_INODE_EVENT(xfs_filemap_fault);
697 DEFINE_INODE_EVENT(xfs_filemap_pmd_fault);
698 DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
699 DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
701 DECLARE_EVENT_CLASS(xfs_iref_class,
702 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
703 TP_ARGS(ip, caller_ip),
704 TP_STRUCT__entry(
705 __field(dev_t, dev)
706 __field(xfs_ino_t, ino)
707 __field(int, count)
708 __field(int, pincount)
709 __field(unsigned long, caller_ip)
711 TP_fast_assign(
712 __entry->dev = VFS_I(ip)->i_sb->s_dev;
713 __entry->ino = ip->i_ino;
714 __entry->count = atomic_read(&VFS_I(ip)->i_count);
715 __entry->pincount = atomic_read(&ip->i_pincount);
716 __entry->caller_ip = caller_ip;
718 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
719 MAJOR(__entry->dev), MINOR(__entry->dev),
720 __entry->ino,
721 __entry->count,
722 __entry->pincount,
723 (char *)__entry->caller_ip)
726 TRACE_EVENT(xfs_iomap_prealloc_size,
727 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
728 unsigned int writeio_blocks),
729 TP_ARGS(ip, blocks, shift, writeio_blocks),
730 TP_STRUCT__entry(
731 __field(dev_t, dev)
732 __field(xfs_ino_t, ino)
733 __field(xfs_fsblock_t, blocks)
734 __field(int, shift)
735 __field(unsigned int, writeio_blocks)
737 TP_fast_assign(
738 __entry->dev = VFS_I(ip)->i_sb->s_dev;
739 __entry->ino = ip->i_ino;
740 __entry->blocks = blocks;
741 __entry->shift = shift;
742 __entry->writeio_blocks = writeio_blocks;
744 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
745 "m_writeio_blocks %u",
746 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
747 __entry->blocks, __entry->shift, __entry->writeio_blocks)
750 TRACE_EVENT(xfs_irec_merge_pre,
751 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
752 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
753 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
754 TP_STRUCT__entry(
755 __field(dev_t, dev)
756 __field(xfs_agnumber_t, agno)
757 __field(xfs_agino_t, agino)
758 __field(uint16_t, holemask)
759 __field(xfs_agino_t, nagino)
760 __field(uint16_t, nholemask)
762 TP_fast_assign(
763 __entry->dev = mp->m_super->s_dev;
764 __entry->agno = agno;
765 __entry->agino = agino;
766 __entry->holemask = holemask;
767 __entry->nagino = nagino;
768 __entry->nholemask = holemask;
770 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
771 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
772 __entry->agino, __entry->holemask, __entry->nagino,
773 __entry->nholemask)
776 TRACE_EVENT(xfs_irec_merge_post,
777 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
778 uint16_t holemask),
779 TP_ARGS(mp, agno, agino, holemask),
780 TP_STRUCT__entry(
781 __field(dev_t, dev)
782 __field(xfs_agnumber_t, agno)
783 __field(xfs_agino_t, agino)
784 __field(uint16_t, holemask)
786 TP_fast_assign(
787 __entry->dev = mp->m_super->s_dev;
788 __entry->agno = agno;
789 __entry->agino = agino;
790 __entry->holemask = holemask;
792 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
793 MINOR(__entry->dev), __entry->agno, __entry->agino,
794 __entry->holemask)
797 #define DEFINE_IREF_EVENT(name) \
798 DEFINE_EVENT(xfs_iref_class, name, \
799 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
800 TP_ARGS(ip, caller_ip))
801 DEFINE_IREF_EVENT(xfs_ihold);
802 DEFINE_IREF_EVENT(xfs_irele);
803 DEFINE_IREF_EVENT(xfs_inode_pin);
804 DEFINE_IREF_EVENT(xfs_inode_unpin);
805 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
807 DECLARE_EVENT_CLASS(xfs_namespace_class,
808 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
809 TP_ARGS(dp, name),
810 TP_STRUCT__entry(
811 __field(dev_t, dev)
812 __field(xfs_ino_t, dp_ino)
813 __field(int, namelen)
814 __dynamic_array(char, name, name->len)
816 TP_fast_assign(
817 __entry->dev = VFS_I(dp)->i_sb->s_dev;
818 __entry->dp_ino = dp->i_ino;
819 __entry->namelen = name->len;
820 memcpy(__get_str(name), name->name, name->len);
822 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
823 MAJOR(__entry->dev), MINOR(__entry->dev),
824 __entry->dp_ino,
825 __entry->namelen,
826 __get_str(name))
829 #define DEFINE_NAMESPACE_EVENT(name) \
830 DEFINE_EVENT(xfs_namespace_class, name, \
831 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
832 TP_ARGS(dp, name))
833 DEFINE_NAMESPACE_EVENT(xfs_remove);
834 DEFINE_NAMESPACE_EVENT(xfs_link);
835 DEFINE_NAMESPACE_EVENT(xfs_lookup);
836 DEFINE_NAMESPACE_EVENT(xfs_create);
837 DEFINE_NAMESPACE_EVENT(xfs_symlink);
839 TRACE_EVENT(xfs_rename,
840 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
841 struct xfs_name *src_name, struct xfs_name *target_name),
842 TP_ARGS(src_dp, target_dp, src_name, target_name),
843 TP_STRUCT__entry(
844 __field(dev_t, dev)
845 __field(xfs_ino_t, src_dp_ino)
846 __field(xfs_ino_t, target_dp_ino)
847 __field(int, src_namelen)
848 __field(int, target_namelen)
849 __dynamic_array(char, src_name, src_name->len)
850 __dynamic_array(char, target_name, target_name->len)
852 TP_fast_assign(
853 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
854 __entry->src_dp_ino = src_dp->i_ino;
855 __entry->target_dp_ino = target_dp->i_ino;
856 __entry->src_namelen = src_name->len;
857 __entry->target_namelen = target_name->len;
858 memcpy(__get_str(src_name), src_name->name, src_name->len);
859 memcpy(__get_str(target_name), target_name->name,
860 target_name->len);
862 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
863 " src name %.*s target name %.*s",
864 MAJOR(__entry->dev), MINOR(__entry->dev),
865 __entry->src_dp_ino,
866 __entry->target_dp_ino,
867 __entry->src_namelen,
868 __get_str(src_name),
869 __entry->target_namelen,
870 __get_str(target_name))
873 DECLARE_EVENT_CLASS(xfs_dquot_class,
874 TP_PROTO(struct xfs_dquot *dqp),
875 TP_ARGS(dqp),
876 TP_STRUCT__entry(
877 __field(dev_t, dev)
878 __field(u32, id)
879 __field(unsigned, flags)
880 __field(unsigned, nrefs)
881 __field(unsigned long long, res_bcount)
882 __field(unsigned long long, bcount)
883 __field(unsigned long long, icount)
884 __field(unsigned long long, blk_hardlimit)
885 __field(unsigned long long, blk_softlimit)
886 __field(unsigned long long, ino_hardlimit)
887 __field(unsigned long long, ino_softlimit)
888 ), \
889 TP_fast_assign(
890 __entry->dev = dqp->q_mount->m_super->s_dev;
891 __entry->id = be32_to_cpu(dqp->q_core.d_id);
892 __entry->flags = dqp->dq_flags;
893 __entry->nrefs = dqp->q_nrefs;
894 __entry->res_bcount = dqp->q_res_bcount;
895 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
896 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
897 __entry->blk_hardlimit =
898 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
899 __entry->blk_softlimit =
900 be64_to_cpu(dqp->q_core.d_blk_softlimit);
901 __entry->ino_hardlimit =
902 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
903 __entry->ino_softlimit =
904 be64_to_cpu(dqp->q_core.d_ino_softlimit);
906 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
907 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
908 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
909 MAJOR(__entry->dev), MINOR(__entry->dev),
910 __entry->id,
911 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
912 __entry->nrefs,
913 __entry->res_bcount,
914 __entry->bcount,
915 __entry->blk_hardlimit,
916 __entry->blk_softlimit,
917 __entry->icount,
918 __entry->ino_hardlimit,
919 __entry->ino_softlimit)
922 #define DEFINE_DQUOT_EVENT(name) \
923 DEFINE_EVENT(xfs_dquot_class, name, \
924 TP_PROTO(struct xfs_dquot *dqp), \
925 TP_ARGS(dqp))
926 DEFINE_DQUOT_EVENT(xfs_dqadjust);
927 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
928 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
929 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
930 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
931 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
932 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
933 DEFINE_DQUOT_EVENT(xfs_dqalloc);
934 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
935 DEFINE_DQUOT_EVENT(xfs_dqread);
936 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
937 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
938 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
939 DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
940 DEFINE_DQUOT_EVENT(xfs_dqget_dup);
941 DEFINE_DQUOT_EVENT(xfs_dqput);
942 DEFINE_DQUOT_EVENT(xfs_dqput_wait);
943 DEFINE_DQUOT_EVENT(xfs_dqput_free);
944 DEFINE_DQUOT_EVENT(xfs_dqrele);
945 DEFINE_DQUOT_EVENT(xfs_dqflush);
946 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
947 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
949 DECLARE_EVENT_CLASS(xfs_loggrant_class,
950 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
951 TP_ARGS(log, tic),
952 TP_STRUCT__entry(
953 __field(dev_t, dev)
954 __field(char, ocnt)
955 __field(char, cnt)
956 __field(int, curr_res)
957 __field(int, unit_res)
958 __field(unsigned int, flags)
959 __field(int, reserveq)
960 __field(int, writeq)
961 __field(int, grant_reserve_cycle)
962 __field(int, grant_reserve_bytes)
963 __field(int, grant_write_cycle)
964 __field(int, grant_write_bytes)
965 __field(int, curr_cycle)
966 __field(int, curr_block)
967 __field(xfs_lsn_t, tail_lsn)
969 TP_fast_assign(
970 __entry->dev = log->l_mp->m_super->s_dev;
971 __entry->ocnt = tic->t_ocnt;
972 __entry->cnt = tic->t_cnt;
973 __entry->curr_res = tic->t_curr_res;
974 __entry->unit_res = tic->t_unit_res;
975 __entry->flags = tic->t_flags;
976 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
977 __entry->writeq = list_empty(&log->l_write_head.waiters);
978 xlog_crack_grant_head(&log->l_reserve_head.grant,
979 &__entry->grant_reserve_cycle,
980 &__entry->grant_reserve_bytes);
981 xlog_crack_grant_head(&log->l_write_head.grant,
982 &__entry->grant_write_cycle,
983 &__entry->grant_write_bytes);
984 __entry->curr_cycle = log->l_curr_cycle;
985 __entry->curr_block = log->l_curr_block;
986 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
988 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
989 "t_unit_res %u t_flags %s reserveq %s "
990 "writeq %s grant_reserve_cycle %d "
991 "grant_reserve_bytes %d grant_write_cycle %d "
992 "grant_write_bytes %d curr_cycle %d curr_block %d "
993 "tail_cycle %d tail_block %d",
994 MAJOR(__entry->dev), MINOR(__entry->dev),
995 __entry->ocnt,
996 __entry->cnt,
997 __entry->curr_res,
998 __entry->unit_res,
999 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
1000 __entry->reserveq ? "empty" : "active",
1001 __entry->writeq ? "empty" : "active",
1002 __entry->grant_reserve_cycle,
1003 __entry->grant_reserve_bytes,
1004 __entry->grant_write_cycle,
1005 __entry->grant_write_bytes,
1006 __entry->curr_cycle,
1007 __entry->curr_block,
1008 CYCLE_LSN(__entry->tail_lsn),
1009 BLOCK_LSN(__entry->tail_lsn)
1013 #define DEFINE_LOGGRANT_EVENT(name) \
1014 DEFINE_EVENT(xfs_loggrant_class, name, \
1015 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1016 TP_ARGS(log, tic))
1017 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1018 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
1019 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1020 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1021 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1022 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1023 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1024 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1025 DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1026 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1027 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1028 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1029 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1030 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1031 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1032 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1034 DECLARE_EVENT_CLASS(xfs_log_item_class,
1035 TP_PROTO(struct xfs_log_item *lip),
1036 TP_ARGS(lip),
1037 TP_STRUCT__entry(
1038 __field(dev_t, dev)
1039 __field(void *, lip)
1040 __field(uint, type)
1041 __field(uint, flags)
1042 __field(xfs_lsn_t, lsn)
1044 TP_fast_assign(
1045 __entry->dev = lip->li_mountp->m_super->s_dev;
1046 __entry->lip = lip;
1047 __entry->type = lip->li_type;
1048 __entry->flags = lip->li_flags;
1049 __entry->lsn = lip->li_lsn;
1051 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1052 MAJOR(__entry->dev), MINOR(__entry->dev),
1053 __entry->lip,
1054 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1055 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1056 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1059 TRACE_EVENT(xfs_log_force,
1060 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1061 TP_ARGS(mp, lsn, caller_ip),
1062 TP_STRUCT__entry(
1063 __field(dev_t, dev)
1064 __field(xfs_lsn_t, lsn)
1065 __field(unsigned long, caller_ip)
1067 TP_fast_assign(
1068 __entry->dev = mp->m_super->s_dev;
1069 __entry->lsn = lsn;
1070 __entry->caller_ip = caller_ip;
1072 TP_printk("dev %d:%d lsn 0x%llx caller %ps",
1073 MAJOR(__entry->dev), MINOR(__entry->dev),
1074 __entry->lsn, (void *)__entry->caller_ip)
1077 #define DEFINE_LOG_ITEM_EVENT(name) \
1078 DEFINE_EVENT(xfs_log_item_class, name, \
1079 TP_PROTO(struct xfs_log_item *lip), \
1080 TP_ARGS(lip))
1081 DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1082 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1083 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1084 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1086 DECLARE_EVENT_CLASS(xfs_ail_class,
1087 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1088 TP_ARGS(lip, old_lsn, new_lsn),
1089 TP_STRUCT__entry(
1090 __field(dev_t, dev)
1091 __field(void *, lip)
1092 __field(uint, type)
1093 __field(uint, flags)
1094 __field(xfs_lsn_t, old_lsn)
1095 __field(xfs_lsn_t, new_lsn)
1097 TP_fast_assign(
1098 __entry->dev = lip->li_mountp->m_super->s_dev;
1099 __entry->lip = lip;
1100 __entry->type = lip->li_type;
1101 __entry->flags = lip->li_flags;
1102 __entry->old_lsn = old_lsn;
1103 __entry->new_lsn = new_lsn;
1105 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1106 MAJOR(__entry->dev), MINOR(__entry->dev),
1107 __entry->lip,
1108 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1109 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1110 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1111 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1114 #define DEFINE_AIL_EVENT(name) \
1115 DEFINE_EVENT(xfs_ail_class, name, \
1116 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1117 TP_ARGS(lip, old_lsn, new_lsn))
1118 DEFINE_AIL_EVENT(xfs_ail_insert);
1119 DEFINE_AIL_EVENT(xfs_ail_move);
1120 DEFINE_AIL_EVENT(xfs_ail_delete);
1122 TRACE_EVENT(xfs_log_assign_tail_lsn,
1123 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1124 TP_ARGS(log, new_lsn),
1125 TP_STRUCT__entry(
1126 __field(dev_t, dev)
1127 __field(xfs_lsn_t, new_lsn)
1128 __field(xfs_lsn_t, old_lsn)
1129 __field(xfs_lsn_t, last_sync_lsn)
1131 TP_fast_assign(
1132 __entry->dev = log->l_mp->m_super->s_dev;
1133 __entry->new_lsn = new_lsn;
1134 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1135 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1137 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1138 MAJOR(__entry->dev), MINOR(__entry->dev),
1139 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1140 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1141 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1144 DECLARE_EVENT_CLASS(xfs_file_class,
1145 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1146 TP_ARGS(ip, count, offset),
1147 TP_STRUCT__entry(
1148 __field(dev_t, dev)
1149 __field(xfs_ino_t, ino)
1150 __field(xfs_fsize_t, size)
1151 __field(loff_t, offset)
1152 __field(size_t, count)
1154 TP_fast_assign(
1155 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1156 __entry->ino = ip->i_ino;
1157 __entry->size = ip->i_d.di_size;
1158 __entry->offset = offset;
1159 __entry->count = count;
1161 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
1162 MAJOR(__entry->dev), MINOR(__entry->dev),
1163 __entry->ino,
1164 __entry->size,
1165 __entry->offset,
1166 __entry->count)
1169 #define DEFINE_RW_EVENT(name) \
1170 DEFINE_EVENT(xfs_file_class, name, \
1171 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1172 TP_ARGS(ip, count, offset))
1173 DEFINE_RW_EVENT(xfs_file_buffered_read);
1174 DEFINE_RW_EVENT(xfs_file_direct_read);
1175 DEFINE_RW_EVENT(xfs_file_dax_read);
1176 DEFINE_RW_EVENT(xfs_file_buffered_write);
1177 DEFINE_RW_EVENT(xfs_file_direct_write);
1178 DEFINE_RW_EVENT(xfs_file_dax_write);
1180 DECLARE_EVENT_CLASS(xfs_page_class,
1181 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1182 unsigned int len),
1183 TP_ARGS(inode, page, off, len),
1184 TP_STRUCT__entry(
1185 __field(dev_t, dev)
1186 __field(xfs_ino_t, ino)
1187 __field(pgoff_t, pgoff)
1188 __field(loff_t, size)
1189 __field(unsigned long, offset)
1190 __field(unsigned int, length)
1191 __field(int, delalloc)
1192 __field(int, unwritten)
1194 TP_fast_assign(
1195 int delalloc = -1, unwritten = -1;
1197 if (page_has_buffers(page))
1198 xfs_count_page_state(page, &delalloc, &unwritten);
1199 __entry->dev = inode->i_sb->s_dev;
1200 __entry->ino = XFS_I(inode)->i_ino;
1201 __entry->pgoff = page_offset(page);
1202 __entry->size = i_size_read(inode);
1203 __entry->offset = off;
1204 __entry->length = len;
1205 __entry->delalloc = delalloc;
1206 __entry->unwritten = unwritten;
1208 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
1209 "length %x delalloc %d unwritten %d",
1210 MAJOR(__entry->dev), MINOR(__entry->dev),
1211 __entry->ino,
1212 __entry->pgoff,
1213 __entry->size,
1214 __entry->offset,
1215 __entry->length,
1216 __entry->delalloc,
1217 __entry->unwritten)
1220 #define DEFINE_PAGE_EVENT(name) \
1221 DEFINE_EVENT(xfs_page_class, name, \
1222 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1223 unsigned int len), \
1224 TP_ARGS(inode, page, off, len))
1225 DEFINE_PAGE_EVENT(xfs_writepage);
1226 DEFINE_PAGE_EVENT(xfs_releasepage);
1227 DEFINE_PAGE_EVENT(xfs_invalidatepage);
1229 DECLARE_EVENT_CLASS(xfs_readpage_class,
1230 TP_PROTO(struct inode *inode, int nr_pages),
1231 TP_ARGS(inode, nr_pages),
1232 TP_STRUCT__entry(
1233 __field(dev_t, dev)
1234 __field(xfs_ino_t, ino)
1235 __field(int, nr_pages)
1237 TP_fast_assign(
1238 __entry->dev = inode->i_sb->s_dev;
1239 __entry->ino = inode->i_ino;
1240 __entry->nr_pages = nr_pages;
1242 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1243 MAJOR(__entry->dev), MINOR(__entry->dev),
1244 __entry->ino,
1245 __entry->nr_pages)
1248 #define DEFINE_READPAGE_EVENT(name) \
1249 DEFINE_EVENT(xfs_readpage_class, name, \
1250 TP_PROTO(struct inode *inode, int nr_pages), \
1251 TP_ARGS(inode, nr_pages))
1252 DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1253 DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1255 DECLARE_EVENT_CLASS(xfs_imap_class,
1256 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1257 int type, struct xfs_bmbt_irec *irec),
1258 TP_ARGS(ip, offset, count, type, irec),
1259 TP_STRUCT__entry(
1260 __field(dev_t, dev)
1261 __field(xfs_ino_t, ino)
1262 __field(loff_t, size)
1263 __field(loff_t, offset)
1264 __field(size_t, count)
1265 __field(int, type)
1266 __field(xfs_fileoff_t, startoff)
1267 __field(xfs_fsblock_t, startblock)
1268 __field(xfs_filblks_t, blockcount)
1270 TP_fast_assign(
1271 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1272 __entry->ino = ip->i_ino;
1273 __entry->size = ip->i_d.di_size;
1274 __entry->offset = offset;
1275 __entry->count = count;
1276 __entry->type = type;
1277 __entry->startoff = irec ? irec->br_startoff : 0;
1278 __entry->startblock = irec ? irec->br_startblock : 0;
1279 __entry->blockcount = irec ? irec->br_blockcount : 0;
1281 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1282 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
1283 MAJOR(__entry->dev), MINOR(__entry->dev),
1284 __entry->ino,
1285 __entry->size,
1286 __entry->offset,
1287 __entry->count,
1288 __print_symbolic(__entry->type, XFS_IO_TYPES),
1289 __entry->startoff,
1290 (__int64_t)__entry->startblock,
1291 __entry->blockcount)
1294 #define DEFINE_IOMAP_EVENT(name) \
1295 DEFINE_EVENT(xfs_imap_class, name, \
1296 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1297 int type, struct xfs_bmbt_irec *irec), \
1298 TP_ARGS(ip, offset, count, type, irec))
1299 DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1300 DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1301 DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1302 DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
1303 DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
1304 DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
1305 DEFINE_IOMAP_EVENT(xfs_iomap_found);
1307 DECLARE_EVENT_CLASS(xfs_simple_io_class,
1308 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1309 TP_ARGS(ip, offset, count),
1310 TP_STRUCT__entry(
1311 __field(dev_t, dev)
1312 __field(xfs_ino_t, ino)
1313 __field(loff_t, isize)
1314 __field(loff_t, disize)
1315 __field(loff_t, offset)
1316 __field(size_t, count)
1318 TP_fast_assign(
1319 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1320 __entry->ino = ip->i_ino;
1321 __entry->isize = VFS_I(ip)->i_size;
1322 __entry->disize = ip->i_d.di_size;
1323 __entry->offset = offset;
1324 __entry->count = count;
1326 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1327 "offset 0x%llx count %zd",
1328 MAJOR(__entry->dev), MINOR(__entry->dev),
1329 __entry->ino,
1330 __entry->isize,
1331 __entry->disize,
1332 __entry->offset,
1333 __entry->count)
1336 #define DEFINE_SIMPLE_IO_EVENT(name) \
1337 DEFINE_EVENT(xfs_simple_io_class, name, \
1338 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1339 TP_ARGS(ip, offset, count))
1340 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1341 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1342 DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
1343 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1344 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1345 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1346 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1347 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1349 DECLARE_EVENT_CLASS(xfs_itrunc_class,
1350 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1351 TP_ARGS(ip, new_size),
1352 TP_STRUCT__entry(
1353 __field(dev_t, dev)
1354 __field(xfs_ino_t, ino)
1355 __field(xfs_fsize_t, size)
1356 __field(xfs_fsize_t, new_size)
1358 TP_fast_assign(
1359 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1360 __entry->ino = ip->i_ino;
1361 __entry->size = ip->i_d.di_size;
1362 __entry->new_size = new_size;
1364 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1365 MAJOR(__entry->dev), MINOR(__entry->dev),
1366 __entry->ino,
1367 __entry->size,
1368 __entry->new_size)
1371 #define DEFINE_ITRUNC_EVENT(name) \
1372 DEFINE_EVENT(xfs_itrunc_class, name, \
1373 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1374 TP_ARGS(ip, new_size))
1375 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1376 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1378 TRACE_EVENT(xfs_pagecache_inval,
1379 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1380 TP_ARGS(ip, start, finish),
1381 TP_STRUCT__entry(
1382 __field(dev_t, dev)
1383 __field(xfs_ino_t, ino)
1384 __field(xfs_fsize_t, size)
1385 __field(xfs_off_t, start)
1386 __field(xfs_off_t, finish)
1388 TP_fast_assign(
1389 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1390 __entry->ino = ip->i_ino;
1391 __entry->size = ip->i_d.di_size;
1392 __entry->start = start;
1393 __entry->finish = finish;
1395 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1396 MAJOR(__entry->dev), MINOR(__entry->dev),
1397 __entry->ino,
1398 __entry->size,
1399 __entry->start,
1400 __entry->finish)
1403 TRACE_EVENT(xfs_bunmap,
1404 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1405 int flags, unsigned long caller_ip),
1406 TP_ARGS(ip, bno, len, flags, caller_ip),
1407 TP_STRUCT__entry(
1408 __field(dev_t, dev)
1409 __field(xfs_ino_t, ino)
1410 __field(xfs_fsize_t, size)
1411 __field(xfs_fileoff_t, bno)
1412 __field(xfs_filblks_t, len)
1413 __field(unsigned long, caller_ip)
1414 __field(int, flags)
1416 TP_fast_assign(
1417 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1418 __entry->ino = ip->i_ino;
1419 __entry->size = ip->i_d.di_size;
1420 __entry->bno = bno;
1421 __entry->len = len;
1422 __entry->caller_ip = caller_ip;
1423 __entry->flags = flags;
1425 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1426 "flags %s caller %ps",
1427 MAJOR(__entry->dev), MINOR(__entry->dev),
1428 __entry->ino,
1429 __entry->size,
1430 __entry->bno,
1431 __entry->len,
1432 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1433 (void *)__entry->caller_ip)
1437 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1438 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1439 xfs_agblock_t agbno, xfs_extlen_t len),
1440 TP_ARGS(mp, agno, agbno, len),
1441 TP_STRUCT__entry(
1442 __field(dev_t, dev)
1443 __field(xfs_agnumber_t, agno)
1444 __field(xfs_agblock_t, agbno)
1445 __field(xfs_extlen_t, len)
1447 TP_fast_assign(
1448 __entry->dev = mp->m_super->s_dev;
1449 __entry->agno = agno;
1450 __entry->agbno = agbno;
1451 __entry->len = len;
1453 TP_printk("dev %d:%d agno %u agbno %u len %u",
1454 MAJOR(__entry->dev), MINOR(__entry->dev),
1455 __entry->agno,
1456 __entry->agbno,
1457 __entry->len)
1459 #define DEFINE_BUSY_EVENT(name) \
1460 DEFINE_EVENT(xfs_extent_busy_class, name, \
1461 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1462 xfs_agblock_t agbno, xfs_extlen_t len), \
1463 TP_ARGS(mp, agno, agbno, len))
1464 DEFINE_BUSY_EVENT(xfs_extent_busy);
1465 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1466 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1467 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1468 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1470 TRACE_EVENT(xfs_extent_busy_trim,
1471 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1472 xfs_agblock_t agbno, xfs_extlen_t len,
1473 xfs_agblock_t tbno, xfs_extlen_t tlen),
1474 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1475 TP_STRUCT__entry(
1476 __field(dev_t, dev)
1477 __field(xfs_agnumber_t, agno)
1478 __field(xfs_agblock_t, agbno)
1479 __field(xfs_extlen_t, len)
1480 __field(xfs_agblock_t, tbno)
1481 __field(xfs_extlen_t, tlen)
1483 TP_fast_assign(
1484 __entry->dev = mp->m_super->s_dev;
1485 __entry->agno = agno;
1486 __entry->agbno = agbno;
1487 __entry->len = len;
1488 __entry->tbno = tbno;
1489 __entry->tlen = tlen;
1491 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1492 MAJOR(__entry->dev), MINOR(__entry->dev),
1493 __entry->agno,
1494 __entry->agbno,
1495 __entry->len,
1496 __entry->tbno,
1497 __entry->tlen)
1500 TRACE_EVENT(xfs_trans_commit_lsn,
1501 TP_PROTO(struct xfs_trans *trans),
1502 TP_ARGS(trans),
1503 TP_STRUCT__entry(
1504 __field(dev_t, dev)
1505 __field(struct xfs_trans *, tp)
1506 __field(xfs_lsn_t, lsn)
1508 TP_fast_assign(
1509 __entry->dev = trans->t_mountp->m_super->s_dev;
1510 __entry->tp = trans;
1511 __entry->lsn = trans->t_commit_lsn;
1513 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1514 MAJOR(__entry->dev), MINOR(__entry->dev),
1515 __entry->tp,
1516 __entry->lsn)
1519 DECLARE_EVENT_CLASS(xfs_agf_class,
1520 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1521 unsigned long caller_ip),
1522 TP_ARGS(mp, agf, flags, caller_ip),
1523 TP_STRUCT__entry(
1524 __field(dev_t, dev)
1525 __field(xfs_agnumber_t, agno)
1526 __field(int, flags)
1527 __field(__u32, length)
1528 __field(__u32, bno_root)
1529 __field(__u32, cnt_root)
1530 __field(__u32, bno_level)
1531 __field(__u32, cnt_level)
1532 __field(__u32, flfirst)
1533 __field(__u32, fllast)
1534 __field(__u32, flcount)
1535 __field(__u32, freeblks)
1536 __field(__u32, longest)
1537 __field(unsigned long, caller_ip)
1539 TP_fast_assign(
1540 __entry->dev = mp->m_super->s_dev;
1541 __entry->agno = be32_to_cpu(agf->agf_seqno),
1542 __entry->flags = flags;
1543 __entry->length = be32_to_cpu(agf->agf_length),
1544 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1545 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1546 __entry->bno_level =
1547 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1548 __entry->cnt_level =
1549 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1550 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1551 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1552 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1553 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1554 __entry->longest = be32_to_cpu(agf->agf_longest);
1555 __entry->caller_ip = caller_ip;
1557 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1558 "levels b %u c %u flfirst %u fllast %u flcount %u "
1559 "freeblks %u longest %u caller %ps",
1560 MAJOR(__entry->dev), MINOR(__entry->dev),
1561 __entry->agno,
1562 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1563 __entry->length,
1564 __entry->bno_root,
1565 __entry->cnt_root,
1566 __entry->bno_level,
1567 __entry->cnt_level,
1568 __entry->flfirst,
1569 __entry->fllast,
1570 __entry->flcount,
1571 __entry->freeblks,
1572 __entry->longest,
1573 (void *)__entry->caller_ip)
1575 #define DEFINE_AGF_EVENT(name) \
1576 DEFINE_EVENT(xfs_agf_class, name, \
1577 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1578 unsigned long caller_ip), \
1579 TP_ARGS(mp, agf, flags, caller_ip))
1580 DEFINE_AGF_EVENT(xfs_agf);
1581 DEFINE_AGF_EVENT(xfs_agfl_reset);
1583 TRACE_EVENT(xfs_free_extent,
1584 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1585 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1586 int haveright),
1587 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
1588 TP_STRUCT__entry(
1589 __field(dev_t, dev)
1590 __field(xfs_agnumber_t, agno)
1591 __field(xfs_agblock_t, agbno)
1592 __field(xfs_extlen_t, len)
1593 __field(int, resv)
1594 __field(int, haveleft)
1595 __field(int, haveright)
1597 TP_fast_assign(
1598 __entry->dev = mp->m_super->s_dev;
1599 __entry->agno = agno;
1600 __entry->agbno = agbno;
1601 __entry->len = len;
1602 __entry->resv = resv;
1603 __entry->haveleft = haveleft;
1604 __entry->haveright = haveright;
1606 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
1607 MAJOR(__entry->dev), MINOR(__entry->dev),
1608 __entry->agno,
1609 __entry->agbno,
1610 __entry->len,
1611 __entry->resv,
1612 __entry->haveleft ?
1613 (__entry->haveright ? "both" : "left") :
1614 (__entry->haveright ? "right" : "none"))
1618 DECLARE_EVENT_CLASS(xfs_alloc_class,
1619 TP_PROTO(struct xfs_alloc_arg *args),
1620 TP_ARGS(args),
1621 TP_STRUCT__entry(
1622 __field(dev_t, dev)
1623 __field(xfs_agnumber_t, agno)
1624 __field(xfs_agblock_t, agbno)
1625 __field(xfs_extlen_t, minlen)
1626 __field(xfs_extlen_t, maxlen)
1627 __field(xfs_extlen_t, mod)
1628 __field(xfs_extlen_t, prod)
1629 __field(xfs_extlen_t, minleft)
1630 __field(xfs_extlen_t, total)
1631 __field(xfs_extlen_t, alignment)
1632 __field(xfs_extlen_t, minalignslop)
1633 __field(xfs_extlen_t, len)
1634 __field(short, type)
1635 __field(short, otype)
1636 __field(char, wasdel)
1637 __field(char, wasfromfl)
1638 __field(int, resv)
1639 __field(int, datatype)
1640 __field(xfs_fsblock_t, firstblock)
1642 TP_fast_assign(
1643 __entry->dev = args->mp->m_super->s_dev;
1644 __entry->agno = args->agno;
1645 __entry->agbno = args->agbno;
1646 __entry->minlen = args->minlen;
1647 __entry->maxlen = args->maxlen;
1648 __entry->mod = args->mod;
1649 __entry->prod = args->prod;
1650 __entry->minleft = args->minleft;
1651 __entry->total = args->total;
1652 __entry->alignment = args->alignment;
1653 __entry->minalignslop = args->minalignslop;
1654 __entry->len = args->len;
1655 __entry->type = args->type;
1656 __entry->otype = args->otype;
1657 __entry->wasdel = args->wasdel;
1658 __entry->wasfromfl = args->wasfromfl;
1659 __entry->resv = args->resv;
1660 __entry->datatype = args->datatype;
1661 __entry->firstblock = args->firstblock;
1663 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1664 "prod %u minleft %u total %u alignment %u minalignslop %u "
1665 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1666 "datatype 0x%x firstblock 0x%llx",
1667 MAJOR(__entry->dev), MINOR(__entry->dev),
1668 __entry->agno,
1669 __entry->agbno,
1670 __entry->minlen,
1671 __entry->maxlen,
1672 __entry->mod,
1673 __entry->prod,
1674 __entry->minleft,
1675 __entry->total,
1676 __entry->alignment,
1677 __entry->minalignslop,
1678 __entry->len,
1679 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1680 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1681 __entry->wasdel,
1682 __entry->wasfromfl,
1683 __entry->resv,
1684 __entry->datatype,
1685 (unsigned long long)__entry->firstblock)
1688 #define DEFINE_ALLOC_EVENT(name) \
1689 DEFINE_EVENT(xfs_alloc_class, name, \
1690 TP_PROTO(struct xfs_alloc_arg *args), \
1691 TP_ARGS(args))
1692 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1693 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1694 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1695 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1696 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1697 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1698 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1699 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1700 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1701 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1702 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1703 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1704 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1705 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1706 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1707 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1708 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1709 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1710 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1711 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1712 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1713 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1714 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1715 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1716 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1718 DECLARE_EVENT_CLASS(xfs_da_class,
1719 TP_PROTO(struct xfs_da_args *args),
1720 TP_ARGS(args),
1721 TP_STRUCT__entry(
1722 __field(dev_t, dev)
1723 __field(xfs_ino_t, ino)
1724 __dynamic_array(char, name, args->namelen)
1725 __field(int, namelen)
1726 __field(xfs_dahash_t, hashval)
1727 __field(xfs_ino_t, inumber)
1728 __field(int, op_flags)
1730 TP_fast_assign(
1731 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1732 __entry->ino = args->dp->i_ino;
1733 if (args->namelen)
1734 memcpy(__get_str(name), args->name, args->namelen);
1735 __entry->namelen = args->namelen;
1736 __entry->hashval = args->hashval;
1737 __entry->inumber = args->inumber;
1738 __entry->op_flags = args->op_flags;
1740 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1741 "inumber 0x%llx op_flags %s",
1742 MAJOR(__entry->dev), MINOR(__entry->dev),
1743 __entry->ino,
1744 __entry->namelen,
1745 __entry->namelen ? __get_str(name) : NULL,
1746 __entry->namelen,
1747 __entry->hashval,
1748 __entry->inumber,
1749 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1752 #define DEFINE_DIR2_EVENT(name) \
1753 DEFINE_EVENT(xfs_da_class, name, \
1754 TP_PROTO(struct xfs_da_args *args), \
1755 TP_ARGS(args))
1756 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1757 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1758 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1759 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1760 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1761 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1762 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1763 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1764 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1765 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1766 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1767 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1768 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1769 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1770 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1771 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1772 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1773 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1774 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1775 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1776 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1777 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1778 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1779 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1780 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1782 DECLARE_EVENT_CLASS(xfs_attr_class,
1783 TP_PROTO(struct xfs_da_args *args),
1784 TP_ARGS(args),
1785 TP_STRUCT__entry(
1786 __field(dev_t, dev)
1787 __field(xfs_ino_t, ino)
1788 __dynamic_array(char, name, args->namelen)
1789 __field(int, namelen)
1790 __field(int, valuelen)
1791 __field(xfs_dahash_t, hashval)
1792 __field(int, op_flags)
1794 TP_fast_assign(
1795 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1796 __entry->ino = args->dp->i_ino;
1797 if (args->namelen)
1798 memcpy(__get_str(name), args->name, args->namelen);
1799 __entry->namelen = args->namelen;
1800 __entry->valuelen = args->valuelen;
1801 __entry->hashval = args->hashval;
1802 __entry->op_flags = args->op_flags;
1804 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1805 "hashval 0x%x op_flags %s",
1806 MAJOR(__entry->dev), MINOR(__entry->dev),
1807 __entry->ino,
1808 __entry->namelen,
1809 __entry->namelen ? __get_str(name) : NULL,
1810 __entry->namelen,
1811 __entry->valuelen,
1812 __entry->hashval,
1813 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1816 #define DEFINE_ATTR_EVENT(name) \
1817 DEFINE_EVENT(xfs_attr_class, name, \
1818 TP_PROTO(struct xfs_da_args *args), \
1819 TP_ARGS(args))
1820 DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1821 DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1822 DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1823 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1824 DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1825 DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1826 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1828 DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1829 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1830 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
1831 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
1832 DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1833 DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
1834 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1835 DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
1836 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1837 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
1838 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
1839 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1840 DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1841 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1842 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1843 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1844 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1845 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1846 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1847 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1848 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1849 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
1850 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
1852 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
1853 DEFINE_ATTR_EVENT(xfs_attr_node_get);
1854 DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1855 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1856 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1858 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1859 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1861 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1862 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1863 DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1865 #define DEFINE_DA_EVENT(name) \
1866 DEFINE_EVENT(xfs_da_class, name, \
1867 TP_PROTO(struct xfs_da_args *args), \
1868 TP_ARGS(args))
1869 DEFINE_DA_EVENT(xfs_da_split);
1870 DEFINE_DA_EVENT(xfs_da_join);
1871 DEFINE_DA_EVENT(xfs_da_link_before);
1872 DEFINE_DA_EVENT(xfs_da_link_after);
1873 DEFINE_DA_EVENT(xfs_da_unlink_back);
1874 DEFINE_DA_EVENT(xfs_da_unlink_forward);
1875 DEFINE_DA_EVENT(xfs_da_root_split);
1876 DEFINE_DA_EVENT(xfs_da_root_join);
1877 DEFINE_DA_EVENT(xfs_da_node_add);
1878 DEFINE_DA_EVENT(xfs_da_node_create);
1879 DEFINE_DA_EVENT(xfs_da_node_split);
1880 DEFINE_DA_EVENT(xfs_da_node_remove);
1881 DEFINE_DA_EVENT(xfs_da_node_rebalance);
1882 DEFINE_DA_EVENT(xfs_da_node_unbalance);
1883 DEFINE_DA_EVENT(xfs_da_node_toosmall);
1884 DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1885 DEFINE_DA_EVENT(xfs_da_grow_inode);
1886 DEFINE_DA_EVENT(xfs_da_shrink_inode);
1887 DEFINE_DA_EVENT(xfs_da_fixhashpath);
1888 DEFINE_DA_EVENT(xfs_da_path_shift);
1890 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1891 TP_PROTO(struct xfs_da_args *args, int idx),
1892 TP_ARGS(args, idx),
1893 TP_STRUCT__entry(
1894 __field(dev_t, dev)
1895 __field(xfs_ino_t, ino)
1896 __field(int, op_flags)
1897 __field(int, idx)
1899 TP_fast_assign(
1900 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1901 __entry->ino = args->dp->i_ino;
1902 __entry->op_flags = args->op_flags;
1903 __entry->idx = idx;
1905 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1906 MAJOR(__entry->dev), MINOR(__entry->dev),
1907 __entry->ino,
1908 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1909 __entry->idx)
1912 #define DEFINE_DIR2_SPACE_EVENT(name) \
1913 DEFINE_EVENT(xfs_dir2_space_class, name, \
1914 TP_PROTO(struct xfs_da_args *args, int idx), \
1915 TP_ARGS(args, idx))
1916 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1917 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1918 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1919 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1921 TRACE_EVENT(xfs_dir2_leafn_moveents,
1922 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1923 TP_ARGS(args, src_idx, dst_idx, count),
1924 TP_STRUCT__entry(
1925 __field(dev_t, dev)
1926 __field(xfs_ino_t, ino)
1927 __field(int, op_flags)
1928 __field(int, src_idx)
1929 __field(int, dst_idx)
1930 __field(int, count)
1932 TP_fast_assign(
1933 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1934 __entry->ino = args->dp->i_ino;
1935 __entry->op_flags = args->op_flags;
1936 __entry->src_idx = src_idx;
1937 __entry->dst_idx = dst_idx;
1938 __entry->count = count;
1940 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1941 "src_idx %d dst_idx %d count %d",
1942 MAJOR(__entry->dev), MINOR(__entry->dev),
1943 __entry->ino,
1944 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1945 __entry->src_idx,
1946 __entry->dst_idx,
1947 __entry->count)
1950 #define XFS_SWAPEXT_INODES \
1951 { 0, "target" }, \
1952 { 1, "temp" }
1954 #define XFS_INODE_FORMAT_STR \
1955 { 0, "invalid" }, \
1956 { 1, "local" }, \
1957 { 2, "extent" }, \
1958 { 3, "btree" }
1960 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1961 TP_PROTO(struct xfs_inode *ip, int which),
1962 TP_ARGS(ip, which),
1963 TP_STRUCT__entry(
1964 __field(dev_t, dev)
1965 __field(int, which)
1966 __field(xfs_ino_t, ino)
1967 __field(int, format)
1968 __field(int, nex)
1969 __field(int, broot_size)
1970 __field(int, fork_off)
1972 TP_fast_assign(
1973 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1974 __entry->which = which;
1975 __entry->ino = ip->i_ino;
1976 __entry->format = ip->i_d.di_format;
1977 __entry->nex = ip->i_d.di_nextents;
1978 __entry->broot_size = ip->i_df.if_broot_bytes;
1979 __entry->fork_off = XFS_IFORK_BOFF(ip);
1981 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1982 "broot size %d, fork offset %d",
1983 MAJOR(__entry->dev), MINOR(__entry->dev),
1984 __entry->ino,
1985 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1986 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1987 __entry->nex,
1988 __entry->broot_size,
1989 __entry->fork_off)
1992 #define DEFINE_SWAPEXT_EVENT(name) \
1993 DEFINE_EVENT(xfs_swap_extent_class, name, \
1994 TP_PROTO(struct xfs_inode *ip, int which), \
1995 TP_ARGS(ip, which))
1997 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1998 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
2000 TRACE_EVENT(xfs_log_recover,
2001 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
2002 TP_ARGS(log, headblk, tailblk),
2003 TP_STRUCT__entry(
2004 __field(dev_t, dev)
2005 __field(xfs_daddr_t, headblk)
2006 __field(xfs_daddr_t, tailblk)
2008 TP_fast_assign(
2009 __entry->dev = log->l_mp->m_super->s_dev;
2010 __entry->headblk = headblk;
2011 __entry->tailblk = tailblk;
2013 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2014 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2015 __entry->tailblk)
2018 TRACE_EVENT(xfs_log_recover_record,
2019 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2020 TP_ARGS(log, rhead, pass),
2021 TP_STRUCT__entry(
2022 __field(dev_t, dev)
2023 __field(xfs_lsn_t, lsn)
2024 __field(int, len)
2025 __field(int, num_logops)
2026 __field(int, pass)
2028 TP_fast_assign(
2029 __entry->dev = log->l_mp->m_super->s_dev;
2030 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2031 __entry->len = be32_to_cpu(rhead->h_len);
2032 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2033 __entry->pass = pass;
2035 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2036 MAJOR(__entry->dev), MINOR(__entry->dev),
2037 __entry->lsn, __entry->len, __entry->num_logops,
2038 __entry->pass)
2041 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2042 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2043 struct xlog_recover_item *item, int pass),
2044 TP_ARGS(log, trans, item, pass),
2045 TP_STRUCT__entry(
2046 __field(dev_t, dev)
2047 __field(unsigned long, item)
2048 __field(xlog_tid_t, tid)
2049 __field(xfs_lsn_t, lsn)
2050 __field(int, type)
2051 __field(int, pass)
2052 __field(int, count)
2053 __field(int, total)
2055 TP_fast_assign(
2056 __entry->dev = log->l_mp->m_super->s_dev;
2057 __entry->item = (unsigned long)item;
2058 __entry->tid = trans->r_log_tid;
2059 __entry->lsn = trans->r_lsn;
2060 __entry->type = ITEM_TYPE(item);
2061 __entry->pass = pass;
2062 __entry->count = item->ri_cnt;
2063 __entry->total = item->ri_total;
2065 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, "
2066 "item type %s item region count/total %d/%d",
2067 MAJOR(__entry->dev), MINOR(__entry->dev),
2068 __entry->tid,
2069 __entry->lsn,
2070 __entry->pass,
2071 (void *)__entry->item,
2072 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2073 __entry->count,
2074 __entry->total)
2077 #define DEFINE_LOG_RECOVER_ITEM(name) \
2078 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2079 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2080 struct xlog_recover_item *item, int pass), \
2081 TP_ARGS(log, trans, item, pass))
2083 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2084 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2085 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2086 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2087 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2089 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2090 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2091 TP_ARGS(log, buf_f),
2092 TP_STRUCT__entry(
2093 __field(dev_t, dev)
2094 __field(__int64_t, blkno)
2095 __field(unsigned short, len)
2096 __field(unsigned short, flags)
2097 __field(unsigned short, size)
2098 __field(unsigned int, map_size)
2100 TP_fast_assign(
2101 __entry->dev = log->l_mp->m_super->s_dev;
2102 __entry->blkno = buf_f->blf_blkno;
2103 __entry->len = buf_f->blf_len;
2104 __entry->flags = buf_f->blf_flags;
2105 __entry->size = buf_f->blf_size;
2106 __entry->map_size = buf_f->blf_map_size;
2108 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2109 "map_size %d",
2110 MAJOR(__entry->dev), MINOR(__entry->dev),
2111 __entry->blkno,
2112 __entry->len,
2113 __entry->flags,
2114 __entry->size,
2115 __entry->map_size)
2118 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2119 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2120 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2121 TP_ARGS(log, buf_f))
2123 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2124 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2125 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2126 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2127 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2128 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2129 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2130 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2131 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2133 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2134 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2135 TP_ARGS(log, in_f),
2136 TP_STRUCT__entry(
2137 __field(dev_t, dev)
2138 __field(xfs_ino_t, ino)
2139 __field(unsigned short, size)
2140 __field(int, fields)
2141 __field(unsigned short, asize)
2142 __field(unsigned short, dsize)
2143 __field(__int64_t, blkno)
2144 __field(int, len)
2145 __field(int, boffset)
2147 TP_fast_assign(
2148 __entry->dev = log->l_mp->m_super->s_dev;
2149 __entry->ino = in_f->ilf_ino;
2150 __entry->size = in_f->ilf_size;
2151 __entry->fields = in_f->ilf_fields;
2152 __entry->asize = in_f->ilf_asize;
2153 __entry->dsize = in_f->ilf_dsize;
2154 __entry->blkno = in_f->ilf_blkno;
2155 __entry->len = in_f->ilf_len;
2156 __entry->boffset = in_f->ilf_boffset;
2158 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2159 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2160 MAJOR(__entry->dev), MINOR(__entry->dev),
2161 __entry->ino,
2162 __entry->size,
2163 __entry->fields,
2164 __entry->asize,
2165 __entry->dsize,
2166 __entry->blkno,
2167 __entry->len,
2168 __entry->boffset)
2170 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2171 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2172 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2173 TP_ARGS(log, in_f))
2175 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2176 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2177 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2179 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2180 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2181 TP_ARGS(log, in_f),
2182 TP_STRUCT__entry(
2183 __field(dev_t, dev)
2184 __field(xfs_agnumber_t, agno)
2185 __field(xfs_agblock_t, agbno)
2186 __field(unsigned int, count)
2187 __field(unsigned int, isize)
2188 __field(xfs_agblock_t, length)
2189 __field(unsigned int, gen)
2191 TP_fast_assign(
2192 __entry->dev = log->l_mp->m_super->s_dev;
2193 __entry->agno = be32_to_cpu(in_f->icl_ag);
2194 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2195 __entry->count = be32_to_cpu(in_f->icl_count);
2196 __entry->isize = be32_to_cpu(in_f->icl_isize);
2197 __entry->length = be32_to_cpu(in_f->icl_length);
2198 __entry->gen = be32_to_cpu(in_f->icl_gen);
2200 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2201 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2202 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2203 __entry->length, __entry->gen)
2205 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2206 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2207 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2208 TP_ARGS(log, in_f))
2210 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2211 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2213 DECLARE_EVENT_CLASS(xfs_discard_class,
2214 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2215 xfs_agblock_t agbno, xfs_extlen_t len),
2216 TP_ARGS(mp, agno, agbno, len),
2217 TP_STRUCT__entry(
2218 __field(dev_t, dev)
2219 __field(xfs_agnumber_t, agno)
2220 __field(xfs_agblock_t, agbno)
2221 __field(xfs_extlen_t, len)
2223 TP_fast_assign(
2224 __entry->dev = mp->m_super->s_dev;
2225 __entry->agno = agno;
2226 __entry->agbno = agbno;
2227 __entry->len = len;
2229 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2230 MAJOR(__entry->dev), MINOR(__entry->dev),
2231 __entry->agno,
2232 __entry->agbno,
2233 __entry->len)
2236 #define DEFINE_DISCARD_EVENT(name) \
2237 DEFINE_EVENT(xfs_discard_class, name, \
2238 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2239 xfs_agblock_t agbno, xfs_extlen_t len), \
2240 TP_ARGS(mp, agno, agbno, len))
2241 DEFINE_DISCARD_EVENT(xfs_discard_extent);
2242 DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2243 DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2244 DEFINE_DISCARD_EVENT(xfs_discard_busy);
2246 /* btree cursor events */
2247 DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2248 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2249 TP_ARGS(cur, level, bp),
2250 TP_STRUCT__entry(
2251 __field(dev_t, dev)
2252 __field(xfs_btnum_t, btnum)
2253 __field(int, level)
2254 __field(int, nlevels)
2255 __field(int, ptr)
2256 __field(xfs_daddr_t, daddr)
2258 TP_fast_assign(
2259 __entry->dev = cur->bc_mp->m_super->s_dev;
2260 __entry->btnum = cur->bc_btnum;
2261 __entry->level = level;
2262 __entry->nlevels = cur->bc_nlevels;
2263 __entry->ptr = cur->bc_ptrs[level];
2264 __entry->daddr = bp ? bp->b_bn : -1;
2266 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2267 MAJOR(__entry->dev), MINOR(__entry->dev),
2268 __entry->btnum,
2269 __entry->level,
2270 __entry->nlevels,
2271 __entry->ptr,
2272 (unsigned long long)__entry->daddr)
2275 #define DEFINE_BTREE_CUR_EVENT(name) \
2276 DEFINE_EVENT(xfs_btree_cur_class, name, \
2277 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2278 TP_ARGS(cur, level, bp))
2279 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2280 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2282 /* deferred ops */
2283 struct xfs_defer_pending;
2284 struct xfs_defer_intake;
2285 struct xfs_defer_ops;
2287 DECLARE_EVENT_CLASS(xfs_defer_class,
2288 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop),
2289 TP_ARGS(mp, dop),
2290 TP_STRUCT__entry(
2291 __field(dev_t, dev)
2292 __field(void *, dop)
2293 __field(bool, committed)
2294 __field(bool, low)
2296 TP_fast_assign(
2297 __entry->dev = mp ? mp->m_super->s_dev : 0;
2298 __entry->dop = dop;
2299 __entry->committed = dop->dop_committed;
2300 __entry->low = dop->dop_low;
2302 TP_printk("dev %d:%d ops %p committed %d low %d\n",
2303 MAJOR(__entry->dev), MINOR(__entry->dev),
2304 __entry->dop,
2305 __entry->committed,
2306 __entry->low)
2308 #define DEFINE_DEFER_EVENT(name) \
2309 DEFINE_EVENT(xfs_defer_class, name, \
2310 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2311 TP_ARGS(mp, dop))
2313 DECLARE_EVENT_CLASS(xfs_defer_error_class,
2314 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
2315 TP_ARGS(mp, dop, error),
2316 TP_STRUCT__entry(
2317 __field(dev_t, dev)
2318 __field(void *, dop)
2319 __field(bool, committed)
2320 __field(bool, low)
2321 __field(int, error)
2323 TP_fast_assign(
2324 __entry->dev = mp ? mp->m_super->s_dev : 0;
2325 __entry->dop = dop;
2326 __entry->committed = dop->dop_committed;
2327 __entry->low = dop->dop_low;
2328 __entry->error = error;
2330 TP_printk("dev %d:%d ops %p committed %d low %d err %d\n",
2331 MAJOR(__entry->dev), MINOR(__entry->dev),
2332 __entry->dop,
2333 __entry->committed,
2334 __entry->low,
2335 __entry->error)
2337 #define DEFINE_DEFER_ERROR_EVENT(name) \
2338 DEFINE_EVENT(xfs_defer_error_class, name, \
2339 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2340 TP_ARGS(mp, dop, error))
2342 DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2343 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2344 TP_ARGS(mp, dfp),
2345 TP_STRUCT__entry(
2346 __field(dev_t, dev)
2347 __field(int, type)
2348 __field(void *, intent)
2349 __field(bool, committed)
2350 __field(int, nr)
2352 TP_fast_assign(
2353 __entry->dev = mp ? mp->m_super->s_dev : 0;
2354 __entry->type = dfp->dfp_type->type;
2355 __entry->intent = dfp->dfp_intent;
2356 __entry->committed = dfp->dfp_done != NULL;
2357 __entry->nr = dfp->dfp_count;
2359 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d\n",
2360 MAJOR(__entry->dev), MINOR(__entry->dev),
2361 __entry->type,
2362 __entry->intent,
2363 __entry->committed,
2364 __entry->nr)
2366 #define DEFINE_DEFER_PENDING_EVENT(name) \
2367 DEFINE_EVENT(xfs_defer_pending_class, name, \
2368 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2369 TP_ARGS(mp, dfp))
2371 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2372 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2373 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2374 TP_ARGS(mp, agno, type, agbno, len),
2375 TP_STRUCT__entry(
2376 __field(dev_t, dev)
2377 __field(xfs_agnumber_t, agno)
2378 __field(int, type)
2379 __field(xfs_agblock_t, agbno)
2380 __field(xfs_extlen_t, len)
2382 TP_fast_assign(
2383 __entry->dev = mp->m_super->s_dev;
2384 __entry->agno = agno;
2385 __entry->type = type;
2386 __entry->agbno = agbno;
2387 __entry->len = len;
2389 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2390 MAJOR(__entry->dev), MINOR(__entry->dev),
2391 __entry->type,
2392 __entry->agno,
2393 __entry->agbno,
2394 __entry->len)
2396 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2397 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2398 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2399 int type, \
2400 xfs_agblock_t bno, \
2401 xfs_extlen_t len), \
2402 TP_ARGS(mp, agno, type, bno, len))
2404 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2405 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2406 int op,
2407 xfs_agblock_t agbno,
2408 xfs_ino_t ino,
2409 int whichfork,
2410 xfs_fileoff_t offset,
2411 xfs_filblks_t len,
2412 xfs_exntst_t state),
2413 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2414 TP_STRUCT__entry(
2415 __field(dev_t, dev)
2416 __field(xfs_agnumber_t, agno)
2417 __field(xfs_ino_t, ino)
2418 __field(xfs_agblock_t, agbno)
2419 __field(int, whichfork)
2420 __field(xfs_fileoff_t, l_loff)
2421 __field(xfs_filblks_t, l_len)
2422 __field(xfs_exntst_t, l_state)
2423 __field(int, op)
2425 TP_fast_assign(
2426 __entry->dev = mp->m_super->s_dev;
2427 __entry->agno = agno;
2428 __entry->ino = ino;
2429 __entry->agbno = agbno;
2430 __entry->whichfork = whichfork;
2431 __entry->l_loff = offset;
2432 __entry->l_len = len;
2433 __entry->l_state = state;
2434 __entry->op = op;
2436 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2437 MAJOR(__entry->dev), MINOR(__entry->dev),
2438 __entry->op,
2439 __entry->agno,
2440 __entry->agbno,
2441 __entry->ino,
2442 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2443 __entry->l_loff,
2444 __entry->l_len,
2445 __entry->l_state)
2447 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2448 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2449 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2450 int op, \
2451 xfs_agblock_t agbno, \
2452 xfs_ino_t ino, \
2453 int whichfork, \
2454 xfs_fileoff_t offset, \
2455 xfs_filblks_t len, \
2456 xfs_exntst_t state), \
2457 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2459 DEFINE_DEFER_EVENT(xfs_defer_init);
2460 DEFINE_DEFER_EVENT(xfs_defer_cancel);
2461 DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2462 DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2463 DEFINE_DEFER_EVENT(xfs_defer_finish);
2464 DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2466 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2467 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2468 DEFINE_DEFER_ERROR_EVENT(xfs_defer_op_finish_error);
2470 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
2471 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
2472 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_commit);
2473 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
2474 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2475 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2477 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2478 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2479 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2481 /* rmap tracepoints */
2482 DECLARE_EVENT_CLASS(xfs_rmap_class,
2483 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2484 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2485 struct xfs_owner_info *oinfo),
2486 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2487 TP_STRUCT__entry(
2488 __field(dev_t, dev)
2489 __field(xfs_agnumber_t, agno)
2490 __field(xfs_agblock_t, agbno)
2491 __field(xfs_extlen_t, len)
2492 __field(uint64_t, owner)
2493 __field(uint64_t, offset)
2494 __field(unsigned long, flags)
2496 TP_fast_assign(
2497 __entry->dev = mp->m_super->s_dev;
2498 __entry->agno = agno;
2499 __entry->agbno = agbno;
2500 __entry->len = len;
2501 __entry->owner = oinfo->oi_owner;
2502 __entry->offset = oinfo->oi_offset;
2503 __entry->flags = oinfo->oi_flags;
2504 if (unwritten)
2505 __entry->flags |= XFS_RMAP_UNWRITTEN;
2507 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2508 MAJOR(__entry->dev), MINOR(__entry->dev),
2509 __entry->agno,
2510 __entry->agbno,
2511 __entry->len,
2512 __entry->owner,
2513 __entry->offset,
2514 __entry->flags)
2516 #define DEFINE_RMAP_EVENT(name) \
2517 DEFINE_EVENT(xfs_rmap_class, name, \
2518 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2519 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2520 struct xfs_owner_info *oinfo), \
2521 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2523 /* simple AG-based error/%ip tracepoint class */
2524 DECLARE_EVENT_CLASS(xfs_ag_error_class,
2525 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2526 unsigned long caller_ip),
2527 TP_ARGS(mp, agno, error, caller_ip),
2528 TP_STRUCT__entry(
2529 __field(dev_t, dev)
2530 __field(xfs_agnumber_t, agno)
2531 __field(int, error)
2532 __field(unsigned long, caller_ip)
2534 TP_fast_assign(
2535 __entry->dev = mp->m_super->s_dev;
2536 __entry->agno = agno;
2537 __entry->error = error;
2538 __entry->caller_ip = caller_ip;
2540 TP_printk("dev %d:%d agno %u error %d caller %ps",
2541 MAJOR(__entry->dev), MINOR(__entry->dev),
2542 __entry->agno,
2543 __entry->error,
2544 (char *)__entry->caller_ip)
2547 #define DEFINE_AG_ERROR_EVENT(name) \
2548 DEFINE_EVENT(xfs_ag_error_class, name, \
2549 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2550 unsigned long caller_ip), \
2551 TP_ARGS(mp, agno, error, caller_ip))
2553 DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2554 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2555 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2556 DEFINE_RMAP_EVENT(xfs_rmap_map);
2557 DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2558 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2559 DEFINE_RMAP_EVENT(xfs_rmap_convert);
2560 DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2561 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2562 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
2564 DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2565 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2566 xfs_agblock_t agbno, xfs_extlen_t len,
2567 uint64_t owner, uint64_t offset, unsigned int flags),
2568 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2569 TP_STRUCT__entry(
2570 __field(dev_t, dev)
2571 __field(xfs_agnumber_t, agno)
2572 __field(xfs_agblock_t, agbno)
2573 __field(xfs_extlen_t, len)
2574 __field(uint64_t, owner)
2575 __field(uint64_t, offset)
2576 __field(unsigned int, flags)
2578 TP_fast_assign(
2579 __entry->dev = mp->m_super->s_dev;
2580 __entry->agno = agno;
2581 __entry->agbno = agbno;
2582 __entry->len = len;
2583 __entry->owner = owner;
2584 __entry->offset = offset;
2585 __entry->flags = flags;
2587 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2588 MAJOR(__entry->dev), MINOR(__entry->dev),
2589 __entry->agno,
2590 __entry->agbno,
2591 __entry->len,
2592 __entry->owner,
2593 __entry->offset,
2594 __entry->flags)
2596 #define DEFINE_RMAPBT_EVENT(name) \
2597 DEFINE_EVENT(xfs_rmapbt_class, name, \
2598 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2599 xfs_agblock_t agbno, xfs_extlen_t len, \
2600 uint64_t owner, uint64_t offset, unsigned int flags), \
2601 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2603 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2604 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2605 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2607 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2608 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
2609 DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2610 DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2611 DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2612 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2613 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2614 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
2616 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2617 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2618 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2619 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
2620 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2621 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
2622 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
2624 /* deferred bmbt updates */
2625 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2626 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2627 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2629 /* per-AG reservation */
2630 DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2631 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2632 xfs_extlen_t len),
2633 TP_ARGS(pag, resv, len),
2634 TP_STRUCT__entry(
2635 __field(dev_t, dev)
2636 __field(xfs_agnumber_t, agno)
2637 __field(int, resv)
2638 __field(xfs_extlen_t, freeblks)
2639 __field(xfs_extlen_t, flcount)
2640 __field(xfs_extlen_t, reserved)
2641 __field(xfs_extlen_t, asked)
2642 __field(xfs_extlen_t, len)
2644 TP_fast_assign(
2645 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2647 __entry->dev = pag->pag_mount->m_super->s_dev;
2648 __entry->agno = pag->pag_agno;
2649 __entry->resv = resv;
2650 __entry->freeblks = pag->pagf_freeblks;
2651 __entry->flcount = pag->pagf_flcount;
2652 __entry->reserved = r ? r->ar_reserved : 0;
2653 __entry->asked = r ? r->ar_asked : 0;
2654 __entry->len = len;
2656 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u resv %u ask %u len %u\n",
2657 MAJOR(__entry->dev), MINOR(__entry->dev),
2658 __entry->agno,
2659 __entry->resv,
2660 __entry->freeblks,
2661 __entry->flcount,
2662 __entry->reserved,
2663 __entry->asked,
2664 __entry->len)
2666 #define DEFINE_AG_RESV_EVENT(name) \
2667 DEFINE_EVENT(xfs_ag_resv_class, name, \
2668 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2669 xfs_extlen_t len), \
2670 TP_ARGS(pag, type, len))
2672 /* per-AG reservation tracepoints */
2673 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2674 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2675 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2676 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2677 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2678 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2680 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2681 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2683 /* refcount tracepoint classes */
2685 /* reuse the discard trace class for agbno/aglen-based traces */
2686 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2688 /* ag btree lookup tracepoint class */
2689 #define XFS_AG_BTREE_CMP_FORMAT_STR \
2690 { XFS_LOOKUP_EQ, "eq" }, \
2691 { XFS_LOOKUP_LE, "le" }, \
2692 { XFS_LOOKUP_GE, "ge" }
2693 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2694 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2695 xfs_agblock_t agbno, xfs_lookup_t dir),
2696 TP_ARGS(mp, agno, agbno, dir),
2697 TP_STRUCT__entry(
2698 __field(dev_t, dev)
2699 __field(xfs_agnumber_t, agno)
2700 __field(xfs_agblock_t, agbno)
2701 __field(xfs_lookup_t, dir)
2703 TP_fast_assign(
2704 __entry->dev = mp->m_super->s_dev;
2705 __entry->agno = agno;
2706 __entry->agbno = agbno;
2707 __entry->dir = dir;
2709 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)\n",
2710 MAJOR(__entry->dev), MINOR(__entry->dev),
2711 __entry->agno,
2712 __entry->agbno,
2713 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2714 __entry->dir)
2717 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2718 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2719 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2720 xfs_agblock_t agbno, xfs_lookup_t dir), \
2721 TP_ARGS(mp, agno, agbno, dir))
2723 /* single-rcext tracepoint class */
2724 DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2725 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2726 struct xfs_refcount_irec *irec),
2727 TP_ARGS(mp, agno, irec),
2728 TP_STRUCT__entry(
2729 __field(dev_t, dev)
2730 __field(xfs_agnumber_t, agno)
2731 __field(xfs_agblock_t, startblock)
2732 __field(xfs_extlen_t, blockcount)
2733 __field(xfs_nlink_t, refcount)
2735 TP_fast_assign(
2736 __entry->dev = mp->m_super->s_dev;
2737 __entry->agno = agno;
2738 __entry->startblock = irec->rc_startblock;
2739 __entry->blockcount = irec->rc_blockcount;
2740 __entry->refcount = irec->rc_refcount;
2742 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u\n",
2743 MAJOR(__entry->dev), MINOR(__entry->dev),
2744 __entry->agno,
2745 __entry->startblock,
2746 __entry->blockcount,
2747 __entry->refcount)
2750 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2751 DEFINE_EVENT(xfs_refcount_extent_class, name, \
2752 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2753 struct xfs_refcount_irec *irec), \
2754 TP_ARGS(mp, agno, irec))
2756 /* single-rcext and an agbno tracepoint class */
2757 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2758 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2759 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2760 TP_ARGS(mp, agno, irec, agbno),
2761 TP_STRUCT__entry(
2762 __field(dev_t, dev)
2763 __field(xfs_agnumber_t, agno)
2764 __field(xfs_agblock_t, startblock)
2765 __field(xfs_extlen_t, blockcount)
2766 __field(xfs_nlink_t, refcount)
2767 __field(xfs_agblock_t, agbno)
2769 TP_fast_assign(
2770 __entry->dev = mp->m_super->s_dev;
2771 __entry->agno = agno;
2772 __entry->startblock = irec->rc_startblock;
2773 __entry->blockcount = irec->rc_blockcount;
2774 __entry->refcount = irec->rc_refcount;
2775 __entry->agbno = agbno;
2777 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u\n",
2778 MAJOR(__entry->dev), MINOR(__entry->dev),
2779 __entry->agno,
2780 __entry->startblock,
2781 __entry->blockcount,
2782 __entry->refcount,
2783 __entry->agbno)
2786 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2787 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2788 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2789 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2790 TP_ARGS(mp, agno, irec, agbno))
2792 /* double-rcext tracepoint class */
2793 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2794 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2795 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2796 TP_ARGS(mp, agno, i1, i2),
2797 TP_STRUCT__entry(
2798 __field(dev_t, dev)
2799 __field(xfs_agnumber_t, agno)
2800 __field(xfs_agblock_t, i1_startblock)
2801 __field(xfs_extlen_t, i1_blockcount)
2802 __field(xfs_nlink_t, i1_refcount)
2803 __field(xfs_agblock_t, i2_startblock)
2804 __field(xfs_extlen_t, i2_blockcount)
2805 __field(xfs_nlink_t, i2_refcount)
2807 TP_fast_assign(
2808 __entry->dev = mp->m_super->s_dev;
2809 __entry->agno = agno;
2810 __entry->i1_startblock = i1->rc_startblock;
2811 __entry->i1_blockcount = i1->rc_blockcount;
2812 __entry->i1_refcount = i1->rc_refcount;
2813 __entry->i2_startblock = i2->rc_startblock;
2814 __entry->i2_blockcount = i2->rc_blockcount;
2815 __entry->i2_refcount = i2->rc_refcount;
2817 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2818 "agbno %u len %u refcount %u\n",
2819 MAJOR(__entry->dev), MINOR(__entry->dev),
2820 __entry->agno,
2821 __entry->i1_startblock,
2822 __entry->i1_blockcount,
2823 __entry->i1_refcount,
2824 __entry->i2_startblock,
2825 __entry->i2_blockcount,
2826 __entry->i2_refcount)
2829 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2830 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2831 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2832 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2833 TP_ARGS(mp, agno, i1, i2))
2835 /* double-rcext and an agbno tracepoint class */
2836 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
2837 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2838 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2839 xfs_agblock_t agbno),
2840 TP_ARGS(mp, agno, i1, i2, agbno),
2841 TP_STRUCT__entry(
2842 __field(dev_t, dev)
2843 __field(xfs_agnumber_t, agno)
2844 __field(xfs_agblock_t, i1_startblock)
2845 __field(xfs_extlen_t, i1_blockcount)
2846 __field(xfs_nlink_t, i1_refcount)
2847 __field(xfs_agblock_t, i2_startblock)
2848 __field(xfs_extlen_t, i2_blockcount)
2849 __field(xfs_nlink_t, i2_refcount)
2850 __field(xfs_agblock_t, agbno)
2852 TP_fast_assign(
2853 __entry->dev = mp->m_super->s_dev;
2854 __entry->agno = agno;
2855 __entry->i1_startblock = i1->rc_startblock;
2856 __entry->i1_blockcount = i1->rc_blockcount;
2857 __entry->i1_refcount = i1->rc_refcount;
2858 __entry->i2_startblock = i2->rc_startblock;
2859 __entry->i2_blockcount = i2->rc_blockcount;
2860 __entry->i2_refcount = i2->rc_refcount;
2861 __entry->agbno = agbno;
2863 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2864 "agbno %u len %u refcount %u @ agbno %u\n",
2865 MAJOR(__entry->dev), MINOR(__entry->dev),
2866 __entry->agno,
2867 __entry->i1_startblock,
2868 __entry->i1_blockcount,
2869 __entry->i1_refcount,
2870 __entry->i2_startblock,
2871 __entry->i2_blockcount,
2872 __entry->i2_refcount,
2873 __entry->agbno)
2876 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2877 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2878 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2879 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2880 xfs_agblock_t agbno), \
2881 TP_ARGS(mp, agno, i1, i2, agbno))
2883 /* triple-rcext tracepoint class */
2884 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
2885 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2886 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2887 struct xfs_refcount_irec *i3),
2888 TP_ARGS(mp, agno, i1, i2, i3),
2889 TP_STRUCT__entry(
2890 __field(dev_t, dev)
2891 __field(xfs_agnumber_t, agno)
2892 __field(xfs_agblock_t, i1_startblock)
2893 __field(xfs_extlen_t, i1_blockcount)
2894 __field(xfs_nlink_t, i1_refcount)
2895 __field(xfs_agblock_t, i2_startblock)
2896 __field(xfs_extlen_t, i2_blockcount)
2897 __field(xfs_nlink_t, i2_refcount)
2898 __field(xfs_agblock_t, i3_startblock)
2899 __field(xfs_extlen_t, i3_blockcount)
2900 __field(xfs_nlink_t, i3_refcount)
2902 TP_fast_assign(
2903 __entry->dev = mp->m_super->s_dev;
2904 __entry->agno = agno;
2905 __entry->i1_startblock = i1->rc_startblock;
2906 __entry->i1_blockcount = i1->rc_blockcount;
2907 __entry->i1_refcount = i1->rc_refcount;
2908 __entry->i2_startblock = i2->rc_startblock;
2909 __entry->i2_blockcount = i2->rc_blockcount;
2910 __entry->i2_refcount = i2->rc_refcount;
2911 __entry->i3_startblock = i3->rc_startblock;
2912 __entry->i3_blockcount = i3->rc_blockcount;
2913 __entry->i3_refcount = i3->rc_refcount;
2915 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2916 "agbno %u len %u refcount %u -- "
2917 "agbno %u len %u refcount %u\n",
2918 MAJOR(__entry->dev), MINOR(__entry->dev),
2919 __entry->agno,
2920 __entry->i1_startblock,
2921 __entry->i1_blockcount,
2922 __entry->i1_refcount,
2923 __entry->i2_startblock,
2924 __entry->i2_blockcount,
2925 __entry->i2_refcount,
2926 __entry->i3_startblock,
2927 __entry->i3_blockcount,
2928 __entry->i3_refcount)
2931 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2932 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
2933 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2934 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2935 struct xfs_refcount_irec *i3), \
2936 TP_ARGS(mp, agno, i1, i2, i3))
2938 /* refcount btree tracepoints */
2939 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
2940 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
2941 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
2942 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
2943 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
2944 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
2945 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
2946 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
2947 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
2948 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
2950 /* refcount adjustment tracepoints */
2951 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
2952 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
2953 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
2954 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
2955 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
2956 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
2957 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
2958 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
2959 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
2960 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
2961 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
2962 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
2963 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
2964 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
2965 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
2966 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
2967 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
2968 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
2969 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
2970 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
2971 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
2973 /* reflink helpers */
2974 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
2975 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
2976 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
2977 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2978 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
2979 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
2981 TRACE_EVENT(xfs_refcount_finish_one_leftover,
2982 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2983 int type, xfs_agblock_t agbno, xfs_extlen_t len,
2984 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
2985 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
2986 TP_STRUCT__entry(
2987 __field(dev_t, dev)
2988 __field(xfs_agnumber_t, agno)
2989 __field(int, type)
2990 __field(xfs_agblock_t, agbno)
2991 __field(xfs_extlen_t, len)
2992 __field(xfs_agblock_t, new_agbno)
2993 __field(xfs_extlen_t, new_len)
2995 TP_fast_assign(
2996 __entry->dev = mp->m_super->s_dev;
2997 __entry->agno = agno;
2998 __entry->type = type;
2999 __entry->agbno = agbno;
3000 __entry->len = len;
3001 __entry->new_agbno = new_agbno;
3002 __entry->new_len = new_len;
3004 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
3005 MAJOR(__entry->dev), MINOR(__entry->dev),
3006 __entry->type,
3007 __entry->agno,
3008 __entry->agbno,
3009 __entry->len,
3010 __entry->new_agbno,
3011 __entry->new_len)
3014 /* simple inode-based error/%ip tracepoint class */
3015 DECLARE_EVENT_CLASS(xfs_inode_error_class,
3016 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3017 TP_ARGS(ip, error, caller_ip),
3018 TP_STRUCT__entry(
3019 __field(dev_t, dev)
3020 __field(xfs_ino_t, ino)
3021 __field(int, error)
3022 __field(unsigned long, caller_ip)
3024 TP_fast_assign(
3025 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3026 __entry->ino = ip->i_ino;
3027 __entry->error = error;
3028 __entry->caller_ip = caller_ip;
3030 TP_printk("dev %d:%d ino %llx error %d caller %ps",
3031 MAJOR(__entry->dev), MINOR(__entry->dev),
3032 __entry->ino,
3033 __entry->error,
3034 (char *)__entry->caller_ip)
3037 #define DEFINE_INODE_ERROR_EVENT(name) \
3038 DEFINE_EVENT(xfs_inode_error_class, name, \
3039 TP_PROTO(struct xfs_inode *ip, int error, \
3040 unsigned long caller_ip), \
3041 TP_ARGS(ip, error, caller_ip))
3043 /* reflink allocator */
3044 TRACE_EVENT(xfs_bmap_remap_alloc,
3045 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t fsbno,
3046 xfs_extlen_t len),
3047 TP_ARGS(ip, fsbno, len),
3048 TP_STRUCT__entry(
3049 __field(dev_t, dev)
3050 __field(xfs_ino_t, ino)
3051 __field(xfs_fsblock_t, fsbno)
3052 __field(xfs_extlen_t, len)
3054 TP_fast_assign(
3055 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3056 __entry->ino = ip->i_ino;
3057 __entry->fsbno = fsbno;
3058 __entry->len = len;
3060 TP_printk("dev %d:%d ino 0x%llx fsbno 0x%llx len %x",
3061 MAJOR(__entry->dev), MINOR(__entry->dev),
3062 __entry->ino,
3063 __entry->fsbno,
3064 __entry->len)
3066 DEFINE_INODE_ERROR_EVENT(xfs_bmap_remap_alloc_error);
3068 /* reflink tracepoint classes */
3070 /* two-file io tracepoint class */
3071 DECLARE_EVENT_CLASS(xfs_double_io_class,
3072 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3073 struct xfs_inode *dest, xfs_off_t doffset),
3074 TP_ARGS(src, soffset, len, dest, doffset),
3075 TP_STRUCT__entry(
3076 __field(dev_t, dev)
3077 __field(xfs_ino_t, src_ino)
3078 __field(loff_t, src_isize)
3079 __field(loff_t, src_disize)
3080 __field(loff_t, src_offset)
3081 __field(size_t, len)
3082 __field(xfs_ino_t, dest_ino)
3083 __field(loff_t, dest_isize)
3084 __field(loff_t, dest_disize)
3085 __field(loff_t, dest_offset)
3087 TP_fast_assign(
3088 __entry->dev = VFS_I(src)->i_sb->s_dev;
3089 __entry->src_ino = src->i_ino;
3090 __entry->src_isize = VFS_I(src)->i_size;
3091 __entry->src_disize = src->i_d.di_size;
3092 __entry->src_offset = soffset;
3093 __entry->len = len;
3094 __entry->dest_ino = dest->i_ino;
3095 __entry->dest_isize = VFS_I(dest)->i_size;
3096 __entry->dest_disize = dest->i_d.di_size;
3097 __entry->dest_offset = doffset;
3099 TP_printk("dev %d:%d count %zd "
3100 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
3101 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
3102 MAJOR(__entry->dev), MINOR(__entry->dev),
3103 __entry->len,
3104 __entry->src_ino,
3105 __entry->src_isize,
3106 __entry->src_disize,
3107 __entry->src_offset,
3108 __entry->dest_ino,
3109 __entry->dest_isize,
3110 __entry->dest_disize,
3111 __entry->dest_offset)
3114 #define DEFINE_DOUBLE_IO_EVENT(name) \
3115 DEFINE_EVENT(xfs_double_io_class, name, \
3116 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3117 struct xfs_inode *dest, xfs_off_t doffset), \
3118 TP_ARGS(src, soffset, len, dest, doffset))
3120 /* two-file vfs io tracepoint class */
3121 DECLARE_EVENT_CLASS(xfs_double_vfs_io_class,
3122 TP_PROTO(struct inode *src, u64 soffset, u64 len,
3123 struct inode *dest, u64 doffset),
3124 TP_ARGS(src, soffset, len, dest, doffset),
3125 TP_STRUCT__entry(
3126 __field(dev_t, dev)
3127 __field(unsigned long, src_ino)
3128 __field(loff_t, src_isize)
3129 __field(loff_t, src_offset)
3130 __field(size_t, len)
3131 __field(unsigned long, dest_ino)
3132 __field(loff_t, dest_isize)
3133 __field(loff_t, dest_offset)
3135 TP_fast_assign(
3136 __entry->dev = src->i_sb->s_dev;
3137 __entry->src_ino = src->i_ino;
3138 __entry->src_isize = i_size_read(src);
3139 __entry->src_offset = soffset;
3140 __entry->len = len;
3141 __entry->dest_ino = dest->i_ino;
3142 __entry->dest_isize = i_size_read(dest);
3143 __entry->dest_offset = doffset;
3145 TP_printk("dev %d:%d count %zd "
3146 "ino 0x%lx isize 0x%llx offset 0x%llx -> "
3147 "ino 0x%lx isize 0x%llx offset 0x%llx",
3148 MAJOR(__entry->dev), MINOR(__entry->dev),
3149 __entry->len,
3150 __entry->src_ino,
3151 __entry->src_isize,
3152 __entry->src_offset,
3153 __entry->dest_ino,
3154 __entry->dest_isize,
3155 __entry->dest_offset)
3158 #define DEFINE_DOUBLE_VFS_IO_EVENT(name) \
3159 DEFINE_EVENT(xfs_double_vfs_io_class, name, \
3160 TP_PROTO(struct inode *src, u64 soffset, u64 len, \
3161 struct inode *dest, u64 doffset), \
3162 TP_ARGS(src, soffset, len, dest, doffset))
3164 /* CoW write tracepoint */
3165 DECLARE_EVENT_CLASS(xfs_copy_on_write_class,
3166 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, xfs_fsblock_t pblk,
3167 xfs_extlen_t len, xfs_fsblock_t new_pblk),
3168 TP_ARGS(ip, lblk, pblk, len, new_pblk),
3169 TP_STRUCT__entry(
3170 __field(dev_t, dev)
3171 __field(xfs_ino_t, ino)
3172 __field(xfs_fileoff_t, lblk)
3173 __field(xfs_fsblock_t, pblk)
3174 __field(xfs_extlen_t, len)
3175 __field(xfs_fsblock_t, new_pblk)
3177 TP_fast_assign(
3178 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3179 __entry->ino = ip->i_ino;
3180 __entry->lblk = lblk;
3181 __entry->pblk = pblk;
3182 __entry->len = len;
3183 __entry->new_pblk = new_pblk;
3185 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx pblk 0x%llx "
3186 "len 0x%x new_pblk %llu",
3187 MAJOR(__entry->dev), MINOR(__entry->dev),
3188 __entry->ino,
3189 __entry->lblk,
3190 __entry->pblk,
3191 __entry->len,
3192 __entry->new_pblk)
3195 #define DEFINE_COW_EVENT(name) \
3196 DEFINE_EVENT(xfs_copy_on_write_class, name, \
3197 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk, xfs_fsblock_t pblk, \
3198 xfs_extlen_t len, xfs_fsblock_t new_pblk), \
3199 TP_ARGS(ip, lblk, pblk, len, new_pblk))
3201 /* inode/irec events */
3202 DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3203 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3204 TP_ARGS(ip, irec),
3205 TP_STRUCT__entry(
3206 __field(dev_t, dev)
3207 __field(xfs_ino_t, ino)
3208 __field(xfs_fileoff_t, lblk)
3209 __field(xfs_extlen_t, len)
3210 __field(xfs_fsblock_t, pblk)
3211 __field(int, state)
3213 TP_fast_assign(
3214 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3215 __entry->ino = ip->i_ino;
3216 __entry->lblk = irec->br_startoff;
3217 __entry->len = irec->br_blockcount;
3218 __entry->pblk = irec->br_startblock;
3219 __entry->state = irec->br_state;
3221 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d",
3222 MAJOR(__entry->dev), MINOR(__entry->dev),
3223 __entry->ino,
3224 __entry->lblk,
3225 __entry->len,
3226 __entry->pblk,
3227 __entry->state)
3229 #define DEFINE_INODE_IREC_EVENT(name) \
3230 DEFINE_EVENT(xfs_inode_irec_class, name, \
3231 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3232 TP_ARGS(ip, irec))
3234 /* refcount/reflink tracepoint definitions */
3236 /* reflink tracepoints */
3237 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3238 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3239 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3240 DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap);
3241 TRACE_EVENT(xfs_reflink_remap_blocks_loop,
3242 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3243 xfs_filblks_t len, struct xfs_inode *dest,
3244 xfs_fileoff_t doffset),
3245 TP_ARGS(src, soffset, len, dest, doffset),
3246 TP_STRUCT__entry(
3247 __field(dev_t, dev)
3248 __field(xfs_ino_t, src_ino)
3249 __field(xfs_fileoff_t, src_lblk)
3250 __field(xfs_filblks_t, len)
3251 __field(xfs_ino_t, dest_ino)
3252 __field(xfs_fileoff_t, dest_lblk)
3254 TP_fast_assign(
3255 __entry->dev = VFS_I(src)->i_sb->s_dev;
3256 __entry->src_ino = src->i_ino;
3257 __entry->src_lblk = soffset;
3258 __entry->len = len;
3259 __entry->dest_ino = dest->i_ino;
3260 __entry->dest_lblk = doffset;
3262 TP_printk("dev %d:%d len 0x%llx "
3263 "ino 0x%llx offset 0x%llx blocks -> "
3264 "ino 0x%llx offset 0x%llx blocks",
3265 MAJOR(__entry->dev), MINOR(__entry->dev),
3266 __entry->len,
3267 __entry->src_ino,
3268 __entry->src_lblk,
3269 __entry->dest_ino,
3270 __entry->dest_lblk)
3272 TRACE_EVENT(xfs_reflink_punch_range,
3273 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3274 xfs_extlen_t len),
3275 TP_ARGS(ip, lblk, len),
3276 TP_STRUCT__entry(
3277 __field(dev_t, dev)
3278 __field(xfs_ino_t, ino)
3279 __field(xfs_fileoff_t, lblk)
3280 __field(xfs_extlen_t, len)
3282 TP_fast_assign(
3283 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3284 __entry->ino = ip->i_ino;
3285 __entry->lblk = lblk;
3286 __entry->len = len;
3288 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x",
3289 MAJOR(__entry->dev), MINOR(__entry->dev),
3290 __entry->ino,
3291 __entry->lblk,
3292 __entry->len)
3294 TRACE_EVENT(xfs_reflink_remap,
3295 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3296 xfs_extlen_t len, xfs_fsblock_t new_pblk),
3297 TP_ARGS(ip, lblk, len, new_pblk),
3298 TP_STRUCT__entry(
3299 __field(dev_t, dev)
3300 __field(xfs_ino_t, ino)
3301 __field(xfs_fileoff_t, lblk)
3302 __field(xfs_extlen_t, len)
3303 __field(xfs_fsblock_t, new_pblk)
3305 TP_fast_assign(
3306 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3307 __entry->ino = ip->i_ino;
3308 __entry->lblk = lblk;
3309 __entry->len = len;
3310 __entry->new_pblk = new_pblk;
3312 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu",
3313 MAJOR(__entry->dev), MINOR(__entry->dev),
3314 __entry->ino,
3315 __entry->lblk,
3316 __entry->len,
3317 __entry->new_pblk)
3319 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3320 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3321 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3322 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
3323 DEFINE_INODE_ERROR_EVENT(xfs_reflink_reflink_main_loop_error);
3324 DEFINE_INODE_ERROR_EVENT(xfs_reflink_read_iomap_error);
3325 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3326 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3328 /* dedupe tracepoints */
3329 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3330 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3332 /* ioctl tracepoints */
3333 DEFINE_DOUBLE_VFS_IO_EVENT(xfs_ioctl_reflink);
3334 DEFINE_DOUBLE_VFS_IO_EVENT(xfs_ioctl_clone_range);
3335 DEFINE_DOUBLE_VFS_IO_EVENT(xfs_ioctl_file_extent_same);
3336 TRACE_EVENT(xfs_ioctl_clone,
3337 TP_PROTO(struct inode *src, struct inode *dest),
3338 TP_ARGS(src, dest),
3339 TP_STRUCT__entry(
3340 __field(dev_t, dev)
3341 __field(unsigned long, src_ino)
3342 __field(loff_t, src_isize)
3343 __field(unsigned long, dest_ino)
3344 __field(loff_t, dest_isize)
3346 TP_fast_assign(
3347 __entry->dev = src->i_sb->s_dev;
3348 __entry->src_ino = src->i_ino;
3349 __entry->src_isize = i_size_read(src);
3350 __entry->dest_ino = dest->i_ino;
3351 __entry->dest_isize = i_size_read(dest);
3353 TP_printk("dev %d:%d "
3354 "ino 0x%lx isize 0x%llx -> "
3355 "ino 0x%lx isize 0x%llx\n",
3356 MAJOR(__entry->dev), MINOR(__entry->dev),
3357 __entry->src_ino,
3358 __entry->src_isize,
3359 __entry->dest_ino,
3360 __entry->dest_isize)
3363 /* unshare tracepoints */
3364 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
3365 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cow_eof_block);
3366 DEFINE_PAGE_EVENT(xfs_reflink_unshare_page);
3367 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
3368 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cow_eof_block_error);
3369 DEFINE_INODE_ERROR_EVENT(xfs_reflink_dirty_page_error);
3371 /* copy on write */
3372 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
3373 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc);
3374 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3375 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
3376 DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
3378 DEFINE_RW_EVENT(xfs_reflink_reserve_cow);
3379 DEFINE_RW_EVENT(xfs_reflink_allocate_cow_range);
3381 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write);
3382 DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping);
3383 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec);
3385 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3386 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3387 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
3389 DEFINE_INODE_ERROR_EVENT(xfs_reflink_allocate_cow_range_error);
3390 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3391 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3393 DEFINE_COW_EVENT(xfs_reflink_fork_buf);
3394 DEFINE_COW_EVENT(xfs_reflink_finish_fork_buf);
3395 DEFINE_INODE_ERROR_EVENT(xfs_reflink_fork_buf_error);
3396 DEFINE_INODE_ERROR_EVENT(xfs_reflink_finish_fork_buf_error);
3398 DEFINE_INODE_EVENT(xfs_reflink_cancel_pending_cow);
3399 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
3400 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_pending_cow_error);
3402 /* rmap swapext tracepoints */
3403 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3404 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3405 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3407 #endif /* _TRACE_XFS_H */
3409 #undef TRACE_INCLUDE_PATH
3410 #define TRACE_INCLUDE_PATH .
3411 #define TRACE_INCLUDE_FILE xfs_trace
3412 #include <trace/define_trace.h>