mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
[linux/fpc-iii.git] / fs / xfs / xfs_trace.h
blob06bc87369632f33f8081a44166d16ed0d49d5f0e
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;
43 struct xfs_fsmap;
44 struct xfs_rmap_irec;
46 DECLARE_EVENT_CLASS(xfs_attr_list_class,
47 TP_PROTO(struct xfs_attr_list_context *ctx),
48 TP_ARGS(ctx),
49 TP_STRUCT__entry(
50 __field(dev_t, dev)
51 __field(xfs_ino_t, ino)
52 __field(u32, hashval)
53 __field(u32, blkno)
54 __field(u32, offset)
55 __field(void *, alist)
56 __field(int, bufsize)
57 __field(int, count)
58 __field(int, firstu)
59 __field(int, dupcnt)
60 __field(int, flags)
62 TP_fast_assign(
63 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
64 __entry->ino = ctx->dp->i_ino;
65 __entry->hashval = ctx->cursor->hashval;
66 __entry->blkno = ctx->cursor->blkno;
67 __entry->offset = ctx->cursor->offset;
68 __entry->alist = ctx->alist;
69 __entry->bufsize = ctx->bufsize;
70 __entry->count = ctx->count;
71 __entry->firstu = ctx->firstu;
72 __entry->flags = ctx->flags;
74 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
75 "alist 0x%p size %u count %u firstu %u flags %d %s",
76 MAJOR(__entry->dev), MINOR(__entry->dev),
77 __entry->ino,
78 __entry->hashval,
79 __entry->blkno,
80 __entry->offset,
81 __entry->dupcnt,
82 __entry->alist,
83 __entry->bufsize,
84 __entry->count,
85 __entry->firstu,
86 __entry->flags,
87 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
91 #define DEFINE_ATTR_LIST_EVENT(name) \
92 DEFINE_EVENT(xfs_attr_list_class, name, \
93 TP_PROTO(struct xfs_attr_list_context *ctx), \
94 TP_ARGS(ctx))
95 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
96 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
97 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
98 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
99 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
100 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
101 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
102 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
103 DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
104 DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
106 DECLARE_EVENT_CLASS(xfs_perag_class,
107 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
108 unsigned long caller_ip),
109 TP_ARGS(mp, agno, refcount, caller_ip),
110 TP_STRUCT__entry(
111 __field(dev_t, dev)
112 __field(xfs_agnumber_t, agno)
113 __field(int, refcount)
114 __field(unsigned long, caller_ip)
116 TP_fast_assign(
117 __entry->dev = mp->m_super->s_dev;
118 __entry->agno = agno;
119 __entry->refcount = refcount;
120 __entry->caller_ip = caller_ip;
122 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
123 MAJOR(__entry->dev), MINOR(__entry->dev),
124 __entry->agno,
125 __entry->refcount,
126 (char *)__entry->caller_ip)
129 #define DEFINE_PERAG_REF_EVENT(name) \
130 DEFINE_EVENT(xfs_perag_class, name, \
131 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
132 unsigned long caller_ip), \
133 TP_ARGS(mp, agno, refcount, caller_ip))
134 DEFINE_PERAG_REF_EVENT(xfs_perag_get);
135 DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
136 DEFINE_PERAG_REF_EVENT(xfs_perag_put);
137 DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
138 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
139 DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
140 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
141 DEFINE_PERAG_REF_EVENT(xfs_perag_set_cowblocks);
142 DEFINE_PERAG_REF_EVENT(xfs_perag_clear_cowblocks);
144 DECLARE_EVENT_CLASS(xfs_ag_class,
145 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
146 TP_ARGS(mp, agno),
147 TP_STRUCT__entry(
148 __field(dev_t, dev)
149 __field(xfs_agnumber_t, agno)
151 TP_fast_assign(
152 __entry->dev = mp->m_super->s_dev;
153 __entry->agno = agno;
155 TP_printk("dev %d:%d agno %u",
156 MAJOR(__entry->dev), MINOR(__entry->dev),
157 __entry->agno)
159 #define DEFINE_AG_EVENT(name) \
160 DEFINE_EVENT(xfs_ag_class, name, \
161 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
162 TP_ARGS(mp, agno))
164 DEFINE_AG_EVENT(xfs_read_agf);
165 DEFINE_AG_EVENT(xfs_alloc_read_agf);
166 DEFINE_AG_EVENT(xfs_read_agi);
167 DEFINE_AG_EVENT(xfs_ialloc_read_agi);
169 TRACE_EVENT(xfs_attr_list_node_descend,
170 TP_PROTO(struct xfs_attr_list_context *ctx,
171 struct xfs_da_node_entry *btree),
172 TP_ARGS(ctx, btree),
173 TP_STRUCT__entry(
174 __field(dev_t, dev)
175 __field(xfs_ino_t, ino)
176 __field(u32, hashval)
177 __field(u32, blkno)
178 __field(u32, offset)
179 __field(void *, alist)
180 __field(int, bufsize)
181 __field(int, count)
182 __field(int, firstu)
183 __field(int, dupcnt)
184 __field(int, flags)
185 __field(u32, bt_hashval)
186 __field(u32, bt_before)
188 TP_fast_assign(
189 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
190 __entry->ino = ctx->dp->i_ino;
191 __entry->hashval = ctx->cursor->hashval;
192 __entry->blkno = ctx->cursor->blkno;
193 __entry->offset = ctx->cursor->offset;
194 __entry->alist = ctx->alist;
195 __entry->bufsize = ctx->bufsize;
196 __entry->count = ctx->count;
197 __entry->firstu = ctx->firstu;
198 __entry->flags = ctx->flags;
199 __entry->bt_hashval = be32_to_cpu(btree->hashval);
200 __entry->bt_before = be32_to_cpu(btree->before);
202 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
203 "alist 0x%p size %u count %u firstu %u flags %d %s "
204 "node hashval %u, node before %u",
205 MAJOR(__entry->dev), MINOR(__entry->dev),
206 __entry->ino,
207 __entry->hashval,
208 __entry->blkno,
209 __entry->offset,
210 __entry->dupcnt,
211 __entry->alist,
212 __entry->bufsize,
213 __entry->count,
214 __entry->firstu,
215 __entry->flags,
216 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
217 __entry->bt_hashval,
218 __entry->bt_before)
221 TRACE_EVENT(xfs_iext_insert,
222 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
223 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
224 TP_ARGS(ip, idx, r, state, caller_ip),
225 TP_STRUCT__entry(
226 __field(dev_t, dev)
227 __field(xfs_ino_t, ino)
228 __field(xfs_extnum_t, idx)
229 __field(xfs_fileoff_t, startoff)
230 __field(xfs_fsblock_t, startblock)
231 __field(xfs_filblks_t, blockcount)
232 __field(xfs_exntst_t, state)
233 __field(int, bmap_state)
234 __field(unsigned long, caller_ip)
236 TP_fast_assign(
237 __entry->dev = VFS_I(ip)->i_sb->s_dev;
238 __entry->ino = ip->i_ino;
239 __entry->idx = idx;
240 __entry->startoff = r->br_startoff;
241 __entry->startblock = r->br_startblock;
242 __entry->blockcount = r->br_blockcount;
243 __entry->state = r->br_state;
244 __entry->bmap_state = state;
245 __entry->caller_ip = caller_ip;
247 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
248 "offset %lld block %lld count %lld flag %d caller %ps",
249 MAJOR(__entry->dev), MINOR(__entry->dev),
250 __entry->ino,
251 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
252 (long)__entry->idx,
253 __entry->startoff,
254 (int64_t)__entry->startblock,
255 __entry->blockcount,
256 __entry->state,
257 (char *)__entry->caller_ip)
260 DECLARE_EVENT_CLASS(xfs_bmap_class,
261 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
262 unsigned long caller_ip),
263 TP_ARGS(ip, idx, state, caller_ip),
264 TP_STRUCT__entry(
265 __field(dev_t, dev)
266 __field(xfs_ino_t, ino)
267 __field(xfs_extnum_t, idx)
268 __field(xfs_fileoff_t, startoff)
269 __field(xfs_fsblock_t, startblock)
270 __field(xfs_filblks_t, blockcount)
271 __field(xfs_exntst_t, state)
272 __field(int, bmap_state)
273 __field(unsigned long, caller_ip)
275 TP_fast_assign(
276 struct xfs_ifork *ifp;
277 struct xfs_bmbt_irec r;
279 ifp = xfs_iext_state_to_fork(ip, state);
280 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
281 __entry->dev = VFS_I(ip)->i_sb->s_dev;
282 __entry->ino = ip->i_ino;
283 __entry->idx = idx;
284 __entry->startoff = r.br_startoff;
285 __entry->startblock = r.br_startblock;
286 __entry->blockcount = r.br_blockcount;
287 __entry->state = r.br_state;
288 __entry->bmap_state = state;
289 __entry->caller_ip = caller_ip;
291 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
292 "offset %lld block %lld count %lld flag %d caller %ps",
293 MAJOR(__entry->dev), MINOR(__entry->dev),
294 __entry->ino,
295 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
296 (long)__entry->idx,
297 __entry->startoff,
298 (int64_t)__entry->startblock,
299 __entry->blockcount,
300 __entry->state,
301 (char *)__entry->caller_ip)
304 #define DEFINE_BMAP_EVENT(name) \
305 DEFINE_EVENT(xfs_bmap_class, name, \
306 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
307 unsigned long caller_ip), \
308 TP_ARGS(ip, idx, state, caller_ip))
309 DEFINE_BMAP_EVENT(xfs_iext_remove);
310 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
311 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
312 DEFINE_BMAP_EVENT(xfs_extlist);
314 DECLARE_EVENT_CLASS(xfs_buf_class,
315 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
316 TP_ARGS(bp, caller_ip),
317 TP_STRUCT__entry(
318 __field(dev_t, dev)
319 __field(xfs_daddr_t, bno)
320 __field(int, nblks)
321 __field(int, hold)
322 __field(int, pincount)
323 __field(unsigned, lockval)
324 __field(unsigned, flags)
325 __field(unsigned long, caller_ip)
327 TP_fast_assign(
328 __entry->dev = bp->b_target->bt_dev;
329 __entry->bno = bp->b_bn;
330 __entry->nblks = bp->b_length;
331 __entry->hold = atomic_read(&bp->b_hold);
332 __entry->pincount = atomic_read(&bp->b_pin_count);
333 __entry->lockval = bp->b_sema.count;
334 __entry->flags = bp->b_flags;
335 __entry->caller_ip = caller_ip;
337 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
338 "lock %d flags %s caller %ps",
339 MAJOR(__entry->dev), MINOR(__entry->dev),
340 (unsigned long long)__entry->bno,
341 __entry->nblks,
342 __entry->hold,
343 __entry->pincount,
344 __entry->lockval,
345 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
346 (void *)__entry->caller_ip)
349 #define DEFINE_BUF_EVENT(name) \
350 DEFINE_EVENT(xfs_buf_class, name, \
351 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
352 TP_ARGS(bp, caller_ip))
353 DEFINE_BUF_EVENT(xfs_buf_init);
354 DEFINE_BUF_EVENT(xfs_buf_free);
355 DEFINE_BUF_EVENT(xfs_buf_hold);
356 DEFINE_BUF_EVENT(xfs_buf_rele);
357 DEFINE_BUF_EVENT(xfs_buf_iodone);
358 DEFINE_BUF_EVENT(xfs_buf_submit);
359 DEFINE_BUF_EVENT(xfs_buf_submit_wait);
360 DEFINE_BUF_EVENT(xfs_buf_lock);
361 DEFINE_BUF_EVENT(xfs_buf_lock_done);
362 DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
363 DEFINE_BUF_EVENT(xfs_buf_trylock);
364 DEFINE_BUF_EVENT(xfs_buf_unlock);
365 DEFINE_BUF_EVENT(xfs_buf_iowait);
366 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
367 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
368 DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
369 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
370 DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
371 DEFINE_BUF_EVENT(xfs_buf_get_uncached);
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_shut);
378 /* not really buffer traces, but the buf provides useful information */
379 DEFINE_BUF_EVENT(xfs_btree_corrupt);
380 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
382 /* pass flags explicitly */
383 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
384 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
385 TP_ARGS(bp, flags, caller_ip),
386 TP_STRUCT__entry(
387 __field(dev_t, dev)
388 __field(xfs_daddr_t, bno)
389 __field(size_t, buffer_length)
390 __field(int, hold)
391 __field(int, pincount)
392 __field(unsigned, lockval)
393 __field(unsigned, flags)
394 __field(unsigned long, caller_ip)
396 TP_fast_assign(
397 __entry->dev = bp->b_target->bt_dev;
398 __entry->bno = bp->b_bn;
399 __entry->buffer_length = BBTOB(bp->b_length);
400 __entry->flags = flags;
401 __entry->hold = atomic_read(&bp->b_hold);
402 __entry->pincount = atomic_read(&bp->b_pin_count);
403 __entry->lockval = bp->b_sema.count;
404 __entry->caller_ip = caller_ip;
406 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
407 "lock %d flags %s caller %ps",
408 MAJOR(__entry->dev), MINOR(__entry->dev),
409 (unsigned long long)__entry->bno,
410 __entry->buffer_length,
411 __entry->hold,
412 __entry->pincount,
413 __entry->lockval,
414 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
415 (void *)__entry->caller_ip)
418 #define DEFINE_BUF_FLAGS_EVENT(name) \
419 DEFINE_EVENT(xfs_buf_flags_class, name, \
420 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
421 TP_ARGS(bp, flags, caller_ip))
422 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
423 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
424 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
426 TRACE_EVENT(xfs_buf_ioerror,
427 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
428 TP_ARGS(bp, error, caller_ip),
429 TP_STRUCT__entry(
430 __field(dev_t, dev)
431 __field(xfs_daddr_t, bno)
432 __field(size_t, buffer_length)
433 __field(unsigned, flags)
434 __field(int, hold)
435 __field(int, pincount)
436 __field(unsigned, lockval)
437 __field(int, error)
438 __field(unsigned long, caller_ip)
440 TP_fast_assign(
441 __entry->dev = bp->b_target->bt_dev;
442 __entry->bno = bp->b_bn;
443 __entry->buffer_length = BBTOB(bp->b_length);
444 __entry->hold = atomic_read(&bp->b_hold);
445 __entry->pincount = atomic_read(&bp->b_pin_count);
446 __entry->lockval = bp->b_sema.count;
447 __entry->error = error;
448 __entry->flags = bp->b_flags;
449 __entry->caller_ip = caller_ip;
451 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
452 "lock %d error %d flags %s caller %ps",
453 MAJOR(__entry->dev), MINOR(__entry->dev),
454 (unsigned long long)__entry->bno,
455 __entry->buffer_length,
456 __entry->hold,
457 __entry->pincount,
458 __entry->lockval,
459 __entry->error,
460 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
461 (void *)__entry->caller_ip)
464 DECLARE_EVENT_CLASS(xfs_buf_item_class,
465 TP_PROTO(struct xfs_buf_log_item *bip),
466 TP_ARGS(bip),
467 TP_STRUCT__entry(
468 __field(dev_t, dev)
469 __field(xfs_daddr_t, buf_bno)
470 __field(size_t, buf_len)
471 __field(int, buf_hold)
472 __field(int, buf_pincount)
473 __field(int, buf_lockval)
474 __field(unsigned, buf_flags)
475 __field(unsigned, bli_recur)
476 __field(int, bli_refcount)
477 __field(unsigned, bli_flags)
478 __field(void *, li_desc)
479 __field(unsigned, li_flags)
481 TP_fast_assign(
482 __entry->dev = bip->bli_buf->b_target->bt_dev;
483 __entry->bli_flags = bip->bli_flags;
484 __entry->bli_recur = bip->bli_recur;
485 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
486 __entry->buf_bno = bip->bli_buf->b_bn;
487 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
488 __entry->buf_flags = bip->bli_buf->b_flags;
489 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
490 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
491 __entry->buf_lockval = bip->bli_buf->b_sema.count;
492 __entry->li_desc = bip->bli_item.li_desc;
493 __entry->li_flags = bip->bli_item.li_flags;
495 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
496 "lock %d flags %s recur %d refcount %d bliflags %s "
497 "lidesc 0x%p liflags %s",
498 MAJOR(__entry->dev), MINOR(__entry->dev),
499 (unsigned long long)__entry->buf_bno,
500 __entry->buf_len,
501 __entry->buf_hold,
502 __entry->buf_pincount,
503 __entry->buf_lockval,
504 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
505 __entry->bli_recur,
506 __entry->bli_refcount,
507 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
508 __entry->li_desc,
509 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
512 #define DEFINE_BUF_ITEM_EVENT(name) \
513 DEFINE_EVENT(xfs_buf_item_class, name, \
514 TP_PROTO(struct xfs_buf_log_item *bip), \
515 TP_ARGS(bip))
516 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
517 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
518 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
519 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
520 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
521 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
522 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
523 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
524 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
525 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
526 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
527 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
528 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
529 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
530 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
531 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
532 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
533 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
534 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
535 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
536 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
537 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
538 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
539 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
540 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
542 DECLARE_EVENT_CLASS(xfs_filestream_class,
543 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
544 TP_ARGS(ip, agno),
545 TP_STRUCT__entry(
546 __field(dev_t, dev)
547 __field(xfs_ino_t, ino)
548 __field(xfs_agnumber_t, agno)
549 __field(int, streams)
551 TP_fast_assign(
552 __entry->dev = VFS_I(ip)->i_sb->s_dev;
553 __entry->ino = ip->i_ino;
554 __entry->agno = agno;
555 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
557 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
558 MAJOR(__entry->dev), MINOR(__entry->dev),
559 __entry->ino,
560 __entry->agno,
561 __entry->streams)
563 #define DEFINE_FILESTREAM_EVENT(name) \
564 DEFINE_EVENT(xfs_filestream_class, name, \
565 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
566 TP_ARGS(ip, agno))
567 DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
568 DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
569 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
571 TRACE_EVENT(xfs_filestream_pick,
572 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
573 xfs_extlen_t free, int nscan),
574 TP_ARGS(ip, agno, free, nscan),
575 TP_STRUCT__entry(
576 __field(dev_t, dev)
577 __field(xfs_ino_t, ino)
578 __field(xfs_agnumber_t, agno)
579 __field(int, streams)
580 __field(xfs_extlen_t, free)
581 __field(int, nscan)
583 TP_fast_assign(
584 __entry->dev = VFS_I(ip)->i_sb->s_dev;
585 __entry->ino = ip->i_ino;
586 __entry->agno = agno;
587 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
588 __entry->free = free;
589 __entry->nscan = nscan;
591 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
592 MAJOR(__entry->dev), MINOR(__entry->dev),
593 __entry->ino,
594 __entry->agno,
595 __entry->streams,
596 __entry->free,
597 __entry->nscan)
600 DECLARE_EVENT_CLASS(xfs_lock_class,
601 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
602 unsigned long caller_ip),
603 TP_ARGS(ip, lock_flags, caller_ip),
604 TP_STRUCT__entry(
605 __field(dev_t, dev)
606 __field(xfs_ino_t, ino)
607 __field(int, lock_flags)
608 __field(unsigned long, caller_ip)
610 TP_fast_assign(
611 __entry->dev = VFS_I(ip)->i_sb->s_dev;
612 __entry->ino = ip->i_ino;
613 __entry->lock_flags = lock_flags;
614 __entry->caller_ip = caller_ip;
616 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
617 MAJOR(__entry->dev), MINOR(__entry->dev),
618 __entry->ino,
619 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
620 (void *)__entry->caller_ip)
623 #define DEFINE_LOCK_EVENT(name) \
624 DEFINE_EVENT(xfs_lock_class, name, \
625 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
626 unsigned long caller_ip), \
627 TP_ARGS(ip, lock_flags, caller_ip))
628 DEFINE_LOCK_EVENT(xfs_ilock);
629 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
630 DEFINE_LOCK_EVENT(xfs_ilock_demote);
631 DEFINE_LOCK_EVENT(xfs_iunlock);
633 DECLARE_EVENT_CLASS(xfs_inode_class,
634 TP_PROTO(struct xfs_inode *ip),
635 TP_ARGS(ip),
636 TP_STRUCT__entry(
637 __field(dev_t, dev)
638 __field(xfs_ino_t, ino)
640 TP_fast_assign(
641 __entry->dev = VFS_I(ip)->i_sb->s_dev;
642 __entry->ino = ip->i_ino;
644 TP_printk("dev %d:%d ino 0x%llx",
645 MAJOR(__entry->dev), MINOR(__entry->dev),
646 __entry->ino)
649 #define DEFINE_INODE_EVENT(name) \
650 DEFINE_EVENT(xfs_inode_class, name, \
651 TP_PROTO(struct xfs_inode *ip), \
652 TP_ARGS(ip))
653 DEFINE_INODE_EVENT(xfs_iget_skip);
654 DEFINE_INODE_EVENT(xfs_iget_reclaim);
655 DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
656 DEFINE_INODE_EVENT(xfs_iget_hit);
657 DEFINE_INODE_EVENT(xfs_iget_miss);
659 DEFINE_INODE_EVENT(xfs_getattr);
660 DEFINE_INODE_EVENT(xfs_setattr);
661 DEFINE_INODE_EVENT(xfs_readlink);
662 DEFINE_INODE_EVENT(xfs_inactive_symlink);
663 DEFINE_INODE_EVENT(xfs_alloc_file_space);
664 DEFINE_INODE_EVENT(xfs_free_file_space);
665 DEFINE_INODE_EVENT(xfs_zero_file_space);
666 DEFINE_INODE_EVENT(xfs_collapse_file_space);
667 DEFINE_INODE_EVENT(xfs_insert_file_space);
668 DEFINE_INODE_EVENT(xfs_readdir);
669 #ifdef CONFIG_XFS_POSIX_ACL
670 DEFINE_INODE_EVENT(xfs_get_acl);
671 #endif
672 DEFINE_INODE_EVENT(xfs_vm_bmap);
673 DEFINE_INODE_EVENT(xfs_file_ioctl);
674 DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
675 DEFINE_INODE_EVENT(xfs_ioctl_setattr);
676 DEFINE_INODE_EVENT(xfs_dir_fsync);
677 DEFINE_INODE_EVENT(xfs_file_fsync);
678 DEFINE_INODE_EVENT(xfs_destroy_inode);
679 DEFINE_INODE_EVENT(xfs_update_time);
681 DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
682 DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
684 DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
685 DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
686 DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
687 DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
688 DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
689 DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
691 DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
693 TRACE_EVENT(xfs_filemap_fault,
694 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
695 bool write_fault),
696 TP_ARGS(ip, pe_size, write_fault),
697 TP_STRUCT__entry(
698 __field(dev_t, dev)
699 __field(xfs_ino_t, ino)
700 __field(enum page_entry_size, pe_size)
701 __field(bool, write_fault)
703 TP_fast_assign(
704 __entry->dev = VFS_I(ip)->i_sb->s_dev;
705 __entry->ino = ip->i_ino;
706 __entry->pe_size = pe_size;
707 __entry->write_fault = write_fault;
709 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
710 MAJOR(__entry->dev), MINOR(__entry->dev),
711 __entry->ino,
712 __print_symbolic(__entry->pe_size,
713 { PE_SIZE_PTE, "PTE" },
714 { PE_SIZE_PMD, "PMD" },
715 { PE_SIZE_PUD, "PUD" }),
716 __entry->write_fault)
719 DECLARE_EVENT_CLASS(xfs_iref_class,
720 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
721 TP_ARGS(ip, caller_ip),
722 TP_STRUCT__entry(
723 __field(dev_t, dev)
724 __field(xfs_ino_t, ino)
725 __field(int, count)
726 __field(int, pincount)
727 __field(unsigned long, caller_ip)
729 TP_fast_assign(
730 __entry->dev = VFS_I(ip)->i_sb->s_dev;
731 __entry->ino = ip->i_ino;
732 __entry->count = atomic_read(&VFS_I(ip)->i_count);
733 __entry->pincount = atomic_read(&ip->i_pincount);
734 __entry->caller_ip = caller_ip;
736 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
737 MAJOR(__entry->dev), MINOR(__entry->dev),
738 __entry->ino,
739 __entry->count,
740 __entry->pincount,
741 (char *)__entry->caller_ip)
744 TRACE_EVENT(xfs_iomap_prealloc_size,
745 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
746 unsigned int writeio_blocks),
747 TP_ARGS(ip, blocks, shift, writeio_blocks),
748 TP_STRUCT__entry(
749 __field(dev_t, dev)
750 __field(xfs_ino_t, ino)
751 __field(xfs_fsblock_t, blocks)
752 __field(int, shift)
753 __field(unsigned int, writeio_blocks)
755 TP_fast_assign(
756 __entry->dev = VFS_I(ip)->i_sb->s_dev;
757 __entry->ino = ip->i_ino;
758 __entry->blocks = blocks;
759 __entry->shift = shift;
760 __entry->writeio_blocks = writeio_blocks;
762 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
763 "m_writeio_blocks %u",
764 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
765 __entry->blocks, __entry->shift, __entry->writeio_blocks)
768 TRACE_EVENT(xfs_irec_merge_pre,
769 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
770 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
771 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
772 TP_STRUCT__entry(
773 __field(dev_t, dev)
774 __field(xfs_agnumber_t, agno)
775 __field(xfs_agino_t, agino)
776 __field(uint16_t, holemask)
777 __field(xfs_agino_t, nagino)
778 __field(uint16_t, nholemask)
780 TP_fast_assign(
781 __entry->dev = mp->m_super->s_dev;
782 __entry->agno = agno;
783 __entry->agino = agino;
784 __entry->holemask = holemask;
785 __entry->nagino = nagino;
786 __entry->nholemask = holemask;
788 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
789 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
790 __entry->agino, __entry->holemask, __entry->nagino,
791 __entry->nholemask)
794 TRACE_EVENT(xfs_irec_merge_post,
795 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
796 uint16_t holemask),
797 TP_ARGS(mp, agno, agino, holemask),
798 TP_STRUCT__entry(
799 __field(dev_t, dev)
800 __field(xfs_agnumber_t, agno)
801 __field(xfs_agino_t, agino)
802 __field(uint16_t, holemask)
804 TP_fast_assign(
805 __entry->dev = mp->m_super->s_dev;
806 __entry->agno = agno;
807 __entry->agino = agino;
808 __entry->holemask = holemask;
810 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
811 MINOR(__entry->dev), __entry->agno, __entry->agino,
812 __entry->holemask)
815 #define DEFINE_IREF_EVENT(name) \
816 DEFINE_EVENT(xfs_iref_class, name, \
817 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
818 TP_ARGS(ip, caller_ip))
819 DEFINE_IREF_EVENT(xfs_irele);
820 DEFINE_IREF_EVENT(xfs_inode_pin);
821 DEFINE_IREF_EVENT(xfs_inode_unpin);
822 DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
824 DECLARE_EVENT_CLASS(xfs_namespace_class,
825 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
826 TP_ARGS(dp, name),
827 TP_STRUCT__entry(
828 __field(dev_t, dev)
829 __field(xfs_ino_t, dp_ino)
830 __field(int, namelen)
831 __dynamic_array(char, name, name->len)
833 TP_fast_assign(
834 __entry->dev = VFS_I(dp)->i_sb->s_dev;
835 __entry->dp_ino = dp->i_ino;
836 __entry->namelen = name->len;
837 memcpy(__get_str(name), name->name, name->len);
839 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
840 MAJOR(__entry->dev), MINOR(__entry->dev),
841 __entry->dp_ino,
842 __entry->namelen,
843 __get_str(name))
846 #define DEFINE_NAMESPACE_EVENT(name) \
847 DEFINE_EVENT(xfs_namespace_class, name, \
848 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
849 TP_ARGS(dp, name))
850 DEFINE_NAMESPACE_EVENT(xfs_remove);
851 DEFINE_NAMESPACE_EVENT(xfs_link);
852 DEFINE_NAMESPACE_EVENT(xfs_lookup);
853 DEFINE_NAMESPACE_EVENT(xfs_create);
854 DEFINE_NAMESPACE_EVENT(xfs_symlink);
856 TRACE_EVENT(xfs_rename,
857 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
858 struct xfs_name *src_name, struct xfs_name *target_name),
859 TP_ARGS(src_dp, target_dp, src_name, target_name),
860 TP_STRUCT__entry(
861 __field(dev_t, dev)
862 __field(xfs_ino_t, src_dp_ino)
863 __field(xfs_ino_t, target_dp_ino)
864 __field(int, src_namelen)
865 __field(int, target_namelen)
866 __dynamic_array(char, src_name, src_name->len)
867 __dynamic_array(char, target_name, target_name->len)
869 TP_fast_assign(
870 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
871 __entry->src_dp_ino = src_dp->i_ino;
872 __entry->target_dp_ino = target_dp->i_ino;
873 __entry->src_namelen = src_name->len;
874 __entry->target_namelen = target_name->len;
875 memcpy(__get_str(src_name), src_name->name, src_name->len);
876 memcpy(__get_str(target_name), target_name->name,
877 target_name->len);
879 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
880 " src name %.*s target name %.*s",
881 MAJOR(__entry->dev), MINOR(__entry->dev),
882 __entry->src_dp_ino,
883 __entry->target_dp_ino,
884 __entry->src_namelen,
885 __get_str(src_name),
886 __entry->target_namelen,
887 __get_str(target_name))
890 DECLARE_EVENT_CLASS(xfs_dquot_class,
891 TP_PROTO(struct xfs_dquot *dqp),
892 TP_ARGS(dqp),
893 TP_STRUCT__entry(
894 __field(dev_t, dev)
895 __field(u32, id)
896 __field(unsigned, flags)
897 __field(unsigned, nrefs)
898 __field(unsigned long long, res_bcount)
899 __field(unsigned long long, bcount)
900 __field(unsigned long long, icount)
901 __field(unsigned long long, blk_hardlimit)
902 __field(unsigned long long, blk_softlimit)
903 __field(unsigned long long, ino_hardlimit)
904 __field(unsigned long long, ino_softlimit)
905 ), \
906 TP_fast_assign(
907 __entry->dev = dqp->q_mount->m_super->s_dev;
908 __entry->id = be32_to_cpu(dqp->q_core.d_id);
909 __entry->flags = dqp->dq_flags;
910 __entry->nrefs = dqp->q_nrefs;
911 __entry->res_bcount = dqp->q_res_bcount;
912 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
913 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
914 __entry->blk_hardlimit =
915 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
916 __entry->blk_softlimit =
917 be64_to_cpu(dqp->q_core.d_blk_softlimit);
918 __entry->ino_hardlimit =
919 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
920 __entry->ino_softlimit =
921 be64_to_cpu(dqp->q_core.d_ino_softlimit);
923 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
924 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
925 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
926 MAJOR(__entry->dev), MINOR(__entry->dev),
927 __entry->id,
928 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
929 __entry->nrefs,
930 __entry->res_bcount,
931 __entry->bcount,
932 __entry->blk_hardlimit,
933 __entry->blk_softlimit,
934 __entry->icount,
935 __entry->ino_hardlimit,
936 __entry->ino_softlimit)
939 #define DEFINE_DQUOT_EVENT(name) \
940 DEFINE_EVENT(xfs_dquot_class, name, \
941 TP_PROTO(struct xfs_dquot *dqp), \
942 TP_ARGS(dqp))
943 DEFINE_DQUOT_EVENT(xfs_dqadjust);
944 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
945 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
946 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
947 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
948 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
949 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
950 DEFINE_DQUOT_EVENT(xfs_dqalloc);
951 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
952 DEFINE_DQUOT_EVENT(xfs_dqread);
953 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
954 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
955 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
956 DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
957 DEFINE_DQUOT_EVENT(xfs_dqget_dup);
958 DEFINE_DQUOT_EVENT(xfs_dqput);
959 DEFINE_DQUOT_EVENT(xfs_dqput_free);
960 DEFINE_DQUOT_EVENT(xfs_dqrele);
961 DEFINE_DQUOT_EVENT(xfs_dqflush);
962 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
963 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
965 DECLARE_EVENT_CLASS(xfs_loggrant_class,
966 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
967 TP_ARGS(log, tic),
968 TP_STRUCT__entry(
969 __field(dev_t, dev)
970 __field(char, ocnt)
971 __field(char, cnt)
972 __field(int, curr_res)
973 __field(int, unit_res)
974 __field(unsigned int, flags)
975 __field(int, reserveq)
976 __field(int, writeq)
977 __field(int, grant_reserve_cycle)
978 __field(int, grant_reserve_bytes)
979 __field(int, grant_write_cycle)
980 __field(int, grant_write_bytes)
981 __field(int, curr_cycle)
982 __field(int, curr_block)
983 __field(xfs_lsn_t, tail_lsn)
985 TP_fast_assign(
986 __entry->dev = log->l_mp->m_super->s_dev;
987 __entry->ocnt = tic->t_ocnt;
988 __entry->cnt = tic->t_cnt;
989 __entry->curr_res = tic->t_curr_res;
990 __entry->unit_res = tic->t_unit_res;
991 __entry->flags = tic->t_flags;
992 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
993 __entry->writeq = list_empty(&log->l_write_head.waiters);
994 xlog_crack_grant_head(&log->l_reserve_head.grant,
995 &__entry->grant_reserve_cycle,
996 &__entry->grant_reserve_bytes);
997 xlog_crack_grant_head(&log->l_write_head.grant,
998 &__entry->grant_write_cycle,
999 &__entry->grant_write_bytes);
1000 __entry->curr_cycle = log->l_curr_cycle;
1001 __entry->curr_block = log->l_curr_block;
1002 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
1004 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
1005 "t_unit_res %u t_flags %s reserveq %s "
1006 "writeq %s grant_reserve_cycle %d "
1007 "grant_reserve_bytes %d grant_write_cycle %d "
1008 "grant_write_bytes %d curr_cycle %d curr_block %d "
1009 "tail_cycle %d tail_block %d",
1010 MAJOR(__entry->dev), MINOR(__entry->dev),
1011 __entry->ocnt,
1012 __entry->cnt,
1013 __entry->curr_res,
1014 __entry->unit_res,
1015 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
1016 __entry->reserveq ? "empty" : "active",
1017 __entry->writeq ? "empty" : "active",
1018 __entry->grant_reserve_cycle,
1019 __entry->grant_reserve_bytes,
1020 __entry->grant_write_cycle,
1021 __entry->grant_write_bytes,
1022 __entry->curr_cycle,
1023 __entry->curr_block,
1024 CYCLE_LSN(__entry->tail_lsn),
1025 BLOCK_LSN(__entry->tail_lsn)
1029 #define DEFINE_LOGGRANT_EVENT(name) \
1030 DEFINE_EVENT(xfs_loggrant_class, name, \
1031 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1032 TP_ARGS(log, tic))
1033 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1034 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
1035 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1036 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1037 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1038 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1039 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1040 DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1041 DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1042 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1043 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1044 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1045 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1046 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1047 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1048 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1050 DECLARE_EVENT_CLASS(xfs_log_item_class,
1051 TP_PROTO(struct xfs_log_item *lip),
1052 TP_ARGS(lip),
1053 TP_STRUCT__entry(
1054 __field(dev_t, dev)
1055 __field(void *, lip)
1056 __field(uint, type)
1057 __field(uint, flags)
1058 __field(xfs_lsn_t, lsn)
1060 TP_fast_assign(
1061 __entry->dev = lip->li_mountp->m_super->s_dev;
1062 __entry->lip = lip;
1063 __entry->type = lip->li_type;
1064 __entry->flags = lip->li_flags;
1065 __entry->lsn = lip->li_lsn;
1067 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1068 MAJOR(__entry->dev), MINOR(__entry->dev),
1069 __entry->lip,
1070 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1071 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1072 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1075 TRACE_EVENT(xfs_log_force,
1076 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1077 TP_ARGS(mp, lsn, caller_ip),
1078 TP_STRUCT__entry(
1079 __field(dev_t, dev)
1080 __field(xfs_lsn_t, lsn)
1081 __field(unsigned long, caller_ip)
1083 TP_fast_assign(
1084 __entry->dev = mp->m_super->s_dev;
1085 __entry->lsn = lsn;
1086 __entry->caller_ip = caller_ip;
1088 TP_printk("dev %d:%d lsn 0x%llx caller %ps",
1089 MAJOR(__entry->dev), MINOR(__entry->dev),
1090 __entry->lsn, (void *)__entry->caller_ip)
1093 #define DEFINE_LOG_ITEM_EVENT(name) \
1094 DEFINE_EVENT(xfs_log_item_class, name, \
1095 TP_PROTO(struct xfs_log_item *lip), \
1096 TP_ARGS(lip))
1097 DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1098 DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1099 DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1100 DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1102 DECLARE_EVENT_CLASS(xfs_ail_class,
1103 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1104 TP_ARGS(lip, old_lsn, new_lsn),
1105 TP_STRUCT__entry(
1106 __field(dev_t, dev)
1107 __field(void *, lip)
1108 __field(uint, type)
1109 __field(uint, flags)
1110 __field(xfs_lsn_t, old_lsn)
1111 __field(xfs_lsn_t, new_lsn)
1113 TP_fast_assign(
1114 __entry->dev = lip->li_mountp->m_super->s_dev;
1115 __entry->lip = lip;
1116 __entry->type = lip->li_type;
1117 __entry->flags = lip->li_flags;
1118 __entry->old_lsn = old_lsn;
1119 __entry->new_lsn = new_lsn;
1121 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1122 MAJOR(__entry->dev), MINOR(__entry->dev),
1123 __entry->lip,
1124 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1125 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1126 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1127 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1130 #define DEFINE_AIL_EVENT(name) \
1131 DEFINE_EVENT(xfs_ail_class, name, \
1132 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1133 TP_ARGS(lip, old_lsn, new_lsn))
1134 DEFINE_AIL_EVENT(xfs_ail_insert);
1135 DEFINE_AIL_EVENT(xfs_ail_move);
1136 DEFINE_AIL_EVENT(xfs_ail_delete);
1138 TRACE_EVENT(xfs_log_assign_tail_lsn,
1139 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1140 TP_ARGS(log, new_lsn),
1141 TP_STRUCT__entry(
1142 __field(dev_t, dev)
1143 __field(xfs_lsn_t, new_lsn)
1144 __field(xfs_lsn_t, old_lsn)
1145 __field(xfs_lsn_t, last_sync_lsn)
1147 TP_fast_assign(
1148 __entry->dev = log->l_mp->m_super->s_dev;
1149 __entry->new_lsn = new_lsn;
1150 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1151 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1153 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1154 MAJOR(__entry->dev), MINOR(__entry->dev),
1155 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1156 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1157 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1160 DECLARE_EVENT_CLASS(xfs_file_class,
1161 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1162 TP_ARGS(ip, count, offset),
1163 TP_STRUCT__entry(
1164 __field(dev_t, dev)
1165 __field(xfs_ino_t, ino)
1166 __field(xfs_fsize_t, size)
1167 __field(loff_t, offset)
1168 __field(size_t, count)
1170 TP_fast_assign(
1171 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1172 __entry->ino = ip->i_ino;
1173 __entry->size = ip->i_d.di_size;
1174 __entry->offset = offset;
1175 __entry->count = count;
1177 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
1178 MAJOR(__entry->dev), MINOR(__entry->dev),
1179 __entry->ino,
1180 __entry->size,
1181 __entry->offset,
1182 __entry->count)
1185 #define DEFINE_RW_EVENT(name) \
1186 DEFINE_EVENT(xfs_file_class, name, \
1187 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1188 TP_ARGS(ip, count, offset))
1189 DEFINE_RW_EVENT(xfs_file_buffered_read);
1190 DEFINE_RW_EVENT(xfs_file_direct_read);
1191 DEFINE_RW_EVENT(xfs_file_dax_read);
1192 DEFINE_RW_EVENT(xfs_file_buffered_write);
1193 DEFINE_RW_EVENT(xfs_file_direct_write);
1194 DEFINE_RW_EVENT(xfs_file_dax_write);
1196 DECLARE_EVENT_CLASS(xfs_page_class,
1197 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1198 unsigned int len),
1199 TP_ARGS(inode, page, off, len),
1200 TP_STRUCT__entry(
1201 __field(dev_t, dev)
1202 __field(xfs_ino_t, ino)
1203 __field(pgoff_t, pgoff)
1204 __field(loff_t, size)
1205 __field(unsigned long, offset)
1206 __field(unsigned int, length)
1207 __field(int, delalloc)
1208 __field(int, unwritten)
1210 TP_fast_assign(
1211 int delalloc = -1, unwritten = -1;
1213 if (page_has_buffers(page))
1214 xfs_count_page_state(page, &delalloc, &unwritten);
1215 __entry->dev = inode->i_sb->s_dev;
1216 __entry->ino = XFS_I(inode)->i_ino;
1217 __entry->pgoff = page_offset(page);
1218 __entry->size = i_size_read(inode);
1219 __entry->offset = off;
1220 __entry->length = len;
1221 __entry->delalloc = delalloc;
1222 __entry->unwritten = unwritten;
1224 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
1225 "length %x delalloc %d unwritten %d",
1226 MAJOR(__entry->dev), MINOR(__entry->dev),
1227 __entry->ino,
1228 __entry->pgoff,
1229 __entry->size,
1230 __entry->offset,
1231 __entry->length,
1232 __entry->delalloc,
1233 __entry->unwritten)
1236 #define DEFINE_PAGE_EVENT(name) \
1237 DEFINE_EVENT(xfs_page_class, name, \
1238 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1239 unsigned int len), \
1240 TP_ARGS(inode, page, off, len))
1241 DEFINE_PAGE_EVENT(xfs_writepage);
1242 DEFINE_PAGE_EVENT(xfs_releasepage);
1243 DEFINE_PAGE_EVENT(xfs_invalidatepage);
1245 DECLARE_EVENT_CLASS(xfs_readpage_class,
1246 TP_PROTO(struct inode *inode, int nr_pages),
1247 TP_ARGS(inode, nr_pages),
1248 TP_STRUCT__entry(
1249 __field(dev_t, dev)
1250 __field(xfs_ino_t, ino)
1251 __field(int, nr_pages)
1253 TP_fast_assign(
1254 __entry->dev = inode->i_sb->s_dev;
1255 __entry->ino = inode->i_ino;
1256 __entry->nr_pages = nr_pages;
1258 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1259 MAJOR(__entry->dev), MINOR(__entry->dev),
1260 __entry->ino,
1261 __entry->nr_pages)
1264 #define DEFINE_READPAGE_EVENT(name) \
1265 DEFINE_EVENT(xfs_readpage_class, name, \
1266 TP_PROTO(struct inode *inode, int nr_pages), \
1267 TP_ARGS(inode, nr_pages))
1268 DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1269 DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1271 DECLARE_EVENT_CLASS(xfs_imap_class,
1272 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1273 int type, struct xfs_bmbt_irec *irec),
1274 TP_ARGS(ip, offset, count, type, irec),
1275 TP_STRUCT__entry(
1276 __field(dev_t, dev)
1277 __field(xfs_ino_t, ino)
1278 __field(loff_t, size)
1279 __field(loff_t, offset)
1280 __field(size_t, count)
1281 __field(int, type)
1282 __field(xfs_fileoff_t, startoff)
1283 __field(xfs_fsblock_t, startblock)
1284 __field(xfs_filblks_t, blockcount)
1286 TP_fast_assign(
1287 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1288 __entry->ino = ip->i_ino;
1289 __entry->size = ip->i_d.di_size;
1290 __entry->offset = offset;
1291 __entry->count = count;
1292 __entry->type = type;
1293 __entry->startoff = irec ? irec->br_startoff : 0;
1294 __entry->startblock = irec ? irec->br_startblock : 0;
1295 __entry->blockcount = irec ? irec->br_blockcount : 0;
1297 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1298 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
1299 MAJOR(__entry->dev), MINOR(__entry->dev),
1300 __entry->ino,
1301 __entry->size,
1302 __entry->offset,
1303 __entry->count,
1304 __print_symbolic(__entry->type, XFS_IO_TYPES),
1305 __entry->startoff,
1306 (int64_t)__entry->startblock,
1307 __entry->blockcount)
1310 #define DEFINE_IOMAP_EVENT(name) \
1311 DEFINE_EVENT(xfs_imap_class, name, \
1312 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1313 int type, struct xfs_bmbt_irec *irec), \
1314 TP_ARGS(ip, offset, count, type, irec))
1315 DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1316 DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1317 DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1318 DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
1319 DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
1320 DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
1321 DEFINE_IOMAP_EVENT(xfs_iomap_found);
1323 DECLARE_EVENT_CLASS(xfs_simple_io_class,
1324 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1325 TP_ARGS(ip, offset, count),
1326 TP_STRUCT__entry(
1327 __field(dev_t, dev)
1328 __field(xfs_ino_t, ino)
1329 __field(loff_t, isize)
1330 __field(loff_t, disize)
1331 __field(loff_t, offset)
1332 __field(size_t, count)
1334 TP_fast_assign(
1335 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1336 __entry->ino = ip->i_ino;
1337 __entry->isize = VFS_I(ip)->i_size;
1338 __entry->disize = ip->i_d.di_size;
1339 __entry->offset = offset;
1340 __entry->count = count;
1342 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1343 "offset 0x%llx count %zd",
1344 MAJOR(__entry->dev), MINOR(__entry->dev),
1345 __entry->ino,
1346 __entry->isize,
1347 __entry->disize,
1348 __entry->offset,
1349 __entry->count)
1352 #define DEFINE_SIMPLE_IO_EVENT(name) \
1353 DEFINE_EVENT(xfs_simple_io_class, name, \
1354 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1355 TP_ARGS(ip, offset, count))
1356 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1357 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1358 DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
1359 DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1360 DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1361 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1362 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1363 DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1365 DECLARE_EVENT_CLASS(xfs_itrunc_class,
1366 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1367 TP_ARGS(ip, new_size),
1368 TP_STRUCT__entry(
1369 __field(dev_t, dev)
1370 __field(xfs_ino_t, ino)
1371 __field(xfs_fsize_t, size)
1372 __field(xfs_fsize_t, new_size)
1374 TP_fast_assign(
1375 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1376 __entry->ino = ip->i_ino;
1377 __entry->size = ip->i_d.di_size;
1378 __entry->new_size = new_size;
1380 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1381 MAJOR(__entry->dev), MINOR(__entry->dev),
1382 __entry->ino,
1383 __entry->size,
1384 __entry->new_size)
1387 #define DEFINE_ITRUNC_EVENT(name) \
1388 DEFINE_EVENT(xfs_itrunc_class, name, \
1389 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1390 TP_ARGS(ip, new_size))
1391 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1392 DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1394 TRACE_EVENT(xfs_pagecache_inval,
1395 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1396 TP_ARGS(ip, start, finish),
1397 TP_STRUCT__entry(
1398 __field(dev_t, dev)
1399 __field(xfs_ino_t, ino)
1400 __field(xfs_fsize_t, size)
1401 __field(xfs_off_t, start)
1402 __field(xfs_off_t, finish)
1404 TP_fast_assign(
1405 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1406 __entry->ino = ip->i_ino;
1407 __entry->size = ip->i_d.di_size;
1408 __entry->start = start;
1409 __entry->finish = finish;
1411 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1412 MAJOR(__entry->dev), MINOR(__entry->dev),
1413 __entry->ino,
1414 __entry->size,
1415 __entry->start,
1416 __entry->finish)
1419 TRACE_EVENT(xfs_bunmap,
1420 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1421 int flags, unsigned long caller_ip),
1422 TP_ARGS(ip, bno, len, flags, caller_ip),
1423 TP_STRUCT__entry(
1424 __field(dev_t, dev)
1425 __field(xfs_ino_t, ino)
1426 __field(xfs_fsize_t, size)
1427 __field(xfs_fileoff_t, bno)
1428 __field(xfs_filblks_t, len)
1429 __field(unsigned long, caller_ip)
1430 __field(int, flags)
1432 TP_fast_assign(
1433 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1434 __entry->ino = ip->i_ino;
1435 __entry->size = ip->i_d.di_size;
1436 __entry->bno = bno;
1437 __entry->len = len;
1438 __entry->caller_ip = caller_ip;
1439 __entry->flags = flags;
1441 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1442 "flags %s caller %ps",
1443 MAJOR(__entry->dev), MINOR(__entry->dev),
1444 __entry->ino,
1445 __entry->size,
1446 __entry->bno,
1447 __entry->len,
1448 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1449 (void *)__entry->caller_ip)
1453 DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1454 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1455 xfs_agblock_t agbno, xfs_extlen_t len),
1456 TP_ARGS(mp, agno, agbno, len),
1457 TP_STRUCT__entry(
1458 __field(dev_t, dev)
1459 __field(xfs_agnumber_t, agno)
1460 __field(xfs_agblock_t, agbno)
1461 __field(xfs_extlen_t, len)
1463 TP_fast_assign(
1464 __entry->dev = mp->m_super->s_dev;
1465 __entry->agno = agno;
1466 __entry->agbno = agbno;
1467 __entry->len = len;
1469 TP_printk("dev %d:%d agno %u agbno %u len %u",
1470 MAJOR(__entry->dev), MINOR(__entry->dev),
1471 __entry->agno,
1472 __entry->agbno,
1473 __entry->len)
1475 #define DEFINE_BUSY_EVENT(name) \
1476 DEFINE_EVENT(xfs_extent_busy_class, name, \
1477 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1478 xfs_agblock_t agbno, xfs_extlen_t len), \
1479 TP_ARGS(mp, agno, agbno, len))
1480 DEFINE_BUSY_EVENT(xfs_extent_busy);
1481 DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1482 DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1483 DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1484 DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1486 TRACE_EVENT(xfs_extent_busy_trim,
1487 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1488 xfs_agblock_t agbno, xfs_extlen_t len,
1489 xfs_agblock_t tbno, xfs_extlen_t tlen),
1490 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1491 TP_STRUCT__entry(
1492 __field(dev_t, dev)
1493 __field(xfs_agnumber_t, agno)
1494 __field(xfs_agblock_t, agbno)
1495 __field(xfs_extlen_t, len)
1496 __field(xfs_agblock_t, tbno)
1497 __field(xfs_extlen_t, tlen)
1499 TP_fast_assign(
1500 __entry->dev = mp->m_super->s_dev;
1501 __entry->agno = agno;
1502 __entry->agbno = agbno;
1503 __entry->len = len;
1504 __entry->tbno = tbno;
1505 __entry->tlen = tlen;
1507 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1508 MAJOR(__entry->dev), MINOR(__entry->dev),
1509 __entry->agno,
1510 __entry->agbno,
1511 __entry->len,
1512 __entry->tbno,
1513 __entry->tlen)
1516 DECLARE_EVENT_CLASS(xfs_agf_class,
1517 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1518 unsigned long caller_ip),
1519 TP_ARGS(mp, agf, flags, caller_ip),
1520 TP_STRUCT__entry(
1521 __field(dev_t, dev)
1522 __field(xfs_agnumber_t, agno)
1523 __field(int, flags)
1524 __field(__u32, length)
1525 __field(__u32, bno_root)
1526 __field(__u32, cnt_root)
1527 __field(__u32, bno_level)
1528 __field(__u32, cnt_level)
1529 __field(__u32, flfirst)
1530 __field(__u32, fllast)
1531 __field(__u32, flcount)
1532 __field(__u32, freeblks)
1533 __field(__u32, longest)
1534 __field(unsigned long, caller_ip)
1536 TP_fast_assign(
1537 __entry->dev = mp->m_super->s_dev;
1538 __entry->agno = be32_to_cpu(agf->agf_seqno),
1539 __entry->flags = flags;
1540 __entry->length = be32_to_cpu(agf->agf_length),
1541 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1542 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1543 __entry->bno_level =
1544 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1545 __entry->cnt_level =
1546 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1547 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1548 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1549 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1550 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1551 __entry->longest = be32_to_cpu(agf->agf_longest);
1552 __entry->caller_ip = caller_ip;
1554 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1555 "levels b %u c %u flfirst %u fllast %u flcount %u "
1556 "freeblks %u longest %u caller %ps",
1557 MAJOR(__entry->dev), MINOR(__entry->dev),
1558 __entry->agno,
1559 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1560 __entry->length,
1561 __entry->bno_root,
1562 __entry->cnt_root,
1563 __entry->bno_level,
1564 __entry->cnt_level,
1565 __entry->flfirst,
1566 __entry->fllast,
1567 __entry->flcount,
1568 __entry->freeblks,
1569 __entry->longest,
1570 (void *)__entry->caller_ip)
1572 #define DEFINE_AGF_EVENT(name) \
1573 DEFINE_EVENT(xfs_agf_class, name, \
1574 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1575 unsigned long caller_ip), \
1576 TP_ARGS(mp, agf, flags, caller_ip))
1577 DEFINE_AGF_EVENT(xfs_agf);
1578 DEFINE_AGF_EVENT(xfs_agfl_reset);
1580 TRACE_EVENT(xfs_free_extent,
1581 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1582 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1583 int haveright),
1584 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
1585 TP_STRUCT__entry(
1586 __field(dev_t, dev)
1587 __field(xfs_agnumber_t, agno)
1588 __field(xfs_agblock_t, agbno)
1589 __field(xfs_extlen_t, len)
1590 __field(int, resv)
1591 __field(int, haveleft)
1592 __field(int, haveright)
1594 TP_fast_assign(
1595 __entry->dev = mp->m_super->s_dev;
1596 __entry->agno = agno;
1597 __entry->agbno = agbno;
1598 __entry->len = len;
1599 __entry->resv = resv;
1600 __entry->haveleft = haveleft;
1601 __entry->haveright = haveright;
1603 TP_printk("dev %d:%d agno %u agbno %u len %u resv %d %s",
1604 MAJOR(__entry->dev), MINOR(__entry->dev),
1605 __entry->agno,
1606 __entry->agbno,
1607 __entry->len,
1608 __entry->resv,
1609 __entry->haveleft ?
1610 (__entry->haveright ? "both" : "left") :
1611 (__entry->haveright ? "right" : "none"))
1615 DECLARE_EVENT_CLASS(xfs_alloc_class,
1616 TP_PROTO(struct xfs_alloc_arg *args),
1617 TP_ARGS(args),
1618 TP_STRUCT__entry(
1619 __field(dev_t, dev)
1620 __field(xfs_agnumber_t, agno)
1621 __field(xfs_agblock_t, agbno)
1622 __field(xfs_extlen_t, minlen)
1623 __field(xfs_extlen_t, maxlen)
1624 __field(xfs_extlen_t, mod)
1625 __field(xfs_extlen_t, prod)
1626 __field(xfs_extlen_t, minleft)
1627 __field(xfs_extlen_t, total)
1628 __field(xfs_extlen_t, alignment)
1629 __field(xfs_extlen_t, minalignslop)
1630 __field(xfs_extlen_t, len)
1631 __field(short, type)
1632 __field(short, otype)
1633 __field(char, wasdel)
1634 __field(char, wasfromfl)
1635 __field(int, resv)
1636 __field(int, datatype)
1637 __field(xfs_fsblock_t, firstblock)
1639 TP_fast_assign(
1640 __entry->dev = args->mp->m_super->s_dev;
1641 __entry->agno = args->agno;
1642 __entry->agbno = args->agbno;
1643 __entry->minlen = args->minlen;
1644 __entry->maxlen = args->maxlen;
1645 __entry->mod = args->mod;
1646 __entry->prod = args->prod;
1647 __entry->minleft = args->minleft;
1648 __entry->total = args->total;
1649 __entry->alignment = args->alignment;
1650 __entry->minalignslop = args->minalignslop;
1651 __entry->len = args->len;
1652 __entry->type = args->type;
1653 __entry->otype = args->otype;
1654 __entry->wasdel = args->wasdel;
1655 __entry->wasfromfl = args->wasfromfl;
1656 __entry->resv = args->resv;
1657 __entry->datatype = args->datatype;
1658 __entry->firstblock = args->firstblock;
1660 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1661 "prod %u minleft %u total %u alignment %u minalignslop %u "
1662 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1663 "datatype 0x%x firstblock 0x%llx",
1664 MAJOR(__entry->dev), MINOR(__entry->dev),
1665 __entry->agno,
1666 __entry->agbno,
1667 __entry->minlen,
1668 __entry->maxlen,
1669 __entry->mod,
1670 __entry->prod,
1671 __entry->minleft,
1672 __entry->total,
1673 __entry->alignment,
1674 __entry->minalignslop,
1675 __entry->len,
1676 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1677 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1678 __entry->wasdel,
1679 __entry->wasfromfl,
1680 __entry->resv,
1681 __entry->datatype,
1682 (unsigned long long)__entry->firstblock)
1685 #define DEFINE_ALLOC_EVENT(name) \
1686 DEFINE_EVENT(xfs_alloc_class, name, \
1687 TP_PROTO(struct xfs_alloc_arg *args), \
1688 TP_ARGS(args))
1689 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1690 DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1691 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1692 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1693 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1694 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1695 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1696 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1697 DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1698 DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1699 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1700 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1701 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1702 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1703 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1704 DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1705 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1706 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1707 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1708 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1709 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1710 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1711 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1712 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1713 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1715 DECLARE_EVENT_CLASS(xfs_da_class,
1716 TP_PROTO(struct xfs_da_args *args),
1717 TP_ARGS(args),
1718 TP_STRUCT__entry(
1719 __field(dev_t, dev)
1720 __field(xfs_ino_t, ino)
1721 __dynamic_array(char, name, args->namelen)
1722 __field(int, namelen)
1723 __field(xfs_dahash_t, hashval)
1724 __field(xfs_ino_t, inumber)
1725 __field(int, op_flags)
1727 TP_fast_assign(
1728 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1729 __entry->ino = args->dp->i_ino;
1730 if (args->namelen)
1731 memcpy(__get_str(name), args->name, args->namelen);
1732 __entry->namelen = args->namelen;
1733 __entry->hashval = args->hashval;
1734 __entry->inumber = args->inumber;
1735 __entry->op_flags = args->op_flags;
1737 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1738 "inumber 0x%llx op_flags %s",
1739 MAJOR(__entry->dev), MINOR(__entry->dev),
1740 __entry->ino,
1741 __entry->namelen,
1742 __entry->namelen ? __get_str(name) : NULL,
1743 __entry->namelen,
1744 __entry->hashval,
1745 __entry->inumber,
1746 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1749 #define DEFINE_DIR2_EVENT(name) \
1750 DEFINE_EVENT(xfs_da_class, name, \
1751 TP_PROTO(struct xfs_da_args *args), \
1752 TP_ARGS(args))
1753 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1754 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1755 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1756 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1757 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1758 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1759 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1760 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1761 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1762 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1763 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1764 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1765 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1766 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1767 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1768 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1769 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1770 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1771 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1772 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1773 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1774 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1775 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1776 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1777 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1779 DECLARE_EVENT_CLASS(xfs_attr_class,
1780 TP_PROTO(struct xfs_da_args *args),
1781 TP_ARGS(args),
1782 TP_STRUCT__entry(
1783 __field(dev_t, dev)
1784 __field(xfs_ino_t, ino)
1785 __dynamic_array(char, name, args->namelen)
1786 __field(int, namelen)
1787 __field(int, valuelen)
1788 __field(xfs_dahash_t, hashval)
1789 __field(int, op_flags)
1791 TP_fast_assign(
1792 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1793 __entry->ino = args->dp->i_ino;
1794 if (args->namelen)
1795 memcpy(__get_str(name), args->name, args->namelen);
1796 __entry->namelen = args->namelen;
1797 __entry->valuelen = args->valuelen;
1798 __entry->hashval = args->hashval;
1799 __entry->op_flags = args->op_flags;
1801 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1802 "hashval 0x%x op_flags %s",
1803 MAJOR(__entry->dev), MINOR(__entry->dev),
1804 __entry->ino,
1805 __entry->namelen,
1806 __entry->namelen ? __get_str(name) : NULL,
1807 __entry->namelen,
1808 __entry->valuelen,
1809 __entry->hashval,
1810 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1813 #define DEFINE_ATTR_EVENT(name) \
1814 DEFINE_EVENT(xfs_attr_class, name, \
1815 TP_PROTO(struct xfs_da_args *args), \
1816 TP_ARGS(args))
1817 DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1818 DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1819 DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1820 DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1821 DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1822 DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1824 DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1825 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1826 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
1827 DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
1828 DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1829 DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
1830 DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1831 DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
1832 DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1833 DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
1834 DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
1835 DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1836 DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1837 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1838 DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1839 DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1840 DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1841 DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1842 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1843 DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1844 DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1845 DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
1846 DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
1848 DEFINE_ATTR_EVENT(xfs_attr_node_addname);
1849 DEFINE_ATTR_EVENT(xfs_attr_node_get);
1850 DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1851 DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1853 DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1854 DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1856 DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1857 DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1858 DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1860 #define DEFINE_DA_EVENT(name) \
1861 DEFINE_EVENT(xfs_da_class, name, \
1862 TP_PROTO(struct xfs_da_args *args), \
1863 TP_ARGS(args))
1864 DEFINE_DA_EVENT(xfs_da_split);
1865 DEFINE_DA_EVENT(xfs_da_join);
1866 DEFINE_DA_EVENT(xfs_da_link_before);
1867 DEFINE_DA_EVENT(xfs_da_link_after);
1868 DEFINE_DA_EVENT(xfs_da_unlink_back);
1869 DEFINE_DA_EVENT(xfs_da_unlink_forward);
1870 DEFINE_DA_EVENT(xfs_da_root_split);
1871 DEFINE_DA_EVENT(xfs_da_root_join);
1872 DEFINE_DA_EVENT(xfs_da_node_add);
1873 DEFINE_DA_EVENT(xfs_da_node_create);
1874 DEFINE_DA_EVENT(xfs_da_node_split);
1875 DEFINE_DA_EVENT(xfs_da_node_remove);
1876 DEFINE_DA_EVENT(xfs_da_node_rebalance);
1877 DEFINE_DA_EVENT(xfs_da_node_unbalance);
1878 DEFINE_DA_EVENT(xfs_da_node_toosmall);
1879 DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1880 DEFINE_DA_EVENT(xfs_da_grow_inode);
1881 DEFINE_DA_EVENT(xfs_da_shrink_inode);
1882 DEFINE_DA_EVENT(xfs_da_fixhashpath);
1883 DEFINE_DA_EVENT(xfs_da_path_shift);
1885 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1886 TP_PROTO(struct xfs_da_args *args, int idx),
1887 TP_ARGS(args, idx),
1888 TP_STRUCT__entry(
1889 __field(dev_t, dev)
1890 __field(xfs_ino_t, ino)
1891 __field(int, op_flags)
1892 __field(int, idx)
1894 TP_fast_assign(
1895 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1896 __entry->ino = args->dp->i_ino;
1897 __entry->op_flags = args->op_flags;
1898 __entry->idx = idx;
1900 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1901 MAJOR(__entry->dev), MINOR(__entry->dev),
1902 __entry->ino,
1903 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1904 __entry->idx)
1907 #define DEFINE_DIR2_SPACE_EVENT(name) \
1908 DEFINE_EVENT(xfs_dir2_space_class, name, \
1909 TP_PROTO(struct xfs_da_args *args, int idx), \
1910 TP_ARGS(args, idx))
1911 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1912 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1913 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1914 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1916 TRACE_EVENT(xfs_dir2_leafn_moveents,
1917 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1918 TP_ARGS(args, src_idx, dst_idx, count),
1919 TP_STRUCT__entry(
1920 __field(dev_t, dev)
1921 __field(xfs_ino_t, ino)
1922 __field(int, op_flags)
1923 __field(int, src_idx)
1924 __field(int, dst_idx)
1925 __field(int, count)
1927 TP_fast_assign(
1928 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1929 __entry->ino = args->dp->i_ino;
1930 __entry->op_flags = args->op_flags;
1931 __entry->src_idx = src_idx;
1932 __entry->dst_idx = dst_idx;
1933 __entry->count = count;
1935 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1936 "src_idx %d dst_idx %d count %d",
1937 MAJOR(__entry->dev), MINOR(__entry->dev),
1938 __entry->ino,
1939 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1940 __entry->src_idx,
1941 __entry->dst_idx,
1942 __entry->count)
1945 #define XFS_SWAPEXT_INODES \
1946 { 0, "target" }, \
1947 { 1, "temp" }
1949 #define XFS_INODE_FORMAT_STR \
1950 { 0, "invalid" }, \
1951 { 1, "local" }, \
1952 { 2, "extent" }, \
1953 { 3, "btree" }
1955 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1956 TP_PROTO(struct xfs_inode *ip, int which),
1957 TP_ARGS(ip, which),
1958 TP_STRUCT__entry(
1959 __field(dev_t, dev)
1960 __field(int, which)
1961 __field(xfs_ino_t, ino)
1962 __field(int, format)
1963 __field(int, nex)
1964 __field(int, broot_size)
1965 __field(int, fork_off)
1967 TP_fast_assign(
1968 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1969 __entry->which = which;
1970 __entry->ino = ip->i_ino;
1971 __entry->format = ip->i_d.di_format;
1972 __entry->nex = ip->i_d.di_nextents;
1973 __entry->broot_size = ip->i_df.if_broot_bytes;
1974 __entry->fork_off = XFS_IFORK_BOFF(ip);
1976 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1977 "broot size %d, fork offset %d",
1978 MAJOR(__entry->dev), MINOR(__entry->dev),
1979 __entry->ino,
1980 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1981 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1982 __entry->nex,
1983 __entry->broot_size,
1984 __entry->fork_off)
1987 #define DEFINE_SWAPEXT_EVENT(name) \
1988 DEFINE_EVENT(xfs_swap_extent_class, name, \
1989 TP_PROTO(struct xfs_inode *ip, int which), \
1990 TP_ARGS(ip, which))
1992 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1993 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1995 TRACE_EVENT(xfs_log_recover,
1996 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
1997 TP_ARGS(log, headblk, tailblk),
1998 TP_STRUCT__entry(
1999 __field(dev_t, dev)
2000 __field(xfs_daddr_t, headblk)
2001 __field(xfs_daddr_t, tailblk)
2003 TP_fast_assign(
2004 __entry->dev = log->l_mp->m_super->s_dev;
2005 __entry->headblk = headblk;
2006 __entry->tailblk = tailblk;
2008 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2009 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2010 __entry->tailblk)
2013 TRACE_EVENT(xfs_log_recover_record,
2014 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2015 TP_ARGS(log, rhead, pass),
2016 TP_STRUCT__entry(
2017 __field(dev_t, dev)
2018 __field(xfs_lsn_t, lsn)
2019 __field(int, len)
2020 __field(int, num_logops)
2021 __field(int, pass)
2023 TP_fast_assign(
2024 __entry->dev = log->l_mp->m_super->s_dev;
2025 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2026 __entry->len = be32_to_cpu(rhead->h_len);
2027 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2028 __entry->pass = pass;
2030 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2031 MAJOR(__entry->dev), MINOR(__entry->dev),
2032 __entry->lsn, __entry->len, __entry->num_logops,
2033 __entry->pass)
2036 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2037 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2038 struct xlog_recover_item *item, int pass),
2039 TP_ARGS(log, trans, item, pass),
2040 TP_STRUCT__entry(
2041 __field(dev_t, dev)
2042 __field(unsigned long, item)
2043 __field(xlog_tid_t, tid)
2044 __field(xfs_lsn_t, lsn)
2045 __field(int, type)
2046 __field(int, pass)
2047 __field(int, count)
2048 __field(int, total)
2050 TP_fast_assign(
2051 __entry->dev = log->l_mp->m_super->s_dev;
2052 __entry->item = (unsigned long)item;
2053 __entry->tid = trans->r_log_tid;
2054 __entry->lsn = trans->r_lsn;
2055 __entry->type = ITEM_TYPE(item);
2056 __entry->pass = pass;
2057 __entry->count = item->ri_cnt;
2058 __entry->total = item->ri_total;
2060 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item 0x%p, "
2061 "item type %s item region count/total %d/%d",
2062 MAJOR(__entry->dev), MINOR(__entry->dev),
2063 __entry->tid,
2064 __entry->lsn,
2065 __entry->pass,
2066 (void *)__entry->item,
2067 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2068 __entry->count,
2069 __entry->total)
2072 #define DEFINE_LOG_RECOVER_ITEM(name) \
2073 DEFINE_EVENT(xfs_log_recover_item_class, name, \
2074 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2075 struct xlog_recover_item *item, int pass), \
2076 TP_ARGS(log, trans, item, pass))
2078 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2079 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2080 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2081 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2082 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2084 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2085 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2086 TP_ARGS(log, buf_f),
2087 TP_STRUCT__entry(
2088 __field(dev_t, dev)
2089 __field(int64_t, blkno)
2090 __field(unsigned short, len)
2091 __field(unsigned short, flags)
2092 __field(unsigned short, size)
2093 __field(unsigned int, map_size)
2095 TP_fast_assign(
2096 __entry->dev = log->l_mp->m_super->s_dev;
2097 __entry->blkno = buf_f->blf_blkno;
2098 __entry->len = buf_f->blf_len;
2099 __entry->flags = buf_f->blf_flags;
2100 __entry->size = buf_f->blf_size;
2101 __entry->map_size = buf_f->blf_map_size;
2103 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2104 "map_size %d",
2105 MAJOR(__entry->dev), MINOR(__entry->dev),
2106 __entry->blkno,
2107 __entry->len,
2108 __entry->flags,
2109 __entry->size,
2110 __entry->map_size)
2113 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2114 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2115 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2116 TP_ARGS(log, buf_f))
2118 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2119 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2120 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2121 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2122 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2123 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2124 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2125 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2126 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2128 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2129 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2130 TP_ARGS(log, in_f),
2131 TP_STRUCT__entry(
2132 __field(dev_t, dev)
2133 __field(xfs_ino_t, ino)
2134 __field(unsigned short, size)
2135 __field(int, fields)
2136 __field(unsigned short, asize)
2137 __field(unsigned short, dsize)
2138 __field(int64_t, blkno)
2139 __field(int, len)
2140 __field(int, boffset)
2142 TP_fast_assign(
2143 __entry->dev = log->l_mp->m_super->s_dev;
2144 __entry->ino = in_f->ilf_ino;
2145 __entry->size = in_f->ilf_size;
2146 __entry->fields = in_f->ilf_fields;
2147 __entry->asize = in_f->ilf_asize;
2148 __entry->dsize = in_f->ilf_dsize;
2149 __entry->blkno = in_f->ilf_blkno;
2150 __entry->len = in_f->ilf_len;
2151 __entry->boffset = in_f->ilf_boffset;
2153 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2154 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2155 MAJOR(__entry->dev), MINOR(__entry->dev),
2156 __entry->ino,
2157 __entry->size,
2158 __entry->fields,
2159 __entry->asize,
2160 __entry->dsize,
2161 __entry->blkno,
2162 __entry->len,
2163 __entry->boffset)
2165 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2166 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2167 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2168 TP_ARGS(log, in_f))
2170 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2171 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2172 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2174 DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2175 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2176 TP_ARGS(log, in_f),
2177 TP_STRUCT__entry(
2178 __field(dev_t, dev)
2179 __field(xfs_agnumber_t, agno)
2180 __field(xfs_agblock_t, agbno)
2181 __field(unsigned int, count)
2182 __field(unsigned int, isize)
2183 __field(xfs_agblock_t, length)
2184 __field(unsigned int, gen)
2186 TP_fast_assign(
2187 __entry->dev = log->l_mp->m_super->s_dev;
2188 __entry->agno = be32_to_cpu(in_f->icl_ag);
2189 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2190 __entry->count = be32_to_cpu(in_f->icl_count);
2191 __entry->isize = be32_to_cpu(in_f->icl_isize);
2192 __entry->length = be32_to_cpu(in_f->icl_length);
2193 __entry->gen = be32_to_cpu(in_f->icl_gen);
2195 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2196 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2197 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2198 __entry->length, __entry->gen)
2200 #define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2201 DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2202 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2203 TP_ARGS(log, in_f))
2205 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2206 DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2208 DECLARE_EVENT_CLASS(xfs_discard_class,
2209 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2210 xfs_agblock_t agbno, xfs_extlen_t len),
2211 TP_ARGS(mp, agno, agbno, len),
2212 TP_STRUCT__entry(
2213 __field(dev_t, dev)
2214 __field(xfs_agnumber_t, agno)
2215 __field(xfs_agblock_t, agbno)
2216 __field(xfs_extlen_t, len)
2218 TP_fast_assign(
2219 __entry->dev = mp->m_super->s_dev;
2220 __entry->agno = agno;
2221 __entry->agbno = agbno;
2222 __entry->len = len;
2224 TP_printk("dev %d:%d agno %u agbno %u len %u",
2225 MAJOR(__entry->dev), MINOR(__entry->dev),
2226 __entry->agno,
2227 __entry->agbno,
2228 __entry->len)
2231 #define DEFINE_DISCARD_EVENT(name) \
2232 DEFINE_EVENT(xfs_discard_class, name, \
2233 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2234 xfs_agblock_t agbno, xfs_extlen_t len), \
2235 TP_ARGS(mp, agno, agbno, len))
2236 DEFINE_DISCARD_EVENT(xfs_discard_extent);
2237 DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2238 DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2239 DEFINE_DISCARD_EVENT(xfs_discard_busy);
2241 /* btree cursor events */
2242 DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2243 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2244 TP_ARGS(cur, level, bp),
2245 TP_STRUCT__entry(
2246 __field(dev_t, dev)
2247 __field(xfs_btnum_t, btnum)
2248 __field(int, level)
2249 __field(int, nlevels)
2250 __field(int, ptr)
2251 __field(xfs_daddr_t, daddr)
2253 TP_fast_assign(
2254 __entry->dev = cur->bc_mp->m_super->s_dev;
2255 __entry->btnum = cur->bc_btnum;
2256 __entry->level = level;
2257 __entry->nlevels = cur->bc_nlevels;
2258 __entry->ptr = cur->bc_ptrs[level];
2259 __entry->daddr = bp ? bp->b_bn : -1;
2261 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2262 MAJOR(__entry->dev), MINOR(__entry->dev),
2263 __entry->btnum,
2264 __entry->level,
2265 __entry->nlevels,
2266 __entry->ptr,
2267 (unsigned long long)__entry->daddr)
2270 #define DEFINE_BTREE_CUR_EVENT(name) \
2271 DEFINE_EVENT(xfs_btree_cur_class, name, \
2272 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2273 TP_ARGS(cur, level, bp))
2274 DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2275 DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2277 /* deferred ops */
2278 struct xfs_defer_pending;
2279 struct xfs_defer_ops;
2281 DECLARE_EVENT_CLASS(xfs_defer_class,
2282 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop),
2283 TP_ARGS(mp, dop),
2284 TP_STRUCT__entry(
2285 __field(dev_t, dev)
2286 __field(void *, dop)
2287 __field(char, committed)
2288 __field(char, low)
2290 TP_fast_assign(
2291 __entry->dev = mp ? mp->m_super->s_dev : 0;
2292 __entry->dop = dop;
2293 __entry->committed = dop->dop_committed;
2294 __entry->low = dop->dop_low;
2296 TP_printk("dev %d:%d ops %p committed %d low %d",
2297 MAJOR(__entry->dev), MINOR(__entry->dev),
2298 __entry->dop,
2299 __entry->committed,
2300 __entry->low)
2302 #define DEFINE_DEFER_EVENT(name) \
2303 DEFINE_EVENT(xfs_defer_class, name, \
2304 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2305 TP_ARGS(mp, dop))
2307 DECLARE_EVENT_CLASS(xfs_defer_error_class,
2308 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
2309 TP_ARGS(mp, dop, error),
2310 TP_STRUCT__entry(
2311 __field(dev_t, dev)
2312 __field(void *, dop)
2313 __field(char, committed)
2314 __field(char, low)
2315 __field(int, error)
2317 TP_fast_assign(
2318 __entry->dev = mp ? mp->m_super->s_dev : 0;
2319 __entry->dop = dop;
2320 __entry->committed = dop->dop_committed;
2321 __entry->low = dop->dop_low;
2322 __entry->error = error;
2324 TP_printk("dev %d:%d ops %p committed %d low %d err %d",
2325 MAJOR(__entry->dev), MINOR(__entry->dev),
2326 __entry->dop,
2327 __entry->committed,
2328 __entry->low,
2329 __entry->error)
2331 #define DEFINE_DEFER_ERROR_EVENT(name) \
2332 DEFINE_EVENT(xfs_defer_error_class, name, \
2333 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2334 TP_ARGS(mp, dop, error))
2336 DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2337 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2338 TP_ARGS(mp, dfp),
2339 TP_STRUCT__entry(
2340 __field(dev_t, dev)
2341 __field(int, type)
2342 __field(void *, intent)
2343 __field(char, committed)
2344 __field(int, nr)
2346 TP_fast_assign(
2347 __entry->dev = mp ? mp->m_super->s_dev : 0;
2348 __entry->type = dfp->dfp_type->type;
2349 __entry->intent = dfp->dfp_intent;
2350 __entry->committed = dfp->dfp_done != NULL;
2351 __entry->nr = dfp->dfp_count;
2353 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
2354 MAJOR(__entry->dev), MINOR(__entry->dev),
2355 __entry->type,
2356 __entry->intent,
2357 __entry->committed,
2358 __entry->nr)
2360 #define DEFINE_DEFER_PENDING_EVENT(name) \
2361 DEFINE_EVENT(xfs_defer_pending_class, name, \
2362 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2363 TP_ARGS(mp, dfp))
2365 DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2366 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2367 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2368 TP_ARGS(mp, agno, type, agbno, len),
2369 TP_STRUCT__entry(
2370 __field(dev_t, dev)
2371 __field(xfs_agnumber_t, agno)
2372 __field(int, type)
2373 __field(xfs_agblock_t, agbno)
2374 __field(xfs_extlen_t, len)
2376 TP_fast_assign(
2377 __entry->dev = mp->m_super->s_dev;
2378 __entry->agno = agno;
2379 __entry->type = type;
2380 __entry->agbno = agbno;
2381 __entry->len = len;
2383 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2384 MAJOR(__entry->dev), MINOR(__entry->dev),
2385 __entry->type,
2386 __entry->agno,
2387 __entry->agbno,
2388 __entry->len)
2390 #define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2391 DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2392 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2393 int type, \
2394 xfs_agblock_t bno, \
2395 xfs_extlen_t len), \
2396 TP_ARGS(mp, agno, type, bno, len))
2398 DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2399 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2400 int op,
2401 xfs_agblock_t agbno,
2402 xfs_ino_t ino,
2403 int whichfork,
2404 xfs_fileoff_t offset,
2405 xfs_filblks_t len,
2406 xfs_exntst_t state),
2407 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2408 TP_STRUCT__entry(
2409 __field(dev_t, dev)
2410 __field(xfs_agnumber_t, agno)
2411 __field(xfs_ino_t, ino)
2412 __field(xfs_agblock_t, agbno)
2413 __field(int, whichfork)
2414 __field(xfs_fileoff_t, l_loff)
2415 __field(xfs_filblks_t, l_len)
2416 __field(xfs_exntst_t, l_state)
2417 __field(int, op)
2419 TP_fast_assign(
2420 __entry->dev = mp->m_super->s_dev;
2421 __entry->agno = agno;
2422 __entry->ino = ino;
2423 __entry->agbno = agbno;
2424 __entry->whichfork = whichfork;
2425 __entry->l_loff = offset;
2426 __entry->l_len = len;
2427 __entry->l_state = state;
2428 __entry->op = op;
2430 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2431 MAJOR(__entry->dev), MINOR(__entry->dev),
2432 __entry->op,
2433 __entry->agno,
2434 __entry->agbno,
2435 __entry->ino,
2436 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2437 __entry->l_loff,
2438 __entry->l_len,
2439 __entry->l_state)
2441 #define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2442 DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2443 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2444 int op, \
2445 xfs_agblock_t agbno, \
2446 xfs_ino_t ino, \
2447 int whichfork, \
2448 xfs_fileoff_t offset, \
2449 xfs_filblks_t len, \
2450 xfs_exntst_t state), \
2451 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2453 DEFINE_DEFER_EVENT(xfs_defer_init);
2454 DEFINE_DEFER_EVENT(xfs_defer_cancel);
2455 DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2456 DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2457 DEFINE_DEFER_EVENT(xfs_defer_finish);
2458 DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2460 DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2461 DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2463 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
2464 DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
2465 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
2466 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2467 DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2469 #define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2470 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2471 DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2473 /* rmap tracepoints */
2474 DECLARE_EVENT_CLASS(xfs_rmap_class,
2475 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2476 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2477 struct xfs_owner_info *oinfo),
2478 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2479 TP_STRUCT__entry(
2480 __field(dev_t, dev)
2481 __field(xfs_agnumber_t, agno)
2482 __field(xfs_agblock_t, agbno)
2483 __field(xfs_extlen_t, len)
2484 __field(uint64_t, owner)
2485 __field(uint64_t, offset)
2486 __field(unsigned long, flags)
2488 TP_fast_assign(
2489 __entry->dev = mp->m_super->s_dev;
2490 __entry->agno = agno;
2491 __entry->agbno = agbno;
2492 __entry->len = len;
2493 __entry->owner = oinfo->oi_owner;
2494 __entry->offset = oinfo->oi_offset;
2495 __entry->flags = oinfo->oi_flags;
2496 if (unwritten)
2497 __entry->flags |= XFS_RMAP_UNWRITTEN;
2499 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2500 MAJOR(__entry->dev), MINOR(__entry->dev),
2501 __entry->agno,
2502 __entry->agbno,
2503 __entry->len,
2504 __entry->owner,
2505 __entry->offset,
2506 __entry->flags)
2508 #define DEFINE_RMAP_EVENT(name) \
2509 DEFINE_EVENT(xfs_rmap_class, name, \
2510 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2511 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2512 struct xfs_owner_info *oinfo), \
2513 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2515 /* simple AG-based error/%ip tracepoint class */
2516 DECLARE_EVENT_CLASS(xfs_ag_error_class,
2517 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2518 unsigned long caller_ip),
2519 TP_ARGS(mp, agno, error, caller_ip),
2520 TP_STRUCT__entry(
2521 __field(dev_t, dev)
2522 __field(xfs_agnumber_t, agno)
2523 __field(int, error)
2524 __field(unsigned long, caller_ip)
2526 TP_fast_assign(
2527 __entry->dev = mp->m_super->s_dev;
2528 __entry->agno = agno;
2529 __entry->error = error;
2530 __entry->caller_ip = caller_ip;
2532 TP_printk("dev %d:%d agno %u error %d caller %ps",
2533 MAJOR(__entry->dev), MINOR(__entry->dev),
2534 __entry->agno,
2535 __entry->error,
2536 (char *)__entry->caller_ip)
2539 #define DEFINE_AG_ERROR_EVENT(name) \
2540 DEFINE_EVENT(xfs_ag_error_class, name, \
2541 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2542 unsigned long caller_ip), \
2543 TP_ARGS(mp, agno, error, caller_ip))
2545 DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2546 DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2547 DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2548 DEFINE_RMAP_EVENT(xfs_rmap_map);
2549 DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2550 DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2551 DEFINE_RMAP_EVENT(xfs_rmap_convert);
2552 DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2553 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2554 DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
2556 DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2557 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2558 xfs_agblock_t agbno, xfs_extlen_t len,
2559 uint64_t owner, uint64_t offset, unsigned int flags),
2560 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2561 TP_STRUCT__entry(
2562 __field(dev_t, dev)
2563 __field(xfs_agnumber_t, agno)
2564 __field(xfs_agblock_t, agbno)
2565 __field(xfs_extlen_t, len)
2566 __field(uint64_t, owner)
2567 __field(uint64_t, offset)
2568 __field(unsigned int, flags)
2570 TP_fast_assign(
2571 __entry->dev = mp->m_super->s_dev;
2572 __entry->agno = agno;
2573 __entry->agbno = agbno;
2574 __entry->len = len;
2575 __entry->owner = owner;
2576 __entry->offset = offset;
2577 __entry->flags = flags;
2579 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2580 MAJOR(__entry->dev), MINOR(__entry->dev),
2581 __entry->agno,
2582 __entry->agbno,
2583 __entry->len,
2584 __entry->owner,
2585 __entry->offset,
2586 __entry->flags)
2588 #define DEFINE_RMAPBT_EVENT(name) \
2589 DEFINE_EVENT(xfs_rmapbt_class, name, \
2590 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2591 xfs_agblock_t agbno, xfs_extlen_t len, \
2592 uint64_t owner, uint64_t offset, unsigned int flags), \
2593 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2595 #define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2596 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2597 DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2599 DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2600 DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
2601 DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2602 DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2603 DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2604 DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2605 DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2606 DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
2608 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2609 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2610 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2611 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
2612 DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2613 DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
2614 DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
2616 /* deferred bmbt updates */
2617 #define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2618 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2619 DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2621 /* per-AG reservation */
2622 DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2623 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2624 xfs_extlen_t len),
2625 TP_ARGS(pag, resv, len),
2626 TP_STRUCT__entry(
2627 __field(dev_t, dev)
2628 __field(xfs_agnumber_t, agno)
2629 __field(int, resv)
2630 __field(xfs_extlen_t, freeblks)
2631 __field(xfs_extlen_t, flcount)
2632 __field(xfs_extlen_t, reserved)
2633 __field(xfs_extlen_t, asked)
2634 __field(xfs_extlen_t, len)
2636 TP_fast_assign(
2637 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2639 __entry->dev = pag->pag_mount->m_super->s_dev;
2640 __entry->agno = pag->pag_agno;
2641 __entry->resv = resv;
2642 __entry->freeblks = pag->pagf_freeblks;
2643 __entry->flcount = pag->pagf_flcount;
2644 __entry->reserved = r ? r->ar_reserved : 0;
2645 __entry->asked = r ? r->ar_asked : 0;
2646 __entry->len = len;
2648 TP_printk("dev %d:%d agno %u resv %d freeblks %u flcount %u "
2649 "resv %u ask %u len %u",
2650 MAJOR(__entry->dev), MINOR(__entry->dev),
2651 __entry->agno,
2652 __entry->resv,
2653 __entry->freeblks,
2654 __entry->flcount,
2655 __entry->reserved,
2656 __entry->asked,
2657 __entry->len)
2659 #define DEFINE_AG_RESV_EVENT(name) \
2660 DEFINE_EVENT(xfs_ag_resv_class, name, \
2661 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2662 xfs_extlen_t len), \
2663 TP_ARGS(pag, type, len))
2665 /* per-AG reservation tracepoints */
2666 DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2667 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2668 DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2669 DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2670 DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2671 DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2673 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2674 DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2676 /* refcount tracepoint classes */
2678 /* reuse the discard trace class for agbno/aglen-based traces */
2679 #define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2681 /* ag btree lookup tracepoint class */
2682 #define XFS_AG_BTREE_CMP_FORMAT_STR \
2683 { XFS_LOOKUP_EQ, "eq" }, \
2684 { XFS_LOOKUP_LE, "le" }, \
2685 { XFS_LOOKUP_GE, "ge" }
2686 DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2687 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2688 xfs_agblock_t agbno, xfs_lookup_t dir),
2689 TP_ARGS(mp, agno, agbno, dir),
2690 TP_STRUCT__entry(
2691 __field(dev_t, dev)
2692 __field(xfs_agnumber_t, agno)
2693 __field(xfs_agblock_t, agbno)
2694 __field(xfs_lookup_t, dir)
2696 TP_fast_assign(
2697 __entry->dev = mp->m_super->s_dev;
2698 __entry->agno = agno;
2699 __entry->agbno = agbno;
2700 __entry->dir = dir;
2702 TP_printk("dev %d:%d agno %u agbno %u cmp %s(%d)",
2703 MAJOR(__entry->dev), MINOR(__entry->dev),
2704 __entry->agno,
2705 __entry->agbno,
2706 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2707 __entry->dir)
2710 #define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2711 DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2712 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2713 xfs_agblock_t agbno, xfs_lookup_t dir), \
2714 TP_ARGS(mp, agno, agbno, dir))
2716 /* single-rcext tracepoint class */
2717 DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2718 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2719 struct xfs_refcount_irec *irec),
2720 TP_ARGS(mp, agno, irec),
2721 TP_STRUCT__entry(
2722 __field(dev_t, dev)
2723 __field(xfs_agnumber_t, agno)
2724 __field(xfs_agblock_t, startblock)
2725 __field(xfs_extlen_t, blockcount)
2726 __field(xfs_nlink_t, refcount)
2728 TP_fast_assign(
2729 __entry->dev = mp->m_super->s_dev;
2730 __entry->agno = agno;
2731 __entry->startblock = irec->rc_startblock;
2732 __entry->blockcount = irec->rc_blockcount;
2733 __entry->refcount = irec->rc_refcount;
2735 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u",
2736 MAJOR(__entry->dev), MINOR(__entry->dev),
2737 __entry->agno,
2738 __entry->startblock,
2739 __entry->blockcount,
2740 __entry->refcount)
2743 #define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2744 DEFINE_EVENT(xfs_refcount_extent_class, name, \
2745 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2746 struct xfs_refcount_irec *irec), \
2747 TP_ARGS(mp, agno, irec))
2749 /* single-rcext and an agbno tracepoint class */
2750 DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2751 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2752 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2753 TP_ARGS(mp, agno, irec, agbno),
2754 TP_STRUCT__entry(
2755 __field(dev_t, dev)
2756 __field(xfs_agnumber_t, agno)
2757 __field(xfs_agblock_t, startblock)
2758 __field(xfs_extlen_t, blockcount)
2759 __field(xfs_nlink_t, refcount)
2760 __field(xfs_agblock_t, agbno)
2762 TP_fast_assign(
2763 __entry->dev = mp->m_super->s_dev;
2764 __entry->agno = agno;
2765 __entry->startblock = irec->rc_startblock;
2766 __entry->blockcount = irec->rc_blockcount;
2767 __entry->refcount = irec->rc_refcount;
2768 __entry->agbno = agbno;
2770 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u @ agbno %u",
2771 MAJOR(__entry->dev), MINOR(__entry->dev),
2772 __entry->agno,
2773 __entry->startblock,
2774 __entry->blockcount,
2775 __entry->refcount,
2776 __entry->agbno)
2779 #define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2780 DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2781 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2782 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2783 TP_ARGS(mp, agno, irec, agbno))
2785 /* double-rcext tracepoint class */
2786 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
2787 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2788 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
2789 TP_ARGS(mp, agno, i1, i2),
2790 TP_STRUCT__entry(
2791 __field(dev_t, dev)
2792 __field(xfs_agnumber_t, agno)
2793 __field(xfs_agblock_t, i1_startblock)
2794 __field(xfs_extlen_t, i1_blockcount)
2795 __field(xfs_nlink_t, i1_refcount)
2796 __field(xfs_agblock_t, i2_startblock)
2797 __field(xfs_extlen_t, i2_blockcount)
2798 __field(xfs_nlink_t, i2_refcount)
2800 TP_fast_assign(
2801 __entry->dev = mp->m_super->s_dev;
2802 __entry->agno = agno;
2803 __entry->i1_startblock = i1->rc_startblock;
2804 __entry->i1_blockcount = i1->rc_blockcount;
2805 __entry->i1_refcount = i1->rc_refcount;
2806 __entry->i2_startblock = i2->rc_startblock;
2807 __entry->i2_blockcount = i2->rc_blockcount;
2808 __entry->i2_refcount = i2->rc_refcount;
2810 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2811 "agbno %u len %u refcount %u",
2812 MAJOR(__entry->dev), MINOR(__entry->dev),
2813 __entry->agno,
2814 __entry->i1_startblock,
2815 __entry->i1_blockcount,
2816 __entry->i1_refcount,
2817 __entry->i2_startblock,
2818 __entry->i2_blockcount,
2819 __entry->i2_refcount)
2822 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
2823 DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
2824 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2825 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
2826 TP_ARGS(mp, agno, i1, i2))
2828 /* double-rcext and an agbno tracepoint class */
2829 DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
2830 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2831 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2832 xfs_agblock_t agbno),
2833 TP_ARGS(mp, agno, i1, i2, agbno),
2834 TP_STRUCT__entry(
2835 __field(dev_t, dev)
2836 __field(xfs_agnumber_t, agno)
2837 __field(xfs_agblock_t, i1_startblock)
2838 __field(xfs_extlen_t, i1_blockcount)
2839 __field(xfs_nlink_t, i1_refcount)
2840 __field(xfs_agblock_t, i2_startblock)
2841 __field(xfs_extlen_t, i2_blockcount)
2842 __field(xfs_nlink_t, i2_refcount)
2843 __field(xfs_agblock_t, agbno)
2845 TP_fast_assign(
2846 __entry->dev = mp->m_super->s_dev;
2847 __entry->agno = agno;
2848 __entry->i1_startblock = i1->rc_startblock;
2849 __entry->i1_blockcount = i1->rc_blockcount;
2850 __entry->i1_refcount = i1->rc_refcount;
2851 __entry->i2_startblock = i2->rc_startblock;
2852 __entry->i2_blockcount = i2->rc_blockcount;
2853 __entry->i2_refcount = i2->rc_refcount;
2854 __entry->agbno = agbno;
2856 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2857 "agbno %u len %u refcount %u @ agbno %u",
2858 MAJOR(__entry->dev), MINOR(__entry->dev),
2859 __entry->agno,
2860 __entry->i1_startblock,
2861 __entry->i1_blockcount,
2862 __entry->i1_refcount,
2863 __entry->i2_startblock,
2864 __entry->i2_blockcount,
2865 __entry->i2_refcount,
2866 __entry->agbno)
2869 #define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
2870 DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
2871 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2872 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2873 xfs_agblock_t agbno), \
2874 TP_ARGS(mp, agno, i1, i2, agbno))
2876 /* triple-rcext tracepoint class */
2877 DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
2878 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2879 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
2880 struct xfs_refcount_irec *i3),
2881 TP_ARGS(mp, agno, i1, i2, i3),
2882 TP_STRUCT__entry(
2883 __field(dev_t, dev)
2884 __field(xfs_agnumber_t, agno)
2885 __field(xfs_agblock_t, i1_startblock)
2886 __field(xfs_extlen_t, i1_blockcount)
2887 __field(xfs_nlink_t, i1_refcount)
2888 __field(xfs_agblock_t, i2_startblock)
2889 __field(xfs_extlen_t, i2_blockcount)
2890 __field(xfs_nlink_t, i2_refcount)
2891 __field(xfs_agblock_t, i3_startblock)
2892 __field(xfs_extlen_t, i3_blockcount)
2893 __field(xfs_nlink_t, i3_refcount)
2895 TP_fast_assign(
2896 __entry->dev = mp->m_super->s_dev;
2897 __entry->agno = agno;
2898 __entry->i1_startblock = i1->rc_startblock;
2899 __entry->i1_blockcount = i1->rc_blockcount;
2900 __entry->i1_refcount = i1->rc_refcount;
2901 __entry->i2_startblock = i2->rc_startblock;
2902 __entry->i2_blockcount = i2->rc_blockcount;
2903 __entry->i2_refcount = i2->rc_refcount;
2904 __entry->i3_startblock = i3->rc_startblock;
2905 __entry->i3_blockcount = i3->rc_blockcount;
2906 __entry->i3_refcount = i3->rc_refcount;
2908 TP_printk("dev %d:%d agno %u agbno %u len %u refcount %u -- "
2909 "agbno %u len %u refcount %u -- "
2910 "agbno %u len %u refcount %u",
2911 MAJOR(__entry->dev), MINOR(__entry->dev),
2912 __entry->agno,
2913 __entry->i1_startblock,
2914 __entry->i1_blockcount,
2915 __entry->i1_refcount,
2916 __entry->i2_startblock,
2917 __entry->i2_blockcount,
2918 __entry->i2_refcount,
2919 __entry->i3_startblock,
2920 __entry->i3_blockcount,
2921 __entry->i3_refcount)
2924 #define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
2925 DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
2926 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2927 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
2928 struct xfs_refcount_irec *i3), \
2929 TP_ARGS(mp, agno, i1, i2, i3))
2931 /* refcount btree tracepoints */
2932 DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
2933 DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
2934 DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
2935 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
2936 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
2937 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
2938 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
2939 DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
2940 DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
2941 DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
2943 /* refcount adjustment tracepoints */
2944 DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
2945 DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
2946 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
2947 DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
2948 DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
2949 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
2950 DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
2951 DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
2952 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
2953 DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
2954 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
2955 DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
2956 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
2957 DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
2958 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
2959 DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
2960 DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
2961 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
2962 DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
2963 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
2964 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
2966 /* reflink helpers */
2967 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
2968 DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
2969 DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
2970 #define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2971 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
2972 DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
2974 TRACE_EVENT(xfs_refcount_finish_one_leftover,
2975 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2976 int type, xfs_agblock_t agbno, xfs_extlen_t len,
2977 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
2978 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
2979 TP_STRUCT__entry(
2980 __field(dev_t, dev)
2981 __field(xfs_agnumber_t, agno)
2982 __field(int, type)
2983 __field(xfs_agblock_t, agbno)
2984 __field(xfs_extlen_t, len)
2985 __field(xfs_agblock_t, new_agbno)
2986 __field(xfs_extlen_t, new_len)
2988 TP_fast_assign(
2989 __entry->dev = mp->m_super->s_dev;
2990 __entry->agno = agno;
2991 __entry->type = type;
2992 __entry->agbno = agbno;
2993 __entry->len = len;
2994 __entry->new_agbno = new_agbno;
2995 __entry->new_len = new_len;
2997 TP_printk("dev %d:%d type %d agno %u agbno %u len %u new_agbno %u new_len %u",
2998 MAJOR(__entry->dev), MINOR(__entry->dev),
2999 __entry->type,
3000 __entry->agno,
3001 __entry->agbno,
3002 __entry->len,
3003 __entry->new_agbno,
3004 __entry->new_len)
3007 /* simple inode-based error/%ip tracepoint class */
3008 DECLARE_EVENT_CLASS(xfs_inode_error_class,
3009 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3010 TP_ARGS(ip, error, caller_ip),
3011 TP_STRUCT__entry(
3012 __field(dev_t, dev)
3013 __field(xfs_ino_t, ino)
3014 __field(int, error)
3015 __field(unsigned long, caller_ip)
3017 TP_fast_assign(
3018 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3019 __entry->ino = ip->i_ino;
3020 __entry->error = error;
3021 __entry->caller_ip = caller_ip;
3023 TP_printk("dev %d:%d ino %llx error %d caller %ps",
3024 MAJOR(__entry->dev), MINOR(__entry->dev),
3025 __entry->ino,
3026 __entry->error,
3027 (char *)__entry->caller_ip)
3030 #define DEFINE_INODE_ERROR_EVENT(name) \
3031 DEFINE_EVENT(xfs_inode_error_class, name, \
3032 TP_PROTO(struct xfs_inode *ip, int error, \
3033 unsigned long caller_ip), \
3034 TP_ARGS(ip, error, caller_ip))
3036 /* reflink tracepoint classes */
3038 /* two-file io tracepoint class */
3039 DECLARE_EVENT_CLASS(xfs_double_io_class,
3040 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3041 struct xfs_inode *dest, xfs_off_t doffset),
3042 TP_ARGS(src, soffset, len, dest, doffset),
3043 TP_STRUCT__entry(
3044 __field(dev_t, dev)
3045 __field(xfs_ino_t, src_ino)
3046 __field(loff_t, src_isize)
3047 __field(loff_t, src_disize)
3048 __field(loff_t, src_offset)
3049 __field(size_t, len)
3050 __field(xfs_ino_t, dest_ino)
3051 __field(loff_t, dest_isize)
3052 __field(loff_t, dest_disize)
3053 __field(loff_t, dest_offset)
3055 TP_fast_assign(
3056 __entry->dev = VFS_I(src)->i_sb->s_dev;
3057 __entry->src_ino = src->i_ino;
3058 __entry->src_isize = VFS_I(src)->i_size;
3059 __entry->src_disize = src->i_d.di_size;
3060 __entry->src_offset = soffset;
3061 __entry->len = len;
3062 __entry->dest_ino = dest->i_ino;
3063 __entry->dest_isize = VFS_I(dest)->i_size;
3064 __entry->dest_disize = dest->i_d.di_size;
3065 __entry->dest_offset = doffset;
3067 TP_printk("dev %d:%d count %zd "
3068 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx -> "
3069 "ino 0x%llx isize 0x%llx disize 0x%llx offset 0x%llx",
3070 MAJOR(__entry->dev), MINOR(__entry->dev),
3071 __entry->len,
3072 __entry->src_ino,
3073 __entry->src_isize,
3074 __entry->src_disize,
3075 __entry->src_offset,
3076 __entry->dest_ino,
3077 __entry->dest_isize,
3078 __entry->dest_disize,
3079 __entry->dest_offset)
3082 #define DEFINE_DOUBLE_IO_EVENT(name) \
3083 DEFINE_EVENT(xfs_double_io_class, name, \
3084 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3085 struct xfs_inode *dest, xfs_off_t doffset), \
3086 TP_ARGS(src, soffset, len, dest, doffset))
3088 /* inode/irec events */
3089 DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3090 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3091 TP_ARGS(ip, irec),
3092 TP_STRUCT__entry(
3093 __field(dev_t, dev)
3094 __field(xfs_ino_t, ino)
3095 __field(xfs_fileoff_t, lblk)
3096 __field(xfs_extlen_t, len)
3097 __field(xfs_fsblock_t, pblk)
3098 __field(int, state)
3100 TP_fast_assign(
3101 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3102 __entry->ino = ip->i_ino;
3103 __entry->lblk = irec->br_startoff;
3104 __entry->len = irec->br_blockcount;
3105 __entry->pblk = irec->br_startblock;
3106 __entry->state = irec->br_state;
3108 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x pblk %llu st %d",
3109 MAJOR(__entry->dev), MINOR(__entry->dev),
3110 __entry->ino,
3111 __entry->lblk,
3112 __entry->len,
3113 __entry->pblk,
3114 __entry->state)
3116 #define DEFINE_INODE_IREC_EVENT(name) \
3117 DEFINE_EVENT(xfs_inode_irec_class, name, \
3118 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3119 TP_ARGS(ip, irec))
3121 /* refcount/reflink tracepoint definitions */
3123 /* reflink tracepoints */
3124 DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3125 DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3126 DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3127 DEFINE_IOMAP_EVENT(xfs_reflink_remap_imap);
3128 TRACE_EVENT(xfs_reflink_remap_blocks_loop,
3129 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3130 xfs_filblks_t len, struct xfs_inode *dest,
3131 xfs_fileoff_t doffset),
3132 TP_ARGS(src, soffset, len, dest, doffset),
3133 TP_STRUCT__entry(
3134 __field(dev_t, dev)
3135 __field(xfs_ino_t, src_ino)
3136 __field(xfs_fileoff_t, src_lblk)
3137 __field(xfs_filblks_t, len)
3138 __field(xfs_ino_t, dest_ino)
3139 __field(xfs_fileoff_t, dest_lblk)
3141 TP_fast_assign(
3142 __entry->dev = VFS_I(src)->i_sb->s_dev;
3143 __entry->src_ino = src->i_ino;
3144 __entry->src_lblk = soffset;
3145 __entry->len = len;
3146 __entry->dest_ino = dest->i_ino;
3147 __entry->dest_lblk = doffset;
3149 TP_printk("dev %d:%d len 0x%llx "
3150 "ino 0x%llx offset 0x%llx blocks -> "
3151 "ino 0x%llx offset 0x%llx blocks",
3152 MAJOR(__entry->dev), MINOR(__entry->dev),
3153 __entry->len,
3154 __entry->src_ino,
3155 __entry->src_lblk,
3156 __entry->dest_ino,
3157 __entry->dest_lblk)
3159 TRACE_EVENT(xfs_reflink_punch_range,
3160 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3161 xfs_extlen_t len),
3162 TP_ARGS(ip, lblk, len),
3163 TP_STRUCT__entry(
3164 __field(dev_t, dev)
3165 __field(xfs_ino_t, ino)
3166 __field(xfs_fileoff_t, lblk)
3167 __field(xfs_extlen_t, len)
3169 TP_fast_assign(
3170 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3171 __entry->ino = ip->i_ino;
3172 __entry->lblk = lblk;
3173 __entry->len = len;
3175 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x",
3176 MAJOR(__entry->dev), MINOR(__entry->dev),
3177 __entry->ino,
3178 __entry->lblk,
3179 __entry->len)
3181 TRACE_EVENT(xfs_reflink_remap,
3182 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t lblk,
3183 xfs_extlen_t len, xfs_fsblock_t new_pblk),
3184 TP_ARGS(ip, lblk, len, new_pblk),
3185 TP_STRUCT__entry(
3186 __field(dev_t, dev)
3187 __field(xfs_ino_t, ino)
3188 __field(xfs_fileoff_t, lblk)
3189 __field(xfs_extlen_t, len)
3190 __field(xfs_fsblock_t, new_pblk)
3192 TP_fast_assign(
3193 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3194 __entry->ino = ip->i_ino;
3195 __entry->lblk = lblk;
3196 __entry->len = len;
3197 __entry->new_pblk = new_pblk;
3199 TP_printk("dev %d:%d ino 0x%llx lblk 0x%llx len 0x%x new_pblk %llu",
3200 MAJOR(__entry->dev), MINOR(__entry->dev),
3201 __entry->ino,
3202 __entry->lblk,
3203 __entry->len,
3204 __entry->new_pblk)
3206 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3207 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3208 DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3209 DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
3210 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3211 DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3213 /* dedupe tracepoints */
3214 DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3215 DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3217 /* ioctl tracepoints */
3218 TRACE_EVENT(xfs_ioctl_clone,
3219 TP_PROTO(struct inode *src, struct inode *dest),
3220 TP_ARGS(src, dest),
3221 TP_STRUCT__entry(
3222 __field(dev_t, dev)
3223 __field(unsigned long, src_ino)
3224 __field(loff_t, src_isize)
3225 __field(unsigned long, dest_ino)
3226 __field(loff_t, dest_isize)
3228 TP_fast_assign(
3229 __entry->dev = src->i_sb->s_dev;
3230 __entry->src_ino = src->i_ino;
3231 __entry->src_isize = i_size_read(src);
3232 __entry->dest_ino = dest->i_ino;
3233 __entry->dest_isize = i_size_read(dest);
3235 TP_printk("dev %d:%d "
3236 "ino 0x%lx isize 0x%llx -> "
3237 "ino 0x%lx isize 0x%llx",
3238 MAJOR(__entry->dev), MINOR(__entry->dev),
3239 __entry->src_ino,
3240 __entry->src_isize,
3241 __entry->dest_ino,
3242 __entry->dest_isize)
3245 /* unshare tracepoints */
3246 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
3247 DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
3249 /* copy on write */
3250 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
3251 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_alloc);
3252 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3253 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
3254 DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
3256 DEFINE_RW_EVENT(xfs_reflink_reserve_cow);
3258 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_bounce_dio_write);
3259 DEFINE_IOMAP_EVENT(xfs_reflink_find_cow_mapping);
3260 DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_irec);
3262 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3263 DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3264 DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap);
3266 DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3267 DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3270 DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
3272 /* rmap swapext tracepoints */
3273 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3274 DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3275 DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3277 /* fsmap traces */
3278 DECLARE_EVENT_CLASS(xfs_fsmap_class,
3279 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3280 struct xfs_rmap_irec *rmap),
3281 TP_ARGS(mp, keydev, agno, rmap),
3282 TP_STRUCT__entry(
3283 __field(dev_t, dev)
3284 __field(dev_t, keydev)
3285 __field(xfs_agnumber_t, agno)
3286 __field(xfs_fsblock_t, bno)
3287 __field(xfs_filblks_t, len)
3288 __field(uint64_t, owner)
3289 __field(uint64_t, offset)
3290 __field(unsigned int, flags)
3292 TP_fast_assign(
3293 __entry->dev = mp->m_super->s_dev;
3294 __entry->keydev = new_decode_dev(keydev);
3295 __entry->agno = agno;
3296 __entry->bno = rmap->rm_startblock;
3297 __entry->len = rmap->rm_blockcount;
3298 __entry->owner = rmap->rm_owner;
3299 __entry->offset = rmap->rm_offset;
3300 __entry->flags = rmap->rm_flags;
3302 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld offset %llu flags 0x%x",
3303 MAJOR(__entry->dev), MINOR(__entry->dev),
3304 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3305 __entry->agno,
3306 __entry->bno,
3307 __entry->len,
3308 __entry->owner,
3309 __entry->offset,
3310 __entry->flags)
3312 #define DEFINE_FSMAP_EVENT(name) \
3313 DEFINE_EVENT(xfs_fsmap_class, name, \
3314 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3315 struct xfs_rmap_irec *rmap), \
3316 TP_ARGS(mp, keydev, agno, rmap))
3317 DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3318 DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3319 DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3321 DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3322 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3323 TP_ARGS(mp, fsmap),
3324 TP_STRUCT__entry(
3325 __field(dev_t, dev)
3326 __field(dev_t, keydev)
3327 __field(xfs_daddr_t, block)
3328 __field(xfs_daddr_t, len)
3329 __field(uint64_t, owner)
3330 __field(uint64_t, offset)
3331 __field(uint64_t, flags)
3333 TP_fast_assign(
3334 __entry->dev = mp->m_super->s_dev;
3335 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3336 __entry->block = fsmap->fmr_physical;
3337 __entry->len = fsmap->fmr_length;
3338 __entry->owner = fsmap->fmr_owner;
3339 __entry->offset = fsmap->fmr_offset;
3340 __entry->flags = fsmap->fmr_flags;
3342 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld offset %llu flags 0x%llx",
3343 MAJOR(__entry->dev), MINOR(__entry->dev),
3344 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3345 __entry->block,
3346 __entry->len,
3347 __entry->owner,
3348 __entry->offset,
3349 __entry->flags)
3351 #define DEFINE_GETFSMAP_EVENT(name) \
3352 DEFINE_EVENT(xfs_getfsmap_class, name, \
3353 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3354 TP_ARGS(mp, fsmap))
3355 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3356 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3357 DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3359 #endif /* _TRACE_XFS_H */
3361 #undef TRACE_INCLUDE_PATH
3362 #define TRACE_INCLUDE_PATH .
3363 #define TRACE_INCLUDE_FILE xfs_trace
3364 #include <trace/define_trace.h>