Linux 2.6.35-rc2
[linux/fpc-iii.git] / fs / xfs / linux-2.6 / xfs_trace.h
blob73d5aa117384bc1e8c626012dba881e02a5deb57
1 /*
2 * Copyright (c) 2009, Christoph Hellwig
3 * All Rights Reserved.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #undef TRACE_SYSTEM
19 #define TRACE_SYSTEM xfs
21 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
22 #define _TRACE_XFS_H
24 #include <linux/tracepoint.h>
26 struct xfs_agf;
27 struct xfs_alloc_arg;
28 struct xfs_attr_list_context;
29 struct xfs_buf_log_item;
30 struct xfs_da_args;
31 struct xfs_da_node_entry;
32 struct xfs_dquot;
33 struct xlog_ticket;
34 struct log;
35 struct xlog_recover;
36 struct xlog_recover_item;
37 struct xfs_buf_log_format;
38 struct xfs_inode_log_format;
40 DECLARE_EVENT_CLASS(xfs_attr_list_class,
41 TP_PROTO(struct xfs_attr_list_context *ctx),
42 TP_ARGS(ctx),
43 TP_STRUCT__entry(
44 __field(dev_t, dev)
45 __field(xfs_ino_t, ino)
46 __field(u32, hashval)
47 __field(u32, blkno)
48 __field(u32, offset)
49 __field(void *, alist)
50 __field(int, bufsize)
51 __field(int, count)
52 __field(int, firstu)
53 __field(int, dupcnt)
54 __field(int, flags)
56 TP_fast_assign(
57 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
58 __entry->ino = ctx->dp->i_ino;
59 __entry->hashval = ctx->cursor->hashval;
60 __entry->blkno = ctx->cursor->blkno;
61 __entry->offset = ctx->cursor->offset;
62 __entry->alist = ctx->alist;
63 __entry->bufsize = ctx->bufsize;
64 __entry->count = ctx->count;
65 __entry->firstu = ctx->firstu;
66 __entry->flags = ctx->flags;
68 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
69 "alist 0x%p size %u count %u firstu %u flags %d %s",
70 MAJOR(__entry->dev), MINOR(__entry->dev),
71 __entry->ino,
72 __entry->hashval,
73 __entry->blkno,
74 __entry->offset,
75 __entry->dupcnt,
76 __entry->alist,
77 __entry->bufsize,
78 __entry->count,
79 __entry->firstu,
80 __entry->flags,
81 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS)
85 #define DEFINE_ATTR_LIST_EVENT(name) \
86 DEFINE_EVENT(xfs_attr_list_class, name, \
87 TP_PROTO(struct xfs_attr_list_context *ctx), \
88 TP_ARGS(ctx))
89 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf);
90 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all);
91 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf);
92 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end);
93 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full);
94 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add);
95 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk);
96 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound);
98 DECLARE_EVENT_CLASS(xfs_perag_class,
99 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount,
100 unsigned long caller_ip),
101 TP_ARGS(mp, agno, refcount, caller_ip),
102 TP_STRUCT__entry(
103 __field(dev_t, dev)
104 __field(xfs_agnumber_t, agno)
105 __field(int, refcount)
106 __field(unsigned long, caller_ip)
108 TP_fast_assign(
109 __entry->dev = mp->m_super->s_dev;
110 __entry->agno = agno;
111 __entry->refcount = refcount;
112 __entry->caller_ip = caller_ip;
114 TP_printk("dev %d:%d agno %u refcount %d caller %pf",
115 MAJOR(__entry->dev), MINOR(__entry->dev),
116 __entry->agno,
117 __entry->refcount,
118 (char *)__entry->caller_ip)
121 #define DEFINE_PERAG_REF_EVENT(name) \
122 DEFINE_EVENT(xfs_perag_class, name, \
123 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, int refcount, \
124 unsigned long caller_ip), \
125 TP_ARGS(mp, agno, refcount, caller_ip))
126 DEFINE_PERAG_REF_EVENT(xfs_perag_get);
127 DEFINE_PERAG_REF_EVENT(xfs_perag_put);
129 TRACE_EVENT(xfs_attr_list_node_descend,
130 TP_PROTO(struct xfs_attr_list_context *ctx,
131 struct xfs_da_node_entry *btree),
132 TP_ARGS(ctx, btree),
133 TP_STRUCT__entry(
134 __field(dev_t, dev)
135 __field(xfs_ino_t, ino)
136 __field(u32, hashval)
137 __field(u32, blkno)
138 __field(u32, offset)
139 __field(void *, alist)
140 __field(int, bufsize)
141 __field(int, count)
142 __field(int, firstu)
143 __field(int, dupcnt)
144 __field(int, flags)
145 __field(u32, bt_hashval)
146 __field(u32, bt_before)
148 TP_fast_assign(
149 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev;
150 __entry->ino = ctx->dp->i_ino;
151 __entry->hashval = ctx->cursor->hashval;
152 __entry->blkno = ctx->cursor->blkno;
153 __entry->offset = ctx->cursor->offset;
154 __entry->alist = ctx->alist;
155 __entry->bufsize = ctx->bufsize;
156 __entry->count = ctx->count;
157 __entry->firstu = ctx->firstu;
158 __entry->flags = ctx->flags;
159 __entry->bt_hashval = be32_to_cpu(btree->hashval);
160 __entry->bt_before = be32_to_cpu(btree->before);
162 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
163 "alist 0x%p size %u count %u firstu %u flags %d %s "
164 "node hashval %u, node before %u",
165 MAJOR(__entry->dev), MINOR(__entry->dev),
166 __entry->ino,
167 __entry->hashval,
168 __entry->blkno,
169 __entry->offset,
170 __entry->dupcnt,
171 __entry->alist,
172 __entry->bufsize,
173 __entry->count,
174 __entry->firstu,
175 __entry->flags,
176 __print_flags(__entry->flags, "|", XFS_ATTR_FLAGS),
177 __entry->bt_hashval,
178 __entry->bt_before)
181 TRACE_EVENT(xfs_iext_insert,
182 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx,
183 struct xfs_bmbt_irec *r, int state, unsigned long caller_ip),
184 TP_ARGS(ip, idx, r, state, caller_ip),
185 TP_STRUCT__entry(
186 __field(dev_t, dev)
187 __field(xfs_ino_t, ino)
188 __field(xfs_extnum_t, idx)
189 __field(xfs_fileoff_t, startoff)
190 __field(xfs_fsblock_t, startblock)
191 __field(xfs_filblks_t, blockcount)
192 __field(xfs_exntst_t, state)
193 __field(int, bmap_state)
194 __field(unsigned long, caller_ip)
196 TP_fast_assign(
197 __entry->dev = VFS_I(ip)->i_sb->s_dev;
198 __entry->ino = ip->i_ino;
199 __entry->idx = idx;
200 __entry->startoff = r->br_startoff;
201 __entry->startblock = r->br_startblock;
202 __entry->blockcount = r->br_blockcount;
203 __entry->state = r->br_state;
204 __entry->bmap_state = state;
205 __entry->caller_ip = caller_ip;
207 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
208 "offset %lld block %lld count %lld flag %d caller %pf",
209 MAJOR(__entry->dev), MINOR(__entry->dev),
210 __entry->ino,
211 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
212 (long)__entry->idx,
213 __entry->startoff,
214 (__int64_t)__entry->startblock,
215 __entry->blockcount,
216 __entry->state,
217 (char *)__entry->caller_ip)
220 DECLARE_EVENT_CLASS(xfs_bmap_class,
221 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state,
222 unsigned long caller_ip),
223 TP_ARGS(ip, idx, state, caller_ip),
224 TP_STRUCT__entry(
225 __field(dev_t, dev)
226 __field(xfs_ino_t, ino)
227 __field(xfs_extnum_t, idx)
228 __field(xfs_fileoff_t, startoff)
229 __field(xfs_fsblock_t, startblock)
230 __field(xfs_filblks_t, blockcount)
231 __field(xfs_exntst_t, state)
232 __field(int, bmap_state)
233 __field(unsigned long, caller_ip)
235 TP_fast_assign(
236 struct xfs_ifork *ifp = (state & BMAP_ATTRFORK) ?
237 ip->i_afp : &ip->i_df;
238 struct xfs_bmbt_irec r;
240 xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), &r);
241 __entry->dev = VFS_I(ip)->i_sb->s_dev;
242 __entry->ino = ip->i_ino;
243 __entry->idx = idx;
244 __entry->startoff = r.br_startoff;
245 __entry->startblock = r.br_startblock;
246 __entry->blockcount = r.br_blockcount;
247 __entry->state = r.br_state;
248 __entry->bmap_state = state;
249 __entry->caller_ip = caller_ip;
251 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
252 "offset %lld block %lld count %lld flag %d caller %pf",
253 MAJOR(__entry->dev), MINOR(__entry->dev),
254 __entry->ino,
255 __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
256 (long)__entry->idx,
257 __entry->startoff,
258 (__int64_t)__entry->startblock,
259 __entry->blockcount,
260 __entry->state,
261 (char *)__entry->caller_ip)
264 #define DEFINE_BMAP_EVENT(name) \
265 DEFINE_EVENT(xfs_bmap_class, name, \
266 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
267 unsigned long caller_ip), \
268 TP_ARGS(ip, idx, state, caller_ip))
269 DEFINE_BMAP_EVENT(xfs_iext_remove);
270 DEFINE_BMAP_EVENT(xfs_bmap_pre_update);
271 DEFINE_BMAP_EVENT(xfs_bmap_post_update);
272 DEFINE_BMAP_EVENT(xfs_extlist);
274 DECLARE_EVENT_CLASS(xfs_buf_class,
275 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip),
276 TP_ARGS(bp, caller_ip),
277 TP_STRUCT__entry(
278 __field(dev_t, dev)
279 __field(xfs_daddr_t, bno)
280 __field(size_t, buffer_length)
281 __field(int, hold)
282 __field(int, pincount)
283 __field(unsigned, lockval)
284 __field(unsigned, flags)
285 __field(unsigned long, caller_ip)
287 TP_fast_assign(
288 __entry->dev = bp->b_target->bt_dev;
289 __entry->bno = bp->b_bn;
290 __entry->buffer_length = bp->b_buffer_length;
291 __entry->hold = atomic_read(&bp->b_hold);
292 __entry->pincount = atomic_read(&bp->b_pin_count);
293 __entry->lockval = xfs_buf_lock_value(bp);
294 __entry->flags = bp->b_flags;
295 __entry->caller_ip = caller_ip;
297 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
298 "lock %d flags %s caller %pf",
299 MAJOR(__entry->dev), MINOR(__entry->dev),
300 (unsigned long long)__entry->bno,
301 __entry->buffer_length,
302 __entry->hold,
303 __entry->pincount,
304 __entry->lockval,
305 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
306 (void *)__entry->caller_ip)
309 #define DEFINE_BUF_EVENT(name) \
310 DEFINE_EVENT(xfs_buf_class, name, \
311 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
312 TP_ARGS(bp, caller_ip))
313 DEFINE_BUF_EVENT(xfs_buf_init);
314 DEFINE_BUF_EVENT(xfs_buf_free);
315 DEFINE_BUF_EVENT(xfs_buf_hold);
316 DEFINE_BUF_EVENT(xfs_buf_rele);
317 DEFINE_BUF_EVENT(xfs_buf_pin);
318 DEFINE_BUF_EVENT(xfs_buf_unpin);
319 DEFINE_BUF_EVENT(xfs_buf_iodone);
320 DEFINE_BUF_EVENT(xfs_buf_iorequest);
321 DEFINE_BUF_EVENT(xfs_buf_bawrite);
322 DEFINE_BUF_EVENT(xfs_buf_bdwrite);
323 DEFINE_BUF_EVENT(xfs_buf_lock);
324 DEFINE_BUF_EVENT(xfs_buf_lock_done);
325 DEFINE_BUF_EVENT(xfs_buf_cond_lock);
326 DEFINE_BUF_EVENT(xfs_buf_unlock);
327 DEFINE_BUF_EVENT(xfs_buf_ordered_retry);
328 DEFINE_BUF_EVENT(xfs_buf_iowait);
329 DEFINE_BUF_EVENT(xfs_buf_iowait_done);
330 DEFINE_BUF_EVENT(xfs_buf_delwri_queue);
331 DEFINE_BUF_EVENT(xfs_buf_delwri_dequeue);
332 DEFINE_BUF_EVENT(xfs_buf_delwri_split);
333 DEFINE_BUF_EVENT(xfs_buf_get_noaddr);
334 DEFINE_BUF_EVENT(xfs_bdstrat_shut);
335 DEFINE_BUF_EVENT(xfs_buf_item_relse);
336 DEFINE_BUF_EVENT(xfs_buf_item_iodone);
337 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async);
338 DEFINE_BUF_EVENT(xfs_buf_error_relse);
339 DEFINE_BUF_EVENT(xfs_trans_read_buf_io);
340 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut);
342 /* not really buffer traces, but the buf provides useful information */
343 DEFINE_BUF_EVENT(xfs_btree_corrupt);
344 DEFINE_BUF_EVENT(xfs_da_btree_corrupt);
345 DEFINE_BUF_EVENT(xfs_reset_dqcounts);
346 DEFINE_BUF_EVENT(xfs_inode_item_push);
348 /* pass flags explicitly */
349 DECLARE_EVENT_CLASS(xfs_buf_flags_class,
350 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip),
351 TP_ARGS(bp, flags, caller_ip),
352 TP_STRUCT__entry(
353 __field(dev_t, dev)
354 __field(xfs_daddr_t, bno)
355 __field(size_t, buffer_length)
356 __field(int, hold)
357 __field(int, pincount)
358 __field(unsigned, lockval)
359 __field(unsigned, flags)
360 __field(unsigned long, caller_ip)
362 TP_fast_assign(
363 __entry->dev = bp->b_target->bt_dev;
364 __entry->bno = bp->b_bn;
365 __entry->buffer_length = bp->b_buffer_length;
366 __entry->flags = flags;
367 __entry->hold = atomic_read(&bp->b_hold);
368 __entry->pincount = atomic_read(&bp->b_pin_count);
369 __entry->lockval = xfs_buf_lock_value(bp);
370 __entry->caller_ip = caller_ip;
372 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
373 "lock %d flags %s caller %pf",
374 MAJOR(__entry->dev), MINOR(__entry->dev),
375 (unsigned long long)__entry->bno,
376 __entry->buffer_length,
377 __entry->hold,
378 __entry->pincount,
379 __entry->lockval,
380 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
381 (void *)__entry->caller_ip)
384 #define DEFINE_BUF_FLAGS_EVENT(name) \
385 DEFINE_EVENT(xfs_buf_flags_class, name, \
386 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
387 TP_ARGS(bp, flags, caller_ip))
388 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find);
389 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get);
390 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read);
392 TRACE_EVENT(xfs_buf_ioerror,
393 TP_PROTO(struct xfs_buf *bp, int error, unsigned long caller_ip),
394 TP_ARGS(bp, error, caller_ip),
395 TP_STRUCT__entry(
396 __field(dev_t, dev)
397 __field(xfs_daddr_t, bno)
398 __field(size_t, buffer_length)
399 __field(unsigned, flags)
400 __field(int, hold)
401 __field(int, pincount)
402 __field(unsigned, lockval)
403 __field(int, error)
404 __field(unsigned long, caller_ip)
406 TP_fast_assign(
407 __entry->dev = bp->b_target->bt_dev;
408 __entry->bno = bp->b_bn;
409 __entry->buffer_length = bp->b_buffer_length;
410 __entry->hold = atomic_read(&bp->b_hold);
411 __entry->pincount = atomic_read(&bp->b_pin_count);
412 __entry->lockval = xfs_buf_lock_value(bp);
413 __entry->error = error;
414 __entry->flags = bp->b_flags;
415 __entry->caller_ip = caller_ip;
417 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
418 "lock %d error %d flags %s caller %pf",
419 MAJOR(__entry->dev), MINOR(__entry->dev),
420 (unsigned long long)__entry->bno,
421 __entry->buffer_length,
422 __entry->hold,
423 __entry->pincount,
424 __entry->lockval,
425 __entry->error,
426 __print_flags(__entry->flags, "|", XFS_BUF_FLAGS),
427 (void *)__entry->caller_ip)
430 DECLARE_EVENT_CLASS(xfs_buf_item_class,
431 TP_PROTO(struct xfs_buf_log_item *bip),
432 TP_ARGS(bip),
433 TP_STRUCT__entry(
434 __field(dev_t, dev)
435 __field(xfs_daddr_t, buf_bno)
436 __field(size_t, buf_len)
437 __field(int, buf_hold)
438 __field(int, buf_pincount)
439 __field(int, buf_lockval)
440 __field(unsigned, buf_flags)
441 __field(unsigned, bli_recur)
442 __field(int, bli_refcount)
443 __field(unsigned, bli_flags)
444 __field(void *, li_desc)
445 __field(unsigned, li_flags)
447 TP_fast_assign(
448 __entry->dev = bip->bli_buf->b_target->bt_dev;
449 __entry->bli_flags = bip->bli_flags;
450 __entry->bli_recur = bip->bli_recur;
451 __entry->bli_refcount = atomic_read(&bip->bli_refcount);
452 __entry->buf_bno = bip->bli_buf->b_bn;
453 __entry->buf_len = bip->bli_buf->b_buffer_length;
454 __entry->buf_flags = bip->bli_buf->b_flags;
455 __entry->buf_hold = atomic_read(&bip->bli_buf->b_hold);
456 __entry->buf_pincount = atomic_read(&bip->bli_buf->b_pin_count);
457 __entry->buf_lockval = xfs_buf_lock_value(bip->bli_buf);
458 __entry->li_desc = bip->bli_item.li_desc;
459 __entry->li_flags = bip->bli_item.li_flags;
461 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
462 "lock %d flags %s recur %d refcount %d bliflags %s "
463 "lidesc 0x%p liflags %s",
464 MAJOR(__entry->dev), MINOR(__entry->dev),
465 (unsigned long long)__entry->buf_bno,
466 __entry->buf_len,
467 __entry->buf_hold,
468 __entry->buf_pincount,
469 __entry->buf_lockval,
470 __print_flags(__entry->buf_flags, "|", XFS_BUF_FLAGS),
471 __entry->bli_recur,
472 __entry->bli_refcount,
473 __print_flags(__entry->bli_flags, "|", XFS_BLI_FLAGS),
474 __entry->li_desc,
475 __print_flags(__entry->li_flags, "|", XFS_LI_FLAGS))
478 #define DEFINE_BUF_ITEM_EVENT(name) \
479 DEFINE_EVENT(xfs_buf_item_class, name, \
480 TP_PROTO(struct xfs_buf_log_item *bip), \
481 TP_ARGS(bip))
482 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size);
483 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale);
484 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format);
485 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale);
486 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin);
487 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin);
488 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale);
489 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_trylock);
490 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock);
491 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale);
492 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed);
493 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push);
494 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pushbuf);
495 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf);
496 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur);
497 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb);
498 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur);
499 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf);
500 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur);
501 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf);
502 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse);
503 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin);
504 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold);
505 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release);
506 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval);
508 DECLARE_EVENT_CLASS(xfs_lock_class,
509 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags,
510 unsigned long caller_ip),
511 TP_ARGS(ip, lock_flags, caller_ip),
512 TP_STRUCT__entry(
513 __field(dev_t, dev)
514 __field(xfs_ino_t, ino)
515 __field(int, lock_flags)
516 __field(unsigned long, caller_ip)
518 TP_fast_assign(
519 __entry->dev = VFS_I(ip)->i_sb->s_dev;
520 __entry->ino = ip->i_ino;
521 __entry->lock_flags = lock_flags;
522 __entry->caller_ip = caller_ip;
524 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
525 MAJOR(__entry->dev), MINOR(__entry->dev),
526 __entry->ino,
527 __print_flags(__entry->lock_flags, "|", XFS_LOCK_FLAGS),
528 (void *)__entry->caller_ip)
531 #define DEFINE_LOCK_EVENT(name) \
532 DEFINE_EVENT(xfs_lock_class, name, \
533 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
534 unsigned long caller_ip), \
535 TP_ARGS(ip, lock_flags, caller_ip))
536 DEFINE_LOCK_EVENT(xfs_ilock);
537 DEFINE_LOCK_EVENT(xfs_ilock_nowait);
538 DEFINE_LOCK_EVENT(xfs_ilock_demote);
539 DEFINE_LOCK_EVENT(xfs_iunlock);
541 DECLARE_EVENT_CLASS(xfs_iget_class,
542 TP_PROTO(struct xfs_inode *ip),
543 TP_ARGS(ip),
544 TP_STRUCT__entry(
545 __field(dev_t, dev)
546 __field(xfs_ino_t, ino)
548 TP_fast_assign(
549 __entry->dev = VFS_I(ip)->i_sb->s_dev;
550 __entry->ino = ip->i_ino;
552 TP_printk("dev %d:%d ino 0x%llx",
553 MAJOR(__entry->dev), MINOR(__entry->dev),
554 __entry->ino)
557 #define DEFINE_IGET_EVENT(name) \
558 DEFINE_EVENT(xfs_iget_class, name, \
559 TP_PROTO(struct xfs_inode *ip), \
560 TP_ARGS(ip))
561 DEFINE_IGET_EVENT(xfs_iget_skip);
562 DEFINE_IGET_EVENT(xfs_iget_reclaim);
563 DEFINE_IGET_EVENT(xfs_iget_found);
564 DEFINE_IGET_EVENT(xfs_iget_alloc);
566 DECLARE_EVENT_CLASS(xfs_inode_class,
567 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
568 TP_ARGS(ip, caller_ip),
569 TP_STRUCT__entry(
570 __field(dev_t, dev)
571 __field(xfs_ino_t, ino)
572 __field(int, count)
573 __field(int, pincount)
574 __field(unsigned long, caller_ip)
576 TP_fast_assign(
577 __entry->dev = VFS_I(ip)->i_sb->s_dev;
578 __entry->ino = ip->i_ino;
579 __entry->count = atomic_read(&VFS_I(ip)->i_count);
580 __entry->pincount = atomic_read(&ip->i_pincount);
581 __entry->caller_ip = caller_ip;
583 TP_printk("dev %d:%d ino 0x%llx count %d pincount %d caller %pf",
584 MAJOR(__entry->dev), MINOR(__entry->dev),
585 __entry->ino,
586 __entry->count,
587 __entry->pincount,
588 (char *)__entry->caller_ip)
591 #define DEFINE_INODE_EVENT(name) \
592 DEFINE_EVENT(xfs_inode_class, name, \
593 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
594 TP_ARGS(ip, caller_ip))
595 DEFINE_INODE_EVENT(xfs_ihold);
596 DEFINE_INODE_EVENT(xfs_irele);
597 DEFINE_INODE_EVENT(xfs_inode_pin);
598 DEFINE_INODE_EVENT(xfs_inode_unpin);
599 DEFINE_INODE_EVENT(xfs_inode_unpin_nowait);
601 /* the old xfs_itrace_entry tracer - to be replaced by s.th. in the VFS */
602 DEFINE_INODE_EVENT(xfs_inode);
603 #define xfs_itrace_entry(ip) \
604 trace_xfs_inode(ip, _THIS_IP_)
606 DECLARE_EVENT_CLASS(xfs_dquot_class,
607 TP_PROTO(struct xfs_dquot *dqp),
608 TP_ARGS(dqp),
609 TP_STRUCT__entry(
610 __field(dev_t, dev)
611 __field(u32, id)
612 __field(unsigned, flags)
613 __field(unsigned, nrefs)
614 __field(unsigned long long, res_bcount)
615 __field(unsigned long long, bcount)
616 __field(unsigned long long, icount)
617 __field(unsigned long long, blk_hardlimit)
618 __field(unsigned long long, blk_softlimit)
619 __field(unsigned long long, ino_hardlimit)
620 __field(unsigned long long, ino_softlimit)
621 ), \
622 TP_fast_assign(
623 __entry->dev = dqp->q_mount->m_super->s_dev;
624 __entry->id = be32_to_cpu(dqp->q_core.d_id);
625 __entry->flags = dqp->dq_flags;
626 __entry->nrefs = dqp->q_nrefs;
627 __entry->res_bcount = dqp->q_res_bcount;
628 __entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
629 __entry->icount = be64_to_cpu(dqp->q_core.d_icount);
630 __entry->blk_hardlimit =
631 be64_to_cpu(dqp->q_core.d_blk_hardlimit);
632 __entry->blk_softlimit =
633 be64_to_cpu(dqp->q_core.d_blk_softlimit);
634 __entry->ino_hardlimit =
635 be64_to_cpu(dqp->q_core.d_ino_hardlimit);
636 __entry->ino_softlimit =
637 be64_to_cpu(dqp->q_core.d_ino_softlimit);
639 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
640 "bcnt 0x%llx bhardlimit 0x%llx bsoftlimit 0x%llx "
641 "icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
642 MAJOR(__entry->dev), MINOR(__entry->dev),
643 __entry->id,
644 __print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
645 __entry->nrefs,
646 __entry->res_bcount,
647 __entry->bcount,
648 __entry->blk_hardlimit,
649 __entry->blk_softlimit,
650 __entry->icount,
651 __entry->ino_hardlimit,
652 __entry->ino_softlimit)
655 #define DEFINE_DQUOT_EVENT(name) \
656 DEFINE_EVENT(xfs_dquot_class, name, \
657 TP_PROTO(struct xfs_dquot *dqp), \
658 TP_ARGS(dqp))
659 DEFINE_DQUOT_EVENT(xfs_dqadjust);
660 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
661 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty);
662 DEFINE_DQUOT_EVENT(xfs_dqreclaim_unlink);
663 DEFINE_DQUOT_EVENT(xfs_dqattach_found);
664 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
665 DEFINE_DQUOT_EVENT(xfs_dqinit);
666 DEFINE_DQUOT_EVENT(xfs_dqreuse);
667 DEFINE_DQUOT_EVENT(xfs_dqalloc);
668 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);
669 DEFINE_DQUOT_EVENT(xfs_dqread);
670 DEFINE_DQUOT_EVENT(xfs_dqread_fail);
671 DEFINE_DQUOT_EVENT(xfs_dqlookup_found);
672 DEFINE_DQUOT_EVENT(xfs_dqlookup_want);
673 DEFINE_DQUOT_EVENT(xfs_dqlookup_freelist);
674 DEFINE_DQUOT_EVENT(xfs_dqlookup_done);
675 DEFINE_DQUOT_EVENT(xfs_dqget_hit);
676 DEFINE_DQUOT_EVENT(xfs_dqget_miss);
677 DEFINE_DQUOT_EVENT(xfs_dqput);
678 DEFINE_DQUOT_EVENT(xfs_dqput_wait);
679 DEFINE_DQUOT_EVENT(xfs_dqput_free);
680 DEFINE_DQUOT_EVENT(xfs_dqrele);
681 DEFINE_DQUOT_EVENT(xfs_dqflush);
682 DEFINE_DQUOT_EVENT(xfs_dqflush_force);
683 DEFINE_DQUOT_EVENT(xfs_dqflush_done);
684 /* not really iget events, but we re-use the format */
685 DEFINE_IGET_EVENT(xfs_dquot_dqalloc);
686 DEFINE_IGET_EVENT(xfs_dquot_dqdetach);
688 DECLARE_EVENT_CLASS(xfs_loggrant_class,
689 TP_PROTO(struct log *log, struct xlog_ticket *tic),
690 TP_ARGS(log, tic),
691 TP_STRUCT__entry(
692 __field(dev_t, dev)
693 __field(unsigned, trans_type)
694 __field(char, ocnt)
695 __field(char, cnt)
696 __field(int, curr_res)
697 __field(int, unit_res)
698 __field(unsigned int, flags)
699 __field(void *, reserve_headq)
700 __field(void *, write_headq)
701 __field(int, grant_reserve_cycle)
702 __field(int, grant_reserve_bytes)
703 __field(int, grant_write_cycle)
704 __field(int, grant_write_bytes)
705 __field(int, curr_cycle)
706 __field(int, curr_block)
707 __field(xfs_lsn_t, tail_lsn)
709 TP_fast_assign(
710 __entry->dev = log->l_mp->m_super->s_dev;
711 __entry->trans_type = tic->t_trans_type;
712 __entry->ocnt = tic->t_ocnt;
713 __entry->cnt = tic->t_cnt;
714 __entry->curr_res = tic->t_curr_res;
715 __entry->unit_res = tic->t_unit_res;
716 __entry->flags = tic->t_flags;
717 __entry->reserve_headq = log->l_reserve_headq;
718 __entry->write_headq = log->l_write_headq;
719 __entry->grant_reserve_cycle = log->l_grant_reserve_cycle;
720 __entry->grant_reserve_bytes = log->l_grant_reserve_bytes;
721 __entry->grant_write_cycle = log->l_grant_write_cycle;
722 __entry->grant_write_bytes = log->l_grant_write_bytes;
723 __entry->curr_cycle = log->l_curr_cycle;
724 __entry->curr_block = log->l_curr_block;
725 __entry->tail_lsn = log->l_tail_lsn;
727 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
728 "t_unit_res %u t_flags %s reserve_headq 0x%p "
729 "write_headq 0x%p grant_reserve_cycle %d "
730 "grant_reserve_bytes %d grant_write_cycle %d "
731 "grant_write_bytes %d curr_cycle %d curr_block %d "
732 "tail_cycle %d tail_block %d",
733 MAJOR(__entry->dev), MINOR(__entry->dev),
734 __print_symbolic(__entry->trans_type, XFS_TRANS_TYPES),
735 __entry->ocnt,
736 __entry->cnt,
737 __entry->curr_res,
738 __entry->unit_res,
739 __print_flags(__entry->flags, "|", XLOG_TIC_FLAGS),
740 __entry->reserve_headq,
741 __entry->write_headq,
742 __entry->grant_reserve_cycle,
743 __entry->grant_reserve_bytes,
744 __entry->grant_write_cycle,
745 __entry->grant_write_bytes,
746 __entry->curr_cycle,
747 __entry->curr_block,
748 CYCLE_LSN(__entry->tail_lsn),
749 BLOCK_LSN(__entry->tail_lsn)
753 #define DEFINE_LOGGRANT_EVENT(name) \
754 DEFINE_EVENT(xfs_loggrant_class, name, \
755 TP_PROTO(struct log *log, struct xlog_ticket *tic), \
756 TP_ARGS(log, tic))
757 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm);
758 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm);
759 DEFINE_LOGGRANT_EVENT(xfs_log_reserve);
760 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write);
761 DEFINE_LOGGRANT_EVENT(xfs_log_grant_enter);
762 DEFINE_LOGGRANT_EVENT(xfs_log_grant_exit);
763 DEFINE_LOGGRANT_EVENT(xfs_log_grant_error);
764 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep1);
765 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake1);
766 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep2);
767 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake2);
768 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_enter);
769 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_exit);
770 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_error);
771 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep1);
772 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake1);
773 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep2);
774 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake2);
775 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter);
776 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit);
777 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub);
778 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter);
779 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit);
780 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub);
782 DECLARE_EVENT_CLASS(xfs_file_class,
783 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags),
784 TP_ARGS(ip, count, offset, flags),
785 TP_STRUCT__entry(
786 __field(dev_t, dev)
787 __field(xfs_ino_t, ino)
788 __field(xfs_fsize_t, size)
789 __field(xfs_fsize_t, new_size)
790 __field(loff_t, offset)
791 __field(size_t, count)
792 __field(int, flags)
794 TP_fast_assign(
795 __entry->dev = VFS_I(ip)->i_sb->s_dev;
796 __entry->ino = ip->i_ino;
797 __entry->size = ip->i_d.di_size;
798 __entry->new_size = ip->i_new_size;
799 __entry->offset = offset;
800 __entry->count = count;
801 __entry->flags = flags;
803 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx "
804 "offset 0x%llx count 0x%zx ioflags %s",
805 MAJOR(__entry->dev), MINOR(__entry->dev),
806 __entry->ino,
807 __entry->size,
808 __entry->new_size,
809 __entry->offset,
810 __entry->count,
811 __print_flags(__entry->flags, "|", XFS_IO_FLAGS))
814 #define DEFINE_RW_EVENT(name) \
815 DEFINE_EVENT(xfs_file_class, name, \
816 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
817 TP_ARGS(ip, count, offset, flags))
818 DEFINE_RW_EVENT(xfs_file_read);
819 DEFINE_RW_EVENT(xfs_file_buffered_write);
820 DEFINE_RW_EVENT(xfs_file_direct_write);
821 DEFINE_RW_EVENT(xfs_file_splice_read);
822 DEFINE_RW_EVENT(xfs_file_splice_write);
824 DECLARE_EVENT_CLASS(xfs_page_class,
825 TP_PROTO(struct inode *inode, struct page *page, unsigned long off),
826 TP_ARGS(inode, page, off),
827 TP_STRUCT__entry(
828 __field(dev_t, dev)
829 __field(xfs_ino_t, ino)
830 __field(pgoff_t, pgoff)
831 __field(loff_t, size)
832 __field(unsigned long, offset)
833 __field(int, delalloc)
834 __field(int, unmapped)
835 __field(int, unwritten)
837 TP_fast_assign(
838 int delalloc = -1, unmapped = -1, unwritten = -1;
840 if (page_has_buffers(page))
841 xfs_count_page_state(page, &delalloc,
842 &unmapped, &unwritten);
843 __entry->dev = inode->i_sb->s_dev;
844 __entry->ino = XFS_I(inode)->i_ino;
845 __entry->pgoff = page_offset(page);
846 __entry->size = i_size_read(inode);
847 __entry->offset = off;
848 __entry->delalloc = delalloc;
849 __entry->unmapped = unmapped;
850 __entry->unwritten = unwritten;
852 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx "
853 "delalloc %d unmapped %d unwritten %d",
854 MAJOR(__entry->dev), MINOR(__entry->dev),
855 __entry->ino,
856 __entry->pgoff,
857 __entry->size,
858 __entry->offset,
859 __entry->delalloc,
860 __entry->unmapped,
861 __entry->unwritten)
864 #define DEFINE_PAGE_EVENT(name) \
865 DEFINE_EVENT(xfs_page_class, name, \
866 TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \
867 TP_ARGS(inode, page, off))
868 DEFINE_PAGE_EVENT(xfs_writepage);
869 DEFINE_PAGE_EVENT(xfs_releasepage);
870 DEFINE_PAGE_EVENT(xfs_invalidatepage);
872 DECLARE_EVENT_CLASS(xfs_iomap_class,
873 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count,
874 int flags, struct xfs_bmbt_irec *irec),
875 TP_ARGS(ip, offset, count, flags, irec),
876 TP_STRUCT__entry(
877 __field(dev_t, dev)
878 __field(xfs_ino_t, ino)
879 __field(loff_t, size)
880 __field(loff_t, new_size)
881 __field(loff_t, offset)
882 __field(size_t, count)
883 __field(int, flags)
884 __field(xfs_fileoff_t, startoff)
885 __field(xfs_fsblock_t, startblock)
886 __field(xfs_filblks_t, blockcount)
888 TP_fast_assign(
889 __entry->dev = VFS_I(ip)->i_sb->s_dev;
890 __entry->ino = ip->i_ino;
891 __entry->size = ip->i_d.di_size;
892 __entry->new_size = ip->i_new_size;
893 __entry->offset = offset;
894 __entry->count = count;
895 __entry->flags = flags;
896 __entry->startoff = irec ? irec->br_startoff : 0;
897 __entry->startblock = irec ? irec->br_startblock : 0;
898 __entry->blockcount = irec ? irec->br_blockcount : 0;
900 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx "
901 "offset 0x%llx count %zd flags %s "
902 "startoff 0x%llx startblock %lld blockcount 0x%llx",
903 MAJOR(__entry->dev), MINOR(__entry->dev),
904 __entry->ino,
905 __entry->size,
906 __entry->new_size,
907 __entry->offset,
908 __entry->count,
909 __print_flags(__entry->flags, "|", BMAPI_FLAGS),
910 __entry->startoff,
911 (__int64_t)__entry->startblock,
912 __entry->blockcount)
915 #define DEFINE_IOMAP_EVENT(name) \
916 DEFINE_EVENT(xfs_iomap_class, name, \
917 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
918 int flags, struct xfs_bmbt_irec *irec), \
919 TP_ARGS(ip, offset, count, flags, irec))
920 DEFINE_IOMAP_EVENT(xfs_iomap_enter);
921 DEFINE_IOMAP_EVENT(xfs_iomap_found);
922 DEFINE_IOMAP_EVENT(xfs_iomap_alloc);
924 DECLARE_EVENT_CLASS(xfs_simple_io_class,
925 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count),
926 TP_ARGS(ip, offset, count),
927 TP_STRUCT__entry(
928 __field(dev_t, dev)
929 __field(xfs_ino_t, ino)
930 __field(loff_t, size)
931 __field(loff_t, new_size)
932 __field(loff_t, offset)
933 __field(size_t, count)
935 TP_fast_assign(
936 __entry->dev = VFS_I(ip)->i_sb->s_dev;
937 __entry->ino = ip->i_ino;
938 __entry->size = ip->i_d.di_size;
939 __entry->new_size = ip->i_new_size;
940 __entry->offset = offset;
941 __entry->count = count;
943 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx "
944 "offset 0x%llx count %zd",
945 MAJOR(__entry->dev), MINOR(__entry->dev),
946 __entry->ino,
947 __entry->size,
948 __entry->new_size,
949 __entry->offset,
950 __entry->count)
953 #define DEFINE_SIMPLE_IO_EVENT(name) \
954 DEFINE_EVENT(xfs_simple_io_class, name, \
955 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
956 TP_ARGS(ip, offset, count))
957 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc);
958 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert);
961 TRACE_EVENT(xfs_itruncate_start,
962 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size, int flag,
963 xfs_off_t toss_start, xfs_off_t toss_finish),
964 TP_ARGS(ip, new_size, flag, toss_start, toss_finish),
965 TP_STRUCT__entry(
966 __field(dev_t, dev)
967 __field(xfs_ino_t, ino)
968 __field(xfs_fsize_t, size)
969 __field(xfs_fsize_t, new_size)
970 __field(xfs_off_t, toss_start)
971 __field(xfs_off_t, toss_finish)
972 __field(int, flag)
974 TP_fast_assign(
975 __entry->dev = VFS_I(ip)->i_sb->s_dev;
976 __entry->ino = ip->i_ino;
977 __entry->size = ip->i_d.di_size;
978 __entry->new_size = new_size;
979 __entry->toss_start = toss_start;
980 __entry->toss_finish = toss_finish;
981 __entry->flag = flag;
983 TP_printk("dev %d:%d ino 0x%llx %s size 0x%llx new_size 0x%llx "
984 "toss start 0x%llx toss finish 0x%llx",
985 MAJOR(__entry->dev), MINOR(__entry->dev),
986 __entry->ino,
987 __print_flags(__entry->flag, "|", XFS_ITRUNC_FLAGS),
988 __entry->size,
989 __entry->new_size,
990 __entry->toss_start,
991 __entry->toss_finish)
994 DECLARE_EVENT_CLASS(xfs_itrunc_class,
995 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size),
996 TP_ARGS(ip, new_size),
997 TP_STRUCT__entry(
998 __field(dev_t, dev)
999 __field(xfs_ino_t, ino)
1000 __field(xfs_fsize_t, size)
1001 __field(xfs_fsize_t, new_size)
1003 TP_fast_assign(
1004 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1005 __entry->ino = ip->i_ino;
1006 __entry->size = ip->i_d.di_size;
1007 __entry->new_size = new_size;
1009 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
1010 MAJOR(__entry->dev), MINOR(__entry->dev),
1011 __entry->ino,
1012 __entry->size,
1013 __entry->new_size)
1016 #define DEFINE_ITRUNC_EVENT(name) \
1017 DEFINE_EVENT(xfs_itrunc_class, name, \
1018 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
1019 TP_ARGS(ip, new_size))
1020 DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_start);
1021 DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_end);
1023 TRACE_EVENT(xfs_pagecache_inval,
1024 TP_PROTO(struct xfs_inode *ip, xfs_off_t start, xfs_off_t finish),
1025 TP_ARGS(ip, start, finish),
1026 TP_STRUCT__entry(
1027 __field(dev_t, dev)
1028 __field(xfs_ino_t, ino)
1029 __field(xfs_fsize_t, size)
1030 __field(xfs_off_t, start)
1031 __field(xfs_off_t, finish)
1033 TP_fast_assign(
1034 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1035 __entry->ino = ip->i_ino;
1036 __entry->size = ip->i_d.di_size;
1037 __entry->start = start;
1038 __entry->finish = finish;
1040 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
1041 MAJOR(__entry->dev), MINOR(__entry->dev),
1042 __entry->ino,
1043 __entry->size,
1044 __entry->start,
1045 __entry->finish)
1048 TRACE_EVENT(xfs_bunmap,
1049 TP_PROTO(struct xfs_inode *ip, xfs_fileoff_t bno, xfs_filblks_t len,
1050 int flags, unsigned long caller_ip),
1051 TP_ARGS(ip, bno, len, flags, caller_ip),
1052 TP_STRUCT__entry(
1053 __field(dev_t, dev)
1054 __field(xfs_ino_t, ino)
1055 __field(xfs_fsize_t, size)
1056 __field(xfs_fileoff_t, bno)
1057 __field(xfs_filblks_t, len)
1058 __field(unsigned long, caller_ip)
1059 __field(int, flags)
1061 TP_fast_assign(
1062 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1063 __entry->ino = ip->i_ino;
1064 __entry->size = ip->i_d.di_size;
1065 __entry->bno = bno;
1066 __entry->len = len;
1067 __entry->caller_ip = caller_ip;
1068 __entry->flags = flags;
1070 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1071 "flags %s caller %pf",
1072 MAJOR(__entry->dev), MINOR(__entry->dev),
1073 __entry->ino,
1074 __entry->size,
1075 __entry->bno,
1076 __entry->len,
1077 __print_flags(__entry->flags, "|", XFS_BMAPI_FLAGS),
1078 (void *)__entry->caller_ip)
1082 #define XFS_BUSY_SYNC \
1083 { 0, "async" }, \
1084 { 1, "sync" }
1086 TRACE_EVENT(xfs_alloc_busy,
1087 TP_PROTO(struct xfs_trans *trans, xfs_agnumber_t agno,
1088 xfs_agblock_t agbno, xfs_extlen_t len, int sync),
1089 TP_ARGS(trans, agno, agbno, len, sync),
1090 TP_STRUCT__entry(
1091 __field(dev_t, dev)
1092 __field(struct xfs_trans *, tp)
1093 __field(int, tid)
1094 __field(xfs_agnumber_t, agno)
1095 __field(xfs_agblock_t, agbno)
1096 __field(xfs_extlen_t, len)
1097 __field(int, sync)
1099 TP_fast_assign(
1100 __entry->dev = trans->t_mountp->m_super->s_dev;
1101 __entry->tp = trans;
1102 __entry->tid = trans->t_ticket->t_tid;
1103 __entry->agno = agno;
1104 __entry->agbno = agbno;
1105 __entry->len = len;
1106 __entry->sync = sync;
1108 TP_printk("dev %d:%d trans 0x%p tid 0x%x agno %u agbno %u len %u %s",
1109 MAJOR(__entry->dev), MINOR(__entry->dev),
1110 __entry->tp,
1111 __entry->tid,
1112 __entry->agno,
1113 __entry->agbno,
1114 __entry->len,
1115 __print_symbolic(__entry->sync, XFS_BUSY_SYNC))
1119 TRACE_EVENT(xfs_alloc_unbusy,
1120 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1121 xfs_agblock_t agbno, xfs_extlen_t len),
1122 TP_ARGS(mp, agno, agbno, len),
1123 TP_STRUCT__entry(
1124 __field(dev_t, dev)
1125 __field(xfs_agnumber_t, agno)
1126 __field(xfs_agblock_t, agbno)
1127 __field(xfs_extlen_t, len)
1129 TP_fast_assign(
1130 __entry->dev = mp->m_super->s_dev;
1131 __entry->agno = agno;
1132 __entry->agbno = agbno;
1133 __entry->len = len;
1135 TP_printk("dev %d:%d agno %u agbno %u len %u",
1136 MAJOR(__entry->dev), MINOR(__entry->dev),
1137 __entry->agno,
1138 __entry->agbno,
1139 __entry->len)
1142 #define XFS_BUSY_STATES \
1143 { 0, "missing" }, \
1144 { 1, "found" }
1146 TRACE_EVENT(xfs_alloc_busysearch,
1147 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1148 xfs_agblock_t agbno, xfs_extlen_t len, int found),
1149 TP_ARGS(mp, agno, agbno, len, found),
1150 TP_STRUCT__entry(
1151 __field(dev_t, dev)
1152 __field(xfs_agnumber_t, agno)
1153 __field(xfs_agblock_t, agbno)
1154 __field(xfs_extlen_t, len)
1155 __field(int, found)
1157 TP_fast_assign(
1158 __entry->dev = mp->m_super->s_dev;
1159 __entry->agno = agno;
1160 __entry->agbno = agbno;
1161 __entry->len = len;
1162 __entry->found = found;
1164 TP_printk("dev %d:%d agno %u agbno %u len %u %s",
1165 MAJOR(__entry->dev), MINOR(__entry->dev),
1166 __entry->agno,
1167 __entry->agbno,
1168 __entry->len,
1169 __print_symbolic(__entry->found, XFS_BUSY_STATES))
1172 TRACE_EVENT(xfs_trans_commit_lsn,
1173 TP_PROTO(struct xfs_trans *trans),
1174 TP_ARGS(trans),
1175 TP_STRUCT__entry(
1176 __field(dev_t, dev)
1177 __field(struct xfs_trans *, tp)
1178 __field(xfs_lsn_t, lsn)
1180 TP_fast_assign(
1181 __entry->dev = trans->t_mountp->m_super->s_dev;
1182 __entry->tp = trans;
1183 __entry->lsn = trans->t_commit_lsn;
1185 TP_printk("dev %d:%d trans 0x%p commit_lsn 0x%llx",
1186 MAJOR(__entry->dev), MINOR(__entry->dev),
1187 __entry->tp,
1188 __entry->lsn)
1191 TRACE_EVENT(xfs_agf,
1192 TP_PROTO(struct xfs_mount *mp, struct xfs_agf *agf, int flags,
1193 unsigned long caller_ip),
1194 TP_ARGS(mp, agf, flags, caller_ip),
1195 TP_STRUCT__entry(
1196 __field(dev_t, dev)
1197 __field(xfs_agnumber_t, agno)
1198 __field(int, flags)
1199 __field(__u32, length)
1200 __field(__u32, bno_root)
1201 __field(__u32, cnt_root)
1202 __field(__u32, bno_level)
1203 __field(__u32, cnt_level)
1204 __field(__u32, flfirst)
1205 __field(__u32, fllast)
1206 __field(__u32, flcount)
1207 __field(__u32, freeblks)
1208 __field(__u32, longest)
1209 __field(unsigned long, caller_ip)
1211 TP_fast_assign(
1212 __entry->dev = mp->m_super->s_dev;
1213 __entry->agno = be32_to_cpu(agf->agf_seqno),
1214 __entry->flags = flags;
1215 __entry->length = be32_to_cpu(agf->agf_length),
1216 __entry->bno_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]),
1217 __entry->cnt_root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]),
1218 __entry->bno_level =
1219 be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
1220 __entry->cnt_level =
1221 be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
1222 __entry->flfirst = be32_to_cpu(agf->agf_flfirst),
1223 __entry->fllast = be32_to_cpu(agf->agf_fllast),
1224 __entry->flcount = be32_to_cpu(agf->agf_flcount),
1225 __entry->freeblks = be32_to_cpu(agf->agf_freeblks),
1226 __entry->longest = be32_to_cpu(agf->agf_longest);
1227 __entry->caller_ip = caller_ip;
1229 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1230 "levels b %u c %u flfirst %u fllast %u flcount %u "
1231 "freeblks %u longest %u caller %pf",
1232 MAJOR(__entry->dev), MINOR(__entry->dev),
1233 __entry->agno,
1234 __print_flags(__entry->flags, "|", XFS_AGF_FLAGS),
1235 __entry->length,
1236 __entry->bno_root,
1237 __entry->cnt_root,
1238 __entry->bno_level,
1239 __entry->cnt_level,
1240 __entry->flfirst,
1241 __entry->fllast,
1242 __entry->flcount,
1243 __entry->freeblks,
1244 __entry->longest,
1245 (void *)__entry->caller_ip)
1248 TRACE_EVENT(xfs_free_extent,
1249 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno, xfs_agblock_t agbno,
1250 xfs_extlen_t len, bool isfl, int haveleft, int haveright),
1251 TP_ARGS(mp, agno, agbno, len, isfl, haveleft, haveright),
1252 TP_STRUCT__entry(
1253 __field(dev_t, dev)
1254 __field(xfs_agnumber_t, agno)
1255 __field(xfs_agblock_t, agbno)
1256 __field(xfs_extlen_t, len)
1257 __field(int, isfl)
1258 __field(int, haveleft)
1259 __field(int, haveright)
1261 TP_fast_assign(
1262 __entry->dev = mp->m_super->s_dev;
1263 __entry->agno = agno;
1264 __entry->agbno = agbno;
1265 __entry->len = len;
1266 __entry->isfl = isfl;
1267 __entry->haveleft = haveleft;
1268 __entry->haveright = haveright;
1270 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1271 MAJOR(__entry->dev), MINOR(__entry->dev),
1272 __entry->agno,
1273 __entry->agbno,
1274 __entry->len,
1275 __entry->isfl,
1276 __entry->haveleft ?
1277 (__entry->haveright ? "both" : "left") :
1278 (__entry->haveright ? "right" : "none"))
1282 DECLARE_EVENT_CLASS(xfs_alloc_class,
1283 TP_PROTO(struct xfs_alloc_arg *args),
1284 TP_ARGS(args),
1285 TP_STRUCT__entry(
1286 __field(dev_t, dev)
1287 __field(xfs_agnumber_t, agno)
1288 __field(xfs_agblock_t, agbno)
1289 __field(xfs_extlen_t, minlen)
1290 __field(xfs_extlen_t, maxlen)
1291 __field(xfs_extlen_t, mod)
1292 __field(xfs_extlen_t, prod)
1293 __field(xfs_extlen_t, minleft)
1294 __field(xfs_extlen_t, total)
1295 __field(xfs_extlen_t, alignment)
1296 __field(xfs_extlen_t, minalignslop)
1297 __field(xfs_extlen_t, len)
1298 __field(short, type)
1299 __field(short, otype)
1300 __field(char, wasdel)
1301 __field(char, wasfromfl)
1302 __field(char, isfl)
1303 __field(char, userdata)
1304 __field(xfs_fsblock_t, firstblock)
1306 TP_fast_assign(
1307 __entry->dev = args->mp->m_super->s_dev;
1308 __entry->agno = args->agno;
1309 __entry->agbno = args->agbno;
1310 __entry->minlen = args->minlen;
1311 __entry->maxlen = args->maxlen;
1312 __entry->mod = args->mod;
1313 __entry->prod = args->prod;
1314 __entry->minleft = args->minleft;
1315 __entry->total = args->total;
1316 __entry->alignment = args->alignment;
1317 __entry->minalignslop = args->minalignslop;
1318 __entry->len = args->len;
1319 __entry->type = args->type;
1320 __entry->otype = args->otype;
1321 __entry->wasdel = args->wasdel;
1322 __entry->wasfromfl = args->wasfromfl;
1323 __entry->isfl = args->isfl;
1324 __entry->userdata = args->userdata;
1325 __entry->firstblock = args->firstblock;
1327 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1328 "prod %u minleft %u total %u alignment %u minalignslop %u "
1329 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1330 "userdata %d firstblock 0x%llx",
1331 MAJOR(__entry->dev), MINOR(__entry->dev),
1332 __entry->agno,
1333 __entry->agbno,
1334 __entry->minlen,
1335 __entry->maxlen,
1336 __entry->mod,
1337 __entry->prod,
1338 __entry->minleft,
1339 __entry->total,
1340 __entry->alignment,
1341 __entry->minalignslop,
1342 __entry->len,
1343 __print_symbolic(__entry->type, XFS_ALLOC_TYPES),
1344 __print_symbolic(__entry->otype, XFS_ALLOC_TYPES),
1345 __entry->wasdel,
1346 __entry->wasfromfl,
1347 __entry->isfl,
1348 __entry->userdata,
1349 __entry->firstblock)
1352 #define DEFINE_ALLOC_EVENT(name) \
1353 DEFINE_EVENT(xfs_alloc_class, name, \
1354 TP_PROTO(struct xfs_alloc_arg *args), \
1355 TP_ARGS(args))
1356 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);
1357 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error);
1358 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft);
1359 DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1360 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1361 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1362 DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1363 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1364 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1365 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1366 DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1367 DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1368 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1369 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1370 DEFINE_ALLOC_EVENT(xfs_alloc_small_done);
1371 DEFINE_ALLOC_EVENT(xfs_alloc_small_error);
1372 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs);
1373 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix);
1374 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp);
1375 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed);
1376 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed);
1378 DECLARE_EVENT_CLASS(xfs_dir2_class,
1379 TP_PROTO(struct xfs_da_args *args),
1380 TP_ARGS(args),
1381 TP_STRUCT__entry(
1382 __field(dev_t, dev)
1383 __field(xfs_ino_t, ino)
1384 __dynamic_array(char, name, args->namelen)
1385 __field(int, namelen)
1386 __field(xfs_dahash_t, hashval)
1387 __field(xfs_ino_t, inumber)
1388 __field(int, op_flags)
1390 TP_fast_assign(
1391 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1392 __entry->ino = args->dp->i_ino;
1393 if (args->namelen)
1394 memcpy(__get_str(name), args->name, args->namelen);
1395 __entry->namelen = args->namelen;
1396 __entry->hashval = args->hashval;
1397 __entry->inumber = args->inumber;
1398 __entry->op_flags = args->op_flags;
1400 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1401 "inumber 0x%llx op_flags %s",
1402 MAJOR(__entry->dev), MINOR(__entry->dev),
1403 __entry->ino,
1404 __entry->namelen,
1405 __entry->namelen ? __get_str(name) : NULL,
1406 __entry->namelen,
1407 __entry->hashval,
1408 __entry->inumber,
1409 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS))
1412 #define DEFINE_DIR2_EVENT(name) \
1413 DEFINE_EVENT(xfs_dir2_class, name, \
1414 TP_PROTO(struct xfs_da_args *args), \
1415 TP_ARGS(args))
1416 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname);
1417 DEFINE_DIR2_EVENT(xfs_dir2_sf_create);
1418 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup);
1419 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace);
1420 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename);
1421 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4);
1422 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8);
1423 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block);
1424 DEFINE_DIR2_EVENT(xfs_dir2_block_addname);
1425 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup);
1426 DEFINE_DIR2_EVENT(xfs_dir2_block_replace);
1427 DEFINE_DIR2_EVENT(xfs_dir2_block_removename);
1428 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf);
1429 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf);
1430 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname);
1431 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup);
1432 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace);
1433 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename);
1434 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block);
1435 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node);
1436 DEFINE_DIR2_EVENT(xfs_dir2_node_addname);
1437 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup);
1438 DEFINE_DIR2_EVENT(xfs_dir2_node_replace);
1439 DEFINE_DIR2_EVENT(xfs_dir2_node_removename);
1440 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf);
1442 DECLARE_EVENT_CLASS(xfs_dir2_space_class,
1443 TP_PROTO(struct xfs_da_args *args, int idx),
1444 TP_ARGS(args, idx),
1445 TP_STRUCT__entry(
1446 __field(dev_t, dev)
1447 __field(xfs_ino_t, ino)
1448 __field(int, op_flags)
1449 __field(int, idx)
1451 TP_fast_assign(
1452 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1453 __entry->ino = args->dp->i_ino;
1454 __entry->op_flags = args->op_flags;
1455 __entry->idx = idx;
1457 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1458 MAJOR(__entry->dev), MINOR(__entry->dev),
1459 __entry->ino,
1460 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1461 __entry->idx)
1464 #define DEFINE_DIR2_SPACE_EVENT(name) \
1465 DEFINE_EVENT(xfs_dir2_space_class, name, \
1466 TP_PROTO(struct xfs_da_args *args, int idx), \
1467 TP_ARGS(args, idx))
1468 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add);
1469 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove);
1470 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode);
1471 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode);
1473 TRACE_EVENT(xfs_dir2_leafn_moveents,
1474 TP_PROTO(struct xfs_da_args *args, int src_idx, int dst_idx, int count),
1475 TP_ARGS(args, src_idx, dst_idx, count),
1476 TP_STRUCT__entry(
1477 __field(dev_t, dev)
1478 __field(xfs_ino_t, ino)
1479 __field(int, op_flags)
1480 __field(int, src_idx)
1481 __field(int, dst_idx)
1482 __field(int, count)
1484 TP_fast_assign(
1485 __entry->dev = VFS_I(args->dp)->i_sb->s_dev;
1486 __entry->ino = args->dp->i_ino;
1487 __entry->op_flags = args->op_flags;
1488 __entry->src_idx = src_idx;
1489 __entry->dst_idx = dst_idx;
1490 __entry->count = count;
1492 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1493 "src_idx %d dst_idx %d count %d",
1494 MAJOR(__entry->dev), MINOR(__entry->dev),
1495 __entry->ino,
1496 __print_flags(__entry->op_flags, "|", XFS_DA_OP_FLAGS),
1497 __entry->src_idx,
1498 __entry->dst_idx,
1499 __entry->count)
1502 #define XFS_SWAPEXT_INODES \
1503 { 0, "target" }, \
1504 { 1, "temp" }
1506 #define XFS_INODE_FORMAT_STR \
1507 { 0, "invalid" }, \
1508 { 1, "local" }, \
1509 { 2, "extent" }, \
1510 { 3, "btree" }
1512 DECLARE_EVENT_CLASS(xfs_swap_extent_class,
1513 TP_PROTO(struct xfs_inode *ip, int which),
1514 TP_ARGS(ip, which),
1515 TP_STRUCT__entry(
1516 __field(dev_t, dev)
1517 __field(int, which)
1518 __field(xfs_ino_t, ino)
1519 __field(int, format)
1520 __field(int, nex)
1521 __field(int, max_nex)
1522 __field(int, broot_size)
1523 __field(int, fork_off)
1525 TP_fast_assign(
1526 __entry->dev = VFS_I(ip)->i_sb->s_dev;
1527 __entry->which = which;
1528 __entry->ino = ip->i_ino;
1529 __entry->format = ip->i_d.di_format;
1530 __entry->nex = ip->i_d.di_nextents;
1531 __entry->max_nex = ip->i_df.if_ext_max;
1532 __entry->broot_size = ip->i_df.if_broot_bytes;
1533 __entry->fork_off = XFS_IFORK_BOFF(ip);
1535 TP_printk("dev %d:%d ino 0x%llx (%s), %s format, num_extents %d, "
1536 "Max in-fork extents %d, broot size %d, fork offset %d",
1537 MAJOR(__entry->dev), MINOR(__entry->dev),
1538 __entry->ino,
1539 __print_symbolic(__entry->which, XFS_SWAPEXT_INODES),
1540 __print_symbolic(__entry->format, XFS_INODE_FORMAT_STR),
1541 __entry->nex,
1542 __entry->max_nex,
1543 __entry->broot_size,
1544 __entry->fork_off)
1547 #define DEFINE_SWAPEXT_EVENT(name) \
1548 DEFINE_EVENT(xfs_swap_extent_class, name, \
1549 TP_PROTO(struct xfs_inode *ip, int which), \
1550 TP_ARGS(ip, which))
1552 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_before);
1553 DEFINE_SWAPEXT_EVENT(xfs_swap_extent_after);
1555 DECLARE_EVENT_CLASS(xfs_log_recover_item_class,
1556 TP_PROTO(struct log *log, struct xlog_recover *trans,
1557 struct xlog_recover_item *item, int pass),
1558 TP_ARGS(log, trans, item, pass),
1559 TP_STRUCT__entry(
1560 __field(dev_t, dev)
1561 __field(unsigned long, item)
1562 __field(xlog_tid_t, tid)
1563 __field(int, type)
1564 __field(int, pass)
1565 __field(int, count)
1566 __field(int, total)
1568 TP_fast_assign(
1569 __entry->dev = log->l_mp->m_super->s_dev;
1570 __entry->item = (unsigned long)item;
1571 __entry->tid = trans->r_log_tid;
1572 __entry->type = ITEM_TYPE(item);
1573 __entry->pass = pass;
1574 __entry->count = item->ri_cnt;
1575 __entry->total = item->ri_total;
1577 TP_printk("dev %d:%d trans 0x%x, pass %d, item 0x%p, item type %s "
1578 "item region count/total %d/%d",
1579 MAJOR(__entry->dev), MINOR(__entry->dev),
1580 __entry->tid,
1581 __entry->pass,
1582 (void *)__entry->item,
1583 __print_symbolic(__entry->type, XFS_LI_TYPE_DESC),
1584 __entry->count,
1585 __entry->total)
1588 #define DEFINE_LOG_RECOVER_ITEM(name) \
1589 DEFINE_EVENT(xfs_log_recover_item_class, name, \
1590 TP_PROTO(struct log *log, struct xlog_recover *trans, \
1591 struct xlog_recover_item *item, int pass), \
1592 TP_ARGS(log, trans, item, pass))
1594 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add);
1595 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_add_cont);
1596 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_head);
1597 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_reorder_tail);
1598 DEFINE_LOG_RECOVER_ITEM(xfs_log_recover_item_recover);
1600 DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
1601 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f),
1602 TP_ARGS(log, buf_f),
1603 TP_STRUCT__entry(
1604 __field(dev_t, dev)
1605 __field(__int64_t, blkno)
1606 __field(unsigned short, len)
1607 __field(unsigned short, flags)
1608 __field(unsigned short, size)
1609 __field(unsigned int, map_size)
1611 TP_fast_assign(
1612 __entry->dev = log->l_mp->m_super->s_dev;
1613 __entry->blkno = buf_f->blf_blkno;
1614 __entry->len = buf_f->blf_len;
1615 __entry->flags = buf_f->blf_flags;
1616 __entry->size = buf_f->blf_size;
1617 __entry->map_size = buf_f->blf_map_size;
1619 TP_printk("dev %d:%d blkno 0x%llx, len %u, flags 0x%x, size %d, "
1620 "map_size %d",
1621 MAJOR(__entry->dev), MINOR(__entry->dev),
1622 __entry->blkno,
1623 __entry->len,
1624 __entry->flags,
1625 __entry->size,
1626 __entry->map_size)
1629 #define DEFINE_LOG_RECOVER_BUF_ITEM(name) \
1630 DEFINE_EVENT(xfs_log_recover_buf_item_class, name, \
1631 TP_PROTO(struct log *log, struct xfs_buf_log_format *buf_f), \
1632 TP_ARGS(log, buf_f))
1634 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_not_cancel);
1635 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel);
1636 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_add);
1637 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_cancel_ref_inc);
1638 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_recover);
1639 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_inode_buf);
1640 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_reg_buf);
1641 DEFINE_LOG_RECOVER_BUF_ITEM(xfs_log_recover_buf_dquot_buf);
1643 DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
1644 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f),
1645 TP_ARGS(log, in_f),
1646 TP_STRUCT__entry(
1647 __field(dev_t, dev)
1648 __field(xfs_ino_t, ino)
1649 __field(unsigned short, size)
1650 __field(int, fields)
1651 __field(unsigned short, asize)
1652 __field(unsigned short, dsize)
1653 __field(__int64_t, blkno)
1654 __field(int, len)
1655 __field(int, boffset)
1657 TP_fast_assign(
1658 __entry->dev = log->l_mp->m_super->s_dev;
1659 __entry->ino = in_f->ilf_ino;
1660 __entry->size = in_f->ilf_size;
1661 __entry->fields = in_f->ilf_fields;
1662 __entry->asize = in_f->ilf_asize;
1663 __entry->dsize = in_f->ilf_dsize;
1664 __entry->blkno = in_f->ilf_blkno;
1665 __entry->len = in_f->ilf_len;
1666 __entry->boffset = in_f->ilf_boffset;
1668 TP_printk("dev %d:%d ino 0x%llx, size %u, fields 0x%x, asize %d, "
1669 "dsize %d, blkno 0x%llx, len %d, boffset %d",
1670 MAJOR(__entry->dev), MINOR(__entry->dev),
1671 __entry->ino,
1672 __entry->size,
1673 __entry->fields,
1674 __entry->asize,
1675 __entry->dsize,
1676 __entry->blkno,
1677 __entry->len,
1678 __entry->boffset)
1680 #define DEFINE_LOG_RECOVER_INO_ITEM(name) \
1681 DEFINE_EVENT(xfs_log_recover_ino_item_class, name, \
1682 TP_PROTO(struct log *log, struct xfs_inode_log_format *in_f), \
1683 TP_ARGS(log, in_f))
1685 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_recover);
1686 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_cancel);
1687 DEFINE_LOG_RECOVER_INO_ITEM(xfs_log_recover_inode_skip);
1689 #endif /* _TRACE_XFS_H */
1691 #undef TRACE_INCLUDE_PATH
1692 #define TRACE_INCLUDE_PATH .
1693 #define TRACE_INCLUDE_FILE xfs_trace
1694 #include <trace/define_trace.h>