Loading...
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2009, Christoph Hellwig
4 * All Rights Reserved.
5 *
6 * NOTE: none of these tracepoints shall be considered a stable kernel ABI
7 * as they can change at any time.
8 *
9 * Current conventions for printing numbers measuring specific units:
10 *
11 * agno: allocation group number
12 *
13 * agino: per-AG inode number
14 * ino: filesystem inode number
15 *
16 * agbno: per-AG block number in fs blocks
17 * startblock: physical block number for file mappings. This is either a
18 * segmented fsblock for data device mappings, or a rfsblock
19 * for realtime device mappings
20 * fsbcount: number of blocks in an extent, in fs blocks
21 *
22 * daddr: physical block number in 512b blocks
23 * bbcount: number of blocks in a physical extent, in 512b blocks
24 *
25 * owner: reverse-mapping owner, usually inodes
26 *
27 * fileoff: file offset, in fs blocks
28 * pos: file offset, in bytes
29 * bytecount: number of bytes
30 *
31 * disize: ondisk file size, in bytes
32 * isize: incore file size, in bytes
33 *
34 * forkoff: inode fork offset, in bytes
35 *
36 * ireccount: number of inode records
37 *
38 * Numbers describing space allocations (blocks, extents, inodes) should be
39 * formatted in hexadecimal.
40 */
41#undef TRACE_SYSTEM
42#define TRACE_SYSTEM xfs
43
44#if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
45#define _TRACE_XFS_H
46
47#include <linux/tracepoint.h>
48
49struct xfs_agf;
50struct xfs_alloc_arg;
51struct xfs_attr_list_context;
52struct xfs_buf_log_item;
53struct xfs_da_args;
54struct xfs_da_node_entry;
55struct xfs_dquot;
56struct xfs_log_item;
57struct xlog;
58struct xlog_ticket;
59struct xlog_recover;
60struct xlog_recover_item;
61struct xlog_rec_header;
62struct xlog_in_core;
63struct xfs_buf_log_format;
64struct xfs_inode_log_format;
65struct xfs_bmbt_irec;
66struct xfs_btree_cur;
67struct xfs_refcount_irec;
68struct xfs_fsmap;
69struct xfs_rmap_irec;
70struct xfs_icreate_log;
71struct xfs_owner_info;
72struct xfs_trans_res;
73struct xfs_inobt_rec_incore;
74union xfs_btree_ptr;
75struct xfs_dqtrx;
76struct xfs_icwalk;
77
78#define XFS_ATTR_FILTER_FLAGS \
79 { XFS_ATTR_ROOT, "ROOT" }, \
80 { XFS_ATTR_SECURE, "SECURE" }, \
81 { XFS_ATTR_INCOMPLETE, "INCOMPLETE" }
82
83DECLARE_EVENT_CLASS(xfs_attr_list_class,
84 TP_PROTO(struct xfs_attr_list_context *ctx),
85 TP_ARGS(ctx),
86 TP_STRUCT__entry(
87 __field(dev_t, dev)
88 __field(xfs_ino_t, ino)
89 __field(u32, hashval)
90 __field(u32, blkno)
91 __field(u32, offset)
92 __field(void *, buffer)
93 __field(int, bufsize)
94 __field(int, count)
95 __field(int, firstu)
96 __field(int, dupcnt)
97 __field(unsigned int, attr_filter)
98 ),
99 TP_fast_assign(
100 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
101 __entry->ino = ctx->dp->i_ino;
102 __entry->hashval = ctx->cursor.hashval;
103 __entry->blkno = ctx->cursor.blkno;
104 __entry->offset = ctx->cursor.offset;
105 __entry->buffer = ctx->buffer;
106 __entry->bufsize = ctx->bufsize;
107 __entry->count = ctx->count;
108 __entry->firstu = ctx->firstu;
109 __entry->attr_filter = ctx->attr_filter;
110 ),
111 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
112 "buffer %p size %u count %u firstu %u filter %s",
113 MAJOR(__entry->dev), MINOR(__entry->dev),
114 __entry->ino,
115 __entry->hashval,
116 __entry->blkno,
117 __entry->offset,
118 __entry->dupcnt,
119 __entry->buffer,
120 __entry->bufsize,
121 __entry->count,
122 __entry->firstu,
123 __print_flags(__entry->attr_filter, "|",
124 XFS_ATTR_FILTER_FLAGS)
125 )
126)
127
128#define DEFINE_ATTR_LIST_EVENT(name) \
129DEFINE_EVENT(xfs_attr_list_class, name, \
130 TP_PROTO(struct xfs_attr_list_context *ctx), \
131 TP_ARGS(ctx))
132DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
133DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
134DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
135DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
136DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
137DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
138DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
139DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
140DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
141DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
142
143TRACE_EVENT(xlog_intent_recovery_failed,
144 TP_PROTO(struct xfs_mount *mp, int error, void *function),
145 TP_ARGS(mp, error, function),
146 TP_STRUCT__entry(
147 __field(dev_t, dev)
148 __field(int, error)
149 __field(void *, function)
150 ),
151 TP_fast_assign(
152 __entry->dev = mp->m_super->s_dev;
153 __entry->error = error;
154 __entry->function = function;
155 ),
156 TP_printk("dev %d:%d error %d function %pS",
157 MAJOR(__entry->dev), MINOR(__entry->dev),
158 __entry->error, __entry->function)
159);
160
161DECLARE_EVENT_CLASS(xfs_perag_class,
162 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
163 unsigned long caller_ip),
164 TP_ARGS(mp, agno, refcount, caller_ip),
165 TP_STRUCT__entry(
166 __field(dev_t, dev)
167 __field(xfs_agnumber_t, agno)
168 __field(int, refcount)
169 __field(unsigned long, caller_ip)
170 ),
171 TP_fast_assign(
172 __entry->dev = mp->m_super->s_dev;
173 __entry->agno = agno;
174 __entry->refcount = refcount;
175 __entry->caller_ip = caller_ip;
176 ),
177 TP_printk("dev %d:%d agno 0x%x refcount %d caller %pS",
178 MAJOR(__entry->dev), MINOR(__entry->dev),
179 __entry->agno,
180 __entry->refcount,
181 (char *)__entry->caller_ip)
182);
183
184#define DEFINE_PERAG_REF_EVENT(name) \
185DEFINE_EVENT(xfs_perag_class, name, \
186 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
187 unsigned long caller_ip), \
188 TP_ARGS(mp, agno, refcount, caller_ip))
189DEFINE_PERAG_REF_EVENT(xfs_perag_get);
190DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
191DEFINE_PERAG_REF_EVENT(xfs_perag_put);
192DEFINE_PERAG_REF_EVENT(xfs_perag_set_inode_tag);
193DEFINE_PERAG_REF_EVENT(xfs_perag_clear_inode_tag);
194
195TRACE_EVENT(xfs_inodegc_worker,
196 TP_PROTO(struct xfs_mount *mp, unsigned int shrinker_hits),
197 TP_ARGS(mp, shrinker_hits),
198 TP_STRUCT__entry(
199 __field(dev_t, dev)
200 __field(unsigned int, shrinker_hits)
201 ),
202 TP_fast_assign(
203 __entry->dev = mp->m_super->s_dev;
204 __entry->shrinker_hits = shrinker_hits;
205 ),
206 TP_printk("dev %d:%d shrinker_hits %u",
207 MAJOR(__entry->dev), MINOR(__entry->dev),
208 __entry->shrinker_hits)
209);
210
211DECLARE_EVENT_CLASS(xfs_fs_class,
212 TP_PROTO(struct xfs_mount *mp, void *caller_ip),
213 TP_ARGS(mp, caller_ip),
214 TP_STRUCT__entry(
215 __field(dev_t, dev)
216 __field(unsigned long long, mflags)
217 __field(unsigned long, opstate)
218 __field(unsigned long, sbflags)
219 __field(void *, caller_ip)
220 ),
221 TP_fast_assign(
222 if (mp) {
223 __entry->dev = mp->m_super->s_dev;
224 __entry->mflags = mp->m_features;
225 __entry->opstate = mp->m_opstate;
226 __entry->sbflags = mp->m_super->s_flags;
227 }
228 __entry->caller_ip = caller_ip;
229 ),
230 TP_printk("dev %d:%d m_features 0x%llx opstate (%s) s_flags 0x%lx caller %pS",
231 MAJOR(__entry->dev), MINOR(__entry->dev),
232 __entry->mflags,
233 __print_flags(__entry->opstate, "|", XFS_OPSTATE_STRINGS),
234 __entry->sbflags,
235 __entry->caller_ip)
236);
237
238#define DEFINE_FS_EVENT(name) \
239DEFINE_EVENT(xfs_fs_class, name, \
240 TP_PROTO(struct xfs_mount *mp, void *caller_ip), \
241 TP_ARGS(mp, caller_ip))
242DEFINE_FS_EVENT(xfs_inodegc_flush);
243DEFINE_FS_EVENT(xfs_inodegc_push);
244DEFINE_FS_EVENT(xfs_inodegc_start);
245DEFINE_FS_EVENT(xfs_inodegc_stop);
246DEFINE_FS_EVENT(xfs_inodegc_queue);
247DEFINE_FS_EVENT(xfs_inodegc_throttle);
248DEFINE_FS_EVENT(xfs_fs_sync_fs);
249DEFINE_FS_EVENT(xfs_blockgc_start);
250DEFINE_FS_EVENT(xfs_blockgc_stop);
251DEFINE_FS_EVENT(xfs_blockgc_worker);
252DEFINE_FS_EVENT(xfs_blockgc_flush_all);
253
254TRACE_EVENT(xfs_inodegc_shrinker_scan,
255 TP_PROTO(struct xfs_mount *mp, struct shrink_control *sc,
256 void *caller_ip),
257 TP_ARGS(mp, sc, caller_ip),
258 TP_STRUCT__entry(
259 __field(dev_t, dev)
260 __field(unsigned long, nr_to_scan)
261 __field(void *, caller_ip)
262 ),
263 TP_fast_assign(
264 __entry->dev = mp->m_super->s_dev;
265 __entry->nr_to_scan = sc->nr_to_scan;
266 __entry->caller_ip = caller_ip;
267 ),
268 TP_printk("dev %d:%d nr_to_scan %lu caller %pS",
269 MAJOR(__entry->dev), MINOR(__entry->dev),
270 __entry->nr_to_scan,
271 __entry->caller_ip)
272);
273
274DECLARE_EVENT_CLASS(xfs_ag_class,
275 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
276 TP_ARGS(mp, agno),
277 TP_STRUCT__entry(
278 __field(dev_t, dev)
279 __field(xfs_agnumber_t, agno)
280 ),
281 TP_fast_assign(
282 __entry->dev = mp->m_super->s_dev;
283 __entry->agno = agno;
284 ),
285 TP_printk("dev %d:%d agno 0x%x",
286 MAJOR(__entry->dev), MINOR(__entry->dev),
287 __entry->agno)
288);
289#define DEFINE_AG_EVENT(name) \
290DEFINE_EVENT(xfs_ag_class, name, \
291 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
292 TP_ARGS(mp, agno))
293
294DEFINE_AG_EVENT(xfs_read_agf);
295DEFINE_AG_EVENT(xfs_alloc_read_agf);
296DEFINE_AG_EVENT(xfs_read_agi);
297DEFINE_AG_EVENT(xfs_ialloc_read_agi);
298
299TRACE_EVENT(xfs_attr_list_node_descend,
300 TP_PROTO(struct xfs_attr_list_context *ctx,
301 struct xfs_da_node_entry *btree),
302 TP_ARGS(ctx, btree),
303 TP_STRUCT__entry(
304 __field(dev_t, dev)
305 __field(xfs_ino_t, ino)
306 __field(u32, hashval)
307 __field(u32, blkno)
308 __field(u32, offset)
309 __field(void *, buffer)
310 __field(int, bufsize)
311 __field(int, count)
312 __field(int, firstu)
313 __field(int, dupcnt)
314 __field(unsigned int, attr_filter)
315 __field(u32, bt_hashval)
316 __field(u32, bt_before)
317 ),
318 TP_fast_assign(
319 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
320 __entry->ino = ctx->dp->i_ino;
321 __entry->hashval = ctx->cursor.hashval;
322 __entry->blkno = ctx->cursor.blkno;
323 __entry->offset = ctx->cursor.offset;
324 __entry->buffer = ctx->buffer;
325 __entry->bufsize = ctx->bufsize;
326 __entry->count = ctx->count;
327 __entry->firstu = ctx->firstu;
328 __entry->attr_filter = ctx->attr_filter;
329 __entry->bt_hashval = be32_to_cpu(btree->hashval);
330 __entry->bt_before = be32_to_cpu(btree->before);
331 ),
332 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
333 "buffer %p size %u count %u firstu %u filter %s "
334 "node hashval %u, node before %u",
335 MAJOR(__entry->dev), MINOR(__entry->dev),
336 __entry->ino,
337 __entry->hashval,
338 __entry->blkno,
339 __entry->offset,
340 __entry->dupcnt,
341 __entry->buffer,
342 __entry->bufsize,
343 __entry->count,
344 __entry->firstu,
345 __print_flags(__entry->attr_filter, "|",
346 XFS_ATTR_FILTER_FLAGS),
347 __entry->bt_hashval,
348 __entry->bt_before)
349);
350
351DECLARE_EVENT_CLASS(xfs_bmap_class,
352 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state,
353 unsigned long caller_ip),
354 TP_ARGS(ip, cur, state, caller_ip),
355 TP_STRUCT__entry(
356 __field(dev_t, dev)
357 __field(xfs_ino_t, ino)
358 __field(void *, leaf)
359 __field(int, pos)
360 __field(xfs_fileoff_t, startoff)
361 __field(xfs_fsblock_t, startblock)
362 __field(xfs_filblks_t, blockcount)
363 __field(xfs_exntst_t, state)
364 __field(int, bmap_state)
365 __field(unsigned long, caller_ip)
366 ),
367 TP_fast_assign(
368 struct xfs_ifork *ifp;
369 struct xfs_bmbt_irec r;
370
371 ifp = xfs_iext_state_to_fork(ip, state);
372 xfs_iext_get_extent(ifp, cur, &r);
373 __entry->dev = VFS_I(ip)->i_sb->s_dev;
374 __entry->ino = ip->i_ino;
375 __entry->leaf = cur->leaf;
376 __entry->pos = cur->pos;
377 __entry->startoff = r.br_startoff;
378 __entry->startblock = r.br_startblock;
379 __entry->blockcount = r.br_blockcount;
380 __entry->state = r.br_state;
381 __entry->bmap_state = state;
382 __entry->caller_ip = caller_ip;
383 ),
384 TP_printk("dev %d:%d ino 0x%llx state %s cur %p/%d "
385 "fileoff 0x%llx startblock 0x%llx fsbcount 0x%llx flag %d caller %pS",
386 MAJOR(__entry->dev), MINOR(__entry->dev),
387 __entry->ino,
388 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
389 __entry->leaf,
390 __entry->pos,
391 __entry->startoff,
392 (int64_t)__entry->startblock,
393 __entry->blockcount,
394 __entry->state,
395 (char *)__entry->caller_ip)
396)
397
398#define DEFINE_BMAP_EVENT(name) \
399DEFINE_EVENT(xfs_bmap_class, name, \
400 TP_PROTO(struct xfs_inode *ip, struct xfs_iext_cursor *cur, int state, \
401 unsigned long caller_ip), \
402 TP_ARGS(ip, cur, state, caller_ip))
403DEFINE_BMAP_EVENT(xfs_iext_insert);
404DEFINE_BMAP_EVENT(xfs_iext_remove);
405DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
406DEFINE_BMAP_EVENT(xfs_bmap_post_update);
407DEFINE_BMAP_EVENT(xfs_read_extent);
408DEFINE_BMAP_EVENT(xfs_write_extent);
409
410DECLARE_EVENT_CLASS(xfs_buf_class,
411 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
412 TP_ARGS(bp, caller_ip),
413 TP_STRUCT__entry(
414 __field(dev_t, dev)
415 __field(xfs_daddr_t, bno)
416 __field(int, nblks)
417 __field(int, hold)
418 __field(int, pincount)
419 __field(unsigned, lockval)
420 __field(unsigned, flags)
421 __field(unsigned long, caller_ip)
422 __field(const void *, buf_ops)
423 ),
424 TP_fast_assign(
425 __entry->dev = bp->b_target->bt_dev;
426 __entry->bno = xfs_buf_daddr(bp);
427 __entry->nblks = bp->b_length;
428 __entry->hold = atomic_read(&bp->b_hold);
429 __entry->pincount = atomic_read(&bp->b_pin_count);
430 __entry->lockval = bp->b_sema.count;
431 __entry->flags = bp->b_flags;
432 __entry->caller_ip = caller_ip;
433 __entry->buf_ops = bp->b_ops;
434 ),
435 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
436 "lock %d flags %s bufops %pS caller %pS",
437 MAJOR(__entry->dev), MINOR(__entry->dev),
438 (unsigned long long)__entry->bno,
439 __entry->nblks,
440 __entry->hold,
441 __entry->pincount,
442 __entry->lockval,
443 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
444 __entry->buf_ops,
445 (void *)__entry->caller_ip)
446)
447
448#define DEFINE_BUF_EVENT(name) \
449DEFINE_EVENT(xfs_buf_class, name, \
450 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
451 TP_ARGS(bp, caller_ip))
452DEFINE_BUF_EVENT(xfs_buf_init);
453DEFINE_BUF_EVENT(xfs_buf_free);
454DEFINE_BUF_EVENT(xfs_buf_hold);
455DEFINE_BUF_EVENT(xfs_buf_rele);
456DEFINE_BUF_EVENT(xfs_buf_iodone);
457DEFINE_BUF_EVENT(xfs_buf_submit);
458DEFINE_BUF_EVENT(xfs_buf_lock);
459DEFINE_BUF_EVENT(xfs_buf_lock_done);
460DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
461DEFINE_BUF_EVENT(xfs_buf_trylock);
462DEFINE_BUF_EVENT(xfs_buf_unlock);
463DEFINE_BUF_EVENT(xfs_buf_iowait);
464DEFINE_BUF_EVENT(xfs_buf_iowait_done);
465DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
466DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
467DEFINE_BUF_EVENT(xfs_buf_delwri_split);
468DEFINE_BUF_EVENT(xfs_buf_delwri_pushbuf);
469DEFINE_BUF_EVENT(xfs_buf_get_uncached);
470DEFINE_BUF_EVENT(xfs_buf_item_relse);
471DEFINE_BUF_EVENT(xfs_buf_iodone_async);
472DEFINE_BUF_EVENT(xfs_buf_error_relse);
473DEFINE_BUF_EVENT(xfs_buf_drain_buftarg);
474DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
475
476/* not really buffer traces, but the buf provides useful information */
477DEFINE_BUF_EVENT(xfs_btree_corrupt);
478DEFINE_BUF_EVENT(xfs_reset_dqcounts);
479
480/* pass flags explicitly */
481DECLARE_EVENT_CLASS(xfs_buf_flags_class,
482 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
483 TP_ARGS(bp, flags, caller_ip),
484 TP_STRUCT__entry(
485 __field(dev_t, dev)
486 __field(xfs_daddr_t, bno)
487 __field(unsigned int, length)
488 __field(int, hold)
489 __field(int, pincount)
490 __field(unsigned, lockval)
491 __field(unsigned, flags)
492 __field(unsigned long, caller_ip)
493 ),
494 TP_fast_assign(
495 __entry->dev = bp->b_target->bt_dev;
496 __entry->bno = xfs_buf_daddr(bp);
497 __entry->length = bp->b_length;
498 __entry->flags = flags;
499 __entry->hold = atomic_read(&bp->b_hold);
500 __entry->pincount = atomic_read(&bp->b_pin_count);
501 __entry->lockval = bp->b_sema.count;
502 __entry->caller_ip = caller_ip;
503 ),
504 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
505 "lock %d flags %s caller %pS",
506 MAJOR(__entry->dev), MINOR(__entry->dev),
507 (unsigned long long)__entry->bno,
508 __entry->length,
509 __entry->hold,
510 __entry->pincount,
511 __entry->lockval,
512 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
513 (void *)__entry->caller_ip)
514)
515
516#define DEFINE_BUF_FLAGS_EVENT(name) \
517DEFINE_EVENT(xfs_buf_flags_class, name, \
518 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
519 TP_ARGS(bp, flags, caller_ip))
520DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
521DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
522DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
523
524TRACE_EVENT(xfs_buf_ioerror,
525 TP_PROTO(struct xfs_buf *bp, int error, xfs_failaddr_t caller_ip),
526 TP_ARGS(bp, error, caller_ip),
527 TP_STRUCT__entry(
528 __field(dev_t, dev)
529 __field(xfs_daddr_t, bno)
530 __field(unsigned int, length)
531 __field(unsigned, flags)
532 __field(int, hold)
533 __field(int, pincount)
534 __field(unsigned, lockval)
535 __field(int, error)
536 __field(xfs_failaddr_t, caller_ip)
537 ),
538 TP_fast_assign(
539 __entry->dev = bp->b_target->bt_dev;
540 __entry->bno = xfs_buf_daddr(bp);
541 __entry->length = bp->b_length;
542 __entry->hold = atomic_read(&bp->b_hold);
543 __entry->pincount = atomic_read(&bp->b_pin_count);
544 __entry->lockval = bp->b_sema.count;
545 __entry->error = error;
546 __entry->flags = bp->b_flags;
547 __entry->caller_ip = caller_ip;
548 ),
549 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
550 "lock %d error %d flags %s caller %pS",
551 MAJOR(__entry->dev), MINOR(__entry->dev),
552 (unsigned long long)__entry->bno,
553 __entry->length,
554 __entry->hold,
555 __entry->pincount,
556 __entry->lockval,
557 __entry->error,
558 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
559 (void *)__entry->caller_ip)
560);
561
562DECLARE_EVENT_CLASS(xfs_buf_item_class,
563 TP_PROTO(struct xfs_buf_log_item *bip),
564 TP_ARGS(bip),
565 TP_STRUCT__entry(
566 __field(dev_t, dev)
567 __field(xfs_daddr_t, buf_bno)
568 __field(unsigned int, buf_len)
569 __field(int, buf_hold)
570 __field(int, buf_pincount)
571 __field(int, buf_lockval)
572 __field(unsigned, buf_flags)
573 __field(unsigned, bli_recur)
574 __field(int, bli_refcount)
575 __field(unsigned, bli_flags)
576 __field(unsigned long, li_flags)
577 ),
578 TP_fast_assign(
579 __entry->dev = bip->bli_buf->b_target->bt_dev;
580 __entry->bli_flags = bip->bli_flags;
581 __entry->bli_recur = bip->bli_recur;
582 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
583 __entry->buf_bno = xfs_buf_daddr(bip->bli_buf);
584 __entry->buf_len = bip->bli_buf->b_length;
585 __entry->buf_flags = bip->bli_buf->b_flags;
586 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
587 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
588 __entry->buf_lockval = bip->bli_buf->b_sema.count;
589 __entry->li_flags = bip->bli_item.li_flags;
590 ),
591 TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d "
592 "lock %d flags %s recur %d refcount %d bliflags %s "
593 "liflags %s",
594 MAJOR(__entry->dev), MINOR(__entry->dev),
595 (unsigned long long)__entry->buf_bno,
596 __entry->buf_len,
597 __entry->buf_hold,
598 __entry->buf_pincount,
599 __entry->buf_lockval,
600 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
601 __entry->bli_recur,
602 __entry->bli_refcount,
603 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
604 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
605)
606
607#define DEFINE_BUF_ITEM_EVENT(name) \
608DEFINE_EVENT(xfs_buf_item_class, name, \
609 TP_PROTO(struct xfs_buf_log_item *bip), \
610 TP_ARGS(bip))
611DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
612DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
613DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
614DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
615DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
616DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
617DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
618DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
619DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
620DEFINE_BUF_ITEM_EVENT(xfs_buf_item_release);
621DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
622DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
623DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
624DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
625DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
626DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
627DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
628DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
629DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
630DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
631DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
632DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
633DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
634DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
635
636DECLARE_EVENT_CLASS(xfs_filestream_class,
637 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno),
638 TP_ARGS(mp, ino, agno),
639 TP_STRUCT__entry(
640 __field(dev_t, dev)
641 __field(xfs_ino_t, ino)
642 __field(xfs_agnumber_t, agno)
643 __field(int, streams)
644 ),
645 TP_fast_assign(
646 __entry->dev = mp->m_super->s_dev;
647 __entry->ino = ino;
648 __entry->agno = agno;
649 __entry->streams = xfs_filestream_peek_ag(mp, agno);
650 ),
651 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d",
652 MAJOR(__entry->dev), MINOR(__entry->dev),
653 __entry->ino,
654 __entry->agno,
655 __entry->streams)
656)
657#define DEFINE_FILESTREAM_EVENT(name) \
658DEFINE_EVENT(xfs_filestream_class, name, \
659 TP_PROTO(struct xfs_mount *mp, xfs_ino_t ino, xfs_agnumber_t agno), \
660 TP_ARGS(mp, ino, agno))
661DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
662DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
663DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
664
665TRACE_EVENT(xfs_filestream_pick,
666 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
667 xfs_extlen_t free, int nscan),
668 TP_ARGS(ip, agno, free, nscan),
669 TP_STRUCT__entry(
670 __field(dev_t, dev)
671 __field(xfs_ino_t, ino)
672 __field(xfs_agnumber_t, agno)
673 __field(int, streams)
674 __field(xfs_extlen_t, free)
675 __field(int, nscan)
676 ),
677 TP_fast_assign(
678 __entry->dev = VFS_I(ip)->i_sb->s_dev;
679 __entry->ino = ip->i_ino;
680 __entry->agno = agno;
681 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
682 __entry->free = free;
683 __entry->nscan = nscan;
684 ),
685 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d nscan %d",
686 MAJOR(__entry->dev), MINOR(__entry->dev),
687 __entry->ino,
688 __entry->agno,
689 __entry->streams,
690 __entry->free,
691 __entry->nscan)
692);
693
694DECLARE_EVENT_CLASS(xfs_lock_class,
695 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
696 unsigned long caller_ip),
697 TP_ARGS(ip, lock_flags, caller_ip),
698 TP_STRUCT__entry(
699 __field(dev_t, dev)
700 __field(xfs_ino_t, ino)
701 __field(int, lock_flags)
702 __field(unsigned long, caller_ip)
703 ),
704 TP_fast_assign(
705 __entry->dev = VFS_I(ip)->i_sb->s_dev;
706 __entry->ino = ip->i_ino;
707 __entry->lock_flags = lock_flags;
708 __entry->caller_ip = caller_ip;
709 ),
710 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pS",
711 MAJOR(__entry->dev), MINOR(__entry->dev),
712 __entry->ino,
713 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
714 (void *)__entry->caller_ip)
715)
716
717#define DEFINE_LOCK_EVENT(name) \
718DEFINE_EVENT(xfs_lock_class, name, \
719 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
720 unsigned long caller_ip), \
721 TP_ARGS(ip, lock_flags, caller_ip))
722DEFINE_LOCK_EVENT(xfs_ilock);
723DEFINE_LOCK_EVENT(xfs_ilock_nowait);
724DEFINE_LOCK_EVENT(xfs_ilock_demote);
725DEFINE_LOCK_EVENT(xfs_iunlock);
726
727DECLARE_EVENT_CLASS(xfs_inode_class,
728 TP_PROTO(struct xfs_inode *ip),
729 TP_ARGS(ip),
730 TP_STRUCT__entry(
731 __field(dev_t, dev)
732 __field(xfs_ino_t, ino)
733 __field(unsigned long, iflags)
734 ),
735 TP_fast_assign(
736 __entry->dev = VFS_I(ip)->i_sb->s_dev;
737 __entry->ino = ip->i_ino;
738 __entry->iflags = ip->i_flags;
739 ),
740 TP_printk("dev %d:%d ino 0x%llx iflags 0x%lx",
741 MAJOR(__entry->dev), MINOR(__entry->dev),
742 __entry->ino,
743 __entry->iflags)
744)
745
746#define DEFINE_INODE_EVENT(name) \
747DEFINE_EVENT(xfs_inode_class, name, \
748 TP_PROTO(struct xfs_inode *ip), \
749 TP_ARGS(ip))
750DEFINE_INODE_EVENT(xfs_iget_skip);
751DEFINE_INODE_EVENT(xfs_iget_recycle);
752DEFINE_INODE_EVENT(xfs_iget_recycle_fail);
753DEFINE_INODE_EVENT(xfs_iget_hit);
754DEFINE_INODE_EVENT(xfs_iget_miss);
755
756DEFINE_INODE_EVENT(xfs_getattr);
757DEFINE_INODE_EVENT(xfs_setattr);
758DEFINE_INODE_EVENT(xfs_readlink);
759DEFINE_INODE_EVENT(xfs_inactive_symlink);
760DEFINE_INODE_EVENT(xfs_alloc_file_space);
761DEFINE_INODE_EVENT(xfs_free_file_space);
762DEFINE_INODE_EVENT(xfs_zero_file_space);
763DEFINE_INODE_EVENT(xfs_collapse_file_space);
764DEFINE_INODE_EVENT(xfs_insert_file_space);
765DEFINE_INODE_EVENT(xfs_readdir);
766#ifdef CONFIG_XFS_POSIX_ACL
767DEFINE_INODE_EVENT(xfs_get_acl);
768#endif
769DEFINE_INODE_EVENT(xfs_vm_bmap);
770DEFINE_INODE_EVENT(xfs_file_ioctl);
771DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
772DEFINE_INODE_EVENT(xfs_ioctl_setattr);
773DEFINE_INODE_EVENT(xfs_dir_fsync);
774DEFINE_INODE_EVENT(xfs_file_fsync);
775DEFINE_INODE_EVENT(xfs_destroy_inode);
776DEFINE_INODE_EVENT(xfs_update_time);
777
778DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
779DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
780
781DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
782DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
783DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
784DEFINE_INODE_EVENT(xfs_inode_set_cowblocks_tag);
785DEFINE_INODE_EVENT(xfs_inode_clear_cowblocks_tag);
786DEFINE_INODE_EVENT(xfs_inode_free_cowblocks_invalid);
787DEFINE_INODE_EVENT(xfs_inode_set_reclaimable);
788DEFINE_INODE_EVENT(xfs_inode_reclaiming);
789DEFINE_INODE_EVENT(xfs_inode_set_need_inactive);
790DEFINE_INODE_EVENT(xfs_inode_inactivating);
791
792/*
793 * ftrace's __print_symbolic requires that all enum values be wrapped in the
794 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
795 * ring buffer. Somehow this was only worth mentioning in the ftrace sample
796 * code.
797 */
798TRACE_DEFINE_ENUM(PE_SIZE_PTE);
799TRACE_DEFINE_ENUM(PE_SIZE_PMD);
800TRACE_DEFINE_ENUM(PE_SIZE_PUD);
801
802TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_SHARED);
803TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_COW);
804
805TRACE_EVENT(xfs_filemap_fault,
806 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size,
807 bool write_fault),
808 TP_ARGS(ip, pe_size, write_fault),
809 TP_STRUCT__entry(
810 __field(dev_t, dev)
811 __field(xfs_ino_t, ino)
812 __field(enum page_entry_size, pe_size)
813 __field(bool, write_fault)
814 ),
815 TP_fast_assign(
816 __entry->dev = VFS_I(ip)->i_sb->s_dev;
817 __entry->ino = ip->i_ino;
818 __entry->pe_size = pe_size;
819 __entry->write_fault = write_fault;
820 ),
821 TP_printk("dev %d:%d ino 0x%llx %s write_fault %d",
822 MAJOR(__entry->dev), MINOR(__entry->dev),
823 __entry->ino,
824 __print_symbolic(__entry->pe_size,
825 { PE_SIZE_PTE, "PTE" },
826 { PE_SIZE_PMD, "PMD" },
827 { PE_SIZE_PUD, "PUD" }),
828 __entry->write_fault)
829)
830
831DECLARE_EVENT_CLASS(xfs_iref_class,
832 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
833 TP_ARGS(ip, caller_ip),
834 TP_STRUCT__entry(
835 __field(dev_t, dev)
836 __field(xfs_ino_t, ino)
837 __field(int, count)
838 __field(int, pincount)
839 __field(unsigned long, caller_ip)
840 ),
841 TP_fast_assign(
842 __entry->dev = VFS_I(ip)->i_sb->s_dev;
843 __entry->ino = ip->i_ino;
844 __entry->count = atomic_read(&VFS_I(ip)->i_count);
845 __entry->pincount = atomic_read(&ip->i_pincount);
846 __entry->caller_ip = caller_ip;
847 ),
848 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pS",
849 MAJOR(__entry->dev), MINOR(__entry->dev),
850 __entry->ino,
851 __entry->count,
852 __entry->pincount,
853 (char *)__entry->caller_ip)
854)
855
856TRACE_EVENT(xfs_iomap_prealloc_size,
857 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
858 unsigned int writeio_blocks),
859 TP_ARGS(ip, blocks, shift, writeio_blocks),
860 TP_STRUCT__entry(
861 __field(dev_t, dev)
862 __field(xfs_ino_t, ino)
863 __field(xfs_fsblock_t, blocks)
864 __field(int, shift)
865 __field(unsigned int, writeio_blocks)
866 ),
867 TP_fast_assign(
868 __entry->dev = VFS_I(ip)->i_sb->s_dev;
869 __entry->ino = ip->i_ino;
870 __entry->blocks = blocks;
871 __entry->shift = shift;
872 __entry->writeio_blocks = writeio_blocks;
873 ),
874 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
875 "m_allocsize_blocks %u",
876 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
877 __entry->blocks, __entry->shift, __entry->writeio_blocks)
878)
879
880TRACE_EVENT(xfs_irec_merge_pre,
881 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
882 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
883 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
884 TP_STRUCT__entry(
885 __field(dev_t, dev)
886 __field(xfs_agnumber_t, agno)
887 __field(xfs_agino_t, agino)
888 __field(uint16_t, holemask)
889 __field(xfs_agino_t, nagino)
890 __field(uint16_t, nholemask)
891 ),
892 TP_fast_assign(
893 __entry->dev = mp->m_super->s_dev;
894 __entry->agno = agno;
895 __entry->agino = agino;
896 __entry->holemask = holemask;
897 __entry->nagino = nagino;
898 __entry->nholemask = holemask;
899 ),
900 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x new_agino 0x%x new_holemask 0x%x",
901 MAJOR(__entry->dev), MINOR(__entry->dev),
902 __entry->agno,
903 __entry->agino,
904 __entry->holemask,
905 __entry->nagino,
906 __entry->nholemask)
907)
908
909TRACE_EVENT(xfs_irec_merge_post,
910 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
911 uint16_t holemask),
912 TP_ARGS(mp, agno, agino, holemask),
913 TP_STRUCT__entry(
914 __field(dev_t, dev)
915 __field(xfs_agnumber_t, agno)
916 __field(xfs_agino_t, agino)
917 __field(uint16_t, holemask)
918 ),
919 TP_fast_assign(
920 __entry->dev = mp->m_super->s_dev;
921 __entry->agno = agno;
922 __entry->agino = agino;
923 __entry->holemask = holemask;
924 ),
925 TP_printk("dev %d:%d agno 0x%x agino 0x%x holemask 0x%x",
926 MAJOR(__entry->dev),
927 MINOR(__entry->dev),
928 __entry->agno,
929 __entry->agino,
930 __entry->holemask)
931)
932
933#define DEFINE_IREF_EVENT(name) \
934DEFINE_EVENT(xfs_iref_class, name, \
935 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
936 TP_ARGS(ip, caller_ip))
937DEFINE_IREF_EVENT(xfs_irele);
938DEFINE_IREF_EVENT(xfs_inode_pin);
939DEFINE_IREF_EVENT(xfs_inode_unpin);
940DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
941
942DECLARE_EVENT_CLASS(xfs_namespace_class,
943 TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name),
944 TP_ARGS(dp, name),
945 TP_STRUCT__entry(
946 __field(dev_t, dev)
947 __field(xfs_ino_t, dp_ino)
948 __field(int, namelen)
949 __dynamic_array(char, name, name->len)
950 ),
951 TP_fast_assign(
952 __entry->dev = VFS_I(dp)->i_sb->s_dev;
953 __entry->dp_ino = dp->i_ino;
954 __entry->namelen = name->len;
955 memcpy(__get_str(name), name->name, name->len);
956 ),
957 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
958 MAJOR(__entry->dev), MINOR(__entry->dev),
959 __entry->dp_ino,
960 __entry->namelen,
961 __get_str(name))
962)
963
964#define DEFINE_NAMESPACE_EVENT(name) \
965DEFINE_EVENT(xfs_namespace_class, name, \
966 TP_PROTO(struct xfs_inode *dp, const struct xfs_name *name), \
967 TP_ARGS(dp, name))
968DEFINE_NAMESPACE_EVENT(xfs_remove);
969DEFINE_NAMESPACE_EVENT(xfs_link);
970DEFINE_NAMESPACE_EVENT(xfs_lookup);
971DEFINE_NAMESPACE_EVENT(xfs_create);
972DEFINE_NAMESPACE_EVENT(xfs_symlink);
973
974TRACE_EVENT(xfs_rename,
975 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
976 struct xfs_name *src_name, struct xfs_name *target_name),
977 TP_ARGS(src_dp, target_dp, src_name, target_name),
978 TP_STRUCT__entry(
979 __field(dev_t, dev)
980 __field(xfs_ino_t, src_dp_ino)
981 __field(xfs_ino_t, target_dp_ino)
982 __field(int, src_namelen)
983 __field(int, target_namelen)
984 __dynamic_array(char, src_name, src_name->len)
985 __dynamic_array(char, target_name, target_name->len)
986 ),
987 TP_fast_assign(
988 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
989 __entry->src_dp_ino = src_dp->i_ino;
990 __entry->target_dp_ino = target_dp->i_ino;
991 __entry->src_namelen = src_name->len;
992 __entry->target_namelen = target_name->len;
993 memcpy(__get_str(src_name), src_name->name, src_name->len);
994 memcpy(__get_str(target_name), target_name->name,
995 target_name->len);
996 ),
997 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
998 " src name %.*s target name %.*s",
999 MAJOR(__entry->dev), MINOR(__entry->dev),
1000 __entry->src_dp_ino,
1001 __entry->target_dp_ino,
1002 __entry->src_namelen,
1003 __get_str(src_name),
1004 __entry->target_namelen,
1005 __get_str(target_name))
1006)
1007
1008DECLARE_EVENT_CLASS(xfs_dquot_class,
1009 TP_PROTO(struct xfs_dquot *dqp),
1010 TP_ARGS(dqp),
1011 TP_STRUCT__entry(
1012 __field(dev_t, dev)
1013 __field(u32, id)
1014 __field(xfs_dqtype_t, type)
1015 __field(unsigned, flags)
1016 __field(unsigned, nrefs)
1017 __field(unsigned long long, res_bcount)
1018 __field(unsigned long long, res_rtbcount)
1019 __field(unsigned long long, res_icount)
1020
1021 __field(unsigned long long, bcount)
1022 __field(unsigned long long, rtbcount)
1023 __field(unsigned long long, icount)
1024
1025 __field(unsigned long long, blk_hardlimit)
1026 __field(unsigned long long, blk_softlimit)
1027 __field(unsigned long long, rtb_hardlimit)
1028 __field(unsigned long long, rtb_softlimit)
1029 __field(unsigned long long, ino_hardlimit)
1030 __field(unsigned long long, ino_softlimit)
1031 ),
1032 TP_fast_assign(
1033 __entry->dev = dqp->q_mount->m_super->s_dev;
1034 __entry->id = dqp->q_id;
1035 __entry->type = dqp->q_type;
1036 __entry->flags = dqp->q_flags;
1037 __entry->nrefs = dqp->q_nrefs;
1038
1039 __entry->res_bcount = dqp->q_blk.reserved;
1040 __entry->res_rtbcount = dqp->q_rtb.reserved;
1041 __entry->res_icount = dqp->q_ino.reserved;
1042
1043 __entry->bcount = dqp->q_blk.count;
1044 __entry->rtbcount = dqp->q_rtb.count;
1045 __entry->icount = dqp->q_ino.count;
1046
1047 __entry->blk_hardlimit = dqp->q_blk.hardlimit;
1048 __entry->blk_softlimit = dqp->q_blk.softlimit;
1049 __entry->rtb_hardlimit = dqp->q_rtb.hardlimit;
1050 __entry->rtb_softlimit = dqp->q_rtb.softlimit;
1051 __entry->ino_hardlimit = dqp->q_ino.hardlimit;
1052 __entry->ino_softlimit = dqp->q_ino.softlimit;
1053 ),
1054 TP_printk("dev %d:%d id 0x%x type %s flags %s nrefs %u "
1055 "res_bc 0x%llx res_rtbc 0x%llx res_ic 0x%llx "
1056 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
1057 "rtbcnt 0x%llx rtbhardlimit 0x%llx rtbsoftlimit 0x%llx "
1058 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
1059 MAJOR(__entry->dev), MINOR(__entry->dev),
1060 __entry->id,
1061 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1062 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1063 __entry->nrefs,
1064 __entry->res_bcount,
1065 __entry->res_rtbcount,
1066 __entry->res_icount,
1067 __entry->bcount,
1068 __entry->blk_hardlimit,
1069 __entry->blk_softlimit,
1070 __entry->rtbcount,
1071 __entry->rtb_hardlimit,
1072 __entry->rtb_softlimit,
1073 __entry->icount,
1074 __entry->ino_hardlimit,
1075 __entry->ino_softlimit)
1076)
1077
1078#define DEFINE_DQUOT_EVENT(name) \
1079DEFINE_EVENT(xfs_dquot_class, name, \
1080 TP_PROTO(struct xfs_dquot *dqp), \
1081 TP_ARGS(dqp))
1082DEFINE_DQUOT_EVENT(xfs_dqadjust);
1083DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
1084DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
1085DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
1086DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
1087DEFINE_DQUOT_EVENT(xfs_dqattach_found);
1088DEFINE_DQUOT_EVENT(xfs_dqattach_get);
1089DEFINE_DQUOT_EVENT(xfs_dqalloc);
1090DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
1091DEFINE_DQUOT_EVENT(xfs_dqread);
1092DEFINE_DQUOT_EVENT(xfs_dqread_fail);
1093DEFINE_DQUOT_EVENT(xfs_dqget_hit);
1094DEFINE_DQUOT_EVENT(xfs_dqget_miss);
1095DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
1096DEFINE_DQUOT_EVENT(xfs_dqget_dup);
1097DEFINE_DQUOT_EVENT(xfs_dqput);
1098DEFINE_DQUOT_EVENT(xfs_dqput_free);
1099DEFINE_DQUOT_EVENT(xfs_dqrele);
1100DEFINE_DQUOT_EVENT(xfs_dqflush);
1101DEFINE_DQUOT_EVENT(xfs_dqflush_force);
1102DEFINE_DQUOT_EVENT(xfs_dqflush_done);
1103DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_before);
1104DEFINE_DQUOT_EVENT(xfs_trans_apply_dquot_deltas_after);
1105
1106TRACE_EVENT(xfs_trans_mod_dquot,
1107 TP_PROTO(struct xfs_trans *tp, struct xfs_dquot *dqp,
1108 unsigned int field, int64_t delta),
1109 TP_ARGS(tp, dqp, field, delta),
1110 TP_STRUCT__entry(
1111 __field(dev_t, dev)
1112 __field(xfs_dqtype_t, type)
1113 __field(unsigned int, flags)
1114 __field(unsigned int, dqid)
1115 __field(unsigned int, field)
1116 __field(int64_t, delta)
1117 ),
1118 TP_fast_assign(
1119 __entry->dev = tp->t_mountp->m_super->s_dev;
1120 __entry->type = dqp->q_type;
1121 __entry->flags = dqp->q_flags;
1122 __entry->dqid = dqp->q_id;
1123 __entry->field = field;
1124 __entry->delta = delta;
1125 ),
1126 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s field %s delta %lld",
1127 MAJOR(__entry->dev), MINOR(__entry->dev),
1128 __entry->dqid,
1129 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1130 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1131 __print_flags(__entry->field, "|", XFS_QMOPT_FLAGS),
1132 __entry->delta)
1133);
1134
1135DECLARE_EVENT_CLASS(xfs_dqtrx_class,
1136 TP_PROTO(struct xfs_dqtrx *qtrx),
1137 TP_ARGS(qtrx),
1138 TP_STRUCT__entry(
1139 __field(dev_t, dev)
1140 __field(xfs_dqtype_t, type)
1141 __field(unsigned int, flags)
1142 __field(u32, dqid)
1143
1144 __field(uint64_t, blk_res)
1145 __field(int64_t, bcount_delta)
1146 __field(int64_t, delbcnt_delta)
1147
1148 __field(uint64_t, rtblk_res)
1149 __field(uint64_t, rtblk_res_used)
1150 __field(int64_t, rtbcount_delta)
1151 __field(int64_t, delrtb_delta)
1152
1153 __field(uint64_t, ino_res)
1154 __field(uint64_t, ino_res_used)
1155 __field(int64_t, icount_delta)
1156 ),
1157 TP_fast_assign(
1158 __entry->dev = qtrx->qt_dquot->q_mount->m_super->s_dev;
1159 __entry->type = qtrx->qt_dquot->q_type;
1160 __entry->flags = qtrx->qt_dquot->q_flags;
1161 __entry->dqid = qtrx->qt_dquot->q_id;
1162
1163 __entry->blk_res = qtrx->qt_blk_res;
1164 __entry->bcount_delta = qtrx->qt_bcount_delta;
1165 __entry->delbcnt_delta = qtrx->qt_delbcnt_delta;
1166
1167 __entry->rtblk_res = qtrx->qt_rtblk_res;
1168 __entry->rtblk_res_used = qtrx->qt_rtblk_res_used;
1169 __entry->rtbcount_delta = qtrx->qt_rtbcount_delta;
1170 __entry->delrtb_delta = qtrx->qt_delrtb_delta;
1171
1172 __entry->ino_res = qtrx->qt_ino_res;
1173 __entry->ino_res_used = qtrx->qt_ino_res_used;
1174 __entry->icount_delta = qtrx->qt_icount_delta;
1175 ),
1176 TP_printk("dev %d:%d dquot id 0x%x type %s flags %s "
1177 "blk_res %llu bcount_delta %lld delbcnt_delta %lld "
1178 "rtblk_res %llu rtblk_res_used %llu rtbcount_delta %lld delrtb_delta %lld "
1179 "ino_res %llu ino_res_used %llu icount_delta %lld",
1180 MAJOR(__entry->dev), MINOR(__entry->dev),
1181 __entry->dqid,
1182 __print_flags(__entry->type, "|", XFS_DQTYPE_STRINGS),
1183 __print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
1184
1185 __entry->blk_res,
1186 __entry->bcount_delta,
1187 __entry->delbcnt_delta,
1188
1189 __entry->rtblk_res,
1190 __entry->rtblk_res_used,
1191 __entry->rtbcount_delta,
1192 __entry->delrtb_delta,
1193
1194 __entry->ino_res,
1195 __entry->ino_res_used,
1196 __entry->icount_delta)
1197)
1198
1199#define DEFINE_DQTRX_EVENT(name) \
1200DEFINE_EVENT(xfs_dqtrx_class, name, \
1201 TP_PROTO(struct xfs_dqtrx *qtrx), \
1202 TP_ARGS(qtrx))
1203DEFINE_DQTRX_EVENT(xfs_trans_apply_dquot_deltas);
1204DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_before);
1205DEFINE_DQTRX_EVENT(xfs_trans_mod_dquot_after);
1206
1207DECLARE_EVENT_CLASS(xfs_loggrant_class,
1208 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
1209 TP_ARGS(log, tic),
1210 TP_STRUCT__entry(
1211 __field(dev_t, dev)
1212 __field(char, ocnt)
1213 __field(char, cnt)
1214 __field(int, curr_res)
1215 __field(int, unit_res)
1216 __field(unsigned int, flags)
1217 __field(int, reserveq)
1218 __field(int, writeq)
1219 __field(int, grant_reserve_cycle)
1220 __field(int, grant_reserve_bytes)
1221 __field(int, grant_write_cycle)
1222 __field(int, grant_write_bytes)
1223 __field(int, curr_cycle)
1224 __field(int, curr_block)
1225 __field(xfs_lsn_t, tail_lsn)
1226 ),
1227 TP_fast_assign(
1228 __entry->dev = log->l_mp->m_super->s_dev;
1229 __entry->ocnt = tic->t_ocnt;
1230 __entry->cnt = tic->t_cnt;
1231 __entry->curr_res = tic->t_curr_res;
1232 __entry->unit_res = tic->t_unit_res;
1233 __entry->flags = tic->t_flags;
1234 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
1235 __entry->writeq = list_empty(&log->l_write_head.waiters);
1236 xlog_crack_grant_head(&log->l_reserve_head.grant,
1237 &__entry->grant_reserve_cycle,
1238 &__entry->grant_reserve_bytes);
1239 xlog_crack_grant_head(&log->l_write_head.grant,
1240 &__entry->grant_write_cycle,
1241 &__entry->grant_write_bytes);
1242 __entry->curr_cycle = log->l_curr_cycle;
1243 __entry->curr_block = log->l_curr_block;
1244 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
1245 ),
1246 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
1247 "t_unit_res %u t_flags %s reserveq %s "
1248 "writeq %s grant_reserve_cycle %d "
1249 "grant_reserve_bytes %d grant_write_cycle %d "
1250 "grant_write_bytes %d curr_cycle %d curr_block %d "
1251 "tail_cycle %d tail_block %d",
1252 MAJOR(__entry->dev), MINOR(__entry->dev),
1253 __entry->ocnt,
1254 __entry->cnt,
1255 __entry->curr_res,
1256 __entry->unit_res,
1257 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
1258 __entry->reserveq ? "empty" : "active",
1259 __entry->writeq ? "empty" : "active",
1260 __entry->grant_reserve_cycle,
1261 __entry->grant_reserve_bytes,
1262 __entry->grant_write_cycle,
1263 __entry->grant_write_bytes,
1264 __entry->curr_cycle,
1265 __entry->curr_block,
1266 CYCLE_LSN(__entry->tail_lsn),
1267 BLOCK_LSN(__entry->tail_lsn)
1268 )
1269)
1270
1271#define DEFINE_LOGGRANT_EVENT(name) \
1272DEFINE_EVENT(xfs_loggrant_class, name, \
1273 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1274 TP_ARGS(log, tic))
1275DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1276DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1277DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1278DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1279DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1280DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1281DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1282DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1283DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant);
1284DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_exit);
1285DEFINE_LOGGRANT_EVENT(xfs_log_ticket_regrant_sub);
1286DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant);
1287DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_sub);
1288DEFINE_LOGGRANT_EVENT(xfs_log_ticket_ungrant_exit);
1289DEFINE_LOGGRANT_EVENT(xfs_log_cil_wait);
1290
1291DECLARE_EVENT_CLASS(xfs_log_item_class,
1292 TP_PROTO(struct xfs_log_item *lip),
1293 TP_ARGS(lip),
1294 TP_STRUCT__entry(
1295 __field(dev_t, dev)
1296 __field(void *, lip)
1297 __field(uint, type)
1298 __field(unsigned long, flags)
1299 __field(xfs_lsn_t, lsn)
1300 ),
1301 TP_fast_assign(
1302 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
1303 __entry->lip = lip;
1304 __entry->type = lip->li_type;
1305 __entry->flags = lip->li_flags;
1306 __entry->lsn = lip->li_lsn;
1307 ),
1308 TP_printk("dev %d:%d lip %p lsn %d/%d type %s flags %s",
1309 MAJOR(__entry->dev), MINOR(__entry->dev),
1310 __entry->lip,
1311 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1312 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1313 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1314)
1315
1316TRACE_EVENT(xfs_log_force,
1317 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1318 TP_ARGS(mp, lsn, caller_ip),
1319 TP_STRUCT__entry(
1320 __field(dev_t, dev)
1321 __field(xfs_lsn_t, lsn)
1322 __field(unsigned long, caller_ip)
1323 ),
1324 TP_fast_assign(
1325 __entry->dev = mp->m_super->s_dev;
1326 __entry->lsn = lsn;
1327 __entry->caller_ip = caller_ip;
1328 ),
1329 TP_printk("dev %d:%d lsn 0x%llx caller %pS",
1330 MAJOR(__entry->dev), MINOR(__entry->dev),
1331 __entry->lsn, (void *)__entry->caller_ip)
1332)
1333
1334#define DEFINE_LOG_ITEM_EVENT(name) \
1335DEFINE_EVENT(xfs_log_item_class, name, \
1336 TP_PROTO(struct xfs_log_item *lip), \
1337 TP_ARGS(lip))
1338DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1339DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1340DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1341DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1342DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_mark);
1343DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_skip);
1344DEFINE_LOG_ITEM_EVENT(xfs_cil_whiteout_unpin);
1345
1346DECLARE_EVENT_CLASS(xfs_ail_class,
1347 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1348 TP_ARGS(lip, old_lsn, new_lsn),
1349 TP_STRUCT__entry(
1350 __field(dev_t, dev)
1351 __field(void *, lip)
1352 __field(uint, type)
1353 __field(unsigned long, flags)
1354 __field(xfs_lsn_t, old_lsn)
1355 __field(xfs_lsn_t, new_lsn)
1356 ),
1357 TP_fast_assign(
1358 __entry->dev = lip->li_log->l_mp->m_super->s_dev;
1359 __entry->lip = lip;
1360 __entry->type = lip->li_type;
1361 __entry->flags = lip->li_flags;
1362 __entry->old_lsn = old_lsn;
1363 __entry->new_lsn = new_lsn;
1364 ),
1365 TP_printk("dev %d:%d lip %p old lsn %d/%d new lsn %d/%d type %s flags %s",
1366 MAJOR(__entry->dev), MINOR(__entry->dev),
1367 __entry->lip,
1368 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1369 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1370 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1371 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1372)
1373
1374#define DEFINE_AIL_EVENT(name) \
1375DEFINE_EVENT(xfs_ail_class, name, \
1376 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1377 TP_ARGS(lip, old_lsn, new_lsn))
1378DEFINE_AIL_EVENT(xfs_ail_insert);
1379DEFINE_AIL_EVENT(xfs_ail_move);
1380DEFINE_AIL_EVENT(xfs_ail_delete);
1381
1382TRACE_EVENT(xfs_log_assign_tail_lsn,
1383 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1384 TP_ARGS(log, new_lsn),
1385 TP_STRUCT__entry(
1386 __field(dev_t, dev)
1387 __field(xfs_lsn_t, new_lsn)
1388 __field(xfs_lsn_t, old_lsn)
1389 __field(xfs_lsn_t, last_sync_lsn)
1390 ),
1391 TP_fast_assign(
1392 __entry->dev = log->l_mp->m_super->s_dev;
1393 __entry->new_lsn = new_lsn;
1394 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1395 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1396 ),
1397 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1398 MAJOR(__entry->dev), MINOR(__entry->dev),
1399 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1400 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1401 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1402)
1403
1404DECLARE_EVENT_CLASS(xfs_file_class,
1405 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter),
1406 TP_ARGS(iocb, iter),
1407 TP_STRUCT__entry(
1408 __field(dev_t, dev)
1409 __field(xfs_ino_t, ino)
1410 __field(xfs_fsize_t, size)
1411 __field(loff_t, offset)
1412 __field(size_t, count)
1413 ),
1414 TP_fast_assign(
1415 __entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
1416 __entry->ino = XFS_I(file_inode(iocb->ki_filp))->i_ino;
1417 __entry->size = XFS_I(file_inode(iocb->ki_filp))->i_disk_size;
1418 __entry->offset = iocb->ki_pos;
1419 __entry->count = iov_iter_count(iter);
1420 ),
1421 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx",
1422 MAJOR(__entry->dev), MINOR(__entry->dev),
1423 __entry->ino,
1424 __entry->size,
1425 __entry->offset,
1426 __entry->count)
1427)
1428
1429#define DEFINE_RW_EVENT(name) \
1430DEFINE_EVENT(xfs_file_class, name, \
1431 TP_PROTO(struct kiocb *iocb, struct iov_iter *iter), \
1432 TP_ARGS(iocb, iter))
1433DEFINE_RW_EVENT(xfs_file_buffered_read);
1434DEFINE_RW_EVENT(xfs_file_direct_read);
1435DEFINE_RW_EVENT(xfs_file_dax_read);
1436DEFINE_RW_EVENT(xfs_file_buffered_write);
1437DEFINE_RW_EVENT(xfs_file_direct_write);
1438DEFINE_RW_EVENT(xfs_file_dax_write);
1439DEFINE_RW_EVENT(xfs_reflink_bounce_dio_write);
1440
1441
1442DECLARE_EVENT_CLASS(xfs_imap_class,
1443 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1444 int whichfork, struct xfs_bmbt_irec *irec),
1445 TP_ARGS(ip, offset, count, whichfork, irec),
1446 TP_STRUCT__entry(
1447 __field(dev_t, dev)
1448 __field(xfs_ino_t, ino)
1449 __field(loff_t, size)
1450 __field(loff_t, offset)
1451 __field(size_t, count)
1452 __field(int, whichfork)
1453 __field(xfs_fileoff_t, startoff)
1454 __field(xfs_fsblock_t, startblock)
1455 __field(xfs_filblks_t, blockcount)
1456 ),
1457 TP_fast_assign(
1458 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1459 __entry->ino = ip->i_ino;
1460 __entry->size = ip->i_disk_size;
1461 __entry->offset = offset;
1462 __entry->count = count;
1463 __entry->whichfork = whichfork;
1464 __entry->startoff = irec ? irec->br_startoff : 0;
1465 __entry->startblock = irec ? irec->br_startblock : 0;
1466 __entry->blockcount = irec ? irec->br_blockcount : 0;
1467 ),
1468 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx pos 0x%llx bytecount 0x%zx "
1469 "fork %s startoff 0x%llx startblock 0x%llx fsbcount 0x%llx",
1470 MAJOR(__entry->dev), MINOR(__entry->dev),
1471 __entry->ino,
1472 __entry->size,
1473 __entry->offset,
1474 __entry->count,
1475 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
1476 __entry->startoff,
1477 (int64_t)__entry->startblock,
1478 __entry->blockcount)
1479)
1480
1481#define DEFINE_IMAP_EVENT(name) \
1482DEFINE_EVENT(xfs_imap_class, name, \
1483 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1484 int whichfork, struct xfs_bmbt_irec *irec), \
1485 TP_ARGS(ip, offset, count, whichfork, irec))
1486DEFINE_IMAP_EVENT(xfs_map_blocks_found);
1487DEFINE_IMAP_EVENT(xfs_map_blocks_alloc);
1488DEFINE_IMAP_EVENT(xfs_iomap_alloc);
1489DEFINE_IMAP_EVENT(xfs_iomap_found);
1490
1491DECLARE_EVENT_CLASS(xfs_simple_io_class,
1492 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1493 TP_ARGS(ip, offset, count),
1494 TP_STRUCT__entry(
1495 __field(dev_t, dev)
1496 __field(xfs_ino_t, ino)
1497 __field(loff_t, isize)
1498 __field(loff_t, disize)
1499 __field(loff_t, offset)
1500 __field(size_t, count)
1501 ),
1502 TP_fast_assign(
1503 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1504 __entry->ino = ip->i_ino;
1505 __entry->isize = VFS_I(ip)->i_size;
1506 __entry->disize = ip->i_disk_size;
1507 __entry->offset = offset;
1508 __entry->count = count;
1509 ),
1510 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1511 "pos 0x%llx bytecount 0x%zx",
1512 MAJOR(__entry->dev), MINOR(__entry->dev),
1513 __entry->ino,
1514 __entry->isize,
1515 __entry->disize,
1516 __entry->offset,
1517 __entry->count)
1518);
1519
1520#define DEFINE_SIMPLE_IO_EVENT(name) \
1521DEFINE_EVENT(xfs_simple_io_class, name, \
1522 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1523 TP_ARGS(ip, offset, count))
1524DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1525DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1526DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1527DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1528DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1529DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1530DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1531
1532DECLARE_EVENT_CLASS(xfs_itrunc_class,
1533 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1534 TP_ARGS(ip, new_size),
1535 TP_STRUCT__entry(
1536 __field(dev_t, dev)
1537 __field(xfs_ino_t, ino)
1538 __field(xfs_fsize_t, size)
1539 __field(xfs_fsize_t, new_size)
1540 ),
1541 TP_fast_assign(
1542 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1543 __entry->ino = ip->i_ino;
1544 __entry->size = ip->i_disk_size;
1545 __entry->new_size = new_size;
1546 ),
1547 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx new_size 0x%llx",
1548 MAJOR(__entry->dev), MINOR(__entry->dev),
1549 __entry->ino,
1550 __entry->size,
1551 __entry->new_size)
1552)
1553
1554#define DEFINE_ITRUNC_EVENT(name) \
1555DEFINE_EVENT(xfs_itrunc_class, name, \
1556 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1557 TP_ARGS(ip, new_size))
1558DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1559DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1560
1561TRACE_EVENT(xfs_pagecache_inval,
1562 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1563 TP_ARGS(ip, start, finish),
1564 TP_STRUCT__entry(
1565 __field(dev_t, dev)
1566 __field(xfs_ino_t, ino)
1567 __field(xfs_fsize_t, size)
1568 __field(xfs_off_t, start)
1569 __field(xfs_off_t, finish)
1570 ),
1571 TP_fast_assign(
1572 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1573 __entry->ino = ip->i_ino;
1574 __entry->size = ip->i_disk_size;
1575 __entry->start = start;
1576 __entry->finish = finish;
1577 ),
1578 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx start 0x%llx finish 0x%llx",
1579 MAJOR(__entry->dev), MINOR(__entry->dev),
1580 __entry->ino,
1581 __entry->size,
1582 __entry->start,
1583 __entry->finish)
1584);
1585
1586TRACE_EVENT(xfs_bunmap,
1587 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t fileoff, xfs_filblks_t len,
1588 int flags, unsigned long caller_ip),
1589 TP_ARGS(ip, fileoff, len, flags, caller_ip),
1590 TP_STRUCT__entry(
1591 __field(dev_t, dev)
1592 __field(xfs_ino_t, ino)
1593 __field(xfs_fsize_t, size)
1594 __field(xfs_fileoff_t, fileoff)
1595 __field(xfs_filblks_t, len)
1596 __field(unsigned long, caller_ip)
1597 __field(int, flags)
1598 ),
1599 TP_fast_assign(
1600 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1601 __entry->ino = ip->i_ino;
1602 __entry->size = ip->i_disk_size;
1603 __entry->fileoff = fileoff;
1604 __entry->len = len;
1605 __entry->caller_ip = caller_ip;
1606 __entry->flags = flags;
1607 ),
1608 TP_printk("dev %d:%d ino 0x%llx disize 0x%llx fileoff 0x%llx fsbcount 0x%llx "
1609 "flags %s caller %pS",
1610 MAJOR(__entry->dev), MINOR(__entry->dev),
1611 __entry->ino,
1612 __entry->size,
1613 __entry->fileoff,
1614 __entry->len,
1615 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1616 (void *)__entry->caller_ip)
1617
1618);
1619
1620DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1621 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1622 xfs_agblock_t agbno, xfs_extlen_t len),
1623 TP_ARGS(mp, agno, agbno, len),
1624 TP_STRUCT__entry(
1625 __field(dev_t, dev)
1626 __field(xfs_agnumber_t, agno)
1627 __field(xfs_agblock_t, agbno)
1628 __field(xfs_extlen_t, len)
1629 ),
1630 TP_fast_assign(
1631 __entry->dev = mp->m_super->s_dev;
1632 __entry->agno = agno;
1633 __entry->agbno = agbno;
1634 __entry->len = len;
1635 ),
1636 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
1637 MAJOR(__entry->dev), MINOR(__entry->dev),
1638 __entry->agno,
1639 __entry->agbno,
1640 __entry->len)
1641);
1642#define DEFINE_BUSY_EVENT(name) \
1643DEFINE_EVENT(xfs_extent_busy_class, name, \
1644 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1645 xfs_agblock_t agbno, xfs_extlen_t len), \
1646 TP_ARGS(mp, agno, agbno, len))
1647DEFINE_BUSY_EVENT(xfs_extent_busy);
1648DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1649DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1650DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1651DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1652
1653TRACE_EVENT(xfs_extent_busy_trim,
1654 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1655 xfs_agblock_t agbno, xfs_extlen_t len,
1656 xfs_agblock_t tbno, xfs_extlen_t tlen),
1657 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1658 TP_STRUCT__entry(
1659 __field(dev_t, dev)
1660 __field(xfs_agnumber_t, agno)
1661 __field(xfs_agblock_t, agbno)
1662 __field(xfs_extlen_t, len)
1663 __field(xfs_agblock_t, tbno)
1664 __field(xfs_extlen_t, tlen)
1665 ),
1666 TP_fast_assign(
1667 __entry->dev = mp->m_super->s_dev;
1668 __entry->agno = agno;
1669 __entry->agbno = agbno;
1670 __entry->len = len;
1671 __entry->tbno = tbno;
1672 __entry->tlen = tlen;
1673 ),
1674 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x found_agbno 0x%x found_fsbcount 0x%x",
1675 MAJOR(__entry->dev), MINOR(__entry->dev),
1676 __entry->agno,
1677 __entry->agbno,
1678 __entry->len,
1679 __entry->tbno,
1680 __entry->tlen)
1681);
1682
1683DECLARE_EVENT_CLASS(xfs_agf_class,
1684 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1685 unsigned long caller_ip),
1686 TP_ARGS(mp, agf, flags, caller_ip),
1687 TP_STRUCT__entry(
1688 __field(dev_t, dev)
1689 __field(xfs_agnumber_t, agno)
1690 __field(int, flags)
1691 __field(__u32, length)
1692 __field(__u32, bno_root)
1693 __field(__u32, cnt_root)
1694 __field(__u32, bno_level)
1695 __field(__u32, cnt_level)
1696 __field(__u32, flfirst)
1697 __field(__u32, fllast)
1698 __field(__u32, flcount)
1699 __field(__u32, freeblks)
1700 __field(__u32, longest)
1701 __field(unsigned long, caller_ip)
1702 ),
1703 TP_fast_assign(
1704 __entry->dev = mp->m_super->s_dev;
1705 __entry->agno = be32_to_cpu(agf->agf_seqno),
1706 __entry->flags = flags;
1707 __entry->length = be32_to_cpu(agf->agf_length),
1708 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1709 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1710 __entry->bno_level =
1711 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1712 __entry->cnt_level =
1713 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1714 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1715 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1716 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1717 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1718 __entry->longest = be32_to_cpu(agf->agf_longest);
1719 __entry->caller_ip = caller_ip;
1720 ),
1721 TP_printk("dev %d:%d agno 0x%x flags %s length %u roots b %u c %u "
1722 "levels b %u c %u flfirst %u fllast %u flcount %u "
1723 "freeblks %u longest %u caller %pS",
1724 MAJOR(__entry->dev), MINOR(__entry->dev),
1725 __entry->agno,
1726 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1727 __entry->length,
1728 __entry->bno_root,
1729 __entry->cnt_root,
1730 __entry->bno_level,
1731 __entry->cnt_level,
1732 __entry->flfirst,
1733 __entry->fllast,
1734 __entry->flcount,
1735 __entry->freeblks,
1736 __entry->longest,
1737 (void *)__entry->caller_ip)
1738);
1739#define DEFINE_AGF_EVENT(name) \
1740DEFINE_EVENT(xfs_agf_class, name, \
1741 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags, \
1742 unsigned long caller_ip), \
1743 TP_ARGS(mp, agf, flags, caller_ip))
1744DEFINE_AGF_EVENT(xfs_agf);
1745DEFINE_AGF_EVENT(xfs_agfl_reset);
1746
1747TRACE_EVENT(xfs_free_extent,
1748 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1749 xfs_extlen_t len, enum xfs_ag_resv_type resv, int haveleft,
1750 int haveright),
1751 TP_ARGS(mp, agno, agbno, len, resv, haveleft, haveright),
1752 TP_STRUCT__entry(
1753 __field(dev_t, dev)
1754 __field(xfs_agnumber_t, agno)
1755 __field(xfs_agblock_t, agbno)
1756 __field(xfs_extlen_t, len)
1757 __field(int, resv)
1758 __field(int, haveleft)
1759 __field(int, haveright)
1760 ),
1761 TP_fast_assign(
1762 __entry->dev = mp->m_super->s_dev;
1763 __entry->agno = agno;
1764 __entry->agbno = agbno;
1765 __entry->len = len;
1766 __entry->resv = resv;
1767 __entry->haveleft = haveleft;
1768 __entry->haveright = haveright;
1769 ),
1770 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x resv %d %s",
1771 MAJOR(__entry->dev), MINOR(__entry->dev),
1772 __entry->agno,
1773 __entry->agbno,
1774 __entry->len,
1775 __entry->resv,
1776 __entry->haveleft ?
1777 (__entry->haveright ? "both" : "left") :
1778 (__entry->haveright ? "right" : "none"))
1779
1780);
1781
1782DECLARE_EVENT_CLASS(xfs_alloc_class,
1783 TP_PROTO(struct xfs_alloc_arg *args),
1784 TP_ARGS(args),
1785 TP_STRUCT__entry(
1786 __field(dev_t, dev)
1787 __field(xfs_agnumber_t, agno)
1788 __field(xfs_agblock_t, agbno)
1789 __field(xfs_extlen_t, minlen)
1790 __field(xfs_extlen_t, maxlen)
1791 __field(xfs_extlen_t, mod)
1792 __field(xfs_extlen_t, prod)
1793 __field(xfs_extlen_t, minleft)
1794 __field(xfs_extlen_t, total)
1795 __field(xfs_extlen_t, alignment)
1796 __field(xfs_extlen_t, minalignslop)
1797 __field(xfs_extlen_t, len)
1798 __field(short, type)
1799 __field(short, otype)
1800 __field(char, wasdel)
1801 __field(char, wasfromfl)
1802 __field(int, resv)
1803 __field(int, datatype)
1804 __field(xfs_fsblock_t, firstblock)
1805 ),
1806 TP_fast_assign(
1807 __entry->dev = args->mp->m_super->s_dev;
1808 __entry->agno = args->agno;
1809 __entry->agbno = args->agbno;
1810 __entry->minlen = args->minlen;
1811 __entry->maxlen = args->maxlen;
1812 __entry->mod = args->mod;
1813 __entry->prod = args->prod;
1814 __entry->minleft = args->minleft;
1815 __entry->total = args->total;
1816 __entry->alignment = args->alignment;
1817 __entry->minalignslop = args->minalignslop;
1818 __entry->len = args->len;
1819 __entry->type = args->type;
1820 __entry->otype = args->otype;
1821 __entry->wasdel = args->wasdel;
1822 __entry->wasfromfl = args->wasfromfl;
1823 __entry->resv = args->resv;
1824 __entry->datatype = args->datatype;
1825 __entry->firstblock = args->tp->t_firstblock;
1826 ),
1827 TP_printk("dev %d:%d agno 0x%x agbno 0x%x minlen %u maxlen %u mod %u "
1828 "prod %u minleft %u total %u alignment %u minalignslop %u "
1829 "len %u type %s otype %s wasdel %d wasfromfl %d resv %d "
1830 "datatype 0x%x firstblock 0x%llx",
1831 MAJOR(__entry->dev), MINOR(__entry->dev),
1832 __entry->agno,
1833 __entry->agbno,
1834 __entry->minlen,
1835 __entry->maxlen,
1836 __entry->mod,
1837 __entry->prod,
1838 __entry->minleft,
1839 __entry->total,
1840 __entry->alignment,
1841 __entry->minalignslop,
1842 __entry->len,
1843 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1844 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1845 __entry->wasdel,
1846 __entry->wasfromfl,
1847 __entry->resv,
1848 __entry->datatype,
1849 (unsigned long long)__entry->firstblock)
1850)
1851
1852#define DEFINE_ALLOC_EVENT(name) \
1853DEFINE_EVENT(xfs_alloc_class, name, \
1854 TP_PROTO(struct xfs_alloc_arg *args), \
1855 TP_ARGS(args))
1856DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1857DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1858DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1859DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1860DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1861DEFINE_ALLOC_EVENT(xfs_alloc_cur);
1862DEFINE_ALLOC_EVENT(xfs_alloc_cur_right);
1863DEFINE_ALLOC_EVENT(xfs_alloc_cur_left);
1864DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup);
1865DEFINE_ALLOC_EVENT(xfs_alloc_cur_lookup_done);
1866DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1867DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1868DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1869DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1870DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1871DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1872DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1873DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1874DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1875DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1876DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1877DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1878DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1879DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1880DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1881DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1882DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1883DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1884
1885TRACE_EVENT(xfs_alloc_cur_check,
1886 TP_PROTO(struct xfs_mount *mp, xfs_btnum_t btnum, xfs_agblock_t bno,
1887 xfs_extlen_t len, xfs_extlen_t diff, bool new),
1888 TP_ARGS(mp, btnum, bno, len, diff, new),
1889 TP_STRUCT__entry(
1890 __field(dev_t, dev)
1891 __field(xfs_btnum_t, btnum)
1892 __field(xfs_agblock_t, bno)
1893 __field(xfs_extlen_t, len)
1894 __field(xfs_extlen_t, diff)
1895 __field(bool, new)
1896 ),
1897 TP_fast_assign(
1898 __entry->dev = mp->m_super->s_dev;
1899 __entry->btnum = btnum;
1900 __entry->bno = bno;
1901 __entry->len = len;
1902 __entry->diff = diff;
1903 __entry->new = new;
1904 ),
1905 TP_printk("dev %d:%d btree %s agbno 0x%x fsbcount 0x%x diff 0x%x new %d",
1906 MAJOR(__entry->dev), MINOR(__entry->dev),
1907 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
1908 __entry->bno, __entry->len, __entry->diff, __entry->new)
1909)
1910
1911DECLARE_EVENT_CLASS(xfs_da_class,
1912 TP_PROTO(struct xfs_da_args *args),
1913 TP_ARGS(args),
1914 TP_STRUCT__entry(
1915 __field(dev_t, dev)
1916 __field(xfs_ino_t, ino)
1917 __dynamic_array(char, name, args->namelen)
1918 __field(int, namelen)
1919 __field(xfs_dahash_t, hashval)
1920 __field(xfs_ino_t, inumber)
1921 __field(uint32_t, op_flags)
1922 ),
1923 TP_fast_assign(
1924 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1925 __entry->ino = args->dp->i_ino;
1926 if (args->namelen)
1927 memcpy(__get_str(name), args->name, args->namelen);
1928 __entry->namelen = args->namelen;
1929 __entry->hashval = args->hashval;
1930 __entry->inumber = args->inumber;
1931 __entry->op_flags = args->op_flags;
1932 ),
1933 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1934 "inumber 0x%llx op_flags %s",
1935 MAJOR(__entry->dev), MINOR(__entry->dev),
1936 __entry->ino,
1937 __entry->namelen,
1938 __entry->namelen ? __get_str(name) : NULL,
1939 __entry->namelen,
1940 __entry->hashval,
1941 __entry->inumber,
1942 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1943)
1944
1945#define DEFINE_DIR2_EVENT(name) \
1946DEFINE_EVENT(xfs_da_class, name, \
1947 TP_PROTO(struct xfs_da_args *args), \
1948 TP_ARGS(args))
1949DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1950DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1951DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1952DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1953DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1954DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1955DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1956DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1957DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1958DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1959DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1960DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1961DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1962DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1963DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1964DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1965DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1966DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1967DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1968DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1969DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1970DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1971DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1972DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1973DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1974
1975DECLARE_EVENT_CLASS(xfs_attr_class,
1976 TP_PROTO(struct xfs_da_args *args),
1977 TP_ARGS(args),
1978 TP_STRUCT__entry(
1979 __field(dev_t, dev)
1980 __field(xfs_ino_t, ino)
1981 __dynamic_array(char, name, args->namelen)
1982 __field(int, namelen)
1983 __field(int, valuelen)
1984 __field(xfs_dahash_t, hashval)
1985 __field(unsigned int, attr_filter)
1986 __field(unsigned int, attr_flags)
1987 __field(uint32_t, op_flags)
1988 ),
1989 TP_fast_assign(
1990 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1991 __entry->ino = args->dp->i_ino;
1992 if (args->namelen)
1993 memcpy(__get_str(name), args->name, args->namelen);
1994 __entry->namelen = args->namelen;
1995 __entry->valuelen = args->valuelen;
1996 __entry->hashval = args->hashval;
1997 __entry->attr_filter = args->attr_filter;
1998 __entry->attr_flags = args->attr_flags;
1999 __entry->op_flags = args->op_flags;
2000 ),
2001 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
2002 "hashval 0x%x filter %s flags %s op_flags %s",
2003 MAJOR(__entry->dev), MINOR(__entry->dev),
2004 __entry->ino,
2005 __entry->namelen,
2006 __entry->namelen ? __get_str(name) : NULL,
2007 __entry->namelen,
2008 __entry->valuelen,
2009 __entry->hashval,
2010 __print_flags(__entry->attr_filter, "|",
2011 XFS_ATTR_FILTER_FLAGS),
2012 __print_flags(__entry->attr_flags, "|",
2013 { XATTR_CREATE, "CREATE" },
2014 { XATTR_REPLACE, "REPLACE" }),
2015 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
2016)
2017
2018#define DEFINE_ATTR_EVENT(name) \
2019DEFINE_EVENT(xfs_attr_class, name, \
2020 TP_PROTO(struct xfs_da_args *args), \
2021 TP_ARGS(args))
2022DEFINE_ATTR_EVENT(xfs_attr_sf_add);
2023DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
2024DEFINE_ATTR_EVENT(xfs_attr_sf_create);
2025DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
2026DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
2027DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
2028
2029DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
2030DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
2031DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
2032DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
2033DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
2034DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
2035DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
2036DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
2037DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
2038DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
2039DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
2040DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
2041DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
2042DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
2043DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
2044DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
2045DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
2046DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
2047DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
2048DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
2049DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
2050DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
2051
2052DEFINE_ATTR_EVENT(xfs_attr_node_addname);
2053DEFINE_ATTR_EVENT(xfs_attr_node_get);
2054DEFINE_ATTR_EVENT(xfs_attr_node_replace);
2055DEFINE_ATTR_EVENT(xfs_attr_node_removename);
2056
2057DEFINE_ATTR_EVENT(xfs_attr_fillstate);
2058DEFINE_ATTR_EVENT(xfs_attr_refillstate);
2059
2060DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
2061DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
2062
2063#define DEFINE_DA_EVENT(name) \
2064DEFINE_EVENT(xfs_da_class, name, \
2065 TP_PROTO(struct xfs_da_args *args), \
2066 TP_ARGS(args))
2067DEFINE_DA_EVENT(xfs_da_split);
2068DEFINE_DA_EVENT(xfs_da_join);
2069DEFINE_DA_EVENT(xfs_da_link_before);
2070DEFINE_DA_EVENT(xfs_da_link_after);
2071DEFINE_DA_EVENT(xfs_da_unlink_back);
2072DEFINE_DA_EVENT(xfs_da_unlink_forward);
2073DEFINE_DA_EVENT(xfs_da_root_split);
2074DEFINE_DA_EVENT(xfs_da_root_join);
2075DEFINE_DA_EVENT(xfs_da_node_add);
2076DEFINE_DA_EVENT(xfs_da_node_create);
2077DEFINE_DA_EVENT(xfs_da_node_split);
2078DEFINE_DA_EVENT(xfs_da_node_remove);
2079DEFINE_DA_EVENT(xfs_da_node_rebalance);
2080DEFINE_DA_EVENT(xfs_da_node_unbalance);
2081DEFINE_DA_EVENT(xfs_da_node_toosmall);
2082DEFINE_DA_EVENT(xfs_da_swap_lastblock);
2083DEFINE_DA_EVENT(xfs_da_grow_inode);
2084DEFINE_DA_EVENT(xfs_da_shrink_inode);
2085DEFINE_DA_EVENT(xfs_da_fixhashpath);
2086DEFINE_DA_EVENT(xfs_da_path_shift);
2087
2088DECLARE_EVENT_CLASS(xfs_dir2_space_class,
2089 TP_PROTO(struct xfs_da_args *args, int idx),
2090 TP_ARGS(args, idx),
2091 TP_STRUCT__entry(
2092 __field(dev_t, dev)
2093 __field(xfs_ino_t, ino)
2094 __field(uint32_t, op_flags)
2095 __field(int, idx)
2096 ),
2097 TP_fast_assign(
2098 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2099 __entry->ino = args->dp->i_ino;
2100 __entry->op_flags = args->op_flags;
2101 __entry->idx = idx;
2102 ),
2103 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
2104 MAJOR(__entry->dev), MINOR(__entry->dev),
2105 __entry->ino,
2106 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2107 __entry->idx)
2108)
2109
2110#define DEFINE_DIR2_SPACE_EVENT(name) \
2111DEFINE_EVENT(xfs_dir2_space_class, name, \
2112 TP_PROTO(struct xfs_da_args *args, int idx), \
2113 TP_ARGS(args, idx))
2114DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
2115DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
2116DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
2117DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
2118
2119TRACE_EVENT(xfs_dir2_leafn_moveents,
2120 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
2121 TP_ARGS(args, src_idx, dst_idx, count),
2122 TP_STRUCT__entry(
2123 __field(dev_t, dev)
2124 __field(xfs_ino_t, ino)
2125 __field(uint32_t, op_flags)
2126 __field(int, src_idx)
2127 __field(int, dst_idx)
2128 __field(int, count)
2129 ),
2130 TP_fast_assign(
2131 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
2132 __entry->ino = args->dp->i_ino;
2133 __entry->op_flags = args->op_flags;
2134 __entry->src_idx = src_idx;
2135 __entry->dst_idx = dst_idx;
2136 __entry->count = count;
2137 ),
2138 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
2139 "src_idx %d dst_idx %d count %d",
2140 MAJOR(__entry->dev), MINOR(__entry->dev),
2141 __entry->ino,
2142 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
2143 __entry->src_idx,
2144 __entry->dst_idx,
2145 __entry->count)
2146);
2147
2148#define XFS_SWAPEXT_INODES \
2149 { 0, "target" }, \
2150 { 1, "temp" }
2151
2152TRACE_DEFINE_ENUM(XFS_DINODE_FMT_DEV);
2153TRACE_DEFINE_ENUM(XFS_DINODE_FMT_LOCAL);
2154TRACE_DEFINE_ENUM(XFS_DINODE_FMT_EXTENTS);
2155TRACE_DEFINE_ENUM(XFS_DINODE_FMT_BTREE);
2156TRACE_DEFINE_ENUM(XFS_DINODE_FMT_UUID);
2157
2158DECLARE_EVENT_CLASS(xfs_swap_extent_class,
2159 TP_PROTO(struct xfs_inode *ip, int which),
2160 TP_ARGS(ip, which),
2161 TP_STRUCT__entry(
2162 __field(dev_t, dev)
2163 __field(int, which)
2164 __field(xfs_ino_t, ino)
2165 __field(int, format)
2166 __field(xfs_extnum_t, nex)
2167 __field(int, broot_size)
2168 __field(int, fork_off)
2169 ),
2170 TP_fast_assign(
2171 __entry->dev = VFS_I(ip)->i_sb->s_dev;
2172 __entry->which = which;
2173 __entry->ino = ip->i_ino;
2174 __entry->format = ip->i_df.if_format;
2175 __entry->nex = ip->i_df.if_nextents;
2176 __entry->broot_size = ip->i_df.if_broot_bytes;
2177 __entry->fork_off = xfs_inode_fork_boff(ip);
2178 ),
2179 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %llu, "
2180 "broot size %d, forkoff 0x%x",
2181 MAJOR(__entry->dev), MINOR(__entry->dev),
2182 __entry->ino,
2183 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
2184 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
2185 __entry->nex,
2186 __entry->broot_size,
2187 __entry->fork_off)
2188)
2189
2190#define DEFINE_SWAPEXT_EVENT(name) \
2191DEFINE_EVENT(xfs_swap_extent_class, name, \
2192 TP_PROTO(struct xfs_inode *ip, int which), \
2193 TP_ARGS(ip, which))
2194
2195DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
2196DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
2197
2198TRACE_EVENT(xfs_log_recover,
2199 TP_PROTO(struct xlog *log, xfs_daddr_t headblk, xfs_daddr_t tailblk),
2200 TP_ARGS(log, headblk, tailblk),
2201 TP_STRUCT__entry(
2202 __field(dev_t, dev)
2203 __field(xfs_daddr_t, headblk)
2204 __field(xfs_daddr_t, tailblk)
2205 ),
2206 TP_fast_assign(
2207 __entry->dev = log->l_mp->m_super->s_dev;
2208 __entry->headblk = headblk;
2209 __entry->tailblk = tailblk;
2210 ),
2211 TP_printk("dev %d:%d headblk 0x%llx tailblk 0x%llx",
2212 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->headblk,
2213 __entry->tailblk)
2214)
2215
2216TRACE_EVENT(xfs_log_recover_record,
2217 TP_PROTO(struct xlog *log, struct xlog_rec_header *rhead, int pass),
2218 TP_ARGS(log, rhead, pass),
2219 TP_STRUCT__entry(
2220 __field(dev_t, dev)
2221 __field(xfs_lsn_t, lsn)
2222 __field(int, len)
2223 __field(int, num_logops)
2224 __field(int, pass)
2225 ),
2226 TP_fast_assign(
2227 __entry->dev = log->l_mp->m_super->s_dev;
2228 __entry->lsn = be64_to_cpu(rhead->h_lsn);
2229 __entry->len = be32_to_cpu(rhead->h_len);
2230 __entry->num_logops = be32_to_cpu(rhead->h_num_logops);
2231 __entry->pass = pass;
2232 ),
2233 TP_printk("dev %d:%d lsn 0x%llx len 0x%x num_logops 0x%x pass %d",
2234 MAJOR(__entry->dev), MINOR(__entry->dev),
2235 __entry->lsn, __entry->len, __entry->num_logops,
2236 __entry->pass)
2237)
2238
2239DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
2240 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
2241 struct xlog_recover_item *item, int pass),
2242 TP_ARGS(log, trans, item, pass),
2243 TP_STRUCT__entry(
2244 __field(dev_t, dev)
2245 __field(unsigned long, item)
2246 __field(xlog_tid_t, tid)
2247 __field(xfs_lsn_t, lsn)
2248 __field(int, type)
2249 __field(int, pass)
2250 __field(int, count)
2251 __field(int, total)
2252 ),
2253 TP_fast_assign(
2254 __entry->dev = log->l_mp->m_super->s_dev;
2255 __entry->item = (unsigned long)item;
2256 __entry->tid = trans->r_log_tid;
2257 __entry->lsn = trans->r_lsn;
2258 __entry->type = ITEM_TYPE(item);
2259 __entry->pass = pass;
2260 __entry->count = item->ri_cnt;
2261 __entry->total = item->ri_total;
2262 ),
2263 TP_printk("dev %d:%d tid 0x%x lsn 0x%llx, pass %d, item %p, "
2264 "item type %s item region count/total %d/%d",
2265 MAJOR(__entry->dev), MINOR(__entry->dev),
2266 __entry->tid,
2267 __entry->lsn,
2268 __entry->pass,
2269 (void *)__entry->item,
2270 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2271 __entry->count,
2272 __entry->total)
2273)
2274
2275#define DEFINE_LOG_RECOVER_ITEM(name) \
2276DEFINE_EVENT(xfs_log_recover_item_class, name, \
2277 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2278 struct xlog_recover_item *item, int pass), \
2279 TP_ARGS(log, trans, item, pass))
2280
2281DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2282DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2283DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2284DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2285DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2286
2287DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2288 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2289 TP_ARGS(log, buf_f),
2290 TP_STRUCT__entry(
2291 __field(dev_t, dev)
2292 __field(int64_t, blkno)
2293 __field(unsigned short, len)
2294 __field(unsigned short, flags)
2295 __field(unsigned short, size)
2296 __field(unsigned int, map_size)
2297 ),
2298 TP_fast_assign(
2299 __entry->dev = log->l_mp->m_super->s_dev;
2300 __entry->blkno = buf_f->blf_blkno;
2301 __entry->len = buf_f->blf_len;
2302 __entry->flags = buf_f->blf_flags;
2303 __entry->size = buf_f->blf_size;
2304 __entry->map_size = buf_f->blf_map_size;
2305 ),
2306 TP_printk("dev %d:%d daddr 0x%llx, bbcount 0x%x, flags 0x%x, size %d, "
2307 "map_size %d",
2308 MAJOR(__entry->dev), MINOR(__entry->dev),
2309 __entry->blkno,
2310 __entry->len,
2311 __entry->flags,
2312 __entry->size,
2313 __entry->map_size)
2314)
2315
2316#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2317DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2318 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2319 TP_ARGS(log, buf_f))
2320
2321DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2322DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2323DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2324DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2325DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2326DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_skip);
2327DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2328DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2329DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2330
2331DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2332 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2333 TP_ARGS(log, in_f),
2334 TP_STRUCT__entry(
2335 __field(dev_t, dev)
2336 __field(xfs_ino_t, ino)
2337 __field(unsigned short, size)
2338 __field(int, fields)
2339 __field(unsigned short, asize)
2340 __field(unsigned short, dsize)
2341 __field(int64_t, blkno)
2342 __field(int, len)
2343 __field(int, boffset)
2344 ),
2345 TP_fast_assign(
2346 __entry->dev = log->l_mp->m_super->s_dev;
2347 __entry->ino = in_f->ilf_ino;
2348 __entry->size = in_f->ilf_size;
2349 __entry->fields = in_f->ilf_fields;
2350 __entry->asize = in_f->ilf_asize;
2351 __entry->dsize = in_f->ilf_dsize;
2352 __entry->blkno = in_f->ilf_blkno;
2353 __entry->len = in_f->ilf_len;
2354 __entry->boffset = in_f->ilf_boffset;
2355 ),
2356 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2357 "dsize %d, daddr 0x%llx, bbcount 0x%x, boffset %d",
2358 MAJOR(__entry->dev), MINOR(__entry->dev),
2359 __entry->ino,
2360 __entry->size,
2361 __entry->fields,
2362 __entry->asize,
2363 __entry->dsize,
2364 __entry->blkno,
2365 __entry->len,
2366 __entry->boffset)
2367)
2368#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2369DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2370 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2371 TP_ARGS(log, in_f))
2372
2373DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2374DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2375DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2376
2377DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2378 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2379 TP_ARGS(log, in_f),
2380 TP_STRUCT__entry(
2381 __field(dev_t, dev)
2382 __field(xfs_agnumber_t, agno)
2383 __field(xfs_agblock_t, agbno)
2384 __field(unsigned int, count)
2385 __field(unsigned int, isize)
2386 __field(xfs_agblock_t, length)
2387 __field(unsigned int, gen)
2388 ),
2389 TP_fast_assign(
2390 __entry->dev = log->l_mp->m_super->s_dev;
2391 __entry->agno = be32_to_cpu(in_f->icl_ag);
2392 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2393 __entry->count = be32_to_cpu(in_f->icl_count);
2394 __entry->isize = be32_to_cpu(in_f->icl_isize);
2395 __entry->length = be32_to_cpu(in_f->icl_length);
2396 __entry->gen = be32_to_cpu(in_f->icl_gen);
2397 ),
2398 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x ireccount %u isize %u gen 0x%x",
2399 MAJOR(__entry->dev), MINOR(__entry->dev),
2400 __entry->agno,
2401 __entry->agbno,
2402 __entry->length,
2403 __entry->count,
2404 __entry->isize,
2405 __entry->gen)
2406)
2407#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2408DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2409 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2410 TP_ARGS(log, in_f))
2411
2412DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2413DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2414
2415DECLARE_EVENT_CLASS(xfs_discard_class,
2416 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2417 xfs_agblock_t agbno, xfs_extlen_t len),
2418 TP_ARGS(mp, agno, agbno, len),
2419 TP_STRUCT__entry(
2420 __field(dev_t, dev)
2421 __field(xfs_agnumber_t, agno)
2422 __field(xfs_agblock_t, agbno)
2423 __field(xfs_extlen_t, len)
2424 ),
2425 TP_fast_assign(
2426 __entry->dev = mp->m_super->s_dev;
2427 __entry->agno = agno;
2428 __entry->agbno = agbno;
2429 __entry->len = len;
2430 ),
2431 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x",
2432 MAJOR(__entry->dev), MINOR(__entry->dev),
2433 __entry->agno,
2434 __entry->agbno,
2435 __entry->len)
2436)
2437
2438#define DEFINE_DISCARD_EVENT(name) \
2439DEFINE_EVENT(xfs_discard_class, name, \
2440 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2441 xfs_agblock_t agbno, xfs_extlen_t len), \
2442 TP_ARGS(mp, agno, agbno, len))
2443DEFINE_DISCARD_EVENT(xfs_discard_extent);
2444DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2445DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2446DEFINE_DISCARD_EVENT(xfs_discard_busy);
2447
2448/* btree cursor events */
2449TRACE_DEFINE_ENUM(XFS_BTNUM_BNOi);
2450TRACE_DEFINE_ENUM(XFS_BTNUM_CNTi);
2451TRACE_DEFINE_ENUM(XFS_BTNUM_BMAPi);
2452TRACE_DEFINE_ENUM(XFS_BTNUM_INOi);
2453TRACE_DEFINE_ENUM(XFS_BTNUM_FINOi);
2454TRACE_DEFINE_ENUM(XFS_BTNUM_RMAPi);
2455TRACE_DEFINE_ENUM(XFS_BTNUM_REFCi);
2456
2457DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2458 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2459 TP_ARGS(cur, level, bp),
2460 TP_STRUCT__entry(
2461 __field(dev_t, dev)
2462 __field(xfs_btnum_t, btnum)
2463 __field(int, level)
2464 __field(int, nlevels)
2465 __field(int, ptr)
2466 __field(xfs_daddr_t, daddr)
2467 ),
2468 TP_fast_assign(
2469 __entry->dev = cur->bc_mp->m_super->s_dev;
2470 __entry->btnum = cur->bc_btnum;
2471 __entry->level = level;
2472 __entry->nlevels = cur->bc_nlevels;
2473 __entry->ptr = cur->bc_levels[level].ptr;
2474 __entry->daddr = bp ? xfs_buf_daddr(bp) : -1;
2475 ),
2476 TP_printk("dev %d:%d btree %s level %d/%d ptr %d daddr 0x%llx",
2477 MAJOR(__entry->dev), MINOR(__entry->dev),
2478 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
2479 __entry->level,
2480 __entry->nlevels,
2481 __entry->ptr,
2482 (unsigned long long)__entry->daddr)
2483)
2484
2485#define DEFINE_BTREE_CUR_EVENT(name) \
2486DEFINE_EVENT(xfs_btree_cur_class, name, \
2487 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2488 TP_ARGS(cur, level, bp))
2489DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
2490DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2491
2492/* deferred ops */
2493struct xfs_defer_pending;
2494
2495DECLARE_EVENT_CLASS(xfs_defer_class,
2496 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
2497 TP_ARGS(tp, caller_ip),
2498 TP_STRUCT__entry(
2499 __field(dev_t, dev)
2500 __field(struct xfs_trans *, tp)
2501 __field(char, committed)
2502 __field(unsigned long, caller_ip)
2503 ),
2504 TP_fast_assign(
2505 __entry->dev = tp->t_mountp->m_super->s_dev;
2506 __entry->tp = tp;
2507 __entry->caller_ip = caller_ip;
2508 ),
2509 TP_printk("dev %d:%d tp %p caller %pS",
2510 MAJOR(__entry->dev), MINOR(__entry->dev),
2511 __entry->tp,
2512 (char *)__entry->caller_ip)
2513)
2514#define DEFINE_DEFER_EVENT(name) \
2515DEFINE_EVENT(xfs_defer_class, name, \
2516 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
2517 TP_ARGS(tp, caller_ip))
2518
2519DECLARE_EVENT_CLASS(xfs_defer_error_class,
2520 TP_PROTO(struct xfs_trans *tp, int error),
2521 TP_ARGS(tp, error),
2522 TP_STRUCT__entry(
2523 __field(dev_t, dev)
2524 __field(struct xfs_trans *, tp)
2525 __field(char, committed)
2526 __field(int, error)
2527 ),
2528 TP_fast_assign(
2529 __entry->dev = tp->t_mountp->m_super->s_dev;
2530 __entry->tp = tp;
2531 __entry->error = error;
2532 ),
2533 TP_printk("dev %d:%d tp %p err %d",
2534 MAJOR(__entry->dev), MINOR(__entry->dev),
2535 __entry->tp,
2536 __entry->error)
2537)
2538#define DEFINE_DEFER_ERROR_EVENT(name) \
2539DEFINE_EVENT(xfs_defer_error_class, name, \
2540 TP_PROTO(struct xfs_trans *tp, int error), \
2541 TP_ARGS(tp, error))
2542
2543DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2544 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2545 TP_ARGS(mp, dfp),
2546 TP_STRUCT__entry(
2547 __field(dev_t, dev)
2548 __field(int, type)
2549 __field(void *, intent)
2550 __field(char, committed)
2551 __field(int, nr)
2552 ),
2553 TP_fast_assign(
2554 __entry->dev = mp ? mp->m_super->s_dev : 0;
2555 __entry->type = dfp->dfp_type;
2556 __entry->intent = dfp->dfp_intent;
2557 __entry->committed = dfp->dfp_done != NULL;
2558 __entry->nr = dfp->dfp_count;
2559 ),
2560 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d",
2561 MAJOR(__entry->dev), MINOR(__entry->dev),
2562 __entry->type,
2563 __entry->intent,
2564 __entry->committed,
2565 __entry->nr)
2566)
2567#define DEFINE_DEFER_PENDING_EVENT(name) \
2568DEFINE_EVENT(xfs_defer_pending_class, name, \
2569 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2570 TP_ARGS(mp, dfp))
2571
2572DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2573 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2574 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2575 TP_ARGS(mp, agno, type, agbno, len),
2576 TP_STRUCT__entry(
2577 __field(dev_t, dev)
2578 __field(xfs_agnumber_t, agno)
2579 __field(int, type)
2580 __field(xfs_agblock_t, agbno)
2581 __field(xfs_extlen_t, len)
2582 ),
2583 TP_fast_assign(
2584 __entry->dev = mp->m_super->s_dev;
2585 __entry->agno = agno;
2586 __entry->type = type;
2587 __entry->agbno = agbno;
2588 __entry->len = len;
2589 ),
2590 TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x fsbcount 0x%x",
2591 MAJOR(__entry->dev), MINOR(__entry->dev),
2592 __entry->type,
2593 __entry->agno,
2594 __entry->agbno,
2595 __entry->len)
2596);
2597#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2598DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2599 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2600 int type, \
2601 xfs_agblock_t bno, \
2602 xfs_extlen_t len), \
2603 TP_ARGS(mp, agno, type, bno, len))
2604
2605DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2606 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2607 int op,
2608 xfs_agblock_t agbno,
2609 xfs_ino_t ino,
2610 int whichfork,
2611 xfs_fileoff_t offset,
2612 xfs_filblks_t len,
2613 xfs_exntst_t state),
2614 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2615 TP_STRUCT__entry(
2616 __field(dev_t, dev)
2617 __field(xfs_agnumber_t, agno)
2618 __field(xfs_ino_t, ino)
2619 __field(xfs_agblock_t, agbno)
2620 __field(int, whichfork)
2621 __field(xfs_fileoff_t, l_loff)
2622 __field(xfs_filblks_t, l_len)
2623 __field(xfs_exntst_t, l_state)
2624 __field(int, op)
2625 ),
2626 TP_fast_assign(
2627 __entry->dev = mp->m_super->s_dev;
2628 __entry->agno = agno;
2629 __entry->ino = ino;
2630 __entry->agbno = agbno;
2631 __entry->whichfork = whichfork;
2632 __entry->l_loff = offset;
2633 __entry->l_len = len;
2634 __entry->l_state = state;
2635 __entry->op = op;
2636 ),
2637 TP_printk("dev %d:%d op %d agno 0x%x agbno 0x%x owner 0x%llx %s fileoff 0x%llx fsbcount 0x%llx state %d",
2638 MAJOR(__entry->dev), MINOR(__entry->dev),
2639 __entry->op,
2640 __entry->agno,
2641 __entry->agbno,
2642 __entry->ino,
2643 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
2644 __entry->l_loff,
2645 __entry->l_len,
2646 __entry->l_state)
2647);
2648#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2649DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2650 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2651 int op, \
2652 xfs_agblock_t agbno, \
2653 xfs_ino_t ino, \
2654 int whichfork, \
2655 xfs_fileoff_t offset, \
2656 xfs_filblks_t len, \
2657 xfs_exntst_t state), \
2658 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2659
2660DEFINE_DEFER_EVENT(xfs_defer_cancel);
2661DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2662DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2663DEFINE_DEFER_EVENT(xfs_defer_finish);
2664DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2665
2666DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2667DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2668
2669DEFINE_DEFER_PENDING_EVENT(xfs_defer_create_intent);
2670DEFINE_DEFER_PENDING_EVENT(xfs_defer_cancel_list);
2671DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2672DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2673DEFINE_DEFER_PENDING_EVENT(xfs_defer_relog_intent);
2674
2675#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2676DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2677DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2678DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_defer);
2679DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_agfl_free_deferred);
2680
2681/* rmap tracepoints */
2682DECLARE_EVENT_CLASS(xfs_rmap_class,
2683 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2684 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2685 const struct xfs_owner_info *oinfo),
2686 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2687 TP_STRUCT__entry(
2688 __field(dev_t, dev)
2689 __field(xfs_agnumber_t, agno)
2690 __field(xfs_agblock_t, agbno)
2691 __field(xfs_extlen_t, len)
2692 __field(uint64_t, owner)
2693 __field(uint64_t, offset)
2694 __field(unsigned long, flags)
2695 ),
2696 TP_fast_assign(
2697 __entry->dev = mp->m_super->s_dev;
2698 __entry->agno = agno;
2699 __entry->agbno = agbno;
2700 __entry->len = len;
2701 __entry->owner = oinfo->oi_owner;
2702 __entry->offset = oinfo->oi_offset;
2703 __entry->flags = oinfo->oi_flags;
2704 if (unwritten)
2705 __entry->flags |= XFS_RMAP_UNWRITTEN;
2706 ),
2707 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%lx",
2708 MAJOR(__entry->dev), MINOR(__entry->dev),
2709 __entry->agno,
2710 __entry->agbno,
2711 __entry->len,
2712 __entry->owner,
2713 __entry->offset,
2714 __entry->flags)
2715);
2716#define DEFINE_RMAP_EVENT(name) \
2717DEFINE_EVENT(xfs_rmap_class, name, \
2718 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2719 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2720 const struct xfs_owner_info *oinfo), \
2721 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2722
2723/* simple AG-based error/%ip tracepoint class */
2724DECLARE_EVENT_CLASS(xfs_ag_error_class,
2725 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2726 unsigned long caller_ip),
2727 TP_ARGS(mp, agno, error, caller_ip),
2728 TP_STRUCT__entry(
2729 __field(dev_t, dev)
2730 __field(xfs_agnumber_t, agno)
2731 __field(int, error)
2732 __field(unsigned long, caller_ip)
2733 ),
2734 TP_fast_assign(
2735 __entry->dev = mp->m_super->s_dev;
2736 __entry->agno = agno;
2737 __entry->error = error;
2738 __entry->caller_ip = caller_ip;
2739 ),
2740 TP_printk("dev %d:%d agno 0x%x error %d caller %pS",
2741 MAJOR(__entry->dev), MINOR(__entry->dev),
2742 __entry->agno,
2743 __entry->error,
2744 (char *)__entry->caller_ip)
2745);
2746
2747#define DEFINE_AG_ERROR_EVENT(name) \
2748DEFINE_EVENT(xfs_ag_error_class, name, \
2749 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2750 unsigned long caller_ip), \
2751 TP_ARGS(mp, agno, error, caller_ip))
2752
2753DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2754DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2755DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2756DEFINE_RMAP_EVENT(xfs_rmap_map);
2757DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2758DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
2759DEFINE_RMAP_EVENT(xfs_rmap_convert);
2760DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2761DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2762DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
2763
2764DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2765 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2766 xfs_agblock_t agbno, xfs_extlen_t len,
2767 uint64_t owner, uint64_t offset, unsigned int flags),
2768 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2769 TP_STRUCT__entry(
2770 __field(dev_t, dev)
2771 __field(xfs_agnumber_t, agno)
2772 __field(xfs_agblock_t, agbno)
2773 __field(xfs_extlen_t, len)
2774 __field(uint64_t, owner)
2775 __field(uint64_t, offset)
2776 __field(unsigned int, flags)
2777 ),
2778 TP_fast_assign(
2779 __entry->dev = mp->m_super->s_dev;
2780 __entry->agno = agno;
2781 __entry->agbno = agbno;
2782 __entry->len = len;
2783 __entry->owner = owner;
2784 __entry->offset = offset;
2785 __entry->flags = flags;
2786 ),
2787 TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x owner 0x%llx fileoff 0x%llx flags 0x%x",
2788 MAJOR(__entry->dev), MINOR(__entry->dev),
2789 __entry->agno,
2790 __entry->agbno,
2791 __entry->len,
2792 __entry->owner,
2793 __entry->offset,
2794 __entry->flags)
2795);
2796#define DEFINE_RMAPBT_EVENT(name) \
2797DEFINE_EVENT(xfs_rmapbt_class, name, \
2798 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2799 xfs_agblock_t agbno, xfs_extlen_t len, \
2800 uint64_t owner, uint64_t offset, unsigned int flags), \
2801 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2802
2803#define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2804DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2805DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2806
2807DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2808DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
2809DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2810DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2811DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2812DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2813DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2814DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
2815
2816DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_candidate);
2817DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_query);
2818DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_candidate);
2819DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range);
2820DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2821DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
2822DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
2823
2824/* deferred bmbt updates */
2825#define DEFINE_BMAP_DEFERRED_EVENT DEFINE_RMAP_DEFERRED_EVENT
2826DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_defer);
2827DEFINE_BMAP_DEFERRED_EVENT(xfs_bmap_deferred);
2828
2829/* per-AG reservation */
2830DECLARE_EVENT_CLASS(xfs_ag_resv_class,
2831 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type resv,
2832 xfs_extlen_t len),
2833 TP_ARGS(pag, resv, len),
2834 TP_STRUCT__entry(
2835 __field(dev_t, dev)
2836 __field(xfs_agnumber_t, agno)
2837 __field(int, resv)
2838 __field(xfs_extlen_t, freeblks)
2839 __field(xfs_extlen_t, flcount)
2840 __field(xfs_extlen_t, reserved)
2841 __field(xfs_extlen_t, asked)
2842 __field(xfs_extlen_t, len)
2843 ),
2844 TP_fast_assign(
2845 struct xfs_ag_resv *r = xfs_perag_resv(pag, resv);
2846
2847 __entry->dev = pag->pag_mount->m_super->s_dev;
2848 __entry->agno = pag->pag_agno;
2849 __entry->resv = resv;
2850 __entry->freeblks = pag->pagf_freeblks;
2851 __entry->flcount = pag->pagf_flcount;
2852 __entry->reserved = r ? r->ar_reserved : 0;
2853 __entry->asked = r ? r->ar_asked : 0;
2854 __entry->len = len;
2855 ),
2856 TP_printk("dev %d:%d agno 0x%x resv %d freeblks %u flcount %u "
2857 "resv %u ask %u len %u",
2858 MAJOR(__entry->dev), MINOR(__entry->dev),
2859 __entry->agno,
2860 __entry->resv,
2861 __entry->freeblks,
2862 __entry->flcount,
2863 __entry->reserved,
2864 __entry->asked,
2865 __entry->len)
2866)
2867#define DEFINE_AG_RESV_EVENT(name) \
2868DEFINE_EVENT(xfs_ag_resv_class, name, \
2869 TP_PROTO(struct xfs_perag *pag, enum xfs_ag_resv_type type, \
2870 xfs_extlen_t len), \
2871 TP_ARGS(pag, type, len))
2872
2873/* per-AG reservation tracepoints */
2874DEFINE_AG_RESV_EVENT(xfs_ag_resv_init);
2875DEFINE_AG_RESV_EVENT(xfs_ag_resv_free);
2876DEFINE_AG_RESV_EVENT(xfs_ag_resv_alloc_extent);
2877DEFINE_AG_RESV_EVENT(xfs_ag_resv_free_extent);
2878DEFINE_AG_RESV_EVENT(xfs_ag_resv_critical);
2879DEFINE_AG_RESV_EVENT(xfs_ag_resv_needed);
2880
2881DEFINE_AG_ERROR_EVENT(xfs_ag_resv_free_error);
2882DEFINE_AG_ERROR_EVENT(xfs_ag_resv_init_error);
2883
2884/* refcount tracepoint classes */
2885
2886/* reuse the discard trace class for agbno/aglen-based traces */
2887#define DEFINE_AG_EXTENT_EVENT(name) DEFINE_DISCARD_EVENT(name)
2888
2889/* ag btree lookup tracepoint class */
2890TRACE_DEFINE_ENUM(XFS_LOOKUP_EQi);
2891TRACE_DEFINE_ENUM(XFS_LOOKUP_LEi);
2892TRACE_DEFINE_ENUM(XFS_LOOKUP_GEi);
2893DECLARE_EVENT_CLASS(xfs_ag_btree_lookup_class,
2894 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2895 xfs_agblock_t agbno, xfs_lookup_t dir),
2896 TP_ARGS(mp, agno, agbno, dir),
2897 TP_STRUCT__entry(
2898 __field(dev_t, dev)
2899 __field(xfs_agnumber_t, agno)
2900 __field(xfs_agblock_t, agbno)
2901 __field(xfs_lookup_t, dir)
2902 ),
2903 TP_fast_assign(
2904 __entry->dev = mp->m_super->s_dev;
2905 __entry->agno = agno;
2906 __entry->agbno = agbno;
2907 __entry->dir = dir;
2908 ),
2909 TP_printk("dev %d:%d agno 0x%x agbno 0x%x cmp %s(%d)",
2910 MAJOR(__entry->dev), MINOR(__entry->dev),
2911 __entry->agno,
2912 __entry->agbno,
2913 __print_symbolic(__entry->dir, XFS_AG_BTREE_CMP_FORMAT_STR),
2914 __entry->dir)
2915)
2916
2917#define DEFINE_AG_BTREE_LOOKUP_EVENT(name) \
2918DEFINE_EVENT(xfs_ag_btree_lookup_class, name, \
2919 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2920 xfs_agblock_t agbno, xfs_lookup_t dir), \
2921 TP_ARGS(mp, agno, agbno, dir))
2922
2923/* single-rcext tracepoint class */
2924DECLARE_EVENT_CLASS(xfs_refcount_extent_class,
2925 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2926 struct xfs_refcount_irec *irec),
2927 TP_ARGS(mp, agno, irec),
2928 TP_STRUCT__entry(
2929 __field(dev_t, dev)
2930 __field(xfs_agnumber_t, agno)
2931 __field(enum xfs_refc_domain, domain)
2932 __field(xfs_agblock_t, startblock)
2933 __field(xfs_extlen_t, blockcount)
2934 __field(xfs_nlink_t, refcount)
2935 ),
2936 TP_fast_assign(
2937 __entry->dev = mp->m_super->s_dev;
2938 __entry->agno = agno;
2939 __entry->domain = irec->rc_domain;
2940 __entry->startblock = irec->rc_startblock;
2941 __entry->blockcount = irec->rc_blockcount;
2942 __entry->refcount = irec->rc_refcount;
2943 ),
2944 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u",
2945 MAJOR(__entry->dev), MINOR(__entry->dev),
2946 __entry->agno,
2947 __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
2948 __entry->startblock,
2949 __entry->blockcount,
2950 __entry->refcount)
2951)
2952
2953#define DEFINE_REFCOUNT_EXTENT_EVENT(name) \
2954DEFINE_EVENT(xfs_refcount_extent_class, name, \
2955 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2956 struct xfs_refcount_irec *irec), \
2957 TP_ARGS(mp, agno, irec))
2958
2959/* single-rcext and an agbno tracepoint class */
2960DECLARE_EVENT_CLASS(xfs_refcount_extent_at_class,
2961 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2962 struct xfs_refcount_irec *irec, xfs_agblock_t agbno),
2963 TP_ARGS(mp, agno, irec, agbno),
2964 TP_STRUCT__entry(
2965 __field(dev_t, dev)
2966 __field(xfs_agnumber_t, agno)
2967 __field(enum xfs_refc_domain, domain)
2968 __field(xfs_agblock_t, startblock)
2969 __field(xfs_extlen_t, blockcount)
2970 __field(xfs_nlink_t, refcount)
2971 __field(xfs_agblock_t, agbno)
2972 ),
2973 TP_fast_assign(
2974 __entry->dev = mp->m_super->s_dev;
2975 __entry->agno = agno;
2976 __entry->domain = irec->rc_domain;
2977 __entry->startblock = irec->rc_startblock;
2978 __entry->blockcount = irec->rc_blockcount;
2979 __entry->refcount = irec->rc_refcount;
2980 __entry->agbno = agbno;
2981 ),
2982 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
2983 MAJOR(__entry->dev), MINOR(__entry->dev),
2984 __entry->agno,
2985 __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS),
2986 __entry->startblock,
2987 __entry->blockcount,
2988 __entry->refcount,
2989 __entry->agbno)
2990)
2991
2992#define DEFINE_REFCOUNT_EXTENT_AT_EVENT(name) \
2993DEFINE_EVENT(xfs_refcount_extent_at_class, name, \
2994 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2995 struct xfs_refcount_irec *irec, xfs_agblock_t agbno), \
2996 TP_ARGS(mp, agno, irec, agbno))
2997
2998/* double-rcext tracepoint class */
2999DECLARE_EVENT_CLASS(xfs_refcount_double_extent_class,
3000 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3001 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2),
3002 TP_ARGS(mp, agno, i1, i2),
3003 TP_STRUCT__entry(
3004 __field(dev_t, dev)
3005 __field(xfs_agnumber_t, agno)
3006 __field(enum xfs_refc_domain, i1_domain)
3007 __field(xfs_agblock_t, i1_startblock)
3008 __field(xfs_extlen_t, i1_blockcount)
3009 __field(xfs_nlink_t, i1_refcount)
3010 __field(enum xfs_refc_domain, i2_domain)
3011 __field(xfs_agblock_t, i2_startblock)
3012 __field(xfs_extlen_t, i2_blockcount)
3013 __field(xfs_nlink_t, i2_refcount)
3014 ),
3015 TP_fast_assign(
3016 __entry->dev = mp->m_super->s_dev;
3017 __entry->agno = agno;
3018 __entry->i1_domain = i1->rc_domain;
3019 __entry->i1_startblock = i1->rc_startblock;
3020 __entry->i1_blockcount = i1->rc_blockcount;
3021 __entry->i1_refcount = i1->rc_refcount;
3022 __entry->i2_domain = i2->rc_domain;
3023 __entry->i2_startblock = i2->rc_startblock;
3024 __entry->i2_blockcount = i2->rc_blockcount;
3025 __entry->i2_refcount = i2->rc_refcount;
3026 ),
3027 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3028 "dom %s agbno 0x%x fsbcount 0x%x refcount %u",
3029 MAJOR(__entry->dev), MINOR(__entry->dev),
3030 __entry->agno,
3031 __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
3032 __entry->i1_startblock,
3033 __entry->i1_blockcount,
3034 __entry->i1_refcount,
3035 __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
3036 __entry->i2_startblock,
3037 __entry->i2_blockcount,
3038 __entry->i2_refcount)
3039)
3040
3041#define DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(name) \
3042DEFINE_EVENT(xfs_refcount_double_extent_class, name, \
3043 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3044 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2), \
3045 TP_ARGS(mp, agno, i1, i2))
3046
3047/* double-rcext and an agbno tracepoint class */
3048DECLARE_EVENT_CLASS(xfs_refcount_double_extent_at_class,
3049 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3050 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3051 xfs_agblock_t agbno),
3052 TP_ARGS(mp, agno, i1, i2, agbno),
3053 TP_STRUCT__entry(
3054 __field(dev_t, dev)
3055 __field(xfs_agnumber_t, agno)
3056 __field(enum xfs_refc_domain, i1_domain)
3057 __field(xfs_agblock_t, i1_startblock)
3058 __field(xfs_extlen_t, i1_blockcount)
3059 __field(xfs_nlink_t, i1_refcount)
3060 __field(enum xfs_refc_domain, i2_domain)
3061 __field(xfs_agblock_t, i2_startblock)
3062 __field(xfs_extlen_t, i2_blockcount)
3063 __field(xfs_nlink_t, i2_refcount)
3064 __field(xfs_agblock_t, agbno)
3065 ),
3066 TP_fast_assign(
3067 __entry->dev = mp->m_super->s_dev;
3068 __entry->agno = agno;
3069 __entry->i1_domain = i1->rc_domain;
3070 __entry->i1_startblock = i1->rc_startblock;
3071 __entry->i1_blockcount = i1->rc_blockcount;
3072 __entry->i1_refcount = i1->rc_refcount;
3073 __entry->i2_domain = i2->rc_domain;
3074 __entry->i2_startblock = i2->rc_startblock;
3075 __entry->i2_blockcount = i2->rc_blockcount;
3076 __entry->i2_refcount = i2->rc_refcount;
3077 __entry->agbno = agbno;
3078 ),
3079 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3080 "dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x",
3081 MAJOR(__entry->dev), MINOR(__entry->dev),
3082 __entry->agno,
3083 __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
3084 __entry->i1_startblock,
3085 __entry->i1_blockcount,
3086 __entry->i1_refcount,
3087 __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
3088 __entry->i2_startblock,
3089 __entry->i2_blockcount,
3090 __entry->i2_refcount,
3091 __entry->agbno)
3092)
3093
3094#define DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(name) \
3095DEFINE_EVENT(xfs_refcount_double_extent_at_class, name, \
3096 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3097 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3098 xfs_agblock_t agbno), \
3099 TP_ARGS(mp, agno, i1, i2, agbno))
3100
3101/* triple-rcext tracepoint class */
3102DECLARE_EVENT_CLASS(xfs_refcount_triple_extent_class,
3103 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3104 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2,
3105 struct xfs_refcount_irec *i3),
3106 TP_ARGS(mp, agno, i1, i2, i3),
3107 TP_STRUCT__entry(
3108 __field(dev_t, dev)
3109 __field(xfs_agnumber_t, agno)
3110 __field(enum xfs_refc_domain, i1_domain)
3111 __field(xfs_agblock_t, i1_startblock)
3112 __field(xfs_extlen_t, i1_blockcount)
3113 __field(xfs_nlink_t, i1_refcount)
3114 __field(enum xfs_refc_domain, i2_domain)
3115 __field(xfs_agblock_t, i2_startblock)
3116 __field(xfs_extlen_t, i2_blockcount)
3117 __field(xfs_nlink_t, i2_refcount)
3118 __field(enum xfs_refc_domain, i3_domain)
3119 __field(xfs_agblock_t, i3_startblock)
3120 __field(xfs_extlen_t, i3_blockcount)
3121 __field(xfs_nlink_t, i3_refcount)
3122 ),
3123 TP_fast_assign(
3124 __entry->dev = mp->m_super->s_dev;
3125 __entry->agno = agno;
3126 __entry->i1_domain = i1->rc_domain;
3127 __entry->i1_startblock = i1->rc_startblock;
3128 __entry->i1_blockcount = i1->rc_blockcount;
3129 __entry->i1_refcount = i1->rc_refcount;
3130 __entry->i2_domain = i2->rc_domain;
3131 __entry->i2_startblock = i2->rc_startblock;
3132 __entry->i2_blockcount = i2->rc_blockcount;
3133 __entry->i2_refcount = i2->rc_refcount;
3134 __entry->i3_domain = i3->rc_domain;
3135 __entry->i3_startblock = i3->rc_startblock;
3136 __entry->i3_blockcount = i3->rc_blockcount;
3137 __entry->i3_refcount = i3->rc_refcount;
3138 ),
3139 TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3140 "dom %s agbno 0x%x fsbcount 0x%x refcount %u -- "
3141 "dom %s agbno 0x%x fsbcount 0x%x refcount %u",
3142 MAJOR(__entry->dev), MINOR(__entry->dev),
3143 __entry->agno,
3144 __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS),
3145 __entry->i1_startblock,
3146 __entry->i1_blockcount,
3147 __entry->i1_refcount,
3148 __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS),
3149 __entry->i2_startblock,
3150 __entry->i2_blockcount,
3151 __entry->i2_refcount,
3152 __print_symbolic(__entry->i3_domain, XFS_REFC_DOMAIN_STRINGS),
3153 __entry->i3_startblock,
3154 __entry->i3_blockcount,
3155 __entry->i3_refcount)
3156);
3157
3158#define DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(name) \
3159DEFINE_EVENT(xfs_refcount_triple_extent_class, name, \
3160 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3161 struct xfs_refcount_irec *i1, struct xfs_refcount_irec *i2, \
3162 struct xfs_refcount_irec *i3), \
3163 TP_ARGS(mp, agno, i1, i2, i3))
3164
3165/* refcount btree tracepoints */
3166DEFINE_BUSY_EVENT(xfs_refcountbt_alloc_block);
3167DEFINE_BUSY_EVENT(xfs_refcountbt_free_block);
3168DEFINE_AG_BTREE_LOOKUP_EVENT(xfs_refcount_lookup);
3169DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_get);
3170DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_update);
3171DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_insert);
3172DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_delete);
3173DEFINE_AG_ERROR_EVENT(xfs_refcount_insert_error);
3174DEFINE_AG_ERROR_EVENT(xfs_refcount_delete_error);
3175DEFINE_AG_ERROR_EVENT(xfs_refcount_update_error);
3176
3177/* refcount adjustment tracepoints */
3178DEFINE_AG_EXTENT_EVENT(xfs_refcount_increase);
3179DEFINE_AG_EXTENT_EVENT(xfs_refcount_decrease);
3180DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_increase);
3181DEFINE_AG_EXTENT_EVENT(xfs_refcount_cow_decrease);
3182DEFINE_REFCOUNT_TRIPLE_EXTENT_EVENT(xfs_refcount_merge_center_extents);
3183DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_modify_extent);
3184DEFINE_REFCOUNT_EXTENT_EVENT(xfs_refcount_recover_extent);
3185DEFINE_REFCOUNT_EXTENT_AT_EVENT(xfs_refcount_split_extent);
3186DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_left_extent);
3187DEFINE_REFCOUNT_DOUBLE_EXTENT_EVENT(xfs_refcount_merge_right_extent);
3188DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_left_extent);
3189DEFINE_REFCOUNT_DOUBLE_EXTENT_AT_EVENT(xfs_refcount_find_right_extent);
3190DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_error);
3191DEFINE_AG_ERROR_EVENT(xfs_refcount_adjust_cow_error);
3192DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_center_extents_error);
3193DEFINE_AG_ERROR_EVENT(xfs_refcount_modify_extent_error);
3194DEFINE_AG_ERROR_EVENT(xfs_refcount_split_extent_error);
3195DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_left_extent_error);
3196DEFINE_AG_ERROR_EVENT(xfs_refcount_merge_right_extent_error);
3197DEFINE_AG_ERROR_EVENT(xfs_refcount_find_left_extent_error);
3198DEFINE_AG_ERROR_EVENT(xfs_refcount_find_right_extent_error);
3199
3200/* reflink helpers */
3201DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared);
3202DEFINE_AG_EXTENT_EVENT(xfs_refcount_find_shared_result);
3203DEFINE_AG_ERROR_EVENT(xfs_refcount_find_shared_error);
3204#define DEFINE_REFCOUNT_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
3205DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_defer);
3206DEFINE_REFCOUNT_DEFERRED_EVENT(xfs_refcount_deferred);
3207
3208TRACE_EVENT(xfs_refcount_finish_one_leftover,
3209 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3210 int type, xfs_agblock_t agbno, xfs_extlen_t len,
3211 xfs_agblock_t new_agbno, xfs_extlen_t new_len),
3212 TP_ARGS(mp, agno, type, agbno, len, new_agbno, new_len),
3213 TP_STRUCT__entry(
3214 __field(dev_t, dev)
3215 __field(xfs_agnumber_t, agno)
3216 __field(int, type)
3217 __field(xfs_agblock_t, agbno)
3218 __field(xfs_extlen_t, len)
3219 __field(xfs_agblock_t, new_agbno)
3220 __field(xfs_extlen_t, new_len)
3221 ),
3222 TP_fast_assign(
3223 __entry->dev = mp->m_super->s_dev;
3224 __entry->agno = agno;
3225 __entry->type = type;
3226 __entry->agbno = agbno;
3227 __entry->len = len;
3228 __entry->new_agbno = new_agbno;
3229 __entry->new_len = new_len;
3230 ),
3231 TP_printk("dev %d:%d type %d agno 0x%x agbno 0x%x fsbcount 0x%x new_agbno 0x%x new_fsbcount 0x%x",
3232 MAJOR(__entry->dev), MINOR(__entry->dev),
3233 __entry->type,
3234 __entry->agno,
3235 __entry->agbno,
3236 __entry->len,
3237 __entry->new_agbno,
3238 __entry->new_len)
3239);
3240
3241/* simple inode-based error/%ip tracepoint class */
3242DECLARE_EVENT_CLASS(xfs_inode_error_class,
3243 TP_PROTO(struct xfs_inode *ip, int error, unsigned long caller_ip),
3244 TP_ARGS(ip, error, caller_ip),
3245 TP_STRUCT__entry(
3246 __field(dev_t, dev)
3247 __field(xfs_ino_t, ino)
3248 __field(int, error)
3249 __field(unsigned long, caller_ip)
3250 ),
3251 TP_fast_assign(
3252 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3253 __entry->ino = ip->i_ino;
3254 __entry->error = error;
3255 __entry->caller_ip = caller_ip;
3256 ),
3257 TP_printk("dev %d:%d ino 0x%llx error %d caller %pS",
3258 MAJOR(__entry->dev), MINOR(__entry->dev),
3259 __entry->ino,
3260 __entry->error,
3261 (char *)__entry->caller_ip)
3262);
3263
3264#define DEFINE_INODE_ERROR_EVENT(name) \
3265DEFINE_EVENT(xfs_inode_error_class, name, \
3266 TP_PROTO(struct xfs_inode *ip, int error, \
3267 unsigned long caller_ip), \
3268 TP_ARGS(ip, error, caller_ip))
3269
3270/* reflink tracepoint classes */
3271
3272/* two-file io tracepoint class */
3273DECLARE_EVENT_CLASS(xfs_double_io_class,
3274 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len,
3275 struct xfs_inode *dest, xfs_off_t doffset),
3276 TP_ARGS(src, soffset, len, dest, doffset),
3277 TP_STRUCT__entry(
3278 __field(dev_t, dev)
3279 __field(xfs_ino_t, src_ino)
3280 __field(loff_t, src_isize)
3281 __field(loff_t, src_disize)
3282 __field(loff_t, src_offset)
3283 __field(long long, len)
3284 __field(xfs_ino_t, dest_ino)
3285 __field(loff_t, dest_isize)
3286 __field(loff_t, dest_disize)
3287 __field(loff_t, dest_offset)
3288 ),
3289 TP_fast_assign(
3290 __entry->dev = VFS_I(src)->i_sb->s_dev;
3291 __entry->src_ino = src->i_ino;
3292 __entry->src_isize = VFS_I(src)->i_size;
3293 __entry->src_disize = src->i_disk_size;
3294 __entry->src_offset = soffset;
3295 __entry->len = len;
3296 __entry->dest_ino = dest->i_ino;
3297 __entry->dest_isize = VFS_I(dest)->i_size;
3298 __entry->dest_disize = dest->i_disk_size;
3299 __entry->dest_offset = doffset;
3300 ),
3301 TP_printk("dev %d:%d bytecount 0x%llx "
3302 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx -> "
3303 "ino 0x%llx isize 0x%llx disize 0x%llx pos 0x%llx",
3304 MAJOR(__entry->dev), MINOR(__entry->dev),
3305 __entry->len,
3306 __entry->src_ino,
3307 __entry->src_isize,
3308 __entry->src_disize,
3309 __entry->src_offset,
3310 __entry->dest_ino,
3311 __entry->dest_isize,
3312 __entry->dest_disize,
3313 __entry->dest_offset)
3314)
3315
3316#define DEFINE_DOUBLE_IO_EVENT(name) \
3317DEFINE_EVENT(xfs_double_io_class, name, \
3318 TP_PROTO(struct xfs_inode *src, xfs_off_t soffset, xfs_off_t len, \
3319 struct xfs_inode *dest, xfs_off_t doffset), \
3320 TP_ARGS(src, soffset, len, dest, doffset))
3321
3322/* inode/irec events */
3323DECLARE_EVENT_CLASS(xfs_inode_irec_class,
3324 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec),
3325 TP_ARGS(ip, irec),
3326 TP_STRUCT__entry(
3327 __field(dev_t, dev)
3328 __field(xfs_ino_t, ino)
3329 __field(xfs_fileoff_t, lblk)
3330 __field(xfs_extlen_t, len)
3331 __field(xfs_fsblock_t, pblk)
3332 __field(int, state)
3333 ),
3334 TP_fast_assign(
3335 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3336 __entry->ino = ip->i_ino;
3337 __entry->lblk = irec->br_startoff;
3338 __entry->len = irec->br_blockcount;
3339 __entry->pblk = irec->br_startblock;
3340 __entry->state = irec->br_state;
3341 ),
3342 TP_printk("dev %d:%d ino 0x%llx fileoff 0x%llx fsbcount 0x%x startblock 0x%llx st %d",
3343 MAJOR(__entry->dev), MINOR(__entry->dev),
3344 __entry->ino,
3345 __entry->lblk,
3346 __entry->len,
3347 __entry->pblk,
3348 __entry->state)
3349);
3350#define DEFINE_INODE_IREC_EVENT(name) \
3351DEFINE_EVENT(xfs_inode_irec_class, name, \
3352 TP_PROTO(struct xfs_inode *ip, struct xfs_bmbt_irec *irec), \
3353 TP_ARGS(ip, irec))
3354
3355/* inode iomap invalidation events */
3356DECLARE_EVENT_CLASS(xfs_wb_invalid_class,
3357 TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap, unsigned int wpcseq, int whichfork),
3358 TP_ARGS(ip, iomap, wpcseq, whichfork),
3359 TP_STRUCT__entry(
3360 __field(dev_t, dev)
3361 __field(xfs_ino_t, ino)
3362 __field(u64, addr)
3363 __field(loff_t, pos)
3364 __field(u64, len)
3365 __field(u16, type)
3366 __field(u16, flags)
3367 __field(u32, wpcseq)
3368 __field(u32, forkseq)
3369 ),
3370 TP_fast_assign(
3371 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3372 __entry->ino = ip->i_ino;
3373 __entry->addr = iomap->addr;
3374 __entry->pos = iomap->offset;
3375 __entry->len = iomap->length;
3376 __entry->type = iomap->type;
3377 __entry->flags = iomap->flags;
3378 __entry->wpcseq = wpcseq;
3379 __entry->forkseq = READ_ONCE(xfs_ifork_ptr(ip, whichfork)->if_seq);
3380 ),
3381 TP_printk("dev %d:%d ino 0x%llx pos 0x%llx addr 0x%llx bytecount 0x%llx type 0x%x flags 0x%x wpcseq 0x%x forkseq 0x%x",
3382 MAJOR(__entry->dev), MINOR(__entry->dev),
3383 __entry->ino,
3384 __entry->pos,
3385 __entry->addr,
3386 __entry->len,
3387 __entry->type,
3388 __entry->flags,
3389 __entry->wpcseq,
3390 __entry->forkseq)
3391);
3392#define DEFINE_WB_INVALID_EVENT(name) \
3393DEFINE_EVENT(xfs_wb_invalid_class, name, \
3394 TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap, unsigned int wpcseq, int whichfork), \
3395 TP_ARGS(ip, iomap, wpcseq, whichfork))
3396DEFINE_WB_INVALID_EVENT(xfs_wb_cow_iomap_invalid);
3397DEFINE_WB_INVALID_EVENT(xfs_wb_data_iomap_invalid);
3398
3399DECLARE_EVENT_CLASS(xfs_iomap_invalid_class,
3400 TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap),
3401 TP_ARGS(ip, iomap),
3402 TP_STRUCT__entry(
3403 __field(dev_t, dev)
3404 __field(xfs_ino_t, ino)
3405 __field(u64, addr)
3406 __field(loff_t, pos)
3407 __field(u64, len)
3408 __field(u64, validity_cookie)
3409 __field(u64, inodeseq)
3410 __field(u16, type)
3411 __field(u16, flags)
3412 ),
3413 TP_fast_assign(
3414 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3415 __entry->ino = ip->i_ino;
3416 __entry->addr = iomap->addr;
3417 __entry->pos = iomap->offset;
3418 __entry->len = iomap->length;
3419 __entry->validity_cookie = iomap->validity_cookie;
3420 __entry->type = iomap->type;
3421 __entry->flags = iomap->flags;
3422 __entry->inodeseq = xfs_iomap_inode_sequence(ip, iomap->flags);
3423 ),
3424 TP_printk("dev %d:%d ino 0x%llx pos 0x%llx addr 0x%llx bytecount 0x%llx type 0x%x flags 0x%x validity_cookie 0x%llx inodeseq 0x%llx",
3425 MAJOR(__entry->dev), MINOR(__entry->dev),
3426 __entry->ino,
3427 __entry->pos,
3428 __entry->addr,
3429 __entry->len,
3430 __entry->type,
3431 __entry->flags,
3432 __entry->validity_cookie,
3433 __entry->inodeseq)
3434);
3435#define DEFINE_IOMAP_INVALID_EVENT(name) \
3436DEFINE_EVENT(xfs_iomap_invalid_class, name, \
3437 TP_PROTO(struct xfs_inode *ip, const struct iomap *iomap), \
3438 TP_ARGS(ip, iomap))
3439DEFINE_IOMAP_INVALID_EVENT(xfs_iomap_invalid);
3440
3441/* refcount/reflink tracepoint definitions */
3442
3443/* reflink tracepoints */
3444DEFINE_INODE_EVENT(xfs_reflink_set_inode_flag);
3445DEFINE_INODE_EVENT(xfs_reflink_unset_inode_flag);
3446DEFINE_ITRUNC_EVENT(xfs_reflink_update_inode_size);
3447TRACE_EVENT(xfs_reflink_remap_blocks,
3448 TP_PROTO(struct xfs_inode *src, xfs_fileoff_t soffset,
3449 xfs_filblks_t len, struct xfs_inode *dest,
3450 xfs_fileoff_t doffset),
3451 TP_ARGS(src, soffset, len, dest, doffset),
3452 TP_STRUCT__entry(
3453 __field(dev_t, dev)
3454 __field(xfs_ino_t, src_ino)
3455 __field(xfs_fileoff_t, src_lblk)
3456 __field(xfs_filblks_t, len)
3457 __field(xfs_ino_t, dest_ino)
3458 __field(xfs_fileoff_t, dest_lblk)
3459 ),
3460 TP_fast_assign(
3461 __entry->dev = VFS_I(src)->i_sb->s_dev;
3462 __entry->src_ino = src->i_ino;
3463 __entry->src_lblk = soffset;
3464 __entry->len = len;
3465 __entry->dest_ino = dest->i_ino;
3466 __entry->dest_lblk = doffset;
3467 ),
3468 TP_printk("dev %d:%d fsbcount 0x%llx "
3469 "ino 0x%llx fileoff 0x%llx -> ino 0x%llx fileoff 0x%llx",
3470 MAJOR(__entry->dev), MINOR(__entry->dev),
3471 __entry->len,
3472 __entry->src_ino,
3473 __entry->src_lblk,
3474 __entry->dest_ino,
3475 __entry->dest_lblk)
3476);
3477DEFINE_DOUBLE_IO_EVENT(xfs_reflink_remap_range);
3478DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_range_error);
3479DEFINE_INODE_ERROR_EVENT(xfs_reflink_set_inode_flag_error);
3480DEFINE_INODE_ERROR_EVENT(xfs_reflink_update_inode_size_error);
3481DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_blocks_error);
3482DEFINE_INODE_ERROR_EVENT(xfs_reflink_remap_extent_error);
3483DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_src);
3484DEFINE_INODE_IREC_EVENT(xfs_reflink_remap_extent_dest);
3485
3486/* dedupe tracepoints */
3487DEFINE_DOUBLE_IO_EVENT(xfs_reflink_compare_extents);
3488DEFINE_INODE_ERROR_EVENT(xfs_reflink_compare_extents_error);
3489
3490/* ioctl tracepoints */
3491TRACE_EVENT(xfs_ioctl_clone,
3492 TP_PROTO(struct inode *src, struct inode *dest),
3493 TP_ARGS(src, dest),
3494 TP_STRUCT__entry(
3495 __field(dev_t, dev)
3496 __field(unsigned long, src_ino)
3497 __field(loff_t, src_isize)
3498 __field(unsigned long, dest_ino)
3499 __field(loff_t, dest_isize)
3500 ),
3501 TP_fast_assign(
3502 __entry->dev = src->i_sb->s_dev;
3503 __entry->src_ino = src->i_ino;
3504 __entry->src_isize = i_size_read(src);
3505 __entry->dest_ino = dest->i_ino;
3506 __entry->dest_isize = i_size_read(dest);
3507 ),
3508 TP_printk("dev %d:%d ino 0x%lx isize 0x%llx -> ino 0x%lx isize 0x%llx",
3509 MAJOR(__entry->dev), MINOR(__entry->dev),
3510 __entry->src_ino,
3511 __entry->src_isize,
3512 __entry->dest_ino,
3513 __entry->dest_isize)
3514);
3515
3516/* unshare tracepoints */
3517DEFINE_SIMPLE_IO_EVENT(xfs_reflink_unshare);
3518DEFINE_INODE_ERROR_EVENT(xfs_reflink_unshare_error);
3519
3520/* copy on write */
3521DEFINE_INODE_IREC_EVENT(xfs_reflink_trim_around_shared);
3522DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_found);
3523DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_enospc);
3524DEFINE_INODE_IREC_EVENT(xfs_reflink_convert_cow);
3525
3526DEFINE_SIMPLE_IO_EVENT(xfs_reflink_cancel_cow_range);
3527DEFINE_SIMPLE_IO_EVENT(xfs_reflink_end_cow);
3528DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_from);
3529DEFINE_INODE_IREC_EVENT(xfs_reflink_cow_remap_to);
3530
3531DEFINE_INODE_ERROR_EVENT(xfs_reflink_cancel_cow_range_error);
3532DEFINE_INODE_ERROR_EVENT(xfs_reflink_end_cow_error);
3533
3534
3535DEFINE_INODE_IREC_EVENT(xfs_reflink_cancel_cow);
3536
3537/* rmap swapext tracepoints */
3538DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap);
3539DEFINE_INODE_IREC_EVENT(xfs_swap_extent_rmap_remap_piece);
3540DEFINE_INODE_ERROR_EVENT(xfs_swap_extent_rmap_error);
3541
3542/* fsmap traces */
3543DECLARE_EVENT_CLASS(xfs_fsmap_class,
3544 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno,
3545 const struct xfs_rmap_irec *rmap),
3546 TP_ARGS(mp, keydev, agno, rmap),
3547 TP_STRUCT__entry(
3548 __field(dev_t, dev)
3549 __field(dev_t, keydev)
3550 __field(xfs_agnumber_t, agno)
3551 __field(xfs_fsblock_t, bno)
3552 __field(xfs_filblks_t, len)
3553 __field(uint64_t, owner)
3554 __field(uint64_t, offset)
3555 __field(unsigned int, flags)
3556 ),
3557 TP_fast_assign(
3558 __entry->dev = mp->m_super->s_dev;
3559 __entry->keydev = new_decode_dev(keydev);
3560 __entry->agno = agno;
3561 __entry->bno = rmap->rm_startblock;
3562 __entry->len = rmap->rm_blockcount;
3563 __entry->owner = rmap->rm_owner;
3564 __entry->offset = rmap->rm_offset;
3565 __entry->flags = rmap->rm_flags;
3566 ),
3567 TP_printk("dev %d:%d keydev %d:%d agno 0x%x startblock 0x%llx fsbcount 0x%llx owner 0x%llx fileoff 0x%llx flags 0x%x",
3568 MAJOR(__entry->dev), MINOR(__entry->dev),
3569 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3570 __entry->agno,
3571 __entry->bno,
3572 __entry->len,
3573 __entry->owner,
3574 __entry->offset,
3575 __entry->flags)
3576)
3577#define DEFINE_FSMAP_EVENT(name) \
3578DEFINE_EVENT(xfs_fsmap_class, name, \
3579 TP_PROTO(struct xfs_mount *mp, u32 keydev, xfs_agnumber_t agno, \
3580 const struct xfs_rmap_irec *rmap), \
3581 TP_ARGS(mp, keydev, agno, rmap))
3582DEFINE_FSMAP_EVENT(xfs_fsmap_low_key);
3583DEFINE_FSMAP_EVENT(xfs_fsmap_high_key);
3584DEFINE_FSMAP_EVENT(xfs_fsmap_mapping);
3585
3586DECLARE_EVENT_CLASS(xfs_getfsmap_class,
3587 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap),
3588 TP_ARGS(mp, fsmap),
3589 TP_STRUCT__entry(
3590 __field(dev_t, dev)
3591 __field(dev_t, keydev)
3592 __field(xfs_daddr_t, block)
3593 __field(xfs_daddr_t, len)
3594 __field(uint64_t, owner)
3595 __field(uint64_t, offset)
3596 __field(uint64_t, flags)
3597 ),
3598 TP_fast_assign(
3599 __entry->dev = mp->m_super->s_dev;
3600 __entry->keydev = new_decode_dev(fsmap->fmr_device);
3601 __entry->block = fsmap->fmr_physical;
3602 __entry->len = fsmap->fmr_length;
3603 __entry->owner = fsmap->fmr_owner;
3604 __entry->offset = fsmap->fmr_offset;
3605 __entry->flags = fsmap->fmr_flags;
3606 ),
3607 TP_printk("dev %d:%d keydev %d:%d daddr 0x%llx bbcount 0x%llx owner 0x%llx fileoff_daddr 0x%llx flags 0x%llx",
3608 MAJOR(__entry->dev), MINOR(__entry->dev),
3609 MAJOR(__entry->keydev), MINOR(__entry->keydev),
3610 __entry->block,
3611 __entry->len,
3612 __entry->owner,
3613 __entry->offset,
3614 __entry->flags)
3615)
3616#define DEFINE_GETFSMAP_EVENT(name) \
3617DEFINE_EVENT(xfs_getfsmap_class, name, \
3618 TP_PROTO(struct xfs_mount *mp, struct xfs_fsmap *fsmap), \
3619 TP_ARGS(mp, fsmap))
3620DEFINE_GETFSMAP_EVENT(xfs_getfsmap_low_key);
3621DEFINE_GETFSMAP_EVENT(xfs_getfsmap_high_key);
3622DEFINE_GETFSMAP_EVENT(xfs_getfsmap_mapping);
3623
3624DECLARE_EVENT_CLASS(xfs_trans_resv_class,
3625 TP_PROTO(struct xfs_mount *mp, unsigned int type,
3626 struct xfs_trans_res *res),
3627 TP_ARGS(mp, type, res),
3628 TP_STRUCT__entry(
3629 __field(dev_t, dev)
3630 __field(int, type)
3631 __field(uint, logres)
3632 __field(int, logcount)
3633 __field(int, logflags)
3634 ),
3635 TP_fast_assign(
3636 __entry->dev = mp->m_super->s_dev;
3637 __entry->type = type;
3638 __entry->logres = res->tr_logres;
3639 __entry->logcount = res->tr_logcount;
3640 __entry->logflags = res->tr_logflags;
3641 ),
3642 TP_printk("dev %d:%d type %d logres %u logcount %d flags 0x%x",
3643 MAJOR(__entry->dev), MINOR(__entry->dev),
3644 __entry->type,
3645 __entry->logres,
3646 __entry->logcount,
3647 __entry->logflags)
3648)
3649
3650#define DEFINE_TRANS_RESV_EVENT(name) \
3651DEFINE_EVENT(xfs_trans_resv_class, name, \
3652 TP_PROTO(struct xfs_mount *mp, unsigned int type, \
3653 struct xfs_trans_res *res), \
3654 TP_ARGS(mp, type, res))
3655DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc);
3656DEFINE_TRANS_RESV_EVENT(xfs_trans_resv_calc_minlogsize);
3657
3658TRACE_EVENT(xfs_log_get_max_trans_res,
3659 TP_PROTO(struct xfs_mount *mp, const struct xfs_trans_res *res),
3660 TP_ARGS(mp, res),
3661 TP_STRUCT__entry(
3662 __field(dev_t, dev)
3663 __field(uint, logres)
3664 __field(int, logcount)
3665 ),
3666 TP_fast_assign(
3667 __entry->dev = mp->m_super->s_dev;
3668 __entry->logres = res->tr_logres;
3669 __entry->logcount = res->tr_logcount;
3670 ),
3671 TP_printk("dev %d:%d logres %u logcount %d",
3672 MAJOR(__entry->dev), MINOR(__entry->dev),
3673 __entry->logres,
3674 __entry->logcount)
3675);
3676
3677DECLARE_EVENT_CLASS(xfs_trans_class,
3678 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip),
3679 TP_ARGS(tp, caller_ip),
3680 TP_STRUCT__entry(
3681 __field(dev_t, dev)
3682 __field(uint32_t, tid)
3683 __field(uint32_t, flags)
3684 __field(unsigned long, caller_ip)
3685 ),
3686 TP_fast_assign(
3687 __entry->dev = tp->t_mountp->m_super->s_dev;
3688 __entry->tid = 0;
3689 if (tp->t_ticket)
3690 __entry->tid = tp->t_ticket->t_tid;
3691 __entry->flags = tp->t_flags;
3692 __entry->caller_ip = caller_ip;
3693 ),
3694 TP_printk("dev %d:%d trans %x flags 0x%x caller %pS",
3695 MAJOR(__entry->dev), MINOR(__entry->dev),
3696 __entry->tid,
3697 __entry->flags,
3698 (char *)__entry->caller_ip)
3699)
3700
3701#define DEFINE_TRANS_EVENT(name) \
3702DEFINE_EVENT(xfs_trans_class, name, \
3703 TP_PROTO(struct xfs_trans *tp, unsigned long caller_ip), \
3704 TP_ARGS(tp, caller_ip))
3705DEFINE_TRANS_EVENT(xfs_trans_alloc);
3706DEFINE_TRANS_EVENT(xfs_trans_cancel);
3707DEFINE_TRANS_EVENT(xfs_trans_commit);
3708DEFINE_TRANS_EVENT(xfs_trans_dup);
3709DEFINE_TRANS_EVENT(xfs_trans_free);
3710DEFINE_TRANS_EVENT(xfs_trans_roll);
3711DEFINE_TRANS_EVENT(xfs_trans_add_item);
3712DEFINE_TRANS_EVENT(xfs_trans_commit_items);
3713DEFINE_TRANS_EVENT(xfs_trans_free_items);
3714
3715TRACE_EVENT(xfs_iunlink_update_bucket,
3716 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int bucket,
3717 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3718 TP_ARGS(mp, agno, bucket, old_ptr, new_ptr),
3719 TP_STRUCT__entry(
3720 __field(dev_t, dev)
3721 __field(xfs_agnumber_t, agno)
3722 __field(unsigned int, bucket)
3723 __field(xfs_agino_t, old_ptr)
3724 __field(xfs_agino_t, new_ptr)
3725 ),
3726 TP_fast_assign(
3727 __entry->dev = mp->m_super->s_dev;
3728 __entry->agno = agno;
3729 __entry->bucket = bucket;
3730 __entry->old_ptr = old_ptr;
3731 __entry->new_ptr = new_ptr;
3732 ),
3733 TP_printk("dev %d:%d agno 0x%x bucket %u old 0x%x new 0x%x",
3734 MAJOR(__entry->dev), MINOR(__entry->dev),
3735 __entry->agno,
3736 __entry->bucket,
3737 __entry->old_ptr,
3738 __entry->new_ptr)
3739);
3740
3741TRACE_EVENT(xfs_iunlink_update_dinode,
3742 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
3743 xfs_agino_t old_ptr, xfs_agino_t new_ptr),
3744 TP_ARGS(mp, agno, agino, old_ptr, new_ptr),
3745 TP_STRUCT__entry(
3746 __field(dev_t, dev)
3747 __field(xfs_agnumber_t, agno)
3748 __field(xfs_agino_t, agino)
3749 __field(xfs_agino_t, old_ptr)
3750 __field(xfs_agino_t, new_ptr)
3751 ),
3752 TP_fast_assign(
3753 __entry->dev = mp->m_super->s_dev;
3754 __entry->agno = agno;
3755 __entry->agino = agino;
3756 __entry->old_ptr = old_ptr;
3757 __entry->new_ptr = new_ptr;
3758 ),
3759 TP_printk("dev %d:%d agno 0x%x agino 0x%x old 0x%x new 0x%x",
3760 MAJOR(__entry->dev), MINOR(__entry->dev),
3761 __entry->agno,
3762 __entry->agino,
3763 __entry->old_ptr,
3764 __entry->new_ptr)
3765);
3766
3767DECLARE_EVENT_CLASS(xfs_ag_inode_class,
3768 TP_PROTO(struct xfs_inode *ip),
3769 TP_ARGS(ip),
3770 TP_STRUCT__entry(
3771 __field(dev_t, dev)
3772 __field(xfs_agnumber_t, agno)
3773 __field(xfs_agino_t, agino)
3774 ),
3775 TP_fast_assign(
3776 __entry->dev = VFS_I(ip)->i_sb->s_dev;
3777 __entry->agno = XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino);
3778 __entry->agino = XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino);
3779 ),
3780 TP_printk("dev %d:%d agno 0x%x agino 0x%x",
3781 MAJOR(__entry->dev), MINOR(__entry->dev),
3782 __entry->agno, __entry->agino)
3783)
3784
3785#define DEFINE_AGINODE_EVENT(name) \
3786DEFINE_EVENT(xfs_ag_inode_class, name, \
3787 TP_PROTO(struct xfs_inode *ip), \
3788 TP_ARGS(ip))
3789DEFINE_AGINODE_EVENT(xfs_iunlink);
3790DEFINE_AGINODE_EVENT(xfs_iunlink_remove);
3791
3792DECLARE_EVENT_CLASS(xfs_fs_corrupt_class,
3793 TP_PROTO(struct xfs_mount *mp, unsigned int flags),
3794 TP_ARGS(mp, flags),
3795 TP_STRUCT__entry(
3796 __field(dev_t, dev)
3797 __field(unsigned int, flags)
3798 ),
3799 TP_fast_assign(
3800 __entry->dev = mp->m_super->s_dev;
3801 __entry->flags = flags;
3802 ),
3803 TP_printk("dev %d:%d flags 0x%x",
3804 MAJOR(__entry->dev), MINOR(__entry->dev),
3805 __entry->flags)
3806);
3807#define DEFINE_FS_CORRUPT_EVENT(name) \
3808DEFINE_EVENT(xfs_fs_corrupt_class, name, \
3809 TP_PROTO(struct xfs_mount *mp, unsigned int flags), \
3810 TP_ARGS(mp, flags))
3811DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_sick);
3812DEFINE_FS_CORRUPT_EVENT(xfs_fs_mark_healthy);
3813DEFINE_FS_CORRUPT_EVENT(xfs_fs_unfixed_corruption);
3814DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_sick);
3815DEFINE_FS_CORRUPT_EVENT(xfs_rt_mark_healthy);
3816DEFINE_FS_CORRUPT_EVENT(xfs_rt_unfixed_corruption);
3817
3818DECLARE_EVENT_CLASS(xfs_ag_corrupt_class,
3819 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, unsigned int flags),
3820 TP_ARGS(mp, agno, flags),
3821 TP_STRUCT__entry(
3822 __field(dev_t, dev)
3823 __field(xfs_agnumber_t, agno)
3824 __field(unsigned int, flags)
3825 ),
3826 TP_fast_assign(
3827 __entry->dev = mp->m_super->s_dev;
3828 __entry->agno = agno;
3829 __entry->flags = flags;
3830 ),
3831 TP_printk("dev %d:%d agno 0x%x flags 0x%x",
3832 MAJOR(__entry->dev), MINOR(__entry->dev),
3833 __entry->agno, __entry->flags)
3834);
3835#define DEFINE_AG_CORRUPT_EVENT(name) \
3836DEFINE_EVENT(xfs_ag_corrupt_class, name, \
3837 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
3838 unsigned int flags), \
3839 TP_ARGS(mp, agno, flags))
3840DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_sick);
3841DEFINE_AG_CORRUPT_EVENT(xfs_ag_mark_healthy);
3842DEFINE_AG_CORRUPT_EVENT(xfs_ag_unfixed_corruption);
3843
3844DECLARE_EVENT_CLASS(xfs_inode_corrupt_class,
3845 TP_PROTO(struct xfs_inode *ip, unsigned int flags),
3846 TP_ARGS(ip, flags),
3847 TP_STRUCT__entry(
3848 __field(dev_t, dev)
3849 __field(xfs_ino_t, ino)
3850 __field(unsigned int, flags)
3851 ),
3852 TP_fast_assign(
3853 __entry->dev = ip->i_mount->m_super->s_dev;
3854 __entry->ino = ip->i_ino;
3855 __entry->flags = flags;
3856 ),
3857 TP_printk("dev %d:%d ino 0x%llx flags 0x%x",
3858 MAJOR(__entry->dev), MINOR(__entry->dev),
3859 __entry->ino, __entry->flags)
3860);
3861#define DEFINE_INODE_CORRUPT_EVENT(name) \
3862DEFINE_EVENT(xfs_inode_corrupt_class, name, \
3863 TP_PROTO(struct xfs_inode *ip, unsigned int flags), \
3864 TP_ARGS(ip, flags))
3865DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_sick);
3866DEFINE_INODE_CORRUPT_EVENT(xfs_inode_mark_healthy);
3867
3868TRACE_EVENT(xfs_iwalk_ag,
3869 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3870 xfs_agino_t startino),
3871 TP_ARGS(mp, agno, startino),
3872 TP_STRUCT__entry(
3873 __field(dev_t, dev)
3874 __field(xfs_agnumber_t, agno)
3875 __field(xfs_agino_t, startino)
3876 ),
3877 TP_fast_assign(
3878 __entry->dev = mp->m_super->s_dev;
3879 __entry->agno = agno;
3880 __entry->startino = startino;
3881 ),
3882 TP_printk("dev %d:%d agno 0x%x startino 0x%x",
3883 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3884 __entry->startino)
3885)
3886
3887TRACE_EVENT(xfs_iwalk_ag_rec,
3888 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
3889 struct xfs_inobt_rec_incore *irec),
3890 TP_ARGS(mp, agno, irec),
3891 TP_STRUCT__entry(
3892 __field(dev_t, dev)
3893 __field(xfs_agnumber_t, agno)
3894 __field(xfs_agino_t, startino)
3895 __field(uint64_t, freemask)
3896 ),
3897 TP_fast_assign(
3898 __entry->dev = mp->m_super->s_dev;
3899 __entry->agno = agno;
3900 __entry->startino = irec->ir_startino;
3901 __entry->freemask = irec->ir_free;
3902 ),
3903 TP_printk("dev %d:%d agno 0x%x startino 0x%x freemask 0x%llx",
3904 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
3905 __entry->startino, __entry->freemask)
3906)
3907
3908TRACE_EVENT(xfs_pwork_init,
3909 TP_PROTO(struct xfs_mount *mp, unsigned int nr_threads, pid_t pid),
3910 TP_ARGS(mp, nr_threads, pid),
3911 TP_STRUCT__entry(
3912 __field(dev_t, dev)
3913 __field(unsigned int, nr_threads)
3914 __field(pid_t, pid)
3915 ),
3916 TP_fast_assign(
3917 __entry->dev = mp->m_super->s_dev;
3918 __entry->nr_threads = nr_threads;
3919 __entry->pid = pid;
3920 ),
3921 TP_printk("dev %d:%d nr_threads %u pid %u",
3922 MAJOR(__entry->dev), MINOR(__entry->dev),
3923 __entry->nr_threads, __entry->pid)
3924)
3925
3926DECLARE_EVENT_CLASS(xfs_kmem_class,
3927 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip),
3928 TP_ARGS(size, flags, caller_ip),
3929 TP_STRUCT__entry(
3930 __field(ssize_t, size)
3931 __field(int, flags)
3932 __field(unsigned long, caller_ip)
3933 ),
3934 TP_fast_assign(
3935 __entry->size = size;
3936 __entry->flags = flags;
3937 __entry->caller_ip = caller_ip;
3938 ),
3939 TP_printk("size %zd flags 0x%x caller %pS",
3940 __entry->size,
3941 __entry->flags,
3942 (char *)__entry->caller_ip)
3943)
3944
3945#define DEFINE_KMEM_EVENT(name) \
3946DEFINE_EVENT(xfs_kmem_class, name, \
3947 TP_PROTO(ssize_t size, int flags, unsigned long caller_ip), \
3948 TP_ARGS(size, flags, caller_ip))
3949DEFINE_KMEM_EVENT(kmem_alloc);
3950
3951TRACE_EVENT(xfs_check_new_dalign,
3952 TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
3953 TP_ARGS(mp, new_dalign, calc_rootino),
3954 TP_STRUCT__entry(
3955 __field(dev_t, dev)
3956 __field(int, new_dalign)
3957 __field(xfs_ino_t, sb_rootino)
3958 __field(xfs_ino_t, calc_rootino)
3959 ),
3960 TP_fast_assign(
3961 __entry->dev = mp->m_super->s_dev;
3962 __entry->new_dalign = new_dalign;
3963 __entry->sb_rootino = mp->m_sb.sb_rootino;
3964 __entry->calc_rootino = calc_rootino;
3965 ),
3966 TP_printk("dev %d:%d new_dalign %d sb_rootino 0x%llx calc_rootino 0x%llx",
3967 MAJOR(__entry->dev), MINOR(__entry->dev),
3968 __entry->new_dalign, __entry->sb_rootino,
3969 __entry->calc_rootino)
3970)
3971
3972TRACE_EVENT(xfs_btree_commit_afakeroot,
3973 TP_PROTO(struct xfs_btree_cur *cur),
3974 TP_ARGS(cur),
3975 TP_STRUCT__entry(
3976 __field(dev_t, dev)
3977 __field(xfs_btnum_t, btnum)
3978 __field(xfs_agnumber_t, agno)
3979 __field(xfs_agblock_t, agbno)
3980 __field(unsigned int, levels)
3981 __field(unsigned int, blocks)
3982 ),
3983 TP_fast_assign(
3984 __entry->dev = cur->bc_mp->m_super->s_dev;
3985 __entry->btnum = cur->bc_btnum;
3986 __entry->agno = cur->bc_ag.pag->pag_agno;
3987 __entry->agbno = cur->bc_ag.afake->af_root;
3988 __entry->levels = cur->bc_ag.afake->af_levels;
3989 __entry->blocks = cur->bc_ag.afake->af_blocks;
3990 ),
3991 TP_printk("dev %d:%d btree %s agno 0x%x levels %u blocks %u root %u",
3992 MAJOR(__entry->dev), MINOR(__entry->dev),
3993 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
3994 __entry->agno,
3995 __entry->levels,
3996 __entry->blocks,
3997 __entry->agbno)
3998)
3999
4000TRACE_EVENT(xfs_btree_commit_ifakeroot,
4001 TP_PROTO(struct xfs_btree_cur *cur),
4002 TP_ARGS(cur),
4003 TP_STRUCT__entry(
4004 __field(dev_t, dev)
4005 __field(xfs_btnum_t, btnum)
4006 __field(xfs_agnumber_t, agno)
4007 __field(xfs_agino_t, agino)
4008 __field(unsigned int, levels)
4009 __field(unsigned int, blocks)
4010 __field(int, whichfork)
4011 ),
4012 TP_fast_assign(
4013 __entry->dev = cur->bc_mp->m_super->s_dev;
4014 __entry->btnum = cur->bc_btnum;
4015 __entry->agno = XFS_INO_TO_AGNO(cur->bc_mp,
4016 cur->bc_ino.ip->i_ino);
4017 __entry->agino = XFS_INO_TO_AGINO(cur->bc_mp,
4018 cur->bc_ino.ip->i_ino);
4019 __entry->levels = cur->bc_ino.ifake->if_levels;
4020 __entry->blocks = cur->bc_ino.ifake->if_blocks;
4021 __entry->whichfork = cur->bc_ino.whichfork;
4022 ),
4023 TP_printk("dev %d:%d btree %s agno 0x%x agino 0x%x whichfork %s levels %u blocks %u",
4024 MAJOR(__entry->dev), MINOR(__entry->dev),
4025 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
4026 __entry->agno,
4027 __entry->agino,
4028 __print_symbolic(__entry->whichfork, XFS_WHICHFORK_STRINGS),
4029 __entry->levels,
4030 __entry->blocks)
4031)
4032
4033TRACE_EVENT(xfs_btree_bload_level_geometry,
4034 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
4035 uint64_t nr_this_level, unsigned int nr_per_block,
4036 unsigned int desired_npb, uint64_t blocks,
4037 uint64_t blocks_with_extra),
4038 TP_ARGS(cur, level, nr_this_level, nr_per_block, desired_npb, blocks,
4039 blocks_with_extra),
4040 TP_STRUCT__entry(
4041 __field(dev_t, dev)
4042 __field(xfs_btnum_t, btnum)
4043 __field(unsigned int, level)
4044 __field(unsigned int, nlevels)
4045 __field(uint64_t, nr_this_level)
4046 __field(unsigned int, nr_per_block)
4047 __field(unsigned int, desired_npb)
4048 __field(unsigned long long, blocks)
4049 __field(unsigned long long, blocks_with_extra)
4050 ),
4051 TP_fast_assign(
4052 __entry->dev = cur->bc_mp->m_super->s_dev;
4053 __entry->btnum = cur->bc_btnum;
4054 __entry->level = level;
4055 __entry->nlevels = cur->bc_nlevels;
4056 __entry->nr_this_level = nr_this_level;
4057 __entry->nr_per_block = nr_per_block;
4058 __entry->desired_npb = desired_npb;
4059 __entry->blocks = blocks;
4060 __entry->blocks_with_extra = blocks_with_extra;
4061 ),
4062 TP_printk("dev %d:%d btree %s level %u/%u nr_this_level %llu nr_per_block %u desired_npb %u blocks %llu blocks_with_extra %llu",
4063 MAJOR(__entry->dev), MINOR(__entry->dev),
4064 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
4065 __entry->level,
4066 __entry->nlevels,
4067 __entry->nr_this_level,
4068 __entry->nr_per_block,
4069 __entry->desired_npb,
4070 __entry->blocks,
4071 __entry->blocks_with_extra)
4072)
4073
4074TRACE_EVENT(xfs_btree_bload_block,
4075 TP_PROTO(struct xfs_btree_cur *cur, unsigned int level,
4076 uint64_t block_idx, uint64_t nr_blocks,
4077 union xfs_btree_ptr *ptr, unsigned int nr_records),
4078 TP_ARGS(cur, level, block_idx, nr_blocks, ptr, nr_records),
4079 TP_STRUCT__entry(
4080 __field(dev_t, dev)
4081 __field(xfs_btnum_t, btnum)
4082 __field(unsigned int, level)
4083 __field(unsigned long long, block_idx)
4084 __field(unsigned long long, nr_blocks)
4085 __field(xfs_agnumber_t, agno)
4086 __field(xfs_agblock_t, agbno)
4087 __field(unsigned int, nr_records)
4088 ),
4089 TP_fast_assign(
4090 __entry->dev = cur->bc_mp->m_super->s_dev;
4091 __entry->btnum = cur->bc_btnum;
4092 __entry->level = level;
4093 __entry->block_idx = block_idx;
4094 __entry->nr_blocks = nr_blocks;
4095 if (cur->bc_flags & XFS_BTREE_LONG_PTRS) {
4096 xfs_fsblock_t fsb = be64_to_cpu(ptr->l);
4097
4098 __entry->agno = XFS_FSB_TO_AGNO(cur->bc_mp, fsb);
4099 __entry->agbno = XFS_FSB_TO_AGBNO(cur->bc_mp, fsb);
4100 } else {
4101 __entry->agno = cur->bc_ag.pag->pag_agno;
4102 __entry->agbno = be32_to_cpu(ptr->s);
4103 }
4104 __entry->nr_records = nr_records;
4105 ),
4106 TP_printk("dev %d:%d btree %s level %u block %llu/%llu agno 0x%x agbno 0x%x recs %u",
4107 MAJOR(__entry->dev), MINOR(__entry->dev),
4108 __print_symbolic(__entry->btnum, XFS_BTNUM_STRINGS),
4109 __entry->level,
4110 __entry->block_idx,
4111 __entry->nr_blocks,
4112 __entry->agno,
4113 __entry->agbno,
4114 __entry->nr_records)
4115)
4116
4117DECLARE_EVENT_CLASS(xfs_timestamp_range_class,
4118 TP_PROTO(struct xfs_mount *mp, time64_t min, time64_t max),
4119 TP_ARGS(mp, min, max),
4120 TP_STRUCT__entry(
4121 __field(dev_t, dev)
4122 __field(long long, min)
4123 __field(long long, max)
4124 ),
4125 TP_fast_assign(
4126 __entry->dev = mp->m_super->s_dev;
4127 __entry->min = min;
4128 __entry->max = max;
4129 ),
4130 TP_printk("dev %d:%d min %lld max %lld",
4131 MAJOR(__entry->dev), MINOR(__entry->dev),
4132 __entry->min,
4133 __entry->max)
4134)
4135
4136#define DEFINE_TIMESTAMP_RANGE_EVENT(name) \
4137DEFINE_EVENT(xfs_timestamp_range_class, name, \
4138 TP_PROTO(struct xfs_mount *mp, long long min, long long max), \
4139 TP_ARGS(mp, min, max))
4140DEFINE_TIMESTAMP_RANGE_EVENT(xfs_inode_timestamp_range);
4141DEFINE_TIMESTAMP_RANGE_EVENT(xfs_quota_expiry_range);
4142
4143DECLARE_EVENT_CLASS(xfs_icwalk_class,
4144 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw,
4145 unsigned long caller_ip),
4146 TP_ARGS(mp, icw, caller_ip),
4147 TP_STRUCT__entry(
4148 __field(dev_t, dev)
4149 __field(__u32, flags)
4150 __field(uint32_t, uid)
4151 __field(uint32_t, gid)
4152 __field(prid_t, prid)
4153 __field(__u64, min_file_size)
4154 __field(long, scan_limit)
4155 __field(unsigned long, caller_ip)
4156 ),
4157 TP_fast_assign(
4158 __entry->dev = mp->m_super->s_dev;
4159 __entry->flags = icw ? icw->icw_flags : 0;
4160 __entry->uid = icw ? from_kuid(mp->m_super->s_user_ns,
4161 icw->icw_uid) : 0;
4162 __entry->gid = icw ? from_kgid(mp->m_super->s_user_ns,
4163 icw->icw_gid) : 0;
4164 __entry->prid = icw ? icw->icw_prid : 0;
4165 __entry->min_file_size = icw ? icw->icw_min_file_size : 0;
4166 __entry->scan_limit = icw ? icw->icw_scan_limit : 0;
4167 __entry->caller_ip = caller_ip;
4168 ),
4169 TP_printk("dev %d:%d flags 0x%x uid %u gid %u prid %u minsize %llu scan_limit %ld caller %pS",
4170 MAJOR(__entry->dev), MINOR(__entry->dev),
4171 __entry->flags,
4172 __entry->uid,
4173 __entry->gid,
4174 __entry->prid,
4175 __entry->min_file_size,
4176 __entry->scan_limit,
4177 (char *)__entry->caller_ip)
4178);
4179#define DEFINE_ICWALK_EVENT(name) \
4180DEFINE_EVENT(xfs_icwalk_class, name, \
4181 TP_PROTO(struct xfs_mount *mp, struct xfs_icwalk *icw, \
4182 unsigned long caller_ip), \
4183 TP_ARGS(mp, icw, caller_ip))
4184DEFINE_ICWALK_EVENT(xfs_ioc_free_eofblocks);
4185DEFINE_ICWALK_EVENT(xfs_blockgc_free_space);
4186
4187TRACE_DEFINE_ENUM(XLOG_STATE_ACTIVE);
4188TRACE_DEFINE_ENUM(XLOG_STATE_WANT_SYNC);
4189TRACE_DEFINE_ENUM(XLOG_STATE_SYNCING);
4190TRACE_DEFINE_ENUM(XLOG_STATE_DONE_SYNC);
4191TRACE_DEFINE_ENUM(XLOG_STATE_CALLBACK);
4192TRACE_DEFINE_ENUM(XLOG_STATE_DIRTY);
4193
4194DECLARE_EVENT_CLASS(xlog_iclog_class,
4195 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip),
4196 TP_ARGS(iclog, caller_ip),
4197 TP_STRUCT__entry(
4198 __field(dev_t, dev)
4199 __field(uint32_t, state)
4200 __field(int32_t, refcount)
4201 __field(uint32_t, offset)
4202 __field(uint32_t, flags)
4203 __field(unsigned long long, lsn)
4204 __field(unsigned long, caller_ip)
4205 ),
4206 TP_fast_assign(
4207 __entry->dev = iclog->ic_log->l_mp->m_super->s_dev;
4208 __entry->state = iclog->ic_state;
4209 __entry->refcount = atomic_read(&iclog->ic_refcnt);
4210 __entry->offset = iclog->ic_offset;
4211 __entry->flags = iclog->ic_flags;
4212 __entry->lsn = be64_to_cpu(iclog->ic_header.h_lsn);
4213 __entry->caller_ip = caller_ip;
4214 ),
4215 TP_printk("dev %d:%d state %s refcnt %d offset %u lsn 0x%llx flags %s caller %pS",
4216 MAJOR(__entry->dev), MINOR(__entry->dev),
4217 __print_symbolic(__entry->state, XLOG_STATE_STRINGS),
4218 __entry->refcount,
4219 __entry->offset,
4220 __entry->lsn,
4221 __print_flags(__entry->flags, "|", XLOG_ICL_STRINGS),
4222 (char *)__entry->caller_ip)
4223
4224);
4225
4226#define DEFINE_ICLOG_EVENT(name) \
4227DEFINE_EVENT(xlog_iclog_class, name, \
4228 TP_PROTO(struct xlog_in_core *iclog, unsigned long caller_ip), \
4229 TP_ARGS(iclog, caller_ip))
4230
4231DEFINE_ICLOG_EVENT(xlog_iclog_activate);
4232DEFINE_ICLOG_EVENT(xlog_iclog_clean);
4233DEFINE_ICLOG_EVENT(xlog_iclog_callback);
4234DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_start);
4235DEFINE_ICLOG_EVENT(xlog_iclog_callbacks_done);
4236DEFINE_ICLOG_EVENT(xlog_iclog_force);
4237DEFINE_ICLOG_EVENT(xlog_iclog_force_lsn);
4238DEFINE_ICLOG_EVENT(xlog_iclog_get_space);
4239DEFINE_ICLOG_EVENT(xlog_iclog_release);
4240DEFINE_ICLOG_EVENT(xlog_iclog_switch);
4241DEFINE_ICLOG_EVENT(xlog_iclog_sync);
4242DEFINE_ICLOG_EVENT(xlog_iclog_syncing);
4243DEFINE_ICLOG_EVENT(xlog_iclog_sync_done);
4244DEFINE_ICLOG_EVENT(xlog_iclog_want_sync);
4245DEFINE_ICLOG_EVENT(xlog_iclog_wait_on);
4246DEFINE_ICLOG_EVENT(xlog_iclog_write);
4247
4248TRACE_DEFINE_ENUM(XFS_DAS_UNINIT);
4249TRACE_DEFINE_ENUM(XFS_DAS_SF_ADD);
4250TRACE_DEFINE_ENUM(XFS_DAS_SF_REMOVE);
4251TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ADD);
4252TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE);
4253TRACE_DEFINE_ENUM(XFS_DAS_NODE_ADD);
4254TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE);
4255TRACE_DEFINE_ENUM(XFS_DAS_LEAF_SET_RMT);
4256TRACE_DEFINE_ENUM(XFS_DAS_LEAF_ALLOC_RMT);
4257TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REPLACE);
4258TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_OLD);
4259TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_RMT);
4260TRACE_DEFINE_ENUM(XFS_DAS_LEAF_REMOVE_ATTR);
4261TRACE_DEFINE_ENUM(XFS_DAS_NODE_SET_RMT);
4262TRACE_DEFINE_ENUM(XFS_DAS_NODE_ALLOC_RMT);
4263TRACE_DEFINE_ENUM(XFS_DAS_NODE_REPLACE);
4264TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_OLD);
4265TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_RMT);
4266TRACE_DEFINE_ENUM(XFS_DAS_NODE_REMOVE_ATTR);
4267TRACE_DEFINE_ENUM(XFS_DAS_DONE);
4268
4269DECLARE_EVENT_CLASS(xfs_das_state_class,
4270 TP_PROTO(int das, struct xfs_inode *ip),
4271 TP_ARGS(das, ip),
4272 TP_STRUCT__entry(
4273 __field(int, das)
4274 __field(xfs_ino_t, ino)
4275 ),
4276 TP_fast_assign(
4277 __entry->das = das;
4278 __entry->ino = ip->i_ino;
4279 ),
4280 TP_printk("state change %s ino 0x%llx",
4281 __print_symbolic(__entry->das, XFS_DAS_STRINGS),
4282 __entry->ino)
4283)
4284
4285#define DEFINE_DAS_STATE_EVENT(name) \
4286DEFINE_EVENT(xfs_das_state_class, name, \
4287 TP_PROTO(int das, struct xfs_inode *ip), \
4288 TP_ARGS(das, ip))
4289DEFINE_DAS_STATE_EVENT(xfs_attr_sf_addname_return);
4290DEFINE_DAS_STATE_EVENT(xfs_attr_set_iter_return);
4291DEFINE_DAS_STATE_EVENT(xfs_attr_leaf_addname_return);
4292DEFINE_DAS_STATE_EVENT(xfs_attr_node_addname_return);
4293DEFINE_DAS_STATE_EVENT(xfs_attr_remove_iter_return);
4294DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_alloc);
4295DEFINE_DAS_STATE_EVENT(xfs_attr_rmtval_remove_return);
4296DEFINE_DAS_STATE_EVENT(xfs_attr_defer_add);
4297DEFINE_DAS_STATE_EVENT(xfs_attr_defer_replace);
4298DEFINE_DAS_STATE_EVENT(xfs_attr_defer_remove);
4299
4300
4301TRACE_EVENT(xfs_force_shutdown,
4302 TP_PROTO(struct xfs_mount *mp, int ptag, int flags, const char *fname,
4303 int line_num),
4304 TP_ARGS(mp, ptag, flags, fname, line_num),
4305 TP_STRUCT__entry(
4306 __field(dev_t, dev)
4307 __field(int, ptag)
4308 __field(int, flags)
4309 __string(fname, fname)
4310 __field(int, line_num)
4311 ),
4312 TP_fast_assign(
4313 __entry->dev = mp->m_super->s_dev;
4314 __entry->ptag = ptag;
4315 __entry->flags = flags;
4316 __assign_str(fname, fname);
4317 __entry->line_num = line_num;
4318 ),
4319 TP_printk("dev %d:%d tag %s flags %s file %s line_num %d",
4320 MAJOR(__entry->dev), MINOR(__entry->dev),
4321 __print_flags(__entry->ptag, "|", XFS_PTAG_STRINGS),
4322 __print_flags(__entry->flags, "|", XFS_SHUTDOWN_STRINGS),
4323 __get_str(fname),
4324 __entry->line_num)
4325);
4326
4327#endif /* _TRACE_XFS_H */
4328
4329#undef TRACE_INCLUDE_PATH
4330#define TRACE_INCLUDE_PATH .
4331#define TRACE_INCLUDE_FILE xfs_trace
4332#include <trace/define_trace.h>
1/*
2 * Copyright (c) 2009, Christoph Hellwig
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18#undef TRACE_SYSTEM
19#define TRACE_SYSTEM xfs
20
21#if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
22#define _TRACE_XFS_H
23
24#include <linux/tracepoint.h>
25
26struct xfs_agf;
27struct xfs_alloc_arg;
28struct xfs_attr_list_context;
29struct xfs_buf_log_item;
30struct xfs_da_args;
31struct xfs_da_node_entry;
32struct xfs_dquot;
33struct xfs_log_item;
34struct xlog;
35struct xlog_ticket;
36struct xlog_recover;
37struct xlog_recover_item;
38struct xfs_buf_log_format;
39struct xfs_inode_log_format;
40struct xfs_bmbt_irec;
41
42DECLARE_EVENT_CLASS(xfs_attr_list_class,
43 TP_PROTO(struct xfs_attr_list_context *ctx),
44 TP_ARGS(ctx),
45 TP_STRUCT__entry(
46 __field(dev_t, dev)
47 __field(xfs_ino_t, ino)
48 __field(u32, hashval)
49 __field(u32, blkno)
50 __field(u32, offset)
51 __field(void *, alist)
52 __field(int, bufsize)
53 __field(int, count)
54 __field(int, firstu)
55 __field(int, dupcnt)
56 __field(int, flags)
57 ),
58 TP_fast_assign(
59 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
60 __entry->ino = ctx->dp->i_ino;
61 __entry->hashval = ctx->cursor->hashval;
62 __entry->blkno = ctx->cursor->blkno;
63 __entry->offset = ctx->cursor->offset;
64 __entry->alist = ctx->alist;
65 __entry->bufsize = ctx->bufsize;
66 __entry->count = ctx->count;
67 __entry->firstu = ctx->firstu;
68 __entry->flags = ctx->flags;
69 ),
70 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
71 "alist 0x%p size %u count %u firstu %u flags %d %s",
72 MAJOR(__entry->dev), MINOR(__entry->dev),
73 __entry->ino,
74 __entry->hashval,
75 __entry->blkno,
76 __entry->offset,
77 __entry->dupcnt,
78 __entry->alist,
79 __entry->bufsize,
80 __entry->count,
81 __entry->firstu,
82 __entry->flags,
83 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
84 )
85)
86
87#define DEFINE_ATTR_LIST_EVENT(name) \
88DEFINE_EVENT(xfs_attr_list_class, name, \
89 TP_PROTO(struct xfs_attr_list_context *ctx), \
90 TP_ARGS(ctx))
91DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
92DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
93DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
94DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
95DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
96DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
98DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
99DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
100DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
101
102DECLARE_EVENT_CLASS(xfs_perag_class,
103 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
104 unsigned long caller_ip),
105 TP_ARGS(mp, agno, refcount, caller_ip),
106 TP_STRUCT__entry(
107 __field(dev_t, dev)
108 __field(xfs_agnumber_t, agno)
109 __field(int, refcount)
110 __field(unsigned long, caller_ip)
111 ),
112 TP_fast_assign(
113 __entry->dev = mp->m_super->s_dev;
114 __entry->agno = agno;
115 __entry->refcount = refcount;
116 __entry->caller_ip = caller_ip;
117 ),
118 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
119 MAJOR(__entry->dev), MINOR(__entry->dev),
120 __entry->agno,
121 __entry->refcount,
122 (char *)__entry->caller_ip)
123);
124
125#define DEFINE_PERAG_REF_EVENT(name) \
126DEFINE_EVENT(xfs_perag_class, name, \
127 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
128 unsigned long caller_ip), \
129 TP_ARGS(mp, agno, refcount, caller_ip))
130DEFINE_PERAG_REF_EVENT(xfs_perag_get);
131DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
132DEFINE_PERAG_REF_EVENT(xfs_perag_put);
133DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
134DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
135DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
136DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
137
138DECLARE_EVENT_CLASS(xfs_ag_class,
139 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
140 TP_ARGS(mp, agno),
141 TP_STRUCT__entry(
142 __field(dev_t, dev)
143 __field(xfs_agnumber_t, agno)
144 ),
145 TP_fast_assign(
146 __entry->dev = mp->m_super->s_dev;
147 __entry->agno = agno;
148 ),
149 TP_printk("dev %d:%d agno %u",
150 MAJOR(__entry->dev), MINOR(__entry->dev),
151 __entry->agno)
152);
153#define DEFINE_AG_EVENT(name) \
154DEFINE_EVENT(xfs_ag_class, name, \
155 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
156 TP_ARGS(mp, agno))
157
158DEFINE_AG_EVENT(xfs_read_agf);
159DEFINE_AG_EVENT(xfs_alloc_read_agf);
160DEFINE_AG_EVENT(xfs_read_agi);
161DEFINE_AG_EVENT(xfs_ialloc_read_agi);
162
163TRACE_EVENT(xfs_attr_list_node_descend,
164 TP_PROTO(struct xfs_attr_list_context *ctx,
165 struct xfs_da_node_entry *btree),
166 TP_ARGS(ctx, btree),
167 TP_STRUCT__entry(
168 __field(dev_t, dev)
169 __field(xfs_ino_t, ino)
170 __field(u32, hashval)
171 __field(u32, blkno)
172 __field(u32, offset)
173 __field(void *, alist)
174 __field(int, bufsize)
175 __field(int, count)
176 __field(int, firstu)
177 __field(int, dupcnt)
178 __field(int, flags)
179 __field(u32, bt_hashval)
180 __field(u32, bt_before)
181 ),
182 TP_fast_assign(
183 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
184 __entry->ino = ctx->dp->i_ino;
185 __entry->hashval = ctx->cursor->hashval;
186 __entry->blkno = ctx->cursor->blkno;
187 __entry->offset = ctx->cursor->offset;
188 __entry->alist = ctx->alist;
189 __entry->bufsize = ctx->bufsize;
190 __entry->count = ctx->count;
191 __entry->firstu = ctx->firstu;
192 __entry->flags = ctx->flags;
193 __entry->bt_hashval = be32_to_cpu(btree->hashval);
194 __entry->bt_before = be32_to_cpu(btree->before);
195 ),
196 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
197 "alist 0x%p size %u count %u firstu %u flags %d %s "
198 "node hashval %u, node before %u",
199 MAJOR(__entry->dev), MINOR(__entry->dev),
200 __entry->ino,
201 __entry->hashval,
202 __entry->blkno,
203 __entry->offset,
204 __entry->dupcnt,
205 __entry->alist,
206 __entry->bufsize,
207 __entry->count,
208 __entry->firstu,
209 __entry->flags,
210 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
211 __entry->bt_hashval,
212 __entry->bt_before)
213);
214
215TRACE_EVENT(xfs_iext_insert,
216 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
217 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
218 TP_ARGS(ip, idx, r, state, caller_ip),
219 TP_STRUCT__entry(
220 __field(dev_t, dev)
221 __field(xfs_ino_t, ino)
222 __field(xfs_extnum_t, idx)
223 __field(xfs_fileoff_t, startoff)
224 __field(xfs_fsblock_t, startblock)
225 __field(xfs_filblks_t, blockcount)
226 __field(xfs_exntst_t, state)
227 __field(int, bmap_state)
228 __field(unsigned long, caller_ip)
229 ),
230 TP_fast_assign(
231 __entry->dev = VFS_I(ip)->i_sb->s_dev;
232 __entry->ino = ip->i_ino;
233 __entry->idx = idx;
234 __entry->startoff = r->br_startoff;
235 __entry->startblock = r->br_startblock;
236 __entry->blockcount = r->br_blockcount;
237 __entry->state = r->br_state;
238 __entry->bmap_state = state;
239 __entry->caller_ip = caller_ip;
240 ),
241 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
242 "offset %lld block %lld count %lld flag %d caller %ps",
243 MAJOR(__entry->dev), MINOR(__entry->dev),
244 __entry->ino,
245 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
246 (long)__entry->idx,
247 __entry->startoff,
248 (__int64_t)__entry->startblock,
249 __entry->blockcount,
250 __entry->state,
251 (char *)__entry->caller_ip)
252);
253
254DECLARE_EVENT_CLASS(xfs_bmap_class,
255 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
256 unsigned long caller_ip),
257 TP_ARGS(ip, idx, state, caller_ip),
258 TP_STRUCT__entry(
259 __field(dev_t, dev)
260 __field(xfs_ino_t, ino)
261 __field(xfs_extnum_t, idx)
262 __field(xfs_fileoff_t, startoff)
263 __field(xfs_fsblock_t, startblock)
264 __field(xfs_filblks_t, blockcount)
265 __field(xfs_exntst_t, state)
266 __field(int, bmap_state)
267 __field(unsigned long, caller_ip)
268 ),
269 TP_fast_assign(
270 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
271 ip->i_afp : &ip->i_df;
272 struct xfs_bmbt_irec r;
273
274 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
275 __entry->dev = VFS_I(ip)->i_sb->s_dev;
276 __entry->ino = ip->i_ino;
277 __entry->idx = idx;
278 __entry->startoff = r.br_startoff;
279 __entry->startblock = r.br_startblock;
280 __entry->blockcount = r.br_blockcount;
281 __entry->state = r.br_state;
282 __entry->bmap_state = state;
283 __entry->caller_ip = caller_ip;
284 ),
285 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
286 "offset %lld block %lld count %lld flag %d caller %ps",
287 MAJOR(__entry->dev), MINOR(__entry->dev),
288 __entry->ino,
289 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
290 (long)__entry->idx,
291 __entry->startoff,
292 (__int64_t)__entry->startblock,
293 __entry->blockcount,
294 __entry->state,
295 (char *)__entry->caller_ip)
296)
297
298#define DEFINE_BMAP_EVENT(name) \
299DEFINE_EVENT(xfs_bmap_class, name, \
300 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
301 unsigned long caller_ip), \
302 TP_ARGS(ip, idx, state, caller_ip))
303DEFINE_BMAP_EVENT(xfs_iext_remove);
304DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
305DEFINE_BMAP_EVENT(xfs_bmap_post_update);
306DEFINE_BMAP_EVENT(xfs_extlist);
307
308DECLARE_EVENT_CLASS(xfs_buf_class,
309 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
310 TP_ARGS(bp, caller_ip),
311 TP_STRUCT__entry(
312 __field(dev_t, dev)
313 __field(xfs_daddr_t, bno)
314 __field(int, nblks)
315 __field(int, hold)
316 __field(int, pincount)
317 __field(unsigned, lockval)
318 __field(unsigned, flags)
319 __field(unsigned long, caller_ip)
320 ),
321 TP_fast_assign(
322 __entry->dev = bp->b_target->bt_dev;
323 __entry->bno = bp->b_bn;
324 __entry->nblks = bp->b_length;
325 __entry->hold = atomic_read(&bp->b_hold);
326 __entry->pincount = atomic_read(&bp->b_pin_count);
327 __entry->lockval = bp->b_sema.count;
328 __entry->flags = bp->b_flags;
329 __entry->caller_ip = caller_ip;
330 ),
331 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
332 "lock %d flags %s caller %ps",
333 MAJOR(__entry->dev), MINOR(__entry->dev),
334 (unsigned long long)__entry->bno,
335 __entry->nblks,
336 __entry->hold,
337 __entry->pincount,
338 __entry->lockval,
339 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
340 (void *)__entry->caller_ip)
341)
342
343#define DEFINE_BUF_EVENT(name) \
344DEFINE_EVENT(xfs_buf_class, name, \
345 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
346 TP_ARGS(bp, caller_ip))
347DEFINE_BUF_EVENT(xfs_buf_init);
348DEFINE_BUF_EVENT(xfs_buf_free);
349DEFINE_BUF_EVENT(xfs_buf_hold);
350DEFINE_BUF_EVENT(xfs_buf_rele);
351DEFINE_BUF_EVENT(xfs_buf_iodone);
352DEFINE_BUF_EVENT(xfs_buf_submit);
353DEFINE_BUF_EVENT(xfs_buf_submit_wait);
354DEFINE_BUF_EVENT(xfs_buf_bawrite);
355DEFINE_BUF_EVENT(xfs_buf_lock);
356DEFINE_BUF_EVENT(xfs_buf_lock_done);
357DEFINE_BUF_EVENT(xfs_buf_trylock);
358DEFINE_BUF_EVENT(xfs_buf_unlock);
359DEFINE_BUF_EVENT(xfs_buf_iowait);
360DEFINE_BUF_EVENT(xfs_buf_iowait_done);
361DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
362DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
363DEFINE_BUF_EVENT(xfs_buf_delwri_split);
364DEFINE_BUF_EVENT(xfs_buf_get_uncached);
365DEFINE_BUF_EVENT(xfs_bdstrat_shut);
366DEFINE_BUF_EVENT(xfs_buf_item_relse);
367DEFINE_BUF_EVENT(xfs_buf_item_iodone);
368DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
369DEFINE_BUF_EVENT(xfs_buf_error_relse);
370DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
371DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
372DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
373
374/* not really buffer traces, but the buf provides useful information */
375DEFINE_BUF_EVENT(xfs_btree_corrupt);
376DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
377DEFINE_BUF_EVENT(xfs_reset_dqcounts);
378DEFINE_BUF_EVENT(xfs_inode_item_push);
379
380/* pass flags explicitly */
381DECLARE_EVENT_CLASS(xfs_buf_flags_class,
382 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
383 TP_ARGS(bp, flags, caller_ip),
384 TP_STRUCT__entry(
385 __field(dev_t, dev)
386 __field(xfs_daddr_t, bno)
387 __field(size_t, buffer_length)
388 __field(int, hold)
389 __field(int, pincount)
390 __field(unsigned, lockval)
391 __field(unsigned, flags)
392 __field(unsigned long, caller_ip)
393 ),
394 TP_fast_assign(
395 __entry->dev = bp->b_target->bt_dev;
396 __entry->bno = bp->b_bn;
397 __entry->buffer_length = BBTOB(bp->b_length);
398 __entry->flags = flags;
399 __entry->hold = atomic_read(&bp->b_hold);
400 __entry->pincount = atomic_read(&bp->b_pin_count);
401 __entry->lockval = bp->b_sema.count;
402 __entry->caller_ip = caller_ip;
403 ),
404 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
405 "lock %d flags %s caller %ps",
406 MAJOR(__entry->dev), MINOR(__entry->dev),
407 (unsigned long long)__entry->bno,
408 __entry->buffer_length,
409 __entry->hold,
410 __entry->pincount,
411 __entry->lockval,
412 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
413 (void *)__entry->caller_ip)
414)
415
416#define DEFINE_BUF_FLAGS_EVENT(name) \
417DEFINE_EVENT(xfs_buf_flags_class, name, \
418 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
419 TP_ARGS(bp, flags, caller_ip))
420DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
421DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
422DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
423
424TRACE_EVENT(xfs_buf_ioerror,
425 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
426 TP_ARGS(bp, error, caller_ip),
427 TP_STRUCT__entry(
428 __field(dev_t, dev)
429 __field(xfs_daddr_t, bno)
430 __field(size_t, buffer_length)
431 __field(unsigned, flags)
432 __field(int, hold)
433 __field(int, pincount)
434 __field(unsigned, lockval)
435 __field(int, error)
436 __field(unsigned long, caller_ip)
437 ),
438 TP_fast_assign(
439 __entry->dev = bp->b_target->bt_dev;
440 __entry->bno = bp->b_bn;
441 __entry->buffer_length = BBTOB(bp->b_length);
442 __entry->hold = atomic_read(&bp->b_hold);
443 __entry->pincount = atomic_read(&bp->b_pin_count);
444 __entry->lockval = bp->b_sema.count;
445 __entry->error = error;
446 __entry->flags = bp->b_flags;
447 __entry->caller_ip = caller_ip;
448 ),
449 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
450 "lock %d error %d flags %s caller %ps",
451 MAJOR(__entry->dev), MINOR(__entry->dev),
452 (unsigned long long)__entry->bno,
453 __entry->buffer_length,
454 __entry->hold,
455 __entry->pincount,
456 __entry->lockval,
457 __entry->error,
458 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
459 (void *)__entry->caller_ip)
460);
461
462DECLARE_EVENT_CLASS(xfs_buf_item_class,
463 TP_PROTO(struct xfs_buf_log_item *bip),
464 TP_ARGS(bip),
465 TP_STRUCT__entry(
466 __field(dev_t, dev)
467 __field(xfs_daddr_t, buf_bno)
468 __field(size_t, buf_len)
469 __field(int, buf_hold)
470 __field(int, buf_pincount)
471 __field(int, buf_lockval)
472 __field(unsigned, buf_flags)
473 __field(unsigned, bli_recur)
474 __field(int, bli_refcount)
475 __field(unsigned, bli_flags)
476 __field(void *, li_desc)
477 __field(unsigned, li_flags)
478 ),
479 TP_fast_assign(
480 __entry->dev = bip->bli_buf->b_target->bt_dev;
481 __entry->bli_flags = bip->bli_flags;
482 __entry->bli_recur = bip->bli_recur;
483 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
484 __entry->buf_bno = bip->bli_buf->b_bn;
485 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
486 __entry->buf_flags = bip->bli_buf->b_flags;
487 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
488 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
489 __entry->buf_lockval = bip->bli_buf->b_sema.count;
490 __entry->li_desc = bip->bli_item.li_desc;
491 __entry->li_flags = bip->bli_item.li_flags;
492 ),
493 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
494 "lock %d flags %s recur %d refcount %d bliflags %s "
495 "lidesc 0x%p liflags %s",
496 MAJOR(__entry->dev), MINOR(__entry->dev),
497 (unsigned long long)__entry->buf_bno,
498 __entry->buf_len,
499 __entry->buf_hold,
500 __entry->buf_pincount,
501 __entry->buf_lockval,
502 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
503 __entry->bli_recur,
504 __entry->bli_refcount,
505 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
506 __entry->li_desc,
507 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
508)
509
510#define DEFINE_BUF_ITEM_EVENT(name) \
511DEFINE_EVENT(xfs_buf_item_class, name, \
512 TP_PROTO(struct xfs_buf_log_item *bip), \
513 TP_ARGS(bip))
514DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
515DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
516DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
517DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
518DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
519DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
520DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
521DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
522DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
523DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
524DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
525DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
526DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
527DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
528DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
529DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
530DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
531DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
532DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
533DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
534DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
535DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
536DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
537DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
538DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
539DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
540DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
541
542DECLARE_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)
550 ),
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);
556 ),
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)
562)
563#define DEFINE_FILESTREAM_EVENT(name) \
564DEFINE_EVENT(xfs_filestream_class, name, \
565 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
566 TP_ARGS(ip, agno))
567DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
568DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
569DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
570
571TRACE_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)
582 ),
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;
590 ),
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)
598);
599
600DECLARE_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)
609 ),
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;
615 ),
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)
621)
622
623#define DEFINE_LOCK_EVENT(name) \
624DEFINE_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))
628DEFINE_LOCK_EVENT(xfs_ilock);
629DEFINE_LOCK_EVENT(xfs_ilock_nowait);
630DEFINE_LOCK_EVENT(xfs_ilock_demote);
631DEFINE_LOCK_EVENT(xfs_iunlock);
632
633DECLARE_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)
639 ),
640 TP_fast_assign(
641 __entry->dev = VFS_I(ip)->i_sb->s_dev;
642 __entry->ino = ip->i_ino;
643 ),
644 TP_printk("dev %d:%d ino 0x%llx",
645 MAJOR(__entry->dev), MINOR(__entry->dev),
646 __entry->ino)
647)
648
649#define DEFINE_INODE_EVENT(name) \
650DEFINE_EVENT(xfs_inode_class, name, \
651 TP_PROTO(struct xfs_inode *ip), \
652 TP_ARGS(ip))
653DEFINE_INODE_EVENT(xfs_iget_skip);
654DEFINE_INODE_EVENT(xfs_iget_reclaim);
655DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
656DEFINE_INODE_EVENT(xfs_iget_hit);
657DEFINE_INODE_EVENT(xfs_iget_miss);
658
659DEFINE_INODE_EVENT(xfs_getattr);
660DEFINE_INODE_EVENT(xfs_setattr);
661DEFINE_INODE_EVENT(xfs_readlink);
662DEFINE_INODE_EVENT(xfs_inactive_symlink);
663DEFINE_INODE_EVENT(xfs_alloc_file_space);
664DEFINE_INODE_EVENT(xfs_free_file_space);
665DEFINE_INODE_EVENT(xfs_zero_file_space);
666DEFINE_INODE_EVENT(xfs_collapse_file_space);
667DEFINE_INODE_EVENT(xfs_insert_file_space);
668DEFINE_INODE_EVENT(xfs_readdir);
669#ifdef CONFIG_XFS_POSIX_ACL
670DEFINE_INODE_EVENT(xfs_get_acl);
671#endif
672DEFINE_INODE_EVENT(xfs_vm_bmap);
673DEFINE_INODE_EVENT(xfs_file_ioctl);
674DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
675DEFINE_INODE_EVENT(xfs_ioctl_setattr);
676DEFINE_INODE_EVENT(xfs_dir_fsync);
677DEFINE_INODE_EVENT(xfs_file_fsync);
678DEFINE_INODE_EVENT(xfs_destroy_inode);
679DEFINE_INODE_EVENT(xfs_evict_inode);
680DEFINE_INODE_EVENT(xfs_update_time);
681
682DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
683DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
684
685DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
686DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
687DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
688
689DEFINE_INODE_EVENT(xfs_filemap_fault);
690DEFINE_INODE_EVENT(xfs_filemap_pmd_fault);
691DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
692DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
693
694DECLARE_EVENT_CLASS(xfs_iref_class,
695 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
696 TP_ARGS(ip, caller_ip),
697 TP_STRUCT__entry(
698 __field(dev_t, dev)
699 __field(xfs_ino_t, ino)
700 __field(int, count)
701 __field(int, pincount)
702 __field(unsigned long, caller_ip)
703 ),
704 TP_fast_assign(
705 __entry->dev = VFS_I(ip)->i_sb->s_dev;
706 __entry->ino = ip->i_ino;
707 __entry->count = atomic_read(&VFS_I(ip)->i_count);
708 __entry->pincount = atomic_read(&ip->i_pincount);
709 __entry->caller_ip = caller_ip;
710 ),
711 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
712 MAJOR(__entry->dev), MINOR(__entry->dev),
713 __entry->ino,
714 __entry->count,
715 __entry->pincount,
716 (char *)__entry->caller_ip)
717)
718
719TRACE_EVENT(xfs_iomap_prealloc_size,
720 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
721 unsigned int writeio_blocks),
722 TP_ARGS(ip, blocks, shift, writeio_blocks),
723 TP_STRUCT__entry(
724 __field(dev_t, dev)
725 __field(xfs_ino_t, ino)
726 __field(xfs_fsblock_t, blocks)
727 __field(int, shift)
728 __field(unsigned int, writeio_blocks)
729 ),
730 TP_fast_assign(
731 __entry->dev = VFS_I(ip)->i_sb->s_dev;
732 __entry->ino = ip->i_ino;
733 __entry->blocks = blocks;
734 __entry->shift = shift;
735 __entry->writeio_blocks = writeio_blocks;
736 ),
737 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
738 "m_writeio_blocks %u",
739 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
740 __entry->blocks, __entry->shift, __entry->writeio_blocks)
741)
742
743TRACE_EVENT(xfs_irec_merge_pre,
744 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
745 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
746 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
747 TP_STRUCT__entry(
748 __field(dev_t, dev)
749 __field(xfs_agnumber_t, agno)
750 __field(xfs_agino_t, agino)
751 __field(uint16_t, holemask)
752 __field(xfs_agino_t, nagino)
753 __field(uint16_t, nholemask)
754 ),
755 TP_fast_assign(
756 __entry->dev = mp->m_super->s_dev;
757 __entry->agno = agno;
758 __entry->agino = agino;
759 __entry->holemask = holemask;
760 __entry->nagino = nagino;
761 __entry->nholemask = holemask;
762 ),
763 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
764 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
765 __entry->agino, __entry->holemask, __entry->nagino,
766 __entry->nholemask)
767)
768
769TRACE_EVENT(xfs_irec_merge_post,
770 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
771 uint16_t holemask),
772 TP_ARGS(mp, agno, agino, holemask),
773 TP_STRUCT__entry(
774 __field(dev_t, dev)
775 __field(xfs_agnumber_t, agno)
776 __field(xfs_agino_t, agino)
777 __field(uint16_t, holemask)
778 ),
779 TP_fast_assign(
780 __entry->dev = mp->m_super->s_dev;
781 __entry->agno = agno;
782 __entry->agino = agino;
783 __entry->holemask = holemask;
784 ),
785 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
786 MINOR(__entry->dev), __entry->agno, __entry->agino,
787 __entry->holemask)
788)
789
790#define DEFINE_IREF_EVENT(name) \
791DEFINE_EVENT(xfs_iref_class, name, \
792 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
793 TP_ARGS(ip, caller_ip))
794DEFINE_IREF_EVENT(xfs_ihold);
795DEFINE_IREF_EVENT(xfs_irele);
796DEFINE_IREF_EVENT(xfs_inode_pin);
797DEFINE_IREF_EVENT(xfs_inode_unpin);
798DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
799
800DECLARE_EVENT_CLASS(xfs_namespace_class,
801 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
802 TP_ARGS(dp, name),
803 TP_STRUCT__entry(
804 __field(dev_t, dev)
805 __field(xfs_ino_t, dp_ino)
806 __field(int, namelen)
807 __dynamic_array(char, name, name->len)
808 ),
809 TP_fast_assign(
810 __entry->dev = VFS_I(dp)->i_sb->s_dev;
811 __entry->dp_ino = dp->i_ino;
812 __entry->namelen = name->len;
813 memcpy(__get_str(name), name->name, name->len);
814 ),
815 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
816 MAJOR(__entry->dev), MINOR(__entry->dev),
817 __entry->dp_ino,
818 __entry->namelen,
819 __get_str(name))
820)
821
822#define DEFINE_NAMESPACE_EVENT(name) \
823DEFINE_EVENT(xfs_namespace_class, name, \
824 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
825 TP_ARGS(dp, name))
826DEFINE_NAMESPACE_EVENT(xfs_remove);
827DEFINE_NAMESPACE_EVENT(xfs_link);
828DEFINE_NAMESPACE_EVENT(xfs_lookup);
829DEFINE_NAMESPACE_EVENT(xfs_create);
830DEFINE_NAMESPACE_EVENT(xfs_symlink);
831
832TRACE_EVENT(xfs_rename,
833 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
834 struct xfs_name *src_name, struct xfs_name *target_name),
835 TP_ARGS(src_dp, target_dp, src_name, target_name),
836 TP_STRUCT__entry(
837 __field(dev_t, dev)
838 __field(xfs_ino_t, src_dp_ino)
839 __field(xfs_ino_t, target_dp_ino)
840 __field(int, src_namelen)
841 __field(int, target_namelen)
842 __dynamic_array(char, src_name, src_name->len)
843 __dynamic_array(char, target_name, target_name->len)
844 ),
845 TP_fast_assign(
846 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
847 __entry->src_dp_ino = src_dp->i_ino;
848 __entry->target_dp_ino = target_dp->i_ino;
849 __entry->src_namelen = src_name->len;
850 __entry->target_namelen = target_name->len;
851 memcpy(__get_str(src_name), src_name->name, src_name->len);
852 memcpy(__get_str(target_name), target_name->name,
853 target_name->len);
854 ),
855 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
856 " src name %.*s target name %.*s",
857 MAJOR(__entry->dev), MINOR(__entry->dev),
858 __entry->src_dp_ino,
859 __entry->target_dp_ino,
860 __entry->src_namelen,
861 __get_str(src_name),
862 __entry->target_namelen,
863 __get_str(target_name))
864)
865
866DECLARE_EVENT_CLASS(xfs_dquot_class,
867 TP_PROTO(struct xfs_dquot *dqp),
868 TP_ARGS(dqp),
869 TP_STRUCT__entry(
870 __field(dev_t, dev)
871 __field(u32, id)
872 __field(unsigned, flags)
873 __field(unsigned, nrefs)
874 __field(unsigned long long, res_bcount)
875 __field(unsigned long long, bcount)
876 __field(unsigned long long, icount)
877 __field(unsigned long long, blk_hardlimit)
878 __field(unsigned long long, blk_softlimit)
879 __field(unsigned long long, ino_hardlimit)
880 __field(unsigned long long, ino_softlimit)
881 ), \
882 TP_fast_assign(
883 __entry->dev = dqp->q_mount->m_super->s_dev;
884 __entry->id = be32_to_cpu(dqp->q_core.d_id);
885 __entry->flags = dqp->dq_flags;
886 __entry->nrefs = dqp->q_nrefs;
887 __entry->res_bcount = dqp->q_res_bcount;
888 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
889 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
890 __entry->blk_hardlimit =
891 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
892 __entry->blk_softlimit =
893 be64_to_cpu(dqp->q_core.d_blk_softlimit);
894 __entry->ino_hardlimit =
895 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
896 __entry->ino_softlimit =
897 be64_to_cpu(dqp->q_core.d_ino_softlimit);
898 ),
899 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
900 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
901 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
902 MAJOR(__entry->dev), MINOR(__entry->dev),
903 __entry->id,
904 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
905 __entry->nrefs,
906 __entry->res_bcount,
907 __entry->bcount,
908 __entry->blk_hardlimit,
909 __entry->blk_softlimit,
910 __entry->icount,
911 __entry->ino_hardlimit,
912 __entry->ino_softlimit)
913)
914
915#define DEFINE_DQUOT_EVENT(name) \
916DEFINE_EVENT(xfs_dquot_class, name, \
917 TP_PROTO(struct xfs_dquot *dqp), \
918 TP_ARGS(dqp))
919DEFINE_DQUOT_EVENT(xfs_dqadjust);
920DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
921DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
922DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
923DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
924DEFINE_DQUOT_EVENT(xfs_dqattach_found);
925DEFINE_DQUOT_EVENT(xfs_dqattach_get);
926DEFINE_DQUOT_EVENT(xfs_dqalloc);
927DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
928DEFINE_DQUOT_EVENT(xfs_dqread);
929DEFINE_DQUOT_EVENT(xfs_dqread_fail);
930DEFINE_DQUOT_EVENT(xfs_dqget_hit);
931DEFINE_DQUOT_EVENT(xfs_dqget_miss);
932DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
933DEFINE_DQUOT_EVENT(xfs_dqget_dup);
934DEFINE_DQUOT_EVENT(xfs_dqput);
935DEFINE_DQUOT_EVENT(xfs_dqput_wait);
936DEFINE_DQUOT_EVENT(xfs_dqput_free);
937DEFINE_DQUOT_EVENT(xfs_dqrele);
938DEFINE_DQUOT_EVENT(xfs_dqflush);
939DEFINE_DQUOT_EVENT(xfs_dqflush_force);
940DEFINE_DQUOT_EVENT(xfs_dqflush_done);
941
942DECLARE_EVENT_CLASS(xfs_loggrant_class,
943 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
944 TP_ARGS(log, tic),
945 TP_STRUCT__entry(
946 __field(dev_t, dev)
947 __field(unsigned, trans_type)
948 __field(char, ocnt)
949 __field(char, cnt)
950 __field(int, curr_res)
951 __field(int, unit_res)
952 __field(unsigned int, flags)
953 __field(int, reserveq)
954 __field(int, writeq)
955 __field(int, grant_reserve_cycle)
956 __field(int, grant_reserve_bytes)
957 __field(int, grant_write_cycle)
958 __field(int, grant_write_bytes)
959 __field(int, curr_cycle)
960 __field(int, curr_block)
961 __field(xfs_lsn_t, tail_lsn)
962 ),
963 TP_fast_assign(
964 __entry->dev = log->l_mp->m_super->s_dev;
965 __entry->trans_type = tic->t_trans_type;
966 __entry->ocnt = tic->t_ocnt;
967 __entry->cnt = tic->t_cnt;
968 __entry->curr_res = tic->t_curr_res;
969 __entry->unit_res = tic->t_unit_res;
970 __entry->flags = tic->t_flags;
971 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
972 __entry->writeq = list_empty(&log->l_write_head.waiters);
973 xlog_crack_grant_head(&log->l_reserve_head.grant,
974 &__entry->grant_reserve_cycle,
975 &__entry->grant_reserve_bytes);
976 xlog_crack_grant_head(&log->l_write_head.grant,
977 &__entry->grant_write_cycle,
978 &__entry->grant_write_bytes);
979 __entry->curr_cycle = log->l_curr_cycle;
980 __entry->curr_block = log->l_curr_block;
981 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
982 ),
983 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
984 "t_unit_res %u t_flags %s reserveq %s "
985 "writeq %s grant_reserve_cycle %d "
986 "grant_reserve_bytes %d grant_write_cycle %d "
987 "grant_write_bytes %d curr_cycle %d curr_block %d "
988 "tail_cycle %d tail_block %d",
989 MAJOR(__entry->dev), MINOR(__entry->dev),
990 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
991 __entry->ocnt,
992 __entry->cnt,
993 __entry->curr_res,
994 __entry->unit_res,
995 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
996 __entry->reserveq ? "empty" : "active",
997 __entry->writeq ? "empty" : "active",
998 __entry->grant_reserve_cycle,
999 __entry->grant_reserve_bytes,
1000 __entry->grant_write_cycle,
1001 __entry->grant_write_bytes,
1002 __entry->curr_cycle,
1003 __entry->curr_block,
1004 CYCLE_LSN(__entry->tail_lsn),
1005 BLOCK_LSN(__entry->tail_lsn)
1006 )
1007)
1008
1009#define DEFINE_LOGGRANT_EVENT(name) \
1010DEFINE_EVENT(xfs_loggrant_class, name, \
1011 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
1012 TP_ARGS(log, tic))
1013DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1014DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
1015DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
1016DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1017DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
1018DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
1019DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1020DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1021DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1022DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
1023DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1024DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1025DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1026DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1027DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1028DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1029
1030DECLARE_EVENT_CLASS(xfs_log_item_class,
1031 TP_PROTO(struct xfs_log_item *lip),
1032 TP_ARGS(lip),
1033 TP_STRUCT__entry(
1034 __field(dev_t, dev)
1035 __field(void *, lip)
1036 __field(uint, type)
1037 __field(uint, flags)
1038 __field(xfs_lsn_t, lsn)
1039 ),
1040 TP_fast_assign(
1041 __entry->dev = lip->li_mountp->m_super->s_dev;
1042 __entry->lip = lip;
1043 __entry->type = lip->li_type;
1044 __entry->flags = lip->li_flags;
1045 __entry->lsn = lip->li_lsn;
1046 ),
1047 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1048 MAJOR(__entry->dev), MINOR(__entry->dev),
1049 __entry->lip,
1050 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1051 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1052 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1053)
1054
1055TRACE_EVENT(xfs_log_force,
1056 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn),
1057 TP_ARGS(mp, lsn),
1058 TP_STRUCT__entry(
1059 __field(dev_t, dev)
1060 __field(xfs_lsn_t, lsn)
1061 ),
1062 TP_fast_assign(
1063 __entry->dev = mp->m_super->s_dev;
1064 __entry->lsn = lsn;
1065 ),
1066 TP_printk("dev %d:%d lsn 0x%llx",
1067 MAJOR(__entry->dev), MINOR(__entry->dev),
1068 __entry->lsn)
1069)
1070
1071#define DEFINE_LOG_ITEM_EVENT(name) \
1072DEFINE_EVENT(xfs_log_item_class, name, \
1073 TP_PROTO(struct xfs_log_item *lip), \
1074 TP_ARGS(lip))
1075DEFINE_LOG_ITEM_EVENT(xfs_ail_push);
1076DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1077DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
1078DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
1079
1080DECLARE_EVENT_CLASS(xfs_ail_class,
1081 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn),
1082 TP_ARGS(lip, old_lsn, new_lsn),
1083 TP_STRUCT__entry(
1084 __field(dev_t, dev)
1085 __field(void *, lip)
1086 __field(uint, type)
1087 __field(uint, flags)
1088 __field(xfs_lsn_t, old_lsn)
1089 __field(xfs_lsn_t, new_lsn)
1090 ),
1091 TP_fast_assign(
1092 __entry->dev = lip->li_mountp->m_super->s_dev;
1093 __entry->lip = lip;
1094 __entry->type = lip->li_type;
1095 __entry->flags = lip->li_flags;
1096 __entry->old_lsn = old_lsn;
1097 __entry->new_lsn = new_lsn;
1098 ),
1099 TP_printk("dev %d:%d lip 0x%p old lsn %d/%d new lsn %d/%d type %s flags %s",
1100 MAJOR(__entry->dev), MINOR(__entry->dev),
1101 __entry->lip,
1102 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1103 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1104 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1105 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1106)
1107
1108#define DEFINE_AIL_EVENT(name) \
1109DEFINE_EVENT(xfs_ail_class, name, \
1110 TP_PROTO(struct xfs_log_item *lip, xfs_lsn_t old_lsn, xfs_lsn_t new_lsn), \
1111 TP_ARGS(lip, old_lsn, new_lsn))
1112DEFINE_AIL_EVENT(xfs_ail_insert);
1113DEFINE_AIL_EVENT(xfs_ail_move);
1114DEFINE_AIL_EVENT(xfs_ail_delete);
1115
1116TRACE_EVENT(xfs_log_assign_tail_lsn,
1117 TP_PROTO(struct xlog *log, xfs_lsn_t new_lsn),
1118 TP_ARGS(log, new_lsn),
1119 TP_STRUCT__entry(
1120 __field(dev_t, dev)
1121 __field(xfs_lsn_t, new_lsn)
1122 __field(xfs_lsn_t, old_lsn)
1123 __field(xfs_lsn_t, last_sync_lsn)
1124 ),
1125 TP_fast_assign(
1126 __entry->dev = log->l_mp->m_super->s_dev;
1127 __entry->new_lsn = new_lsn;
1128 __entry->old_lsn = atomic64_read(&log->l_tail_lsn);
1129 __entry->last_sync_lsn = atomic64_read(&log->l_last_sync_lsn);
1130 ),
1131 TP_printk("dev %d:%d new tail lsn %d/%d, old lsn %d/%d, last sync %d/%d",
1132 MAJOR(__entry->dev), MINOR(__entry->dev),
1133 CYCLE_LSN(__entry->new_lsn), BLOCK_LSN(__entry->new_lsn),
1134 CYCLE_LSN(__entry->old_lsn), BLOCK_LSN(__entry->old_lsn),
1135 CYCLE_LSN(__entry->last_sync_lsn), BLOCK_LSN(__entry->last_sync_lsn))
1136)
1137
1138DECLARE_EVENT_CLASS(xfs_file_class,
1139 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
1140 TP_ARGS(ip, count, offset, flags),
1141 TP_STRUCT__entry(
1142 __field(dev_t, dev)
1143 __field(xfs_ino_t, ino)
1144 __field(xfs_fsize_t, size)
1145 __field(loff_t, offset)
1146 __field(size_t, count)
1147 __field(int, flags)
1148 ),
1149 TP_fast_assign(
1150 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1151 __entry->ino = ip->i_ino;
1152 __entry->size = ip->i_d.di_size;
1153 __entry->offset = offset;
1154 __entry->count = count;
1155 __entry->flags = flags;
1156 ),
1157 TP_printk("dev %d:%d ino 0x%llx size 0x%llx "
1158 "offset 0x%llx count 0x%zx ioflags %s",
1159 MAJOR(__entry->dev), MINOR(__entry->dev),
1160 __entry->ino,
1161 __entry->size,
1162 __entry->offset,
1163 __entry->count,
1164 __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
1165)
1166
1167#define DEFINE_RW_EVENT(name) \
1168DEFINE_EVENT(xfs_file_class, name, \
1169 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
1170 TP_ARGS(ip, count, offset, flags))
1171DEFINE_RW_EVENT(xfs_file_read);
1172DEFINE_RW_EVENT(xfs_file_buffered_write);
1173DEFINE_RW_EVENT(xfs_file_direct_write);
1174DEFINE_RW_EVENT(xfs_file_splice_read);
1175
1176DECLARE_EVENT_CLASS(xfs_page_class,
1177 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1178 unsigned int len),
1179 TP_ARGS(inode, page, off, len),
1180 TP_STRUCT__entry(
1181 __field(dev_t, dev)
1182 __field(xfs_ino_t, ino)
1183 __field(pgoff_t, pgoff)
1184 __field(loff_t, size)
1185 __field(unsigned long, offset)
1186 __field(unsigned int, length)
1187 __field(int, delalloc)
1188 __field(int, unwritten)
1189 ),
1190 TP_fast_assign(
1191 int delalloc = -1, unwritten = -1;
1192
1193 if (page_has_buffers(page))
1194 xfs_count_page_state(page, &delalloc, &unwritten);
1195 __entry->dev = inode->i_sb->s_dev;
1196 __entry->ino = XFS_I(inode)->i_ino;
1197 __entry->pgoff = page_offset(page);
1198 __entry->size = i_size_read(inode);
1199 __entry->offset = off;
1200 __entry->length = len;
1201 __entry->delalloc = delalloc;
1202 __entry->unwritten = unwritten;
1203 ),
1204 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
1205 "length %x delalloc %d unwritten %d",
1206 MAJOR(__entry->dev), MINOR(__entry->dev),
1207 __entry->ino,
1208 __entry->pgoff,
1209 __entry->size,
1210 __entry->offset,
1211 __entry->length,
1212 __entry->delalloc,
1213 __entry->unwritten)
1214)
1215
1216#define DEFINE_PAGE_EVENT(name) \
1217DEFINE_EVENT(xfs_page_class, name, \
1218 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1219 unsigned int len), \
1220 TP_ARGS(inode, page, off, len))
1221DEFINE_PAGE_EVENT(xfs_writepage);
1222DEFINE_PAGE_EVENT(xfs_releasepage);
1223DEFINE_PAGE_EVENT(xfs_invalidatepage);
1224
1225DECLARE_EVENT_CLASS(xfs_readpage_class,
1226 TP_PROTO(struct inode *inode, int nr_pages),
1227 TP_ARGS(inode, nr_pages),
1228 TP_STRUCT__entry(
1229 __field(dev_t, dev)
1230 __field(xfs_ino_t, ino)
1231 __field(int, nr_pages)
1232 ),
1233 TP_fast_assign(
1234 __entry->dev = inode->i_sb->s_dev;
1235 __entry->ino = inode->i_ino;
1236 __entry->nr_pages = nr_pages;
1237 ),
1238 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1239 MAJOR(__entry->dev), MINOR(__entry->dev),
1240 __entry->ino,
1241 __entry->nr_pages)
1242)
1243
1244#define DEFINE_READPAGE_EVENT(name) \
1245DEFINE_EVENT(xfs_readpage_class, name, \
1246 TP_PROTO(struct inode *inode, int nr_pages), \
1247 TP_ARGS(inode, nr_pages))
1248DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1249DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1250
1251DECLARE_EVENT_CLASS(xfs_imap_class,
1252 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
1253 int type, struct xfs_bmbt_irec *irec),
1254 TP_ARGS(ip, offset, count, type, irec),
1255 TP_STRUCT__entry(
1256 __field(dev_t, dev)
1257 __field(xfs_ino_t, ino)
1258 __field(loff_t, size)
1259 __field(loff_t, offset)
1260 __field(size_t, count)
1261 __field(int, type)
1262 __field(xfs_fileoff_t, startoff)
1263 __field(xfs_fsblock_t, startblock)
1264 __field(xfs_filblks_t, blockcount)
1265 ),
1266 TP_fast_assign(
1267 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1268 __entry->ino = ip->i_ino;
1269 __entry->size = ip->i_d.di_size;
1270 __entry->offset = offset;
1271 __entry->count = count;
1272 __entry->type = type;
1273 __entry->startoff = irec ? irec->br_startoff : 0;
1274 __entry->startblock = irec ? irec->br_startblock : 0;
1275 __entry->blockcount = irec ? irec->br_blockcount : 0;
1276 ),
1277 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1278 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
1279 MAJOR(__entry->dev), MINOR(__entry->dev),
1280 __entry->ino,
1281 __entry->size,
1282 __entry->offset,
1283 __entry->count,
1284 __print_symbolic(__entry->type, XFS_IO_TYPES),
1285 __entry->startoff,
1286 (__int64_t)__entry->startblock,
1287 __entry->blockcount)
1288)
1289
1290#define DEFINE_IOMAP_EVENT(name) \
1291DEFINE_EVENT(xfs_imap_class, name, \
1292 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
1293 int type, struct xfs_bmbt_irec *irec), \
1294 TP_ARGS(ip, offset, count, type, irec))
1295DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1296DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1297DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1298DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
1299DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
1300
1301DECLARE_EVENT_CLASS(xfs_simple_io_class,
1302 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
1303 TP_ARGS(ip, offset, count),
1304 TP_STRUCT__entry(
1305 __field(dev_t, dev)
1306 __field(xfs_ino_t, ino)
1307 __field(loff_t, isize)
1308 __field(loff_t, disize)
1309 __field(loff_t, offset)
1310 __field(size_t, count)
1311 ),
1312 TP_fast_assign(
1313 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1314 __entry->ino = ip->i_ino;
1315 __entry->isize = VFS_I(ip)->i_size;
1316 __entry->disize = ip->i_d.di_size;
1317 __entry->offset = offset;
1318 __entry->count = count;
1319 ),
1320 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
1321 "offset 0x%llx count %zd",
1322 MAJOR(__entry->dev), MINOR(__entry->dev),
1323 __entry->ino,
1324 __entry->isize,
1325 __entry->disize,
1326 __entry->offset,
1327 __entry->count)
1328);
1329
1330#define DEFINE_SIMPLE_IO_EVENT(name) \
1331DEFINE_EVENT(xfs_simple_io_class, name, \
1332 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
1333 TP_ARGS(ip, offset, count))
1334DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1335DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
1336DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
1337DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
1338DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
1339DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write);
1340DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_unwritten);
1341DEFINE_SIMPLE_IO_EVENT(xfs_end_io_direct_write_append);
1342
1343DECLARE_EVENT_CLASS(xfs_itrunc_class,
1344 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
1345 TP_ARGS(ip, new_size),
1346 TP_STRUCT__entry(
1347 __field(dev_t, dev)
1348 __field(xfs_ino_t, ino)
1349 __field(xfs_fsize_t, size)
1350 __field(xfs_fsize_t, new_size)
1351 ),
1352 TP_fast_assign(
1353 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1354 __entry->ino = ip->i_ino;
1355 __entry->size = ip->i_d.di_size;
1356 __entry->new_size = new_size;
1357 ),
1358 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1359 MAJOR(__entry->dev), MINOR(__entry->dev),
1360 __entry->ino,
1361 __entry->size,
1362 __entry->new_size)
1363)
1364
1365#define DEFINE_ITRUNC_EVENT(name) \
1366DEFINE_EVENT(xfs_itrunc_class, name, \
1367 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1368 TP_ARGS(ip, new_size))
1369DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1370DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
1371
1372TRACE_EVENT(xfs_pagecache_inval,
1373 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1374 TP_ARGS(ip, start, finish),
1375 TP_STRUCT__entry(
1376 __field(dev_t, dev)
1377 __field(xfs_ino_t, ino)
1378 __field(xfs_fsize_t, size)
1379 __field(xfs_off_t, start)
1380 __field(xfs_off_t, finish)
1381 ),
1382 TP_fast_assign(
1383 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1384 __entry->ino = ip->i_ino;
1385 __entry->size = ip->i_d.di_size;
1386 __entry->start = start;
1387 __entry->finish = finish;
1388 ),
1389 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1390 MAJOR(__entry->dev), MINOR(__entry->dev),
1391 __entry->ino,
1392 __entry->size,
1393 __entry->start,
1394 __entry->finish)
1395);
1396
1397TRACE_EVENT(xfs_bunmap,
1398 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1399 int flags, unsigned long caller_ip),
1400 TP_ARGS(ip, bno, len, flags, caller_ip),
1401 TP_STRUCT__entry(
1402 __field(dev_t, dev)
1403 __field(xfs_ino_t, ino)
1404 __field(xfs_fsize_t, size)
1405 __field(xfs_fileoff_t, bno)
1406 __field(xfs_filblks_t, len)
1407 __field(unsigned long, caller_ip)
1408 __field(int, flags)
1409 ),
1410 TP_fast_assign(
1411 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1412 __entry->ino = ip->i_ino;
1413 __entry->size = ip->i_d.di_size;
1414 __entry->bno = bno;
1415 __entry->len = len;
1416 __entry->caller_ip = caller_ip;
1417 __entry->flags = flags;
1418 ),
1419 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1420 "flags %s caller %ps",
1421 MAJOR(__entry->dev), MINOR(__entry->dev),
1422 __entry->ino,
1423 __entry->size,
1424 __entry->bno,
1425 __entry->len,
1426 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1427 (void *)__entry->caller_ip)
1428
1429);
1430
1431DECLARE_EVENT_CLASS(xfs_extent_busy_class,
1432 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1433 xfs_agblock_t agbno, xfs_extlen_t len),
1434 TP_ARGS(mp, agno, agbno, len),
1435 TP_STRUCT__entry(
1436 __field(dev_t, dev)
1437 __field(xfs_agnumber_t, agno)
1438 __field(xfs_agblock_t, agbno)
1439 __field(xfs_extlen_t, len)
1440 ),
1441 TP_fast_assign(
1442 __entry->dev = mp->m_super->s_dev;
1443 __entry->agno = agno;
1444 __entry->agbno = agbno;
1445 __entry->len = len;
1446 ),
1447 TP_printk("dev %d:%d agno %u agbno %u len %u",
1448 MAJOR(__entry->dev), MINOR(__entry->dev),
1449 __entry->agno,
1450 __entry->agbno,
1451 __entry->len)
1452);
1453#define DEFINE_BUSY_EVENT(name) \
1454DEFINE_EVENT(xfs_extent_busy_class, name, \
1455 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
1456 xfs_agblock_t agbno, xfs_extlen_t len), \
1457 TP_ARGS(mp, agno, agbno, len))
1458DEFINE_BUSY_EVENT(xfs_extent_busy);
1459DEFINE_BUSY_EVENT(xfs_extent_busy_enomem);
1460DEFINE_BUSY_EVENT(xfs_extent_busy_force);
1461DEFINE_BUSY_EVENT(xfs_extent_busy_reuse);
1462DEFINE_BUSY_EVENT(xfs_extent_busy_clear);
1463
1464TRACE_EVENT(xfs_extent_busy_trim,
1465 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1466 xfs_agblock_t agbno, xfs_extlen_t len,
1467 xfs_agblock_t tbno, xfs_extlen_t tlen),
1468 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1469 TP_STRUCT__entry(
1470 __field(dev_t, dev)
1471 __field(xfs_agnumber_t, agno)
1472 __field(xfs_agblock_t, agbno)
1473 __field(xfs_extlen_t, len)
1474 __field(xfs_agblock_t, tbno)
1475 __field(xfs_extlen_t, tlen)
1476 ),
1477 TP_fast_assign(
1478 __entry->dev = mp->m_super->s_dev;
1479 __entry->agno = agno;
1480 __entry->agbno = agbno;
1481 __entry->len = len;
1482 __entry->tbno = tbno;
1483 __entry->tlen = tlen;
1484 ),
1485 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1486 MAJOR(__entry->dev), MINOR(__entry->dev),
1487 __entry->agno,
1488 __entry->agbno,
1489 __entry->len,
1490 __entry->tbno,
1491 __entry->tlen)
1492);
1493
1494TRACE_EVENT(xfs_trans_commit_lsn,
1495 TP_PROTO(struct xfs_trans *trans),
1496 TP_ARGS(trans),
1497 TP_STRUCT__entry(
1498 __field(dev_t, dev)
1499 __field(struct xfs_trans *, tp)
1500 __field(xfs_lsn_t, lsn)
1501 ),
1502 TP_fast_assign(
1503 __entry->dev = trans->t_mountp->m_super->s_dev;
1504 __entry->tp = trans;
1505 __entry->lsn = trans->t_commit_lsn;
1506 ),
1507 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1508 MAJOR(__entry->dev), MINOR(__entry->dev),
1509 __entry->tp,
1510 __entry->lsn)
1511);
1512
1513TRACE_EVENT(xfs_agf,
1514 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1515 unsigned long caller_ip),
1516 TP_ARGS(mp, agf, flags, caller_ip),
1517 TP_STRUCT__entry(
1518 __field(dev_t, dev)
1519 __field(xfs_agnumber_t, agno)
1520 __field(int, flags)
1521 __field(__u32, length)
1522 __field(__u32, bno_root)
1523 __field(__u32, cnt_root)
1524 __field(__u32, bno_level)
1525 __field(__u32, cnt_level)
1526 __field(__u32, flfirst)
1527 __field(__u32, fllast)
1528 __field(__u32, flcount)
1529 __field(__u32, freeblks)
1530 __field(__u32, longest)
1531 __field(unsigned long, caller_ip)
1532 ),
1533 TP_fast_assign(
1534 __entry->dev = mp->m_super->s_dev;
1535 __entry->agno = be32_to_cpu(agf->agf_seqno),
1536 __entry->flags = flags;
1537 __entry->length = be32_to_cpu(agf->agf_length),
1538 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1539 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1540 __entry->bno_level =
1541 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1542 __entry->cnt_level =
1543 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1544 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1545 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1546 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1547 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1548 __entry->longest = be32_to_cpu(agf->agf_longest);
1549 __entry->caller_ip = caller_ip;
1550 ),
1551 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1552 "levels b %u c %u flfirst %u fllast %u flcount %u "
1553 "freeblks %u longest %u caller %ps",
1554 MAJOR(__entry->dev), MINOR(__entry->dev),
1555 __entry->agno,
1556 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1557 __entry->length,
1558 __entry->bno_root,
1559 __entry->cnt_root,
1560 __entry->bno_level,
1561 __entry->cnt_level,
1562 __entry->flfirst,
1563 __entry->fllast,
1564 __entry->flcount,
1565 __entry->freeblks,
1566 __entry->longest,
1567 (void *)__entry->caller_ip)
1568);
1569
1570TRACE_EVENT(xfs_free_extent,
1571 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1572 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1573 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1574 TP_STRUCT__entry(
1575 __field(dev_t, dev)
1576 __field(xfs_agnumber_t, agno)
1577 __field(xfs_agblock_t, agbno)
1578 __field(xfs_extlen_t, len)
1579 __field(int, isfl)
1580 __field(int, haveleft)
1581 __field(int, haveright)
1582 ),
1583 TP_fast_assign(
1584 __entry->dev = mp->m_super->s_dev;
1585 __entry->agno = agno;
1586 __entry->agbno = agbno;
1587 __entry->len = len;
1588 __entry->isfl = isfl;
1589 __entry->haveleft = haveleft;
1590 __entry->haveright = haveright;
1591 ),
1592 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1593 MAJOR(__entry->dev), MINOR(__entry->dev),
1594 __entry->agno,
1595 __entry->agbno,
1596 __entry->len,
1597 __entry->isfl,
1598 __entry->haveleft ?
1599 (__entry->haveright ? "both" : "left") :
1600 (__entry->haveright ? "right" : "none"))
1601
1602);
1603
1604DECLARE_EVENT_CLASS(xfs_alloc_class,
1605 TP_PROTO(struct xfs_alloc_arg *args),
1606 TP_ARGS(args),
1607 TP_STRUCT__entry(
1608 __field(dev_t, dev)
1609 __field(xfs_agnumber_t, agno)
1610 __field(xfs_agblock_t, agbno)
1611 __field(xfs_extlen_t, minlen)
1612 __field(xfs_extlen_t, maxlen)
1613 __field(xfs_extlen_t, mod)
1614 __field(xfs_extlen_t, prod)
1615 __field(xfs_extlen_t, minleft)
1616 __field(xfs_extlen_t, total)
1617 __field(xfs_extlen_t, alignment)
1618 __field(xfs_extlen_t, minalignslop)
1619 __field(xfs_extlen_t, len)
1620 __field(short, type)
1621 __field(short, otype)
1622 __field(char, wasdel)
1623 __field(char, wasfromfl)
1624 __field(char, isfl)
1625 __field(char, userdata)
1626 __field(xfs_fsblock_t, firstblock)
1627 ),
1628 TP_fast_assign(
1629 __entry->dev = args->mp->m_super->s_dev;
1630 __entry->agno = args->agno;
1631 __entry->agbno = args->agbno;
1632 __entry->minlen = args->minlen;
1633 __entry->maxlen = args->maxlen;
1634 __entry->mod = args->mod;
1635 __entry->prod = args->prod;
1636 __entry->minleft = args->minleft;
1637 __entry->total = args->total;
1638 __entry->alignment = args->alignment;
1639 __entry->minalignslop = args->minalignslop;
1640 __entry->len = args->len;
1641 __entry->type = args->type;
1642 __entry->otype = args->otype;
1643 __entry->wasdel = args->wasdel;
1644 __entry->wasfromfl = args->wasfromfl;
1645 __entry->isfl = args->isfl;
1646 __entry->userdata = args->userdata;
1647 __entry->firstblock = args->firstblock;
1648 ),
1649 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1650 "prod %u minleft %u total %u alignment %u minalignslop %u "
1651 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1652 "userdata %d firstblock 0x%llx",
1653 MAJOR(__entry->dev), MINOR(__entry->dev),
1654 __entry->agno,
1655 __entry->agbno,
1656 __entry->minlen,
1657 __entry->maxlen,
1658 __entry->mod,
1659 __entry->prod,
1660 __entry->minleft,
1661 __entry->total,
1662 __entry->alignment,
1663 __entry->minalignslop,
1664 __entry->len,
1665 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1666 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1667 __entry->wasdel,
1668 __entry->wasfromfl,
1669 __entry->isfl,
1670 __entry->userdata,
1671 (unsigned long long)__entry->firstblock)
1672)
1673
1674#define DEFINE_ALLOC_EVENT(name) \
1675DEFINE_EVENT(xfs_alloc_class, name, \
1676 TP_PROTO(struct xfs_alloc_arg *args), \
1677 TP_ARGS(args))
1678DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1679DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
1680DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1681DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1682DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1683DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1684DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1685DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1686DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1687DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1688DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1689DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1690DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1691DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1692DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1693DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1694DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1695DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1696DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1697DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1698DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1699DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1700DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1701DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1702DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1703
1704DECLARE_EVENT_CLASS(xfs_da_class,
1705 TP_PROTO(struct xfs_da_args *args),
1706 TP_ARGS(args),
1707 TP_STRUCT__entry(
1708 __field(dev_t, dev)
1709 __field(xfs_ino_t, ino)
1710 __dynamic_array(char, name, args->namelen)
1711 __field(int, namelen)
1712 __field(xfs_dahash_t, hashval)
1713 __field(xfs_ino_t, inumber)
1714 __field(int, op_flags)
1715 ),
1716 TP_fast_assign(
1717 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1718 __entry->ino = args->dp->i_ino;
1719 if (args->namelen)
1720 memcpy(__get_str(name), args->name, args->namelen);
1721 __entry->namelen = args->namelen;
1722 __entry->hashval = args->hashval;
1723 __entry->inumber = args->inumber;
1724 __entry->op_flags = args->op_flags;
1725 ),
1726 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1727 "inumber 0x%llx op_flags %s",
1728 MAJOR(__entry->dev), MINOR(__entry->dev),
1729 __entry->ino,
1730 __entry->namelen,
1731 __entry->namelen ? __get_str(name) : NULL,
1732 __entry->namelen,
1733 __entry->hashval,
1734 __entry->inumber,
1735 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1736)
1737
1738#define DEFINE_DIR2_EVENT(name) \
1739DEFINE_EVENT(xfs_da_class, name, \
1740 TP_PROTO(struct xfs_da_args *args), \
1741 TP_ARGS(args))
1742DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1743DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1744DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1745DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1746DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1747DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1748DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1749DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1750DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1751DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1752DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1753DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1754DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1755DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1756DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1757DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1758DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1759DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1760DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1761DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1762DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1763DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1764DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1765DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1766DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1767
1768DECLARE_EVENT_CLASS(xfs_attr_class,
1769 TP_PROTO(struct xfs_da_args *args),
1770 TP_ARGS(args),
1771 TP_STRUCT__entry(
1772 __field(dev_t, dev)
1773 __field(xfs_ino_t, ino)
1774 __dynamic_array(char, name, args->namelen)
1775 __field(int, namelen)
1776 __field(int, valuelen)
1777 __field(xfs_dahash_t, hashval)
1778 __field(int, op_flags)
1779 ),
1780 TP_fast_assign(
1781 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1782 __entry->ino = args->dp->i_ino;
1783 if (args->namelen)
1784 memcpy(__get_str(name), args->name, args->namelen);
1785 __entry->namelen = args->namelen;
1786 __entry->valuelen = args->valuelen;
1787 __entry->hashval = args->hashval;
1788 __entry->op_flags = args->op_flags;
1789 ),
1790 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d valuelen %d "
1791 "hashval 0x%x op_flags %s",
1792 MAJOR(__entry->dev), MINOR(__entry->dev),
1793 __entry->ino,
1794 __entry->namelen,
1795 __entry->namelen ? __get_str(name) : NULL,
1796 __entry->namelen,
1797 __entry->valuelen,
1798 __entry->hashval,
1799 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1800)
1801
1802#define DEFINE_ATTR_EVENT(name) \
1803DEFINE_EVENT(xfs_attr_class, name, \
1804 TP_PROTO(struct xfs_da_args *args), \
1805 TP_ARGS(args))
1806DEFINE_ATTR_EVENT(xfs_attr_sf_add);
1807DEFINE_ATTR_EVENT(xfs_attr_sf_addname);
1808DEFINE_ATTR_EVENT(xfs_attr_sf_create);
1809DEFINE_ATTR_EVENT(xfs_attr_sf_lookup);
1810DEFINE_ATTR_EVENT(xfs_attr_sf_remove);
1811DEFINE_ATTR_EVENT(xfs_attr_sf_removename);
1812DEFINE_ATTR_EVENT(xfs_attr_sf_to_leaf);
1813
1814DEFINE_ATTR_EVENT(xfs_attr_leaf_add);
1815DEFINE_ATTR_EVENT(xfs_attr_leaf_add_old);
1816DEFINE_ATTR_EVENT(xfs_attr_leaf_add_new);
1817DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
1818DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1819DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
1820DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1821DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
1822DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1823DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
1824DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
1825DEFINE_ATTR_EVENT(xfs_attr_leaf_removename);
1826DEFINE_ATTR_EVENT(xfs_attr_leaf_split);
1827DEFINE_ATTR_EVENT(xfs_attr_leaf_split_before);
1828DEFINE_ATTR_EVENT(xfs_attr_leaf_split_after);
1829DEFINE_ATTR_EVENT(xfs_attr_leaf_clearflag);
1830DEFINE_ATTR_EVENT(xfs_attr_leaf_setflag);
1831DEFINE_ATTR_EVENT(xfs_attr_leaf_flipflags);
1832DEFINE_ATTR_EVENT(xfs_attr_leaf_to_sf);
1833DEFINE_ATTR_EVENT(xfs_attr_leaf_to_node);
1834DEFINE_ATTR_EVENT(xfs_attr_leaf_rebalance);
1835DEFINE_ATTR_EVENT(xfs_attr_leaf_unbalance);
1836DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
1837
1838DEFINE_ATTR_EVENT(xfs_attr_node_addname);
1839DEFINE_ATTR_EVENT(xfs_attr_node_get);
1840DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1841DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1842DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1843
1844DEFINE_ATTR_EVENT(xfs_attr_fillstate);
1845DEFINE_ATTR_EVENT(xfs_attr_refillstate);
1846
1847DEFINE_ATTR_EVENT(xfs_attr_rmtval_get);
1848DEFINE_ATTR_EVENT(xfs_attr_rmtval_set);
1849DEFINE_ATTR_EVENT(xfs_attr_rmtval_remove);
1850
1851#define DEFINE_DA_EVENT(name) \
1852DEFINE_EVENT(xfs_da_class, name, \
1853 TP_PROTO(struct xfs_da_args *args), \
1854 TP_ARGS(args))
1855DEFINE_DA_EVENT(xfs_da_split);
1856DEFINE_DA_EVENT(xfs_da_join);
1857DEFINE_DA_EVENT(xfs_da_link_before);
1858DEFINE_DA_EVENT(xfs_da_link_after);
1859DEFINE_DA_EVENT(xfs_da_unlink_back);
1860DEFINE_DA_EVENT(xfs_da_unlink_forward);
1861DEFINE_DA_EVENT(xfs_da_root_split);
1862DEFINE_DA_EVENT(xfs_da_root_join);
1863DEFINE_DA_EVENT(xfs_da_node_add);
1864DEFINE_DA_EVENT(xfs_da_node_create);
1865DEFINE_DA_EVENT(xfs_da_node_split);
1866DEFINE_DA_EVENT(xfs_da_node_remove);
1867DEFINE_DA_EVENT(xfs_da_node_rebalance);
1868DEFINE_DA_EVENT(xfs_da_node_unbalance);
1869DEFINE_DA_EVENT(xfs_da_node_toosmall);
1870DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1871DEFINE_DA_EVENT(xfs_da_grow_inode);
1872DEFINE_DA_EVENT(xfs_da_shrink_inode);
1873DEFINE_DA_EVENT(xfs_da_fixhashpath);
1874DEFINE_DA_EVENT(xfs_da_path_shift);
1875
1876DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1877 TP_PROTO(struct xfs_da_args *args, int idx),
1878 TP_ARGS(args, idx),
1879 TP_STRUCT__entry(
1880 __field(dev_t, dev)
1881 __field(xfs_ino_t, ino)
1882 __field(int, op_flags)
1883 __field(int, idx)
1884 ),
1885 TP_fast_assign(
1886 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1887 __entry->ino = args->dp->i_ino;
1888 __entry->op_flags = args->op_flags;
1889 __entry->idx = idx;
1890 ),
1891 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1892 MAJOR(__entry->dev), MINOR(__entry->dev),
1893 __entry->ino,
1894 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1895 __entry->idx)
1896)
1897
1898#define DEFINE_DIR2_SPACE_EVENT(name) \
1899DEFINE_EVENT(xfs_dir2_space_class, name, \
1900 TP_PROTO(struct xfs_da_args *args, int idx), \
1901 TP_ARGS(args, idx))
1902DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1903DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1904DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1905DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1906
1907TRACE_EVENT(xfs_dir2_leafn_moveents,
1908 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1909 TP_ARGS(args, src_idx, dst_idx, count),
1910 TP_STRUCT__entry(
1911 __field(dev_t, dev)
1912 __field(xfs_ino_t, ino)
1913 __field(int, op_flags)
1914 __field(int, src_idx)
1915 __field(int, dst_idx)
1916 __field(int, count)
1917 ),
1918 TP_fast_assign(
1919 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1920 __entry->ino = args->dp->i_ino;
1921 __entry->op_flags = args->op_flags;
1922 __entry->src_idx = src_idx;
1923 __entry->dst_idx = dst_idx;
1924 __entry->count = count;
1925 ),
1926 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1927 "src_idx %d dst_idx %d count %d",
1928 MAJOR(__entry->dev), MINOR(__entry->dev),
1929 __entry->ino,
1930 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1931 __entry->src_idx,
1932 __entry->dst_idx,
1933 __entry->count)
1934);
1935
1936#define XFS_SWAPEXT_INODES \
1937 { 0, "target" }, \
1938 { 1, "temp" }
1939
1940#define XFS_INODE_FORMAT_STR \
1941 { 0, "invalid" }, \
1942 { 1, "local" }, \
1943 { 2, "extent" }, \
1944 { 3, "btree" }
1945
1946DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1947 TP_PROTO(struct xfs_inode *ip, int which),
1948 TP_ARGS(ip, which),
1949 TP_STRUCT__entry(
1950 __field(dev_t, dev)
1951 __field(int, which)
1952 __field(xfs_ino_t, ino)
1953 __field(int, format)
1954 __field(int, nex)
1955 __field(int, broot_size)
1956 __field(int, fork_off)
1957 ),
1958 TP_fast_assign(
1959 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1960 __entry->which = which;
1961 __entry->ino = ip->i_ino;
1962 __entry->format = ip->i_d.di_format;
1963 __entry->nex = ip->i_d.di_nextents;
1964 __entry->broot_size = ip->i_df.if_broot_bytes;
1965 __entry->fork_off = XFS_IFORK_BOFF(ip);
1966 ),
1967 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1968 "broot size %d, fork offset %d",
1969 MAJOR(__entry->dev), MINOR(__entry->dev),
1970 __entry->ino,
1971 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1972 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1973 __entry->nex,
1974 __entry->broot_size,
1975 __entry->fork_off)
1976)
1977
1978#define DEFINE_SWAPEXT_EVENT(name) \
1979DEFINE_EVENT(xfs_swap_extent_class, name, \
1980 TP_PROTO(struct xfs_inode *ip, int which), \
1981 TP_ARGS(ip, which))
1982
1983DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1984DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1985
1986DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
1987 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
1988 struct xlog_recover_item *item, int pass),
1989 TP_ARGS(log, trans, item, pass),
1990 TP_STRUCT__entry(
1991 __field(dev_t, dev)
1992 __field(unsigned long, item)
1993 __field(xlog_tid_t, tid)
1994 __field(int, type)
1995 __field(int, pass)
1996 __field(int, count)
1997 __field(int, total)
1998 ),
1999 TP_fast_assign(
2000 __entry->dev = log->l_mp->m_super->s_dev;
2001 __entry->item = (unsigned long)item;
2002 __entry->tid = trans->r_log_tid;
2003 __entry->type = ITEM_TYPE(item);
2004 __entry->pass = pass;
2005 __entry->count = item->ri_cnt;
2006 __entry->total = item->ri_total;
2007 ),
2008 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
2009 "item region count/total %d/%d",
2010 MAJOR(__entry->dev), MINOR(__entry->dev),
2011 __entry->tid,
2012 __entry->pass,
2013 (void *)__entry->item,
2014 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
2015 __entry->count,
2016 __entry->total)
2017)
2018
2019#define DEFINE_LOG_RECOVER_ITEM(name) \
2020DEFINE_EVENT(xfs_log_recover_item_class, name, \
2021 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
2022 struct xlog_recover_item *item, int pass), \
2023 TP_ARGS(log, trans, item, pass))
2024
2025DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
2026DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
2027DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
2028DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
2029DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
2030
2031DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
2032 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
2033 TP_ARGS(log, buf_f),
2034 TP_STRUCT__entry(
2035 __field(dev_t, dev)
2036 __field(__int64_t, blkno)
2037 __field(unsigned short, len)
2038 __field(unsigned short, flags)
2039 __field(unsigned short, size)
2040 __field(unsigned int, map_size)
2041 ),
2042 TP_fast_assign(
2043 __entry->dev = log->l_mp->m_super->s_dev;
2044 __entry->blkno = buf_f->blf_blkno;
2045 __entry->len = buf_f->blf_len;
2046 __entry->flags = buf_f->blf_flags;
2047 __entry->size = buf_f->blf_size;
2048 __entry->map_size = buf_f->blf_map_size;
2049 ),
2050 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
2051 "map_size %d",
2052 MAJOR(__entry->dev), MINOR(__entry->dev),
2053 __entry->blkno,
2054 __entry->len,
2055 __entry->flags,
2056 __entry->size,
2057 __entry->map_size)
2058)
2059
2060#define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
2061DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
2062 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
2063 TP_ARGS(log, buf_f))
2064
2065DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
2066DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
2067DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
2068DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
2069DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
2070DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
2071DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
2072DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
2073
2074DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
2075 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
2076 TP_ARGS(log, in_f),
2077 TP_STRUCT__entry(
2078 __field(dev_t, dev)
2079 __field(xfs_ino_t, ino)
2080 __field(unsigned short, size)
2081 __field(int, fields)
2082 __field(unsigned short, asize)
2083 __field(unsigned short, dsize)
2084 __field(__int64_t, blkno)
2085 __field(int, len)
2086 __field(int, boffset)
2087 ),
2088 TP_fast_assign(
2089 __entry->dev = log->l_mp->m_super->s_dev;
2090 __entry->ino = in_f->ilf_ino;
2091 __entry->size = in_f->ilf_size;
2092 __entry->fields = in_f->ilf_fields;
2093 __entry->asize = in_f->ilf_asize;
2094 __entry->dsize = in_f->ilf_dsize;
2095 __entry->blkno = in_f->ilf_blkno;
2096 __entry->len = in_f->ilf_len;
2097 __entry->boffset = in_f->ilf_boffset;
2098 ),
2099 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
2100 "dsize %d, blkno 0x%llx, len %d, boffset %d",
2101 MAJOR(__entry->dev), MINOR(__entry->dev),
2102 __entry->ino,
2103 __entry->size,
2104 __entry->fields,
2105 __entry->asize,
2106 __entry->dsize,
2107 __entry->blkno,
2108 __entry->len,
2109 __entry->boffset)
2110)
2111#define DEFINE_LOG_RECOVER_INO_ITEM(name) \
2112DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
2113 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
2114 TP_ARGS(log, in_f))
2115
2116DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
2117DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
2118DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
2119
2120DECLARE_EVENT_CLASS(xfs_log_recover_icreate_item_class,
2121 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f),
2122 TP_ARGS(log, in_f),
2123 TP_STRUCT__entry(
2124 __field(dev_t, dev)
2125 __field(xfs_agnumber_t, agno)
2126 __field(xfs_agblock_t, agbno)
2127 __field(unsigned int, count)
2128 __field(unsigned int, isize)
2129 __field(xfs_agblock_t, length)
2130 __field(unsigned int, gen)
2131 ),
2132 TP_fast_assign(
2133 __entry->dev = log->l_mp->m_super->s_dev;
2134 __entry->agno = be32_to_cpu(in_f->icl_ag);
2135 __entry->agbno = be32_to_cpu(in_f->icl_agbno);
2136 __entry->count = be32_to_cpu(in_f->icl_count);
2137 __entry->isize = be32_to_cpu(in_f->icl_isize);
2138 __entry->length = be32_to_cpu(in_f->icl_length);
2139 __entry->gen = be32_to_cpu(in_f->icl_gen);
2140 ),
2141 TP_printk("dev %d:%d agno %u agbno %u count %u isize %u length %u "
2142 "gen %u", MAJOR(__entry->dev), MINOR(__entry->dev),
2143 __entry->agno, __entry->agbno, __entry->count, __entry->isize,
2144 __entry->length, __entry->gen)
2145)
2146#define DEFINE_LOG_RECOVER_ICREATE_ITEM(name) \
2147DEFINE_EVENT(xfs_log_recover_icreate_item_class, name, \
2148 TP_PROTO(struct xlog *log, struct xfs_icreate_log *in_f), \
2149 TP_ARGS(log, in_f))
2150
2151DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_cancel);
2152DEFINE_LOG_RECOVER_ICREATE_ITEM(xfs_log_recover_icreate_recover);
2153
2154DECLARE_EVENT_CLASS(xfs_discard_class,
2155 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2156 xfs_agblock_t agbno, xfs_extlen_t len),
2157 TP_ARGS(mp, agno, agbno, len),
2158 TP_STRUCT__entry(
2159 __field(dev_t, dev)
2160 __field(xfs_agnumber_t, agno)
2161 __field(xfs_agblock_t, agbno)
2162 __field(xfs_extlen_t, len)
2163 ),
2164 TP_fast_assign(
2165 __entry->dev = mp->m_super->s_dev;
2166 __entry->agno = agno;
2167 __entry->agbno = agbno;
2168 __entry->len = len;
2169 ),
2170 TP_printk("dev %d:%d agno %u agbno %u len %u\n",
2171 MAJOR(__entry->dev), MINOR(__entry->dev),
2172 __entry->agno,
2173 __entry->agbno,
2174 __entry->len)
2175)
2176
2177#define DEFINE_DISCARD_EVENT(name) \
2178DEFINE_EVENT(xfs_discard_class, name, \
2179 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2180 xfs_agblock_t agbno, xfs_extlen_t len), \
2181 TP_ARGS(mp, agno, agbno, len))
2182DEFINE_DISCARD_EVENT(xfs_discard_extent);
2183DEFINE_DISCARD_EVENT(xfs_discard_toosmall);
2184DEFINE_DISCARD_EVENT(xfs_discard_exclude);
2185DEFINE_DISCARD_EVENT(xfs_discard_busy);
2186
2187#endif /* _TRACE_XFS_H */
2188
2189#undef TRACE_INCLUDE_PATH
2190#define TRACE_INCLUDE_PATH .
2191#define TRACE_INCLUDE_FILE xfs_trace
2192#include <trace/define_trace.h>