]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - fs/xfs/xfs_trace.h
switch generic_file_splice_read() to use of ->read_iter()
[mirror_ubuntu-jammy-kernel.git] / fs / xfs / xfs_trace.h
CommitLineData
0b1b213f
CH
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;
9e4c109a 33struct xfs_log_item;
ad223e60 34struct xlog;
750b9c90 35struct xlog_ticket;
9abbc539
DC
36struct xlog_recover;
37struct xlog_recover_item;
38struct xfs_buf_log_format;
39struct xfs_inode_log_format;
1ed845df 40struct xfs_bmbt_irec;
2c813ad6 41struct xfs_btree_cur;
0b1b213f 42
ea9a4888
CH
43DECLARE_EVENT_CLASS(xfs_attr_list_class,
44 TP_PROTO(struct xfs_attr_list_context *ctx),
45 TP_ARGS(ctx),
46 TP_STRUCT__entry(
47 __field(dev_t, dev)
48 __field(xfs_ino_t, ino)
49 __field(u32, hashval)
50 __field(u32, blkno)
51 __field(u32, offset)
52 __field(void *, alist)
53 __field(int, bufsize)
54 __field(int, count)
55 __field(int, firstu)
56 __field(int, dupcnt)
57 __field(int, flags)
58 ),
59 TP_fast_assign(
60 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
61 __entry->ino = ctx->dp->i_ino;
62 __entry->hashval = ctx->cursor->hashval;
63 __entry->blkno = ctx->cursor->blkno;
64 __entry->offset = ctx->cursor->offset;
65 __entry->alist = ctx->alist;
66 __entry->bufsize = ctx->bufsize;
67 __entry->count = ctx->count;
68 __entry->firstu = ctx->firstu;
69 __entry->flags = ctx->flags;
70 ),
71 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
72 "alist 0x%p size %u count %u firstu %u flags %d %s",
73 MAJOR(__entry->dev), MINOR(__entry->dev),
74 __entry->ino,
75 __entry->hashval,
76 __entry->blkno,
77 __entry->offset,
78 __entry->dupcnt,
79 __entry->alist,
80 __entry->bufsize,
81 __entry->count,
82 __entry->firstu,
83 __entry->flags,
84 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
85 )
86)
87
0b1b213f 88#define DEFINE_ATTR_LIST_EVENT(name) \
ea9a4888 89DEFINE_EVENT(xfs_attr_list_class, name, \
0b1b213f 90 TP_PROTO(struct xfs_attr_list_context *ctx), \
ea9a4888 91 TP_ARGS(ctx))
0b1b213f
CH
92DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
93DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
94DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
95DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
96DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
97DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
98DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
99DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
ee73259b
DC
100DEFINE_ATTR_LIST_EVENT(xfs_attr_leaf_list);
101DEFINE_ATTR_LIST_EVENT(xfs_attr_node_list);
0b1b213f 102
f8adb4d5
LZ
103DECLARE_EVENT_CLASS(xfs_perag_class,
104 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
105 unsigned long caller_ip),
106 TP_ARGS(mp, agno, refcount, caller_ip),
107 TP_STRUCT__entry(
108 __field(dev_t, dev)
109 __field(xfs_agnumber_t, agno)
110 __field(int, refcount)
111 __field(unsigned long, caller_ip)
112 ),
113 TP_fast_assign(
114 __entry->dev = mp->m_super->s_dev;
115 __entry->agno = agno;
116 __entry->refcount = refcount;
117 __entry->caller_ip = caller_ip;
118 ),
65dd297a 119 TP_printk("dev %d:%d agno %u refcount %d caller %ps",
f8adb4d5
LZ
120 MAJOR(__entry->dev), MINOR(__entry->dev),
121 __entry->agno,
122 __entry->refcount,
123 (char *)__entry->caller_ip)
124);
125
126#define DEFINE_PERAG_REF_EVENT(name) \
127DEFINE_EVENT(xfs_perag_class, name, \
128 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
129 unsigned long caller_ip), \
130 TP_ARGS(mp, agno, refcount, caller_ip))
131DEFINE_PERAG_REF_EVENT(xfs_perag_get);
65d0f205 132DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
f8adb4d5 133DEFINE_PERAG_REF_EVENT(xfs_perag_put);
16fd5367
DC
134DEFINE_PERAG_REF_EVENT(xfs_perag_set_reclaim);
135DEFINE_PERAG_REF_EVENT(xfs_perag_clear_reclaim);
27b52867
BF
136DEFINE_PERAG_REF_EVENT(xfs_perag_set_eofblocks);
137DEFINE_PERAG_REF_EVENT(xfs_perag_clear_eofblocks);
f8adb4d5 138
d123031a
DC
139DECLARE_EVENT_CLASS(xfs_ag_class,
140 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno),
141 TP_ARGS(mp, agno),
142 TP_STRUCT__entry(
143 __field(dev_t, dev)
144 __field(xfs_agnumber_t, agno)
145 ),
146 TP_fast_assign(
147 __entry->dev = mp->m_super->s_dev;
148 __entry->agno = agno;
149 ),
150 TP_printk("dev %d:%d agno %u",
151 MAJOR(__entry->dev), MINOR(__entry->dev),
152 __entry->agno)
153);
154#define DEFINE_AG_EVENT(name) \
155DEFINE_EVENT(xfs_ag_class, name, \
156 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno), \
157 TP_ARGS(mp, agno))
158
159DEFINE_AG_EVENT(xfs_read_agf);
160DEFINE_AG_EVENT(xfs_alloc_read_agf);
161DEFINE_AG_EVENT(xfs_read_agi);
162DEFINE_AG_EVENT(xfs_ialloc_read_agi);
163
0b1b213f
CH
164TRACE_EVENT(xfs_attr_list_node_descend,
165 TP_PROTO(struct xfs_attr_list_context *ctx,
166 struct xfs_da_node_entry *btree),
167 TP_ARGS(ctx, btree),
168 TP_STRUCT__entry(
169 __field(dev_t, dev)
170 __field(xfs_ino_t, ino)
171 __field(u32, hashval)
172 __field(u32, blkno)
173 __field(u32, offset)
174 __field(void *, alist)
175 __field(int, bufsize)
176 __field(int, count)
177 __field(int, firstu)
178 __field(int, dupcnt)
179 __field(int, flags)
180 __field(u32, bt_hashval)
181 __field(u32, bt_before)
182 ),
183 TP_fast_assign(
184 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
185 __entry->ino = ctx->dp->i_ino;
186 __entry->hashval = ctx->cursor->hashval;
187 __entry->blkno = ctx->cursor->blkno;
188 __entry->offset = ctx->cursor->offset;
189 __entry->alist = ctx->alist;
190 __entry->bufsize = ctx->bufsize;
191 __entry->count = ctx->count;
192 __entry->firstu = ctx->firstu;
193 __entry->flags = ctx->flags;
194 __entry->bt_hashval = be32_to_cpu(btree->hashval);
195 __entry->bt_before = be32_to_cpu(btree->before);
196 ),
197 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
198 "alist 0x%p size %u count %u firstu %u flags %d %s "
199 "node hashval %u, node before %u",
200 MAJOR(__entry->dev), MINOR(__entry->dev),
201 __entry->ino,
202 __entry->hashval,
203 __entry->blkno,
204 __entry->offset,
205 __entry->dupcnt,
206 __entry->alist,
207 __entry->bufsize,
208 __entry->count,
209 __entry->firstu,
210 __entry->flags,
211 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
212 __entry->bt_hashval,
213 __entry->bt_before)
214);
215
216TRACE_EVENT(xfs_iext_insert,
217 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
218 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
219 TP_ARGS(ip, idx, r, state, caller_ip),
220 TP_STRUCT__entry(
221 __field(dev_t, dev)
222 __field(xfs_ino_t, ino)
223 __field(xfs_extnum_t, idx)
224 __field(xfs_fileoff_t, startoff)
225 __field(xfs_fsblock_t, startblock)
226 __field(xfs_filblks_t, blockcount)
227 __field(xfs_exntst_t, state)
228 __field(int, bmap_state)
229 __field(unsigned long, caller_ip)
230 ),
231 TP_fast_assign(
232 __entry->dev = VFS_I(ip)->i_sb->s_dev;
233 __entry->ino = ip->i_ino;
234 __entry->idx = idx;
235 __entry->startoff = r->br_startoff;
236 __entry->startblock = r->br_startblock;
237 __entry->blockcount = r->br_blockcount;
238 __entry->state = r->br_state;
239 __entry->bmap_state = state;
240 __entry->caller_ip = caller_ip;
241 ),
242 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
65dd297a 243 "offset %lld block %lld count %lld flag %d caller %ps",
0b1b213f
CH
244 MAJOR(__entry->dev), MINOR(__entry->dev),
245 __entry->ino,
246 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
247 (long)__entry->idx,
248 __entry->startoff,
f7008d0a 249 (__int64_t)__entry->startblock,
0b1b213f
CH
250 __entry->blockcount,
251 __entry->state,
252 (char *)__entry->caller_ip)
253);
254
ea9a4888
CH
255DECLARE_EVENT_CLASS(xfs_bmap_class,
256 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
257 unsigned long caller_ip),
258 TP_ARGS(ip, idx, state, caller_ip),
259 TP_STRUCT__entry(
260 __field(dev_t, dev)
261 __field(xfs_ino_t, ino)
262 __field(xfs_extnum_t, idx)
263 __field(xfs_fileoff_t, startoff)
264 __field(xfs_fsblock_t, startblock)
265 __field(xfs_filblks_t, blockcount)
266 __field(xfs_exntst_t, state)
267 __field(int, bmap_state)
268 __field(unsigned long, caller_ip)
269 ),
270 TP_fast_assign(
271 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
272 ip->i_afp : &ip->i_df;
273 struct xfs_bmbt_irec r;
274
275 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
276 __entry->dev = VFS_I(ip)->i_sb->s_dev;
277 __entry->ino = ip->i_ino;
278 __entry->idx = idx;
279 __entry->startoff = r.br_startoff;
280 __entry->startblock = r.br_startblock;
281 __entry->blockcount = r.br_blockcount;
282 __entry->state = r.br_state;
283 __entry->bmap_state = state;
284 __entry->caller_ip = caller_ip;
285 ),
286 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
65dd297a 287 "offset %lld block %lld count %lld flag %d caller %ps",
ea9a4888
CH
288 MAJOR(__entry->dev), MINOR(__entry->dev),
289 __entry->ino,
290 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
291 (long)__entry->idx,
292 __entry->startoff,
f7008d0a 293 (__int64_t)__entry->startblock,
ea9a4888
CH
294 __entry->blockcount,
295 __entry->state,
296 (char *)__entry->caller_ip)
297)
298
0b1b213f 299#define DEFINE_BMAP_EVENT(name) \
ea9a4888 300DEFINE_EVENT(xfs_bmap_class, name, \
0b1b213f
CH
301 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
302 unsigned long caller_ip), \
ea9a4888 303 TP_ARGS(ip, idx, state, caller_ip))
0b1b213f
CH
304DEFINE_BMAP_EVENT(xfs_iext_remove);
305DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
306DEFINE_BMAP_EVENT(xfs_bmap_post_update);
307DEFINE_BMAP_EVENT(xfs_extlist);
308
ea9a4888
CH
309DECLARE_EVENT_CLASS(xfs_buf_class,
310 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
311 TP_ARGS(bp, caller_ip),
312 TP_STRUCT__entry(
313 __field(dev_t, dev)
314 __field(xfs_daddr_t, bno)
4e94b71b 315 __field(int, nblks)
ea9a4888
CH
316 __field(int, hold)
317 __field(int, pincount)
318 __field(unsigned, lockval)
319 __field(unsigned, flags)
320 __field(unsigned long, caller_ip)
321 ),
322 TP_fast_assign(
323 __entry->dev = bp->b_target->bt_dev;
324 __entry->bno = bp->b_bn;
4e94b71b 325 __entry->nblks = bp->b_length;
ea9a4888
CH
326 __entry->hold = atomic_read(&bp->b_hold);
327 __entry->pincount = atomic_read(&bp->b_pin_count);
0c842ad4 328 __entry->lockval = bp->b_sema.count;
ea9a4888
CH
329 __entry->flags = bp->b_flags;
330 __entry->caller_ip = caller_ip;
331 ),
4e94b71b 332 TP_printk("dev %d:%d bno 0x%llx nblks 0x%x hold %d pincount %d "
65dd297a 333 "lock %d flags %s caller %ps",
ea9a4888
CH
334 MAJOR(__entry->dev), MINOR(__entry->dev),
335 (unsigned long long)__entry->bno,
4e94b71b 336 __entry->nblks,
ea9a4888
CH
337 __entry->hold,
338 __entry->pincount,
339 __entry->lockval,
340 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
341 (void *)__entry->caller_ip)
0b1b213f 342)
ea9a4888
CH
343
344#define DEFINE_BUF_EVENT(name) \
345DEFINE_EVENT(xfs_buf_class, name, \
346 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
347 TP_ARGS(bp, caller_ip))
0b1b213f
CH
348DEFINE_BUF_EVENT(xfs_buf_init);
349DEFINE_BUF_EVENT(xfs_buf_free);
350DEFINE_BUF_EVENT(xfs_buf_hold);
351DEFINE_BUF_EVENT(xfs_buf_rele);
0b1b213f 352DEFINE_BUF_EVENT(xfs_buf_iodone);
595bff75
DC
353DEFINE_BUF_EVENT(xfs_buf_submit);
354DEFINE_BUF_EVENT(xfs_buf_submit_wait);
0b1b213f 355DEFINE_BUF_EVENT(xfs_buf_bawrite);
0b1b213f
CH
356DEFINE_BUF_EVENT(xfs_buf_lock);
357DEFINE_BUF_EVENT(xfs_buf_lock_done);
479c6412 358DEFINE_BUF_EVENT(xfs_buf_trylock_fail);
0c842ad4 359DEFINE_BUF_EVENT(xfs_buf_trylock);
0b1b213f 360DEFINE_BUF_EVENT(xfs_buf_unlock);
0b1b213f
CH
361DEFINE_BUF_EVENT(xfs_buf_iowait);
362DEFINE_BUF_EVENT(xfs_buf_iowait_done);
363DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
43ff2122 364DEFINE_BUF_EVENT(xfs_buf_delwri_queued);
0b1b213f 365DEFINE_BUF_EVENT(xfs_buf_delwri_split);
686865f7 366DEFINE_BUF_EVENT(xfs_buf_get_uncached);
0b1b213f
CH
367DEFINE_BUF_EVENT(xfs_bdstrat_shut);
368DEFINE_BUF_EVENT(xfs_buf_item_relse);
0b1b213f
CH
369DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
370DEFINE_BUF_EVENT(xfs_buf_error_relse);
9f87832a 371DEFINE_BUF_EVENT(xfs_buf_wait_buftarg);
0b1b213f
CH
372DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
373DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
374
375/* not really buffer traces, but the buf provides useful information */
376DEFINE_BUF_EVENT(xfs_btree_corrupt);
377DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
378DEFINE_BUF_EVENT(xfs_reset_dqcounts);
379DEFINE_BUF_EVENT(xfs_inode_item_push);
380
381/* pass flags explicitly */
ea9a4888
CH
382DECLARE_EVENT_CLASS(xfs_buf_flags_class,
383 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
384 TP_ARGS(bp, flags, caller_ip),
385 TP_STRUCT__entry(
386 __field(dev_t, dev)
387 __field(xfs_daddr_t, bno)
388 __field(size_t, buffer_length)
389 __field(int, hold)
390 __field(int, pincount)
391 __field(unsigned, lockval)
392 __field(unsigned, flags)
393 __field(unsigned long, caller_ip)
394 ),
395 TP_fast_assign(
396 __entry->dev = bp->b_target->bt_dev;
397 __entry->bno = bp->b_bn;
4e94b71b 398 __entry->buffer_length = BBTOB(bp->b_length);
ea9a4888
CH
399 __entry->flags = flags;
400 __entry->hold = atomic_read(&bp->b_hold);
401 __entry->pincount = atomic_read(&bp->b_pin_count);
0c842ad4 402 __entry->lockval = bp->b_sema.count;
ea9a4888
CH
403 __entry->caller_ip = caller_ip;
404 ),
405 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
65dd297a 406 "lock %d flags %s caller %ps",
ea9a4888
CH
407 MAJOR(__entry->dev), MINOR(__entry->dev),
408 (unsigned long long)__entry->bno,
409 __entry->buffer_length,
410 __entry->hold,
411 __entry->pincount,
412 __entry->lockval,
413 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
414 (void *)__entry->caller_ip)
0b1b213f 415)
ea9a4888
CH
416
417#define DEFINE_BUF_FLAGS_EVENT(name) \
418DEFINE_EVENT(xfs_buf_flags_class, name, \
419 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
420 TP_ARGS(bp, flags, caller_ip))
0b1b213f
CH
421DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
422DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
423DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
424
425TRACE_EVENT(xfs_buf_ioerror,
426 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
427 TP_ARGS(bp, error, caller_ip),
428 TP_STRUCT__entry(
429 __field(dev_t, dev)
430 __field(xfs_daddr_t, bno)
431 __field(size_t, buffer_length)
432 __field(unsigned, flags)
433 __field(int, hold)
434 __field(int, pincount)
435 __field(unsigned, lockval)
436 __field(int, error)
437 __field(unsigned long, caller_ip)
438 ),
439 TP_fast_assign(
440 __entry->dev = bp->b_target->bt_dev;
441 __entry->bno = bp->b_bn;
4e94b71b 442 __entry->buffer_length = BBTOB(bp->b_length);
0b1b213f
CH
443 __entry->hold = atomic_read(&bp->b_hold);
444 __entry->pincount = atomic_read(&bp->b_pin_count);
0c842ad4 445 __entry->lockval = bp->b_sema.count;
0b1b213f
CH
446 __entry->error = error;
447 __entry->flags = bp->b_flags;
448 __entry->caller_ip = caller_ip;
449 ),
450 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
65dd297a 451 "lock %d error %d flags %s caller %ps",
0b1b213f
CH
452 MAJOR(__entry->dev), MINOR(__entry->dev),
453 (unsigned long long)__entry->bno,
454 __entry->buffer_length,
455 __entry->hold,
456 __entry->pincount,
457 __entry->lockval,
458 __entry->error,
459 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
460 (void *)__entry->caller_ip)
461);
462
ea9a4888
CH
463DECLARE_EVENT_CLASS(xfs_buf_item_class,
464 TP_PROTO(struct xfs_buf_log_item *bip),
465 TP_ARGS(bip),
466 TP_STRUCT__entry(
467 __field(dev_t, dev)
468 __field(xfs_daddr_t, buf_bno)
469 __field(size_t, buf_len)
470 __field(int, buf_hold)
471 __field(int, buf_pincount)
472 __field(int, buf_lockval)
473 __field(unsigned, buf_flags)
474 __field(unsigned, bli_recur)
475 __field(int, bli_refcount)
476 __field(unsigned, bli_flags)
477 __field(void *, li_desc)
478 __field(unsigned, li_flags)
479 ),
480 TP_fast_assign(
481 __entry->dev = bip->bli_buf->b_target->bt_dev;
482 __entry->bli_flags = bip->bli_flags;
483 __entry->bli_recur = bip->bli_recur;
484 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
485 __entry->buf_bno = bip->bli_buf->b_bn;
4e94b71b 486 __entry->buf_len = BBTOB(bip->bli_buf->b_length);
ea9a4888
CH
487 __entry->buf_flags = bip->bli_buf->b_flags;
488 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
489 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
0c842ad4 490 __entry->buf_lockval = bip->bli_buf->b_sema.count;
ea9a4888
CH
491 __entry->li_desc = bip->bli_item.li_desc;
492 __entry->li_flags = bip->bli_item.li_flags;
493 ),
494 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
495 "lock %d flags %s recur %d refcount %d bliflags %s "
496 "lidesc 0x%p liflags %s",
497 MAJOR(__entry->dev), MINOR(__entry->dev),
498 (unsigned long long)__entry->buf_bno,
499 __entry->buf_len,
500 __entry->buf_hold,
501 __entry->buf_pincount,
502 __entry->buf_lockval,
503 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
504 __entry->bli_recur,
505 __entry->bli_refcount,
506 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
507 __entry->li_desc,
508 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
0b1b213f 509)
ea9a4888
CH
510
511#define DEFINE_BUF_ITEM_EVENT(name) \
512DEFINE_EVENT(xfs_buf_item_class, name, \
513 TP_PROTO(struct xfs_buf_log_item *bip), \
514 TP_ARGS(bip))
0b1b213f 515DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
5f6bed76 516DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_ordered);
0b1b213f
CH
517DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
518DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
5f6bed76 519DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_ordered);
0b1b213f 520DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
5f6bed76 521DEFINE_BUF_ITEM_EVENT(xfs_buf_item_ordered);
0b1b213f
CH
522DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
523DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
524DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
0b1b213f
CH
525DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
526DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
527DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
528DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
529DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
530DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
531DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
532DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
533DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
534DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
535DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
536DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
537DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
538DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
539DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
540DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
5f6bed76 541DEFINE_BUF_ITEM_EVENT(xfs_trans_buf_ordered);
0b1b213f 542
b94acd47
CH
543DECLARE_EVENT_CLASS(xfs_filestream_class,
544 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno),
545 TP_ARGS(ip, agno),
546 TP_STRUCT__entry(
547 __field(dev_t, dev)
548 __field(xfs_ino_t, ino)
549 __field(xfs_agnumber_t, agno)
550 __field(int, streams)
551 ),
552 TP_fast_assign(
553 __entry->dev = VFS_I(ip)->i_sb->s_dev;
554 __entry->ino = ip->i_ino;
555 __entry->agno = agno;
556 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
557 ),
558 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d",
559 MAJOR(__entry->dev), MINOR(__entry->dev),
560 __entry->ino,
561 __entry->agno,
562 __entry->streams)
563)
564#define DEFINE_FILESTREAM_EVENT(name) \
565DEFINE_EVENT(xfs_filestream_class, name, \
566 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno), \
567 TP_ARGS(ip, agno))
568DEFINE_FILESTREAM_EVENT(xfs_filestream_free);
569DEFINE_FILESTREAM_EVENT(xfs_filestream_lookup);
570DEFINE_FILESTREAM_EVENT(xfs_filestream_scan);
571
572TRACE_EVENT(xfs_filestream_pick,
573 TP_PROTO(struct xfs_inode *ip, xfs_agnumber_t agno,
574 xfs_extlen_t free, int nscan),
575 TP_ARGS(ip, agno, free, nscan),
576 TP_STRUCT__entry(
577 __field(dev_t, dev)
578 __field(xfs_ino_t, ino)
579 __field(xfs_agnumber_t, agno)
580 __field(int, streams)
581 __field(xfs_extlen_t, free)
582 __field(int, nscan)
583 ),
584 TP_fast_assign(
585 __entry->dev = VFS_I(ip)->i_sb->s_dev;
586 __entry->ino = ip->i_ino;
587 __entry->agno = agno;
588 __entry->streams = xfs_filestream_peek_ag(ip->i_mount, agno);
589 __entry->free = free;
590 __entry->nscan = nscan;
591 ),
592 TP_printk("dev %d:%d ino 0x%llx agno %u streams %d free %d nscan %d",
593 MAJOR(__entry->dev), MINOR(__entry->dev),
594 __entry->ino,
595 __entry->agno,
596 __entry->streams,
597 __entry->free,
598 __entry->nscan)
599);
600
ea9a4888
CH
601DECLARE_EVENT_CLASS(xfs_lock_class,
602 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
603 unsigned long caller_ip),
604 TP_ARGS(ip, lock_flags, caller_ip),
605 TP_STRUCT__entry(
606 __field(dev_t, dev)
607 __field(xfs_ino_t, ino)
608 __field(int, lock_flags)
609 __field(unsigned long, caller_ip)
610 ),
611 TP_fast_assign(
612 __entry->dev = VFS_I(ip)->i_sb->s_dev;
613 __entry->ino = ip->i_ino;
614 __entry->lock_flags = lock_flags;
615 __entry->caller_ip = caller_ip;
616 ),
65dd297a 617 TP_printk("dev %d:%d ino 0x%llx flags %s caller %ps",
ea9a4888
CH
618 MAJOR(__entry->dev), MINOR(__entry->dev),
619 __entry->ino,
620 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
621 (void *)__entry->caller_ip)
622)
623
0b1b213f 624#define DEFINE_LOCK_EVENT(name) \
ea9a4888 625DEFINE_EVENT(xfs_lock_class, name, \
0b1b213f
CH
626 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
627 unsigned long caller_ip), \
ea9a4888 628 TP_ARGS(ip, lock_flags, caller_ip))
0b1b213f
CH
629DEFINE_LOCK_EVENT(xfs_ilock);
630DEFINE_LOCK_EVENT(xfs_ilock_nowait);
631DEFINE_LOCK_EVENT(xfs_ilock_demote);
632DEFINE_LOCK_EVENT(xfs_iunlock);
633
cca28fb8 634DECLARE_EVENT_CLASS(xfs_inode_class,
ea9a4888
CH
635 TP_PROTO(struct xfs_inode *ip),
636 TP_ARGS(ip),
637 TP_STRUCT__entry(
638 __field(dev_t, dev)
639 __field(xfs_ino_t, ino)
640 ),
641 TP_fast_assign(
642 __entry->dev = VFS_I(ip)->i_sb->s_dev;
643 __entry->ino = ip->i_ino;
644 ),
645 TP_printk("dev %d:%d ino 0x%llx",
646 MAJOR(__entry->dev), MINOR(__entry->dev),
647 __entry->ino)
648)
649
cca28fb8
CH
650#define DEFINE_INODE_EVENT(name) \
651DEFINE_EVENT(xfs_inode_class, name, \
0b1b213f 652 TP_PROTO(struct xfs_inode *ip), \
ea9a4888 653 TP_ARGS(ip))
cca28fb8
CH
654DEFINE_INODE_EVENT(xfs_iget_skip);
655DEFINE_INODE_EVENT(xfs_iget_reclaim);
656DEFINE_INODE_EVENT(xfs_iget_reclaim_fail);
657DEFINE_INODE_EVENT(xfs_iget_hit);
658DEFINE_INODE_EVENT(xfs_iget_miss);
0b1b213f 659
cca28fb8
CH
660DEFINE_INODE_EVENT(xfs_getattr);
661DEFINE_INODE_EVENT(xfs_setattr);
662DEFINE_INODE_EVENT(xfs_readlink);
725eb1eb 663DEFINE_INODE_EVENT(xfs_inactive_symlink);
cca28fb8
CH
664DEFINE_INODE_EVENT(xfs_alloc_file_space);
665DEFINE_INODE_EVENT(xfs_free_file_space);
897b73b6 666DEFINE_INODE_EVENT(xfs_zero_file_space);
e1d8fb88 667DEFINE_INODE_EVENT(xfs_collapse_file_space);
a904b1ca 668DEFINE_INODE_EVENT(xfs_insert_file_space);
cca28fb8 669DEFINE_INODE_EVENT(xfs_readdir);
0f1a932f 670#ifdef CONFIG_XFS_POSIX_ACL
4e34e719 671DEFINE_INODE_EVENT(xfs_get_acl);
0f1a932f 672#endif
cca28fb8
CH
673DEFINE_INODE_EVENT(xfs_vm_bmap);
674DEFINE_INODE_EVENT(xfs_file_ioctl);
675DEFINE_INODE_EVENT(xfs_file_compat_ioctl);
676DEFINE_INODE_EVENT(xfs_ioctl_setattr);
1da2f2db 677DEFINE_INODE_EVENT(xfs_dir_fsync);
cca28fb8
CH
678DEFINE_INODE_EVENT(xfs_file_fsync);
679DEFINE_INODE_EVENT(xfs_destroy_inode);
b57922d9 680DEFINE_INODE_EVENT(xfs_evict_inode);
69ff2826 681DEFINE_INODE_EVENT(xfs_update_time);
cca28fb8
CH
682
683DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
684DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
685
27b52867
BF
686DEFINE_INODE_EVENT(xfs_inode_set_eofblocks_tag);
687DEFINE_INODE_EVENT(xfs_inode_clear_eofblocks_tag);
41176a68 688DEFINE_INODE_EVENT(xfs_inode_free_eofblocks_invalid);
27b52867 689
de0e8c20 690DEFINE_INODE_EVENT(xfs_filemap_fault);
acd76e74 691DEFINE_INODE_EVENT(xfs_filemap_pmd_fault);
075a924d 692DEFINE_INODE_EVENT(xfs_filemap_page_mkwrite);
3af49285 693DEFINE_INODE_EVENT(xfs_filemap_pfn_mkwrite);
de0e8c20 694
cca28fb8 695DECLARE_EVENT_CLASS(xfs_iref_class,
ea9a4888
CH
696 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
697 TP_ARGS(ip, caller_ip),
698 TP_STRUCT__entry(
699 __field(dev_t, dev)
700 __field(xfs_ino_t, ino)
701 __field(int, count)
4aaf15d1 702 __field(int, pincount)
ea9a4888
CH
703 __field(unsigned long, caller_ip)
704 ),
705 TP_fast_assign(
706 __entry->dev = VFS_I(ip)->i_sb->s_dev;
707 __entry->ino = ip->i_ino;
708 __entry->count = atomic_read(&VFS_I(ip)->i_count);
4aaf15d1 709 __entry->pincount = atomic_read(&ip->i_pincount);
ea9a4888
CH
710 __entry->caller_ip = caller_ip;
711 ),
65dd297a 712 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %ps",
ea9a4888
CH
713 MAJOR(__entry->dev), MINOR(__entry->dev),
714 __entry->ino,
715 __entry->count,
4aaf15d1 716 __entry->pincount,
ea9a4888 717 (char *)__entry->caller_ip)
19cb7e38
BF
718)
719
720TRACE_EVENT(xfs_iomap_prealloc_size,
721 TP_PROTO(struct xfs_inode *ip, xfs_fsblock_t blocks, int shift,
722 unsigned int writeio_blocks),
723 TP_ARGS(ip, blocks, shift, writeio_blocks),
724 TP_STRUCT__entry(
725 __field(dev_t, dev)
726 __field(xfs_ino_t, ino)
727 __field(xfs_fsblock_t, blocks)
728 __field(int, shift)
729 __field(unsigned int, writeio_blocks)
730 ),
731 TP_fast_assign(
732 __entry->dev = VFS_I(ip)->i_sb->s_dev;
733 __entry->ino = ip->i_ino;
734 __entry->blocks = blocks;
735 __entry->shift = shift;
736 __entry->writeio_blocks = writeio_blocks;
737 ),
738 TP_printk("dev %d:%d ino 0x%llx prealloc blocks %llu shift %d "
739 "m_writeio_blocks %u",
740 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino,
741 __entry->blocks, __entry->shift, __entry->writeio_blocks)
ea9a4888
CH
742)
743
56d1115c
BF
744TRACE_EVENT(xfs_irec_merge_pre,
745 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
746 uint16_t holemask, xfs_agino_t nagino, uint16_t nholemask),
747 TP_ARGS(mp, agno, agino, holemask, nagino, nholemask),
748 TP_STRUCT__entry(
749 __field(dev_t, dev)
750 __field(xfs_agnumber_t, agno)
751 __field(xfs_agino_t, agino)
752 __field(uint16_t, holemask)
753 __field(xfs_agino_t, nagino)
754 __field(uint16_t, nholemask)
755 ),
756 TP_fast_assign(
757 __entry->dev = mp->m_super->s_dev;
758 __entry->agno = agno;
759 __entry->agino = agino;
760 __entry->holemask = holemask;
761 __entry->nagino = nagino;
762 __entry->nholemask = holemask;
763 ),
764 TP_printk("dev %d:%d agno %d inobt (%u:0x%x) new (%u:0x%x)",
765 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->agno,
766 __entry->agino, __entry->holemask, __entry->nagino,
767 __entry->nholemask)
768)
769
770TRACE_EVENT(xfs_irec_merge_post,
771 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agino_t agino,
772 uint16_t holemask),
773 TP_ARGS(mp, agno, agino, holemask),
774 TP_STRUCT__entry(
775 __field(dev_t, dev)
776 __field(xfs_agnumber_t, agno)
777 __field(xfs_agino_t, agino)
778 __field(uint16_t, holemask)
779 ),
780 TP_fast_assign(
781 __entry->dev = mp->m_super->s_dev;
782 __entry->agno = agno;
783 __entry->agino = agino;
784 __entry->holemask = holemask;
785 ),
786 TP_printk("dev %d:%d agno %d inobt (%u:0x%x)", MAJOR(__entry->dev),
787 MINOR(__entry->dev), __entry->agno, __entry->agino,
788 __entry->holemask)
789)
790
cca28fb8
CH
791#define DEFINE_IREF_EVENT(name) \
792DEFINE_EVENT(xfs_iref_class, name, \
0b1b213f 793 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
ea9a4888 794 TP_ARGS(ip, caller_ip))
cca28fb8
CH
795DEFINE_IREF_EVENT(xfs_ihold);
796DEFINE_IREF_EVENT(xfs_irele);
797DEFINE_IREF_EVENT(xfs_inode_pin);
798DEFINE_IREF_EVENT(xfs_inode_unpin);
799DEFINE_IREF_EVENT(xfs_inode_unpin_nowait);
800
801DECLARE_EVENT_CLASS(xfs_namespace_class,
802 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name),
803 TP_ARGS(dp, name),
804 TP_STRUCT__entry(
805 __field(dev_t, dev)
806 __field(xfs_ino_t, dp_ino)
f6161375 807 __field(int, namelen)
cca28fb8
CH
808 __dynamic_array(char, name, name->len)
809 ),
810 TP_fast_assign(
811 __entry->dev = VFS_I(dp)->i_sb->s_dev;
812 __entry->dp_ino = dp->i_ino;
f6161375 813 __entry->namelen = name->len;
cca28fb8
CH
814 memcpy(__get_str(name), name->name, name->len);
815 ),
f6161375 816 TP_printk("dev %d:%d dp ino 0x%llx name %.*s",
cca28fb8
CH
817 MAJOR(__entry->dev), MINOR(__entry->dev),
818 __entry->dp_ino,
f6161375 819 __entry->namelen,
cca28fb8
CH
820 __get_str(name))
821)
822
823#define DEFINE_NAMESPACE_EVENT(name) \
824DEFINE_EVENT(xfs_namespace_class, name, \
825 TP_PROTO(struct xfs_inode *dp, struct xfs_name *name), \
826 TP_ARGS(dp, name))
827DEFINE_NAMESPACE_EVENT(xfs_remove);
828DEFINE_NAMESPACE_EVENT(xfs_link);
829DEFINE_NAMESPACE_EVENT(xfs_lookup);
830DEFINE_NAMESPACE_EVENT(xfs_create);
831DEFINE_NAMESPACE_EVENT(xfs_symlink);
4aaf15d1 832
cca28fb8
CH
833TRACE_EVENT(xfs_rename,
834 TP_PROTO(struct xfs_inode *src_dp, struct xfs_inode *target_dp,
835 struct xfs_name *src_name, struct xfs_name *target_name),
836 TP_ARGS(src_dp, target_dp, src_name, target_name),
837 TP_STRUCT__entry(
838 __field(dev_t, dev)
839 __field(xfs_ino_t, src_dp_ino)
840 __field(xfs_ino_t, target_dp_ino)
f6161375
CH
841 __field(int, src_namelen)
842 __field(int, target_namelen)
cca28fb8
CH
843 __dynamic_array(char, src_name, src_name->len)
844 __dynamic_array(char, target_name, target_name->len)
845 ),
846 TP_fast_assign(
847 __entry->dev = VFS_I(src_dp)->i_sb->s_dev;
848 __entry->src_dp_ino = src_dp->i_ino;
849 __entry->target_dp_ino = target_dp->i_ino;
f6161375
CH
850 __entry->src_namelen = src_name->len;
851 __entry->target_namelen = target_name->len;
cca28fb8 852 memcpy(__get_str(src_name), src_name->name, src_name->len);
f6161375
CH
853 memcpy(__get_str(target_name), target_name->name,
854 target_name->len);
cca28fb8
CH
855 ),
856 TP_printk("dev %d:%d src dp ino 0x%llx target dp ino 0x%llx"
f6161375 857 " src name %.*s target name %.*s",
cca28fb8
CH
858 MAJOR(__entry->dev), MINOR(__entry->dev),
859 __entry->src_dp_ino,
860 __entry->target_dp_ino,
f6161375 861 __entry->src_namelen,
cca28fb8 862 __get_str(src_name),
f6161375 863 __entry->target_namelen,
cca28fb8
CH
864 __get_str(target_name))
865)
0b1b213f 866
ea9a4888
CH
867DECLARE_EVENT_CLASS(xfs_dquot_class,
868 TP_PROTO(struct xfs_dquot *dqp),
869 TP_ARGS(dqp),
870 TP_STRUCT__entry(
871 __field(dev_t, dev)
b262e5df 872 __field(u32, id)
ea9a4888
CH
873 __field(unsigned, flags)
874 __field(unsigned, nrefs)
875 __field(unsigned long long, res_bcount)
876 __field(unsigned long long, bcount)
877 __field(unsigned long long, icount)
878 __field(unsigned long long, blk_hardlimit)
879 __field(unsigned long long, blk_softlimit)
880 __field(unsigned long long, ino_hardlimit)
881 __field(unsigned long long, ino_softlimit)
0b1b213f 882 ), \
ea9a4888
CH
883 TP_fast_assign(
884 __entry->dev = dqp->q_mount->m_super->s_dev;
b262e5df 885 __entry->id = be32_to_cpu(dqp->q_core.d_id);
ea9a4888
CH
886 __entry->flags = dqp->dq_flags;
887 __entry->nrefs = dqp->q_nrefs;
888 __entry->res_bcount = dqp->q_res_bcount;
889 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
890 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
891 __entry->blk_hardlimit =
892 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
893 __entry->blk_softlimit =
894 be64_to_cpu(dqp->q_core.d_blk_softlimit);
895 __entry->ino_hardlimit =
896 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
897 __entry->ino_softlimit =
898 be64_to_cpu(dqp->q_core.d_ino_softlimit);
899 ),
900 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
b262e5df
CH
901 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
902 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
ea9a4888 903 MAJOR(__entry->dev), MINOR(__entry->dev),
b262e5df 904 __entry->id,
ea9a4888
CH
905 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
906 __entry->nrefs,
907 __entry->res_bcount,
908 __entry->bcount,
909 __entry->blk_hardlimit,
910 __entry->blk_softlimit,
911 __entry->icount,
912 __entry->ino_hardlimit,
913 __entry->ino_softlimit)
0b1b213f 914)
ea9a4888
CH
915
916#define DEFINE_DQUOT_EVENT(name) \
917DEFINE_EVENT(xfs_dquot_class, name, \
918 TP_PROTO(struct xfs_dquot *dqp), \
919 TP_ARGS(dqp))
0b1b213f 920DEFINE_DQUOT_EVENT(xfs_dqadjust);
0b1b213f
CH
921DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
922DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
92b2e5b3
CH
923DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
924DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
0b1b213f
CH
925DEFINE_DQUOT_EVENT(xfs_dqattach_found);
926DEFINE_DQUOT_EVENT(xfs_dqattach_get);
0b1b213f
CH
927DEFINE_DQUOT_EVENT(xfs_dqalloc);
928DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
929DEFINE_DQUOT_EVENT(xfs_dqread);
930DEFINE_DQUOT_EVENT(xfs_dqread_fail);
0b1b213f
CH
931DEFINE_DQUOT_EVENT(xfs_dqget_hit);
932DEFINE_DQUOT_EVENT(xfs_dqget_miss);
9f920f11
CH
933DEFINE_DQUOT_EVENT(xfs_dqget_freeing);
934DEFINE_DQUOT_EVENT(xfs_dqget_dup);
0b1b213f
CH
935DEFINE_DQUOT_EVENT(xfs_dqput);
936DEFINE_DQUOT_EVENT(xfs_dqput_wait);
937DEFINE_DQUOT_EVENT(xfs_dqput_free);
938DEFINE_DQUOT_EVENT(xfs_dqrele);
939DEFINE_DQUOT_EVENT(xfs_dqflush);
940DEFINE_DQUOT_EVENT(xfs_dqflush_force);
941DEFINE_DQUOT_EVENT(xfs_dqflush_done);
0b1b213f 942
ea9a4888 943DECLARE_EVENT_CLASS(xfs_loggrant_class,
ad223e60 944 TP_PROTO(struct xlog *log, struct xlog_ticket *tic),
ea9a4888
CH
945 TP_ARGS(log, tic),
946 TP_STRUCT__entry(
947 __field(dev_t, dev)
ea9a4888
CH
948 __field(char, ocnt)
949 __field(char, cnt)
950 __field(int, curr_res)
951 __field(int, unit_res)
952 __field(unsigned int, flags)
10547941
DC
953 __field(int, reserveq)
954 __field(int, writeq)
ea9a4888
CH
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;
ea9a4888
CH
965 __entry->ocnt = tic->t_ocnt;
966 __entry->cnt = tic->t_cnt;
967 __entry->curr_res = tic->t_curr_res;
968 __entry->unit_res = tic->t_unit_res;
969 __entry->flags = tic->t_flags;
28496968
CH
970 __entry->reserveq = list_empty(&log->l_reserve_head.waiters);
971 __entry->writeq = list_empty(&log->l_write_head.waiters);
972 xlog_crack_grant_head(&log->l_reserve_head.grant,
a69ed03c
DC
973 &__entry->grant_reserve_cycle,
974 &__entry->grant_reserve_bytes);
28496968 975 xlog_crack_grant_head(&log->l_write_head.grant,
a69ed03c
DC
976 &__entry->grant_write_cycle,
977 &__entry->grant_write_bytes);
ea9a4888
CH
978 __entry->curr_cycle = log->l_curr_cycle;
979 __entry->curr_block = log->l_curr_block;
1c3cb9ec 980 __entry->tail_lsn = atomic64_read(&log->l_tail_lsn);
ea9a4888 981 ),
710b1e2c 982 TP_printk("dev %d:%d t_ocnt %u t_cnt %u t_curr_res %u "
10547941
DC
983 "t_unit_res %u t_flags %s reserveq %s "
984 "writeq %s grant_reserve_cycle %d "
ea9a4888
CH
985 "grant_reserve_bytes %d grant_write_cycle %d "
986 "grant_write_bytes %d curr_cycle %d curr_block %d "
987 "tail_cycle %d tail_block %d",
988 MAJOR(__entry->dev), MINOR(__entry->dev),
ea9a4888
CH
989 __entry->ocnt,
990 __entry->cnt,
991 __entry->curr_res,
992 __entry->unit_res,
993 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
10547941
DC
994 __entry->reserveq ? "empty" : "active",
995 __entry->writeq ? "empty" : "active",
ea9a4888
CH
996 __entry->grant_reserve_cycle,
997 __entry->grant_reserve_bytes,
998 __entry->grant_write_cycle,
999 __entry->grant_write_bytes,
1000 __entry->curr_cycle,
1001 __entry->curr_block,
1002 CYCLE_LSN(__entry->tail_lsn),
1003 BLOCK_LSN(__entry->tail_lsn)
1004 )
1005)
0b1b213f 1006
ea9a4888
CH
1007#define DEFINE_LOGGRANT_EVENT(name) \
1008DEFINE_EVENT(xfs_loggrant_class, name, \
ad223e60 1009 TP_PROTO(struct xlog *log, struct xlog_ticket *tic), \
ea9a4888 1010 TP_ARGS(log, tic))
0b1b213f
CH
1011DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
1012DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
0b1b213f 1013DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
9f9c19ec
CH
1014DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep);
1015DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake);
3f16b985 1016DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake_up);
9006fb91
CH
1017DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
1018DEFINE_LOGGRANT_EVENT(xfs_log_reserve_exit);
1019DEFINE_LOGGRANT_EVENT(xfs_log_regrant);
1020DEFINE_LOGGRANT_EVENT(xfs_log_regrant_exit);
0b1b213f
CH
1021DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
1022DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
1023DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
1024DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
1025DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
1026DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
1027
9e4c109a
CH
1028DECLARE_EVENT_CLASS(xfs_log_item_class,
1029 TP_PROTO(struct xfs_log_item *lip),
1030 TP_ARGS(lip),
1031 TP_STRUCT__entry(
1032 __field(dev_t, dev)
1033 __field(void *, lip)
1034 __field(uint, type)
1035 __field(uint, flags)
1036 __field(xfs_lsn_t, lsn)
1037 ),
1038 TP_fast_assign(
1039 __entry->dev = lip->li_mountp->m_super->s_dev;
1040 __entry->lip = lip;
1041 __entry->type = lip->li_type;
1042 __entry->flags = lip->li_flags;
1043 __entry->lsn = lip->li_lsn;
1044 ),
1045 TP_printk("dev %d:%d lip 0x%p lsn %d/%d type %s flags %s",
1046 MAJOR(__entry->dev), MINOR(__entry->dev),
1047 __entry->lip,
1048 CYCLE_LSN(__entry->lsn), BLOCK_LSN(__entry->lsn),
1049 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1050 __print_flags(__entry->flags, "|", XFS_LI_FLAGS))
1051)
1052
14c26c6a 1053TRACE_EVENT(xfs_log_force,
9f27889f
CM
1054 TP_PROTO(struct xfs_mount *mp, xfs_lsn_t lsn, unsigned long caller_ip),
1055 TP_ARGS(mp, lsn, caller_ip),
14c26c6a
DC
1056 TP_STRUCT__entry(
1057 __field(dev_t, dev)
1058 __field(xfs_lsn_t, lsn)
9f27889f 1059 __field(unsigned long, caller_ip)
14c26c6a
DC
1060 ),
1061 TP_fast_assign(
1062 __entry->dev = mp->m_super->s_dev;
1063 __entry->lsn = lsn;
9f27889f 1064 __entry->caller_ip = caller_ip;
14c26c6a 1065 ),
9f27889f 1066 TP_printk("dev %d:%d lsn 0x%llx caller %ps",
14c26c6a 1067 MAJOR(__entry->dev), MINOR(__entry->dev),
9f27889f 1068 __entry->lsn, (void *)__entry->caller_ip)
14c26c6a
DC
1069)
1070
9e4c109a
CH
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);
9e4c109a
CH
1076DEFINE_LOG_ITEM_EVENT(xfs_ail_pinned);
1077DEFINE_LOG_ITEM_EVENT(xfs_ail_locked);
43ff2122 1078DEFINE_LOG_ITEM_EVENT(xfs_ail_flushing);
9e4c109a 1079
750b9c90
DC
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)
9e4c109a 1137
f8adb4d5 1138DECLARE_EVENT_CLASS(xfs_file_class,
3176c3e0
CH
1139 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset),
1140 TP_ARGS(ip, count, offset),
f8adb4d5
LZ
1141 TP_STRUCT__entry(
1142 __field(dev_t, dev)
1143 __field(xfs_ino_t, ino)
1144 __field(xfs_fsize_t, size)
f8adb4d5
LZ
1145 __field(loff_t, offset)
1146 __field(size_t, count)
f8adb4d5
LZ
1147 ),
1148 TP_fast_assign(
1149 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1150 __entry->ino = ip->i_ino;
1151 __entry->size = ip->i_d.di_size;
f8adb4d5
LZ
1152 __entry->offset = offset;
1153 __entry->count = count;
f8adb4d5 1154 ),
3176c3e0 1155 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count 0x%zx",
f8adb4d5
LZ
1156 MAJOR(__entry->dev), MINOR(__entry->dev),
1157 __entry->ino,
1158 __entry->size,
f8adb4d5 1159 __entry->offset,
3176c3e0 1160 __entry->count)
0b1b213f 1161)
f8adb4d5
LZ
1162
1163#define DEFINE_RW_EVENT(name) \
1164DEFINE_EVENT(xfs_file_class, name, \
3176c3e0
CH
1165 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset), \
1166 TP_ARGS(ip, count, offset))
1167DEFINE_RW_EVENT(xfs_file_buffered_read);
1168DEFINE_RW_EVENT(xfs_file_direct_read);
16d4d435 1169DEFINE_RW_EVENT(xfs_file_dax_read);
0b1b213f
CH
1170DEFINE_RW_EVENT(xfs_file_buffered_write);
1171DEFINE_RW_EVENT(xfs_file_direct_write);
16d4d435 1172DEFINE_RW_EVENT(xfs_file_dax_write);
0b1b213f 1173
f8adb4d5 1174DECLARE_EVENT_CLASS(xfs_page_class,
34097dfe
LC
1175 TP_PROTO(struct inode *inode, struct page *page, unsigned long off,
1176 unsigned int len),
1177 TP_ARGS(inode, page, off, len),
f8adb4d5
LZ
1178 TP_STRUCT__entry(
1179 __field(dev_t, dev)
1180 __field(xfs_ino_t, ino)
1181 __field(pgoff_t, pgoff)
1182 __field(loff_t, size)
1183 __field(unsigned long, offset)
34097dfe 1184 __field(unsigned int, length)
f8adb4d5 1185 __field(int, delalloc)
f8adb4d5
LZ
1186 __field(int, unwritten)
1187 ),
1188 TP_fast_assign(
20cb52eb 1189 int delalloc = -1, unwritten = -1;
f8adb4d5
LZ
1190
1191 if (page_has_buffers(page))
20cb52eb 1192 xfs_count_page_state(page, &delalloc, &unwritten);
f8adb4d5
LZ
1193 __entry->dev = inode->i_sb->s_dev;
1194 __entry->ino = XFS_I(inode)->i_ino;
1195 __entry->pgoff = page_offset(page);
1196 __entry->size = i_size_read(inode);
1197 __entry->offset = off;
34097dfe 1198 __entry->length = len;
f8adb4d5 1199 __entry->delalloc = delalloc;
f8adb4d5
LZ
1200 __entry->unwritten = unwritten;
1201 ),
1202 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
34097dfe 1203 "length %x delalloc %d unwritten %d",
f8adb4d5
LZ
1204 MAJOR(__entry->dev), MINOR(__entry->dev),
1205 __entry->ino,
1206 __entry->pgoff,
1207 __entry->size,
1208 __entry->offset,
34097dfe 1209 __entry->length,
f8adb4d5 1210 __entry->delalloc,
f8adb4d5 1211 __entry->unwritten)
0b1b213f 1212)
f8adb4d5
LZ
1213
1214#define DEFINE_PAGE_EVENT(name) \
1215DEFINE_EVENT(xfs_page_class, name, \
34097dfe
LC
1216 TP_PROTO(struct inode *inode, struct page *page, unsigned long off, \
1217 unsigned int len), \
1218 TP_ARGS(inode, page, off, len))
0b1b213f
CH
1219DEFINE_PAGE_EVENT(xfs_writepage);
1220DEFINE_PAGE_EVENT(xfs_releasepage);
1221DEFINE_PAGE_EVENT(xfs_invalidatepage);
1222
121e213e
DC
1223DECLARE_EVENT_CLASS(xfs_readpage_class,
1224 TP_PROTO(struct inode *inode, int nr_pages),
1225 TP_ARGS(inode, nr_pages),
1226 TP_STRUCT__entry(
1227 __field(dev_t, dev)
1228 __field(xfs_ino_t, ino)
1229 __field(int, nr_pages)
1230 ),
1231 TP_fast_assign(
1232 __entry->dev = inode->i_sb->s_dev;
1233 __entry->ino = inode->i_ino;
1234 __entry->nr_pages = nr_pages;
1235 ),
1236 TP_printk("dev %d:%d ino 0x%llx nr_pages %d",
1237 MAJOR(__entry->dev), MINOR(__entry->dev),
1238 __entry->ino,
1239 __entry->nr_pages)
1240)
1241
1242#define DEFINE_READPAGE_EVENT(name) \
1243DEFINE_EVENT(xfs_readpage_class, name, \
1244 TP_PROTO(struct inode *inode, int nr_pages), \
1245 TP_ARGS(inode, nr_pages))
1246DEFINE_READPAGE_EVENT(xfs_vm_readpage);
1247DEFINE_READPAGE_EVENT(xfs_vm_readpages);
1248
a206c817 1249DECLARE_EVENT_CLASS(xfs_imap_class,
f8adb4d5 1250 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
a206c817
CH
1251 int type, struct xfs_bmbt_irec *irec),
1252 TP_ARGS(ip, offset, count, type, irec),
f8adb4d5
LZ
1253 TP_STRUCT__entry(
1254 __field(dev_t, dev)
1255 __field(xfs_ino_t, ino)
1256 __field(loff_t, size)
f8adb4d5
LZ
1257 __field(loff_t, offset)
1258 __field(size_t, count)
a206c817 1259 __field(int, type)
f8adb4d5
LZ
1260 __field(xfs_fileoff_t, startoff)
1261 __field(xfs_fsblock_t, startblock)
1262 __field(xfs_filblks_t, blockcount)
1263 ),
1264 TP_fast_assign(
1265 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1266 __entry->ino = ip->i_ino;
1267 __entry->size = ip->i_d.di_size;
f8adb4d5
LZ
1268 __entry->offset = offset;
1269 __entry->count = count;
a206c817 1270 __entry->type = type;
f8adb4d5
LZ
1271 __entry->startoff = irec ? irec->br_startoff : 0;
1272 __entry->startblock = irec ? irec->br_startblock : 0;
1273 __entry->blockcount = irec ? irec->br_blockcount : 0;
1274 ),
2813d682
CH
1275 TP_printk("dev %d:%d ino 0x%llx size 0x%llx offset 0x%llx count %zd "
1276 "type %s startoff 0x%llx startblock %lld blockcount 0x%llx",
f8adb4d5
LZ
1277 MAJOR(__entry->dev), MINOR(__entry->dev),
1278 __entry->ino,
1279 __entry->size,
f8adb4d5
LZ
1280 __entry->offset,
1281 __entry->count,
a206c817 1282 __print_symbolic(__entry->type, XFS_IO_TYPES),
f8adb4d5
LZ
1283 __entry->startoff,
1284 (__int64_t)__entry->startblock,
1285 __entry->blockcount)
0b1b213f 1286)
f8adb4d5
LZ
1287
1288#define DEFINE_IOMAP_EVENT(name) \
a206c817 1289DEFINE_EVENT(xfs_imap_class, name, \
f8adb4d5 1290 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
a206c817
CH
1291 int type, struct xfs_bmbt_irec *irec), \
1292 TP_ARGS(ip, offset, count, type, irec))
1293DEFINE_IOMAP_EVENT(xfs_map_blocks_found);
1294DEFINE_IOMAP_EVENT(xfs_map_blocks_alloc);
1295DEFINE_IOMAP_EVENT(xfs_get_blocks_found);
1296DEFINE_IOMAP_EVENT(xfs_get_blocks_alloc);
273dda76 1297DEFINE_IOMAP_EVENT(xfs_get_blocks_map_direct);
68a9f5e7
CH
1298DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
1299DEFINE_IOMAP_EVENT(xfs_iomap_found);
0b1b213f 1300
f8adb4d5
LZ
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)
55fb25d5
DC
1307 __field(loff_t, isize)
1308 __field(loff_t, disize)
f8adb4d5
LZ
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;
ce7ae151 1315 __entry->isize = VFS_I(ip)->i_size;
55fb25d5 1316 __entry->disize = ip->i_d.di_size;
f8adb4d5
LZ
1317 __entry->offset = offset;
1318 __entry->count = count;
1319 ),
2813d682 1320 TP_printk("dev %d:%d ino 0x%llx isize 0x%llx disize 0x%llx "
f8adb4d5
LZ
1321 "offset 0x%llx count %zd",
1322 MAJOR(__entry->dev), MINOR(__entry->dev),
1323 __entry->ino,
55fb25d5
DC
1324 __entry->isize,
1325 __entry->disize,
f8adb4d5
LZ
1326 __entry->offset,
1327 __entry->count)
0b1b213f 1328);
f8adb4d5
LZ
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))
0b1b213f
CH
1334DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
1335DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
a206c817 1336DEFINE_SIMPLE_IO_EVENT(xfs_get_blocks_notfound);
55fb25d5 1337DEFINE_SIMPLE_IO_EVENT(xfs_setfilesize);
0a50f162 1338DEFINE_SIMPLE_IO_EVENT(xfs_zero_eof);
273dda76
CH
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);
0b1b213f 1342
ea9a4888
CH
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
0b1b213f 1365#define DEFINE_ITRUNC_EVENT(name) \
ea9a4888 1366DEFINE_EVENT(xfs_itrunc_class, name, \
0b1b213f 1367 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
ea9a4888 1368 TP_ARGS(ip, new_size))
673e8e59
CH
1369DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_start);
1370DEFINE_ITRUNC_EVENT(xfs_itruncate_extents_end);
0b1b213f
CH
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"
65dd297a 1420 "flags %s caller %ps",
0b1b213f
CH
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
4ecbfe63 1431DECLARE_EVENT_CLASS(xfs_extent_busy_class,
0b1b213f 1432 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
ed3b4d6c
DC
1433 xfs_agblock_t agbno, xfs_extlen_t len),
1434 TP_ARGS(mp, agno, agbno, len),
0b1b213f
CH
1435 TP_STRUCT__entry(
1436 __field(dev_t, dev)
1437 __field(xfs_agnumber_t, agno)
ed3b4d6c
DC
1438 __field(xfs_agblock_t, agbno)
1439 __field(xfs_extlen_t, len)
0b1b213f
CH
1440 ),
1441 TP_fast_assign(
1442 __entry->dev = mp->m_super->s_dev;
1443 __entry->agno = agno;
ed3b4d6c
DC
1444 __entry->agbno = agbno;
1445 __entry->len = len;
0b1b213f 1446 ),
ed3b4d6c 1447 TP_printk("dev %d:%d agno %u agbno %u len %u",
0b1b213f
CH
1448 MAJOR(__entry->dev), MINOR(__entry->dev),
1449 __entry->agno,
ed3b4d6c
DC
1450 __entry->agbno,
1451 __entry->len)
0b1b213f 1452);
97d3ac75 1453#define DEFINE_BUSY_EVENT(name) \
4ecbfe63 1454DEFINE_EVENT(xfs_extent_busy_class, name, \
97d3ac75
CH
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))
4ecbfe63
DC
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);
ed3b4d6c 1463
4ecbfe63 1464TRACE_EVENT(xfs_extent_busy_trim,
e26f0501
CH
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
ed3b4d6c
DC
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,
fd45e478 1510 __entry->lsn)
0b1b213f
CH
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 "
65dd297a 1553 "freeblks %u longest %u caller %ps",
0b1b213f
CH
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
ea9a4888
CH
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,
1a18a294 1671 (unsigned long long)__entry->firstblock)
0b1b213f
CH
1672)
1673
ea9a4888
CH
1674#define DEFINE_ALLOC_EVENT(name) \
1675DEFINE_EVENT(xfs_alloc_class, name, \
1676 TP_PROTO(struct xfs_alloc_arg *args), \
1677 TP_ARGS(args))
0b1b213f 1678DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
9f9baab3 1679DEFINE_ALLOC_EVENT(xfs_alloc_exact_notfound);
0b1b213f
CH
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);
e26f0501
CH
1686DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1687DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
0b1b213f
CH
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);
e26f0501 1693DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
0b1b213f
CH
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
5a5881cd 1704DECLARE_EVENT_CLASS(xfs_da_class,
ea9a4888
CH
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) \
5a5881cd 1739DEFINE_EVENT(xfs_da_class, name, \
0b1b213f 1740 TP_PROTO(struct xfs_da_args *args), \
ea9a4888
CH
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
ee73259b
DC
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
5a5881cd 1802#define DEFINE_ATTR_EVENT(name) \
ee73259b 1803DEFINE_EVENT(xfs_attr_class, name, \
5a5881cd
DC
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);
ee73259b 1817DEFINE_ATTR_EVENT(xfs_attr_leaf_add_work);
5a5881cd
DC
1818DEFINE_ATTR_EVENT(xfs_attr_leaf_addname);
1819DEFINE_ATTR_EVENT(xfs_attr_leaf_create);
ee73259b
DC
1820DEFINE_ATTR_EVENT(xfs_attr_leaf_compact);
1821DEFINE_ATTR_EVENT(xfs_attr_leaf_get);
5a5881cd
DC
1822DEFINE_ATTR_EVENT(xfs_attr_leaf_lookup);
1823DEFINE_ATTR_EVENT(xfs_attr_leaf_replace);
ee73259b 1824DEFINE_ATTR_EVENT(xfs_attr_leaf_remove);
5a5881cd
DC
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);
ee73259b 1836DEFINE_ATTR_EVENT(xfs_attr_leaf_toosmall);
5a5881cd
DC
1837
1838DEFINE_ATTR_EVENT(xfs_attr_node_addname);
ee73259b 1839DEFINE_ATTR_EVENT(xfs_attr_node_get);
5a5881cd
DC
1840DEFINE_ATTR_EVENT(xfs_attr_node_lookup);
1841DEFINE_ATTR_EVENT(xfs_attr_node_replace);
1842DEFINE_ATTR_EVENT(xfs_attr_node_removename);
1843
ee73259b
DC
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
5a5881cd
DC
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);
ee73259b 1869DEFINE_DA_EVENT(xfs_da_node_toosmall);
5a5881cd
DC
1870DEFINE_DA_EVENT(xfs_da_swap_lastblock);
1871DEFINE_DA_EVENT(xfs_da_grow_inode);
1872DEFINE_DA_EVENT(xfs_da_shrink_inode);
ee73259b
DC
1873DEFINE_DA_EVENT(xfs_da_fixhashpath);
1874DEFINE_DA_EVENT(xfs_da_path_shift);
5a5881cd 1875
ea9a4888
CH
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)
0b1b213f 1896)
0b1b213f 1897
ea9a4888
CH
1898#define DEFINE_DIR2_SPACE_EVENT(name) \
1899DEFINE_EVENT(xfs_dir2_space_class, name, \
0b1b213f 1900 TP_PROTO(struct xfs_da_args *args, int idx), \
ea9a4888
CH
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);
0b1b213f
CH
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
3a85cd96
DC
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)
3a85cd96
DC
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;
3a85cd96
DC
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, "
8096b1eb 1968 "broot size %d, fork offset %d",
3a85cd96
DC
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,
3a85cd96
DC
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
9abbc539 1986DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
ad223e60 1987 TP_PROTO(struct xlog *log, struct xlog_recover *trans,
9abbc539
DC
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, \
ad223e60 2021 TP_PROTO(struct xlog *log, struct xlog_recover *trans, \
9abbc539
DC
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,
ad223e60 2032 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f),
9abbc539
DC
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, \
ad223e60 2062 TP_PROTO(struct xlog *log, struct xfs_buf_log_format *buf_f), \
9abbc539
DC
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,
ad223e60 2075 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f),
9abbc539
DC
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, \
ad223e60 2113 TP_PROTO(struct xlog *log, struct xfs_inode_log_format *in_f), \
9abbc539
DC
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
78d57e45
BF
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
a46db608
CH
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
2c813ad6
DW
2187/* btree cursor events */
2188DECLARE_EVENT_CLASS(xfs_btree_cur_class,
2189 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp),
2190 TP_ARGS(cur, level, bp),
2191 TP_STRUCT__entry(
2192 __field(dev_t, dev)
2193 __field(xfs_btnum_t, btnum)
2194 __field(int, level)
2195 __field(int, nlevels)
2196 __field(int, ptr)
2197 __field(xfs_daddr_t, daddr)
2198 ),
2199 TP_fast_assign(
2200 __entry->dev = cur->bc_mp->m_super->s_dev;
2201 __entry->btnum = cur->bc_btnum;
2202 __entry->level = level;
2203 __entry->nlevels = cur->bc_nlevels;
2204 __entry->ptr = cur->bc_ptrs[level];
2205 __entry->daddr = bp ? bp->b_bn : -1;
2206 ),
2207 TP_printk("dev %d:%d btnum %d level %d/%d ptr %d daddr 0x%llx",
2208 MAJOR(__entry->dev), MINOR(__entry->dev),
2209 __entry->btnum,
2210 __entry->level,
2211 __entry->nlevels,
2212 __entry->ptr,
2213 (unsigned long long)__entry->daddr)
2214)
2215
2216#define DEFINE_BTREE_CUR_EVENT(name) \
2217DEFINE_EVENT(xfs_btree_cur_class, name, \
2218 TP_PROTO(struct xfs_btree_cur *cur, int level, struct xfs_buf *bp), \
2219 TP_ARGS(cur, level, bp))
2220DEFINE_BTREE_CUR_EVENT(xfs_btree_updkeys);
105f7d83 2221DEFINE_BTREE_CUR_EVENT(xfs_btree_overlapped_query_range);
2c813ad6 2222
3cd48abc
DW
2223/* deferred ops */
2224struct xfs_defer_pending;
2225struct xfs_defer_intake;
2226struct xfs_defer_ops;
2227
2228DECLARE_EVENT_CLASS(xfs_defer_class,
2229 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop),
2230 TP_ARGS(mp, dop),
2231 TP_STRUCT__entry(
2232 __field(dev_t, dev)
2233 __field(void *, dop)
2234 __field(bool, committed)
2235 __field(bool, low)
2236 ),
2237 TP_fast_assign(
2238 __entry->dev = mp ? mp->m_super->s_dev : 0;
2239 __entry->dop = dop;
2240 __entry->committed = dop->dop_committed;
2241 __entry->low = dop->dop_low;
2242 ),
2243 TP_printk("dev %d:%d ops %p committed %d low %d\n",
2244 MAJOR(__entry->dev), MINOR(__entry->dev),
2245 __entry->dop,
2246 __entry->committed,
2247 __entry->low)
2248)
2249#define DEFINE_DEFER_EVENT(name) \
2250DEFINE_EVENT(xfs_defer_class, name, \
2251 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop), \
2252 TP_ARGS(mp, dop))
2253
2254DECLARE_EVENT_CLASS(xfs_defer_error_class,
2255 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error),
2256 TP_ARGS(mp, dop, error),
2257 TP_STRUCT__entry(
2258 __field(dev_t, dev)
2259 __field(void *, dop)
2260 __field(bool, committed)
2261 __field(bool, low)
2262 __field(int, error)
2263 ),
2264 TP_fast_assign(
2265 __entry->dev = mp ? mp->m_super->s_dev : 0;
2266 __entry->dop = dop;
2267 __entry->committed = dop->dop_committed;
2268 __entry->low = dop->dop_low;
2269 __entry->error = error;
2270 ),
2271 TP_printk("dev %d:%d ops %p committed %d low %d err %d\n",
2272 MAJOR(__entry->dev), MINOR(__entry->dev),
2273 __entry->dop,
2274 __entry->committed,
2275 __entry->low,
2276 __entry->error)
2277)
2278#define DEFINE_DEFER_ERROR_EVENT(name) \
2279DEFINE_EVENT(xfs_defer_error_class, name, \
2280 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_ops *dop, int error), \
2281 TP_ARGS(mp, dop, error))
2282
2283DECLARE_EVENT_CLASS(xfs_defer_pending_class,
2284 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp),
2285 TP_ARGS(mp, dfp),
2286 TP_STRUCT__entry(
2287 __field(dev_t, dev)
2288 __field(int, type)
2289 __field(void *, intent)
2290 __field(bool, committed)
2291 __field(int, nr)
2292 ),
2293 TP_fast_assign(
2294 __entry->dev = mp ? mp->m_super->s_dev : 0;
2295 __entry->type = dfp->dfp_type->type;
2296 __entry->intent = dfp->dfp_intent;
ea78d808 2297 __entry->committed = dfp->dfp_done != NULL;
3cd48abc
DW
2298 __entry->nr = dfp->dfp_count;
2299 ),
2300 TP_printk("dev %d:%d optype %d intent %p committed %d nr %d\n",
2301 MAJOR(__entry->dev), MINOR(__entry->dev),
2302 __entry->type,
2303 __entry->intent,
2304 __entry->committed,
2305 __entry->nr)
2306)
2307#define DEFINE_DEFER_PENDING_EVENT(name) \
2308DEFINE_EVENT(xfs_defer_pending_class, name, \
2309 TP_PROTO(struct xfs_mount *mp, struct xfs_defer_pending *dfp), \
2310 TP_ARGS(mp, dfp))
2311
2312DECLARE_EVENT_CLASS(xfs_phys_extent_deferred_class,
2313 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2314 int type, xfs_agblock_t agbno, xfs_extlen_t len),
2315 TP_ARGS(mp, agno, type, agbno, len),
2316 TP_STRUCT__entry(
2317 __field(dev_t, dev)
2318 __field(xfs_agnumber_t, agno)
2319 __field(int, type)
2320 __field(xfs_agblock_t, agbno)
2321 __field(xfs_extlen_t, len)
2322 ),
2323 TP_fast_assign(
2324 __entry->dev = mp->m_super->s_dev;
2325 __entry->agno = agno;
2326 __entry->type = type;
2327 __entry->agbno = agbno;
2328 __entry->len = len;
2329 ),
2330 TP_printk("dev %d:%d op %d agno %u agbno %u len %u",
2331 MAJOR(__entry->dev), MINOR(__entry->dev),
2332 __entry->type,
2333 __entry->agno,
2334 __entry->agbno,
2335 __entry->len)
2336);
2337#define DEFINE_PHYS_EXTENT_DEFERRED_EVENT(name) \
2338DEFINE_EVENT(xfs_phys_extent_deferred_class, name, \
2339 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2340 int type, \
2341 xfs_agblock_t bno, \
2342 xfs_extlen_t len), \
2343 TP_ARGS(mp, agno, type, bno, len))
2344
2345DECLARE_EVENT_CLASS(xfs_map_extent_deferred_class,
2346 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2347 int op,
2348 xfs_agblock_t agbno,
2349 xfs_ino_t ino,
2350 int whichfork,
2351 xfs_fileoff_t offset,
2352 xfs_filblks_t len,
2353 xfs_exntst_t state),
2354 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state),
2355 TP_STRUCT__entry(
2356 __field(dev_t, dev)
2357 __field(xfs_agnumber_t, agno)
2358 __field(xfs_ino_t, ino)
2359 __field(xfs_agblock_t, agbno)
2360 __field(int, whichfork)
2361 __field(xfs_fileoff_t, l_loff)
2362 __field(xfs_filblks_t, l_len)
2363 __field(xfs_exntst_t, l_state)
2364 __field(int, op)
2365 ),
2366 TP_fast_assign(
2367 __entry->dev = mp->m_super->s_dev;
2368 __entry->agno = agno;
2369 __entry->ino = ino;
2370 __entry->agbno = agbno;
2371 __entry->whichfork = whichfork;
2372 __entry->l_loff = offset;
2373 __entry->l_len = len;
2374 __entry->l_state = state;
2375 __entry->op = op;
2376 ),
2377 TP_printk("dev %d:%d op %d agno %u agbno %u owner %lld %s offset %llu len %llu state %d",
2378 MAJOR(__entry->dev), MINOR(__entry->dev),
2379 __entry->op,
2380 __entry->agno,
2381 __entry->agbno,
2382 __entry->ino,
2383 __entry->whichfork == XFS_ATTR_FORK ? "attr" : "data",
2384 __entry->l_loff,
2385 __entry->l_len,
2386 __entry->l_state)
2387);
2388#define DEFINE_MAP_EXTENT_DEFERRED_EVENT(name) \
2389DEFINE_EVENT(xfs_map_extent_deferred_class, name, \
2390 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2391 int op, \
2392 xfs_agblock_t agbno, \
2393 xfs_ino_t ino, \
2394 int whichfork, \
2395 xfs_fileoff_t offset, \
2396 xfs_filblks_t len, \
2397 xfs_exntst_t state), \
2398 TP_ARGS(mp, agno, op, agbno, ino, whichfork, offset, len, state))
2399
2400DEFINE_DEFER_EVENT(xfs_defer_init);
2401DEFINE_DEFER_EVENT(xfs_defer_cancel);
2402DEFINE_DEFER_EVENT(xfs_defer_trans_roll);
2403DEFINE_DEFER_EVENT(xfs_defer_trans_abort);
2404DEFINE_DEFER_EVENT(xfs_defer_finish);
2405DEFINE_DEFER_EVENT(xfs_defer_finish_done);
2406
2407DEFINE_DEFER_ERROR_EVENT(xfs_defer_trans_roll_error);
2408DEFINE_DEFER_ERROR_EVENT(xfs_defer_finish_error);
2409DEFINE_DEFER_ERROR_EVENT(xfs_defer_op_finish_error);
2410
2411DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_work);
2412DEFINE_DEFER_PENDING_EVENT(xfs_defer_intake_cancel);
2413DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_commit);
2414DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_cancel);
2415DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_finish);
2416DEFINE_DEFER_PENDING_EVENT(xfs_defer_pending_abort);
2417
ba9e7802
DW
2418#define DEFINE_BMAP_FREE_DEFERRED_EVENT DEFINE_PHYS_EXTENT_DEFERRED_EVENT
2419DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_defer);
2420DEFINE_BMAP_FREE_DEFERRED_EVENT(xfs_bmap_free_deferred);
2421
673930c3
DW
2422/* rmap tracepoints */
2423DECLARE_EVENT_CLASS(xfs_rmap_class,
2424 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2425 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten,
2426 struct xfs_owner_info *oinfo),
2427 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo),
2428 TP_STRUCT__entry(
2429 __field(dev_t, dev)
2430 __field(xfs_agnumber_t, agno)
2431 __field(xfs_agblock_t, agbno)
2432 __field(xfs_extlen_t, len)
2433 __field(uint64_t, owner)
2434 __field(uint64_t, offset)
2435 __field(unsigned long, flags)
2436 ),
2437 TP_fast_assign(
2438 __entry->dev = mp->m_super->s_dev;
2439 __entry->agno = agno;
2440 __entry->agbno = agbno;
2441 __entry->len = len;
2442 __entry->owner = oinfo->oi_owner;
2443 __entry->offset = oinfo->oi_offset;
2444 __entry->flags = oinfo->oi_flags;
035e00ac
DW
2445 if (unwritten)
2446 __entry->flags |= XFS_RMAP_UNWRITTEN;
673930c3
DW
2447 ),
2448 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%lx",
2449 MAJOR(__entry->dev), MINOR(__entry->dev),
2450 __entry->agno,
2451 __entry->agbno,
2452 __entry->len,
2453 __entry->owner,
2454 __entry->offset,
2455 __entry->flags)
2456);
2457#define DEFINE_RMAP_EVENT(name) \
2458DEFINE_EVENT(xfs_rmap_class, name, \
2459 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2460 xfs_agblock_t agbno, xfs_extlen_t len, bool unwritten, \
2461 struct xfs_owner_info *oinfo), \
2462 TP_ARGS(mp, agno, agbno, len, unwritten, oinfo))
2463
2464/* simple AG-based error/%ip tracepoint class */
2465DECLARE_EVENT_CLASS(xfs_ag_error_class,
2466 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error,
2467 unsigned long caller_ip),
2468 TP_ARGS(mp, agno, error, caller_ip),
2469 TP_STRUCT__entry(
2470 __field(dev_t, dev)
2471 __field(xfs_agnumber_t, agno)
2472 __field(int, error)
2473 __field(unsigned long, caller_ip)
2474 ),
2475 TP_fast_assign(
2476 __entry->dev = mp->m_super->s_dev;
2477 __entry->agno = agno;
2478 __entry->error = error;
2479 __entry->caller_ip = caller_ip;
2480 ),
2481 TP_printk("dev %d:%d agno %u error %d caller %ps",
2482 MAJOR(__entry->dev), MINOR(__entry->dev),
2483 __entry->agno,
2484 __entry->error,
2485 (char *)__entry->caller_ip)
2486);
2487
2488#define DEFINE_AG_ERROR_EVENT(name) \
2489DEFINE_EVENT(xfs_ag_error_class, name, \
2490 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int error, \
2491 unsigned long caller_ip), \
2492 TP_ARGS(mp, agno, error, caller_ip))
2493
2494DEFINE_RMAP_EVENT(xfs_rmap_unmap);
2495DEFINE_RMAP_EVENT(xfs_rmap_unmap_done);
2496DEFINE_AG_ERROR_EVENT(xfs_rmap_unmap_error);
2497DEFINE_RMAP_EVENT(xfs_rmap_map);
2498DEFINE_RMAP_EVENT(xfs_rmap_map_done);
2499DEFINE_AG_ERROR_EVENT(xfs_rmap_map_error);
fb7d9267
DW
2500DEFINE_RMAP_EVENT(xfs_rmap_convert);
2501DEFINE_RMAP_EVENT(xfs_rmap_convert_done);
2502DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_error);
2503DEFINE_AG_ERROR_EVENT(xfs_rmap_convert_state);
673930c3 2504
aa966d84
DW
2505DECLARE_EVENT_CLASS(xfs_rmapbt_class,
2506 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
2507 xfs_agblock_t agbno, xfs_extlen_t len,
2508 uint64_t owner, uint64_t offset, unsigned int flags),
2509 TP_ARGS(mp, agno, agbno, len, owner, offset, flags),
2510 TP_STRUCT__entry(
2511 __field(dev_t, dev)
2512 __field(xfs_agnumber_t, agno)
2513 __field(xfs_agblock_t, agbno)
2514 __field(xfs_extlen_t, len)
2515 __field(uint64_t, owner)
2516 __field(uint64_t, offset)
2517 __field(unsigned int, flags)
2518 ),
2519 TP_fast_assign(
2520 __entry->dev = mp->m_super->s_dev;
2521 __entry->agno = agno;
2522 __entry->agbno = agbno;
2523 __entry->len = len;
2524 __entry->owner = owner;
2525 __entry->offset = offset;
2526 __entry->flags = flags;
2527 ),
2528 TP_printk("dev %d:%d agno %u agbno %u len %u owner %lld offset %llu flags 0x%x",
2529 MAJOR(__entry->dev), MINOR(__entry->dev),
2530 __entry->agno,
2531 __entry->agbno,
2532 __entry->len,
2533 __entry->owner,
2534 __entry->offset,
2535 __entry->flags)
2536);
2537#define DEFINE_RMAPBT_EVENT(name) \
2538DEFINE_EVENT(xfs_rmapbt_class, name, \
2539 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, \
2540 xfs_agblock_t agbno, xfs_extlen_t len, \
2541 uint64_t owner, uint64_t offset, unsigned int flags), \
2542 TP_ARGS(mp, agno, agbno, len, owner, offset, flags))
2543
2544#define DEFINE_RMAP_DEFERRED_EVENT DEFINE_MAP_EXTENT_DEFERRED_EVENT
2545DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_defer);
2546DEFINE_RMAP_DEFERRED_EVENT(xfs_rmap_deferred);
2547
4b8ed677
DW
2548DEFINE_BUSY_EVENT(xfs_rmapbt_alloc_block);
2549DEFINE_BUSY_EVENT(xfs_rmapbt_free_block);
aa966d84
DW
2550DEFINE_RMAPBT_EVENT(xfs_rmap_update);
2551DEFINE_RMAPBT_EVENT(xfs_rmap_insert);
2552DEFINE_RMAPBT_EVENT(xfs_rmap_delete);
2553DEFINE_AG_ERROR_EVENT(xfs_rmap_insert_error);
2554DEFINE_AG_ERROR_EVENT(xfs_rmap_delete_error);
2555DEFINE_AG_ERROR_EVENT(xfs_rmap_update_error);
0a1b0b38
DW
2556DEFINE_RMAPBT_EVENT(xfs_rmap_lookup_le_range_result);
2557DEFINE_RMAPBT_EVENT(xfs_rmap_find_right_neighbor_result);
fb7d9267 2558DEFINE_RMAPBT_EVENT(xfs_rmap_find_left_neighbor_result);
4b8ed677 2559
0b1b213f
CH
2560#endif /* _TRACE_XFS_H */
2561
2562#undef TRACE_INCLUDE_PATH
2563#define TRACE_INCLUDE_PATH .
2564#define TRACE_INCLUDE_FILE xfs_trace
2565#include <trace/define_trace.h>