2 * Copyright (c) 2009, Christoph Hellwig
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
19 #define TRACE_SYSTEM xfs
21 #if !defined(_TRACE_XFS_H) || defined(TRACE_HEADER_MULTI_READ)
24 #include <linux/tracepoint.h>
28 struct xfs_attr_list_context
;
29 struct xfs_buf_log_item
;
31 struct xfs_da_node_entry
;
36 DECLARE_EVENT_CLASS(xfs_attr_list_class
,
37 TP_PROTO(struct xfs_attr_list_context
*ctx
),
41 __field(xfs_ino_t
, ino
)
45 __field(void *, alist
)
53 __entry
->dev
= VFS_I(ctx
->dp
)->i_sb
->s_dev
;
54 __entry
->ino
= ctx
->dp
->i_ino
;
55 __entry
->hashval
= ctx
->cursor
->hashval
;
56 __entry
->blkno
= ctx
->cursor
->blkno
;
57 __entry
->offset
= ctx
->cursor
->offset
;
58 __entry
->alist
= ctx
->alist
;
59 __entry
->bufsize
= ctx
->bufsize
;
60 __entry
->count
= ctx
->count
;
61 __entry
->firstu
= ctx
->firstu
;
62 __entry
->flags
= ctx
->flags
;
64 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
65 "alist 0x%p size %u count %u firstu %u flags %d %s",
66 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
77 __print_flags(__entry
->flags
, "|", XFS_ATTR_FLAGS
)
81 #define DEFINE_ATTR_LIST_EVENT(name) \
82 DEFINE_EVENT(xfs_attr_list_class, name, \
83 TP_PROTO(struct xfs_attr_list_context *ctx), \
85 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf
);
86 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_sf_all
);
87 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf
);
88 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_leaf_end
);
89 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_full
);
90 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_add
);
91 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_wrong_blk
);
92 DEFINE_ATTR_LIST_EVENT(xfs_attr_list_notfound
);
94 TRACE_EVENT(xfs_attr_list_node_descend
,
95 TP_PROTO(struct xfs_attr_list_context
*ctx
,
96 struct xfs_da_node_entry
*btree
),
100 __field(xfs_ino_t
, ino
)
101 __field(u32
, hashval
)
104 __field(void *, alist
)
105 __field(int, bufsize
)
110 __field(u32
, bt_hashval
)
111 __field(u32
, bt_before
)
114 __entry
->dev
= VFS_I(ctx
->dp
)->i_sb
->s_dev
;
115 __entry
->ino
= ctx
->dp
->i_ino
;
116 __entry
->hashval
= ctx
->cursor
->hashval
;
117 __entry
->blkno
= ctx
->cursor
->blkno
;
118 __entry
->offset
= ctx
->cursor
->offset
;
119 __entry
->alist
= ctx
->alist
;
120 __entry
->bufsize
= ctx
->bufsize
;
121 __entry
->count
= ctx
->count
;
122 __entry
->firstu
= ctx
->firstu
;
123 __entry
->flags
= ctx
->flags
;
124 __entry
->bt_hashval
= be32_to_cpu(btree
->hashval
);
125 __entry
->bt_before
= be32_to_cpu(btree
->before
);
127 TP_printk("dev %d:%d ino 0x%llx cursor h/b/o 0x%x/0x%x/%u dupcnt %u "
128 "alist 0x%p size %u count %u firstu %u flags %d %s "
129 "node hashval %u, node before %u",
130 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
141 __print_flags(__entry
->flags
, "|", XFS_ATTR_FLAGS
),
146 TRACE_EVENT(xfs_iext_insert
,
147 TP_PROTO(struct xfs_inode
*ip
, xfs_extnum_t idx
,
148 struct xfs_bmbt_irec
*r
, int state
, unsigned long caller_ip
),
149 TP_ARGS(ip
, idx
, r
, state
, caller_ip
),
152 __field(xfs_ino_t
, ino
)
153 __field(xfs_extnum_t
, idx
)
154 __field(xfs_fileoff_t
, startoff
)
155 __field(xfs_fsblock_t
, startblock
)
156 __field(xfs_filblks_t
, blockcount
)
157 __field(xfs_exntst_t
, state
)
158 __field(int, bmap_state
)
159 __field(unsigned long, caller_ip
)
162 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
163 __entry
->ino
= ip
->i_ino
;
165 __entry
->startoff
= r
->br_startoff
;
166 __entry
->startblock
= r
->br_startblock
;
167 __entry
->blockcount
= r
->br_blockcount
;
168 __entry
->state
= r
->br_state
;
169 __entry
->bmap_state
= state
;
170 __entry
->caller_ip
= caller_ip
;
172 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
173 "offset %lld block %s count %lld flag %d caller %pf",
174 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
176 __print_flags(__entry
->bmap_state
, "|", XFS_BMAP_EXT_FLAGS
),
179 xfs_fmtfsblock(__entry
->startblock
),
182 (char *)__entry
->caller_ip
)
185 DECLARE_EVENT_CLASS(xfs_bmap_class
,
186 TP_PROTO(struct xfs_inode
*ip
, xfs_extnum_t idx
, int state
,
187 unsigned long caller_ip
),
188 TP_ARGS(ip
, idx
, state
, caller_ip
),
191 __field(xfs_ino_t
, ino
)
192 __field(xfs_extnum_t
, idx
)
193 __field(xfs_fileoff_t
, startoff
)
194 __field(xfs_fsblock_t
, startblock
)
195 __field(xfs_filblks_t
, blockcount
)
196 __field(xfs_exntst_t
, state
)
197 __field(int, bmap_state
)
198 __field(unsigned long, caller_ip
)
201 struct xfs_ifork
*ifp
= (state
& BMAP_ATTRFORK
) ?
202 ip
->i_afp
: &ip
->i_df
;
203 struct xfs_bmbt_irec r
;
205 xfs_bmbt_get_all(xfs_iext_get_ext(ifp
, idx
), &r
);
206 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
207 __entry
->ino
= ip
->i_ino
;
209 __entry
->startoff
= r
.br_startoff
;
210 __entry
->startblock
= r
.br_startblock
;
211 __entry
->blockcount
= r
.br_blockcount
;
212 __entry
->state
= r
.br_state
;
213 __entry
->bmap_state
= state
;
214 __entry
->caller_ip
= caller_ip
;
216 TP_printk("dev %d:%d ino 0x%llx state %s idx %ld "
217 "offset %lld block %s count %lld flag %d caller %pf",
218 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
220 __print_flags(__entry
->bmap_state
, "|", XFS_BMAP_EXT_FLAGS
),
223 xfs_fmtfsblock(__entry
->startblock
),
226 (char *)__entry
->caller_ip
)
229 #define DEFINE_BMAP_EVENT(name) \
230 DEFINE_EVENT(xfs_bmap_class, name, \
231 TP_PROTO(struct xfs_inode *ip, xfs_extnum_t idx, int state, \
232 unsigned long caller_ip), \
233 TP_ARGS(ip, idx, state, caller_ip))
234 DEFINE_BMAP_EVENT(xfs_iext_remove
);
235 DEFINE_BMAP_EVENT(xfs_bmap_pre_update
);
236 DEFINE_BMAP_EVENT(xfs_bmap_post_update
);
237 DEFINE_BMAP_EVENT(xfs_extlist
);
239 DECLARE_EVENT_CLASS(xfs_buf_class
,
240 TP_PROTO(struct xfs_buf
*bp
, unsigned long caller_ip
),
241 TP_ARGS(bp
, caller_ip
),
244 __field(xfs_daddr_t
, bno
)
245 __field(size_t, buffer_length
)
247 __field(int, pincount
)
248 __field(unsigned, lockval
)
249 __field(unsigned, flags
)
250 __field(unsigned long, caller_ip
)
253 __entry
->dev
= bp
->b_target
->bt_dev
;
254 __entry
->bno
= bp
->b_bn
;
255 __entry
->buffer_length
= bp
->b_buffer_length
;
256 __entry
->hold
= atomic_read(&bp
->b_hold
);
257 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
258 __entry
->lockval
= xfs_buf_lock_value(bp
);
259 __entry
->flags
= bp
->b_flags
;
260 __entry
->caller_ip
= caller_ip
;
262 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
263 "lock %d flags %s caller %pf",
264 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
265 (unsigned long long)__entry
->bno
,
266 __entry
->buffer_length
,
270 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
271 (void *)__entry
->caller_ip
)
274 #define DEFINE_BUF_EVENT(name) \
275 DEFINE_EVENT(xfs_buf_class, name, \
276 TP_PROTO(struct xfs_buf *bp, unsigned long caller_ip), \
277 TP_ARGS(bp, caller_ip))
278 DEFINE_BUF_EVENT(xfs_buf_init
);
279 DEFINE_BUF_EVENT(xfs_buf_free
);
280 DEFINE_BUF_EVENT(xfs_buf_hold
);
281 DEFINE_BUF_EVENT(xfs_buf_rele
);
282 DEFINE_BUF_EVENT(xfs_buf_pin
);
283 DEFINE_BUF_EVENT(xfs_buf_unpin
);
284 DEFINE_BUF_EVENT(xfs_buf_iodone
);
285 DEFINE_BUF_EVENT(xfs_buf_iorequest
);
286 DEFINE_BUF_EVENT(xfs_buf_bawrite
);
287 DEFINE_BUF_EVENT(xfs_buf_bdwrite
);
288 DEFINE_BUF_EVENT(xfs_buf_lock
);
289 DEFINE_BUF_EVENT(xfs_buf_lock_done
);
290 DEFINE_BUF_EVENT(xfs_buf_cond_lock
);
291 DEFINE_BUF_EVENT(xfs_buf_unlock
);
292 DEFINE_BUF_EVENT(xfs_buf_ordered_retry
);
293 DEFINE_BUF_EVENT(xfs_buf_iowait
);
294 DEFINE_BUF_EVENT(xfs_buf_iowait_done
);
295 DEFINE_BUF_EVENT(xfs_buf_delwri_queue
);
296 DEFINE_BUF_EVENT(xfs_buf_delwri_dequeue
);
297 DEFINE_BUF_EVENT(xfs_buf_delwri_split
);
298 DEFINE_BUF_EVENT(xfs_buf_get_noaddr
);
299 DEFINE_BUF_EVENT(xfs_bdstrat_shut
);
300 DEFINE_BUF_EVENT(xfs_buf_item_relse
);
301 DEFINE_BUF_EVENT(xfs_buf_item_iodone
);
302 DEFINE_BUF_EVENT(xfs_buf_item_iodone_async
);
303 DEFINE_BUF_EVENT(xfs_buf_error_relse
);
304 DEFINE_BUF_EVENT(xfs_trans_read_buf_io
);
305 DEFINE_BUF_EVENT(xfs_trans_read_buf_shut
);
307 /* not really buffer traces, but the buf provides useful information */
308 DEFINE_BUF_EVENT(xfs_btree_corrupt
);
309 DEFINE_BUF_EVENT(xfs_da_btree_corrupt
);
310 DEFINE_BUF_EVENT(xfs_reset_dqcounts
);
311 DEFINE_BUF_EVENT(xfs_inode_item_push
);
313 /* pass flags explicitly */
314 DECLARE_EVENT_CLASS(xfs_buf_flags_class
,
315 TP_PROTO(struct xfs_buf
*bp
, unsigned flags
, unsigned long caller_ip
),
316 TP_ARGS(bp
, flags
, caller_ip
),
319 __field(xfs_daddr_t
, bno
)
320 __field(size_t, buffer_length
)
322 __field(int, pincount
)
323 __field(unsigned, lockval
)
324 __field(unsigned, flags
)
325 __field(unsigned long, caller_ip
)
328 __entry
->dev
= bp
->b_target
->bt_dev
;
329 __entry
->bno
= bp
->b_bn
;
330 __entry
->buffer_length
= bp
->b_buffer_length
;
331 __entry
->flags
= flags
;
332 __entry
->hold
= atomic_read(&bp
->b_hold
);
333 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
334 __entry
->lockval
= xfs_buf_lock_value(bp
);
335 __entry
->caller_ip
= caller_ip
;
337 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
338 "lock %d flags %s caller %pf",
339 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
340 (unsigned long long)__entry
->bno
,
341 __entry
->buffer_length
,
345 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
346 (void *)__entry
->caller_ip
)
349 #define DEFINE_BUF_FLAGS_EVENT(name) \
350 DEFINE_EVENT(xfs_buf_flags_class, name, \
351 TP_PROTO(struct xfs_buf *bp, unsigned flags, unsigned long caller_ip), \
352 TP_ARGS(bp, flags, caller_ip))
353 DEFINE_BUF_FLAGS_EVENT(xfs_buf_find
);
354 DEFINE_BUF_FLAGS_EVENT(xfs_buf_get
);
355 DEFINE_BUF_FLAGS_EVENT(xfs_buf_read
);
357 TRACE_EVENT(xfs_buf_ioerror
,
358 TP_PROTO(struct xfs_buf
*bp
, int error
, unsigned long caller_ip
),
359 TP_ARGS(bp
, error
, caller_ip
),
362 __field(xfs_daddr_t
, bno
)
363 __field(size_t, buffer_length
)
364 __field(unsigned, flags
)
366 __field(int, pincount
)
367 __field(unsigned, lockval
)
369 __field(unsigned long, caller_ip
)
372 __entry
->dev
= bp
->b_target
->bt_dev
;
373 __entry
->bno
= bp
->b_bn
;
374 __entry
->buffer_length
= bp
->b_buffer_length
;
375 __entry
->hold
= atomic_read(&bp
->b_hold
);
376 __entry
->pincount
= atomic_read(&bp
->b_pin_count
);
377 __entry
->lockval
= xfs_buf_lock_value(bp
);
378 __entry
->error
= error
;
379 __entry
->flags
= bp
->b_flags
;
380 __entry
->caller_ip
= caller_ip
;
382 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
383 "lock %d error %d flags %s caller %pf",
384 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
385 (unsigned long long)__entry
->bno
,
386 __entry
->buffer_length
,
391 __print_flags(__entry
->flags
, "|", XFS_BUF_FLAGS
),
392 (void *)__entry
->caller_ip
)
395 DECLARE_EVENT_CLASS(xfs_buf_item_class
,
396 TP_PROTO(struct xfs_buf_log_item
*bip
),
400 __field(xfs_daddr_t
, buf_bno
)
401 __field(size_t, buf_len
)
402 __field(int, buf_hold
)
403 __field(int, buf_pincount
)
404 __field(int, buf_lockval
)
405 __field(unsigned, buf_flags
)
406 __field(unsigned, bli_recur
)
407 __field(int, bli_refcount
)
408 __field(unsigned, bli_flags
)
409 __field(void *, li_desc
)
410 __field(unsigned, li_flags
)
413 __entry
->dev
= bip
->bli_buf
->b_target
->bt_dev
;
414 __entry
->bli_flags
= bip
->bli_flags
;
415 __entry
->bli_recur
= bip
->bli_recur
;
416 __entry
->bli_refcount
= atomic_read(&bip
->bli_refcount
);
417 __entry
->buf_bno
= bip
->bli_buf
->b_bn
;
418 __entry
->buf_len
= bip
->bli_buf
->b_buffer_length
;
419 __entry
->buf_flags
= bip
->bli_buf
->b_flags
;
420 __entry
->buf_hold
= atomic_read(&bip
->bli_buf
->b_hold
);
421 __entry
->buf_pincount
= atomic_read(&bip
->bli_buf
->b_pin_count
);
422 __entry
->buf_lockval
= xfs_buf_lock_value(bip
->bli_buf
);
423 __entry
->li_desc
= bip
->bli_item
.li_desc
;
424 __entry
->li_flags
= bip
->bli_item
.li_flags
;
426 TP_printk("dev %d:%d bno 0x%llx len 0x%zx hold %d pincount %d "
427 "lock %d flags %s recur %d refcount %d bliflags %s "
428 "lidesc 0x%p liflags %s",
429 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
430 (unsigned long long)__entry
->buf_bno
,
433 __entry
->buf_pincount
,
434 __entry
->buf_lockval
,
435 __print_flags(__entry
->buf_flags
, "|", XFS_BUF_FLAGS
),
437 __entry
->bli_refcount
,
438 __print_flags(__entry
->bli_flags
, "|", XFS_BLI_FLAGS
),
440 __print_flags(__entry
->li_flags
, "|", XFS_LI_FLAGS
))
443 #define DEFINE_BUF_ITEM_EVENT(name) \
444 DEFINE_EVENT(xfs_buf_item_class, name, \
445 TP_PROTO(struct xfs_buf_log_item *bip), \
447 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size
);
448 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_size_stale
);
449 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format
);
450 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_format_stale
);
451 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_pin
);
452 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin
);
453 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unpin_stale
);
454 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_trylock
);
455 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock
);
456 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_unlock_stale
);
457 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_committed
);
458 DEFINE_BUF_ITEM_EVENT(xfs_buf_item_push
);
459 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf
);
460 DEFINE_BUF_ITEM_EVENT(xfs_trans_get_buf_recur
);
461 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb
);
462 DEFINE_BUF_ITEM_EVENT(xfs_trans_getsb_recur
);
463 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf
);
464 DEFINE_BUF_ITEM_EVENT(xfs_trans_read_buf_recur
);
465 DEFINE_BUF_ITEM_EVENT(xfs_trans_log_buf
);
466 DEFINE_BUF_ITEM_EVENT(xfs_trans_brelse
);
467 DEFINE_BUF_ITEM_EVENT(xfs_trans_bjoin
);
468 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold
);
469 DEFINE_BUF_ITEM_EVENT(xfs_trans_bhold_release
);
470 DEFINE_BUF_ITEM_EVENT(xfs_trans_binval
);
472 DECLARE_EVENT_CLASS(xfs_lock_class
,
473 TP_PROTO(struct xfs_inode
*ip
, unsigned lock_flags
,
474 unsigned long caller_ip
),
475 TP_ARGS(ip
, lock_flags
, caller_ip
),
478 __field(xfs_ino_t
, ino
)
479 __field(int, lock_flags
)
480 __field(unsigned long, caller_ip
)
483 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
484 __entry
->ino
= ip
->i_ino
;
485 __entry
->lock_flags
= lock_flags
;
486 __entry
->caller_ip
= caller_ip
;
488 TP_printk("dev %d:%d ino 0x%llx flags %s caller %pf",
489 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
491 __print_flags(__entry
->lock_flags
, "|", XFS_LOCK_FLAGS
),
492 (void *)__entry
->caller_ip
)
495 #define DEFINE_LOCK_EVENT(name) \
496 DEFINE_EVENT(xfs_lock_class, name, \
497 TP_PROTO(struct xfs_inode *ip, unsigned lock_flags, \
498 unsigned long caller_ip), \
499 TP_ARGS(ip, lock_flags, caller_ip))
500 DEFINE_LOCK_EVENT(xfs_ilock
);
501 DEFINE_LOCK_EVENT(xfs_ilock_nowait
);
502 DEFINE_LOCK_EVENT(xfs_ilock_demote
);
503 DEFINE_LOCK_EVENT(xfs_iunlock
);
505 DECLARE_EVENT_CLASS(xfs_iget_class
,
506 TP_PROTO(struct xfs_inode
*ip
),
510 __field(xfs_ino_t
, ino
)
513 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
514 __entry
->ino
= ip
->i_ino
;
516 TP_printk("dev %d:%d ino 0x%llx",
517 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
521 #define DEFINE_IGET_EVENT(name) \
522 DEFINE_EVENT(xfs_iget_class, name, \
523 TP_PROTO(struct xfs_inode *ip), \
525 DEFINE_IGET_EVENT(xfs_iget_skip
);
526 DEFINE_IGET_EVENT(xfs_iget_reclaim
);
527 DEFINE_IGET_EVENT(xfs_iget_found
);
528 DEFINE_IGET_EVENT(xfs_iget_alloc
);
530 DECLARE_EVENT_CLASS(xfs_inode_class
,
531 TP_PROTO(struct xfs_inode
*ip
, unsigned long caller_ip
),
532 TP_ARGS(ip
, caller_ip
),
535 __field(xfs_ino_t
, ino
)
537 __field(unsigned long, caller_ip
)
540 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
541 __entry
->ino
= ip
->i_ino
;
542 __entry
->count
= atomic_read(&VFS_I(ip
)->i_count
);
543 __entry
->caller_ip
= caller_ip
;
545 TP_printk("dev %d:%d ino 0x%llx count %d caller %pf",
546 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
549 (char *)__entry
->caller_ip
)
552 #define DEFINE_INODE_EVENT(name) \
553 DEFINE_EVENT(xfs_inode_class, name, \
554 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), \
555 TP_ARGS(ip, caller_ip))
556 DEFINE_INODE_EVENT(xfs_ihold
);
557 DEFINE_INODE_EVENT(xfs_irele
);
558 /* the old xfs_itrace_entry tracer - to be replaced by s.th. in the VFS */
559 DEFINE_INODE_EVENT(xfs_inode
);
560 #define xfs_itrace_entry(ip) \
561 trace_xfs_inode(ip, _THIS_IP_)
563 DECLARE_EVENT_CLASS(xfs_dquot_class
,
564 TP_PROTO(struct xfs_dquot
*dqp
),
569 __field(unsigned, flags
)
570 __field(unsigned, nrefs
)
571 __field(unsigned long long, res_bcount
)
572 __field(unsigned long long, bcount
)
573 __field(unsigned long long, icount
)
574 __field(unsigned long long, blk_hardlimit
)
575 __field(unsigned long long, blk_softlimit
)
576 __field(unsigned long long, ino_hardlimit
)
577 __field(unsigned long long, ino_softlimit
)
580 __entry
->dev
= dqp
->q_mount
->m_super
->s_dev
;
581 __entry
->id
= dqp
->q_core
.d_id
;
582 __entry
->flags
= dqp
->dq_flags
;
583 __entry
->nrefs
= dqp
->q_nrefs
;
584 __entry
->res_bcount
= dqp
->q_res_bcount
;
585 __entry
->bcount
= be64_to_cpu(dqp
->q_core
.d_bcount
);
586 __entry
->icount
= be64_to_cpu(dqp
->q_core
.d_icount
);
587 __entry
->blk_hardlimit
=
588 be64_to_cpu(dqp
->q_core
.d_blk_hardlimit
);
589 __entry
->blk_softlimit
=
590 be64_to_cpu(dqp
->q_core
.d_blk_softlimit
);
591 __entry
->ino_hardlimit
=
592 be64_to_cpu(dqp
->q_core
.d_ino_hardlimit
);
593 __entry
->ino_softlimit
=
594 be64_to_cpu(dqp
->q_core
.d_ino_softlimit
);
596 TP_printk("dev %d:%d id 0x%x flags %s nrefs %u res_bc 0x%llx "
597 "bcnt 0x%llx [hard 0x%llx | soft 0x%llx] "
598 "icnt 0x%llx [hard 0x%llx | soft 0x%llx]",
599 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
600 be32_to_cpu(__entry
->id
),
601 __print_flags(__entry
->flags
, "|", XFS_DQ_FLAGS
),
605 __entry
->blk_hardlimit
,
606 __entry
->blk_softlimit
,
608 __entry
->ino_hardlimit
,
609 __entry
->ino_softlimit
)
612 #define DEFINE_DQUOT_EVENT(name) \
613 DEFINE_EVENT(xfs_dquot_class, name, \
614 TP_PROTO(struct xfs_dquot *dqp), \
616 DEFINE_DQUOT_EVENT(xfs_dqadjust
);
617 DEFINE_DQUOT_EVENT(xfs_dqshake_dirty
);
618 DEFINE_DQUOT_EVENT(xfs_dqshake_unlink
);
619 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want
);
620 DEFINE_DQUOT_EVENT(xfs_dqreclaim_dirty
);
621 DEFINE_DQUOT_EVENT(xfs_dqreclaim_unlink
);
622 DEFINE_DQUOT_EVENT(xfs_dqattach_found
);
623 DEFINE_DQUOT_EVENT(xfs_dqattach_get
);
624 DEFINE_DQUOT_EVENT(xfs_dqinit
);
625 DEFINE_DQUOT_EVENT(xfs_dqreuse
);
626 DEFINE_DQUOT_EVENT(xfs_dqalloc
);
627 DEFINE_DQUOT_EVENT(xfs_dqtobp_read
);
628 DEFINE_DQUOT_EVENT(xfs_dqread
);
629 DEFINE_DQUOT_EVENT(xfs_dqread_fail
);
630 DEFINE_DQUOT_EVENT(xfs_dqlookup_found
);
631 DEFINE_DQUOT_EVENT(xfs_dqlookup_want
);
632 DEFINE_DQUOT_EVENT(xfs_dqlookup_freelist
);
633 DEFINE_DQUOT_EVENT(xfs_dqlookup_move
);
634 DEFINE_DQUOT_EVENT(xfs_dqlookup_done
);
635 DEFINE_DQUOT_EVENT(xfs_dqget_hit
);
636 DEFINE_DQUOT_EVENT(xfs_dqget_miss
);
637 DEFINE_DQUOT_EVENT(xfs_dqput
);
638 DEFINE_DQUOT_EVENT(xfs_dqput_wait
);
639 DEFINE_DQUOT_EVENT(xfs_dqput_free
);
640 DEFINE_DQUOT_EVENT(xfs_dqrele
);
641 DEFINE_DQUOT_EVENT(xfs_dqflush
);
642 DEFINE_DQUOT_EVENT(xfs_dqflush_force
);
643 DEFINE_DQUOT_EVENT(xfs_dqflush_done
);
644 /* not really iget events, but we re-use the format */
645 DEFINE_IGET_EVENT(xfs_dquot_dqalloc
);
646 DEFINE_IGET_EVENT(xfs_dquot_dqdetach
);
648 DECLARE_EVENT_CLASS(xfs_loggrant_class
,
649 TP_PROTO(struct log
*log
, struct xlog_ticket
*tic
),
653 __field(unsigned, trans_type
)
656 __field(int, curr_res
)
657 __field(int, unit_res
)
658 __field(unsigned int, flags
)
659 __field(void *, reserve_headq
)
660 __field(void *, write_headq
)
661 __field(int, grant_reserve_cycle
)
662 __field(int, grant_reserve_bytes
)
663 __field(int, grant_write_cycle
)
664 __field(int, grant_write_bytes
)
665 __field(int, curr_cycle
)
666 __field(int, curr_block
)
667 __field(xfs_lsn_t
, tail_lsn
)
670 __entry
->dev
= log
->l_mp
->m_super
->s_dev
;
671 __entry
->trans_type
= tic
->t_trans_type
;
672 __entry
->ocnt
= tic
->t_ocnt
;
673 __entry
->cnt
= tic
->t_cnt
;
674 __entry
->curr_res
= tic
->t_curr_res
;
675 __entry
->unit_res
= tic
->t_unit_res
;
676 __entry
->flags
= tic
->t_flags
;
677 __entry
->reserve_headq
= log
->l_reserve_headq
;
678 __entry
->write_headq
= log
->l_write_headq
;
679 __entry
->grant_reserve_cycle
= log
->l_grant_reserve_cycle
;
680 __entry
->grant_reserve_bytes
= log
->l_grant_reserve_bytes
;
681 __entry
->grant_write_cycle
= log
->l_grant_write_cycle
;
682 __entry
->grant_write_bytes
= log
->l_grant_write_bytes
;
683 __entry
->curr_cycle
= log
->l_curr_cycle
;
684 __entry
->curr_block
= log
->l_curr_block
;
685 __entry
->tail_lsn
= log
->l_tail_lsn
;
687 TP_printk("dev %d:%d type %s t_ocnt %u t_cnt %u t_curr_res %u "
688 "t_unit_res %u t_flags %s reserve_headq 0x%p "
689 "write_headq 0x%p grant_reserve_cycle %d "
690 "grant_reserve_bytes %d grant_write_cycle %d "
691 "grant_write_bytes %d curr_cycle %d curr_block %d "
692 "tail_cycle %d tail_block %d",
693 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
694 __print_symbolic(__entry
->trans_type
, XFS_TRANS_TYPES
),
699 __print_flags(__entry
->flags
, "|", XLOG_TIC_FLAGS
),
700 __entry
->reserve_headq
,
701 __entry
->write_headq
,
702 __entry
->grant_reserve_cycle
,
703 __entry
->grant_reserve_bytes
,
704 __entry
->grant_write_cycle
,
705 __entry
->grant_write_bytes
,
708 CYCLE_LSN(__entry
->tail_lsn
),
709 BLOCK_LSN(__entry
->tail_lsn
)
713 #define DEFINE_LOGGRANT_EVENT(name) \
714 DEFINE_EVENT(xfs_loggrant_class, name, \
715 TP_PROTO(struct log *log, struct xlog_ticket *tic), \
717 DEFINE_LOGGRANT_EVENT(xfs_log_done_nonperm
);
718 DEFINE_LOGGRANT_EVENT(xfs_log_done_perm
);
719 DEFINE_LOGGRANT_EVENT(xfs_log_reserve
);
720 DEFINE_LOGGRANT_EVENT(xfs_log_umount_write
);
721 DEFINE_LOGGRANT_EVENT(xfs_log_grant_enter
);
722 DEFINE_LOGGRANT_EVENT(xfs_log_grant_exit
);
723 DEFINE_LOGGRANT_EVENT(xfs_log_grant_error
);
724 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep1
);
725 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake1
);
726 DEFINE_LOGGRANT_EVENT(xfs_log_grant_sleep2
);
727 DEFINE_LOGGRANT_EVENT(xfs_log_grant_wake2
);
728 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_enter
);
729 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_exit
);
730 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_error
);
731 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep1
);
732 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake1
);
733 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_sleep2
);
734 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_write_wake2
);
735 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_enter
);
736 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_exit
);
737 DEFINE_LOGGRANT_EVENT(xfs_log_regrant_reserve_sub
);
738 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_enter
);
739 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_exit
);
740 DEFINE_LOGGRANT_EVENT(xfs_log_ungrant_sub
);
742 #define DEFINE_RW_EVENT(name) \
744 TP_PROTO(struct xfs_inode *ip, size_t count, loff_t offset, int flags), \
745 TP_ARGS(ip, count, offset, flags), \
747 __field(dev_t, dev) \
748 __field(xfs_ino_t, ino) \
749 __field(xfs_fsize_t, size) \
750 __field(xfs_fsize_t, new_size) \
751 __field(loff_t, offset) \
752 __field(size_t, count) \
753 __field(int, flags) \
756 __entry->dev = VFS_I(ip)->i_sb->s_dev; \
757 __entry->ino = ip->i_ino; \
758 __entry->size = ip->i_d.di_size; \
759 __entry->new_size = ip->i_new_size; \
760 __entry->offset = offset; \
761 __entry->count = count; \
762 __entry->flags = flags; \
764 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
765 "offset 0x%llx count 0x%zx ioflags %s", \
766 MAJOR(__entry->dev), MINOR(__entry->dev), \
772 __print_flags(__entry->flags, "|", XFS_IO_FLAGS)) \
774 DEFINE_RW_EVENT(xfs_file_read
);
775 DEFINE_RW_EVENT(xfs_file_buffered_write
);
776 DEFINE_RW_EVENT(xfs_file_direct_write
);
777 DEFINE_RW_EVENT(xfs_file_splice_read
);
778 DEFINE_RW_EVENT(xfs_file_splice_write
);
781 #define DEFINE_PAGE_EVENT(name) \
783 TP_PROTO(struct inode *inode, struct page *page, unsigned long off), \
784 TP_ARGS(inode, page, off), \
786 __field(dev_t, dev) \
787 __field(xfs_ino_t, ino) \
788 __field(pgoff_t, pgoff) \
789 __field(loff_t, size) \
790 __field(unsigned long, offset) \
791 __field(int, delalloc) \
792 __field(int, unmapped) \
793 __field(int, unwritten) \
796 int delalloc = -1, unmapped = -1, unwritten = -1; \
798 if (page_has_buffers(page)) \
799 xfs_count_page_state(page, &delalloc, \
800 &unmapped, &unwritten); \
801 __entry->dev = inode->i_sb->s_dev; \
802 __entry->ino = XFS_I(inode)->i_ino; \
803 __entry->pgoff = page_offset(page); \
804 __entry->size = i_size_read(inode); \
805 __entry->offset = off; \
806 __entry->delalloc = delalloc; \
807 __entry->unmapped = unmapped; \
808 __entry->unwritten = unwritten; \
810 TP_printk("dev %d:%d ino 0x%llx pgoff 0x%lx size 0x%llx offset %lx " \
811 "delalloc %d unmapped %d unwritten %d", \
812 MAJOR(__entry->dev), MINOR(__entry->dev), \
819 __entry->unwritten) \
821 DEFINE_PAGE_EVENT(xfs_writepage
);
822 DEFINE_PAGE_EVENT(xfs_releasepage
);
823 DEFINE_PAGE_EVENT(xfs_invalidatepage
);
825 #define DEFINE_IOMAP_EVENT(name) \
827 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count, \
828 int flags, struct xfs_bmbt_irec *irec), \
829 TP_ARGS(ip, offset, count, flags, irec), \
831 __field(dev_t, dev) \
832 __field(xfs_ino_t, ino) \
833 __field(loff_t, size) \
834 __field(loff_t, new_size) \
835 __field(loff_t, offset) \
836 __field(size_t, count) \
837 __field(int, flags) \
838 __field(xfs_fileoff_t, startoff) \
839 __field(xfs_fsblock_t, startblock) \
840 __field(xfs_filblks_t, blockcount) \
843 __entry->dev = VFS_I(ip)->i_sb->s_dev; \
844 __entry->ino = ip->i_ino; \
845 __entry->size = ip->i_d.di_size; \
846 __entry->new_size = ip->i_new_size; \
847 __entry->offset = offset; \
848 __entry->count = count; \
849 __entry->flags = flags; \
850 __entry->startoff = irec ? irec->br_startoff : 0; \
851 __entry->startblock = irec ? irec->br_startblock : 0; \
852 __entry->blockcount = irec ? irec->br_blockcount : 0; \
854 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
855 "offset 0x%llx count %zd flags %s " \
856 "startoff 0x%llx startblock %s blockcount 0x%llx", \
857 MAJOR(__entry->dev), MINOR(__entry->dev), \
863 __print_flags(__entry->flags, "|", BMAPI_FLAGS), \
865 xfs_fmtfsblock(__entry->startblock), \
866 __entry->blockcount) \
868 DEFINE_IOMAP_EVENT(xfs_iomap_enter
);
869 DEFINE_IOMAP_EVENT(xfs_iomap_found
);
870 DEFINE_IOMAP_EVENT(xfs_iomap_alloc
);
872 #define DEFINE_SIMPLE_IO_EVENT(name) \
874 TP_PROTO(struct xfs_inode *ip, xfs_off_t offset, ssize_t count), \
875 TP_ARGS(ip, offset, count), \
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) \
885 __entry->dev = VFS_I(ip)->i_sb->s_dev; \
886 __entry->ino = ip->i_ino; \
887 __entry->size = ip->i_d.di_size; \
888 __entry->new_size = ip->i_new_size; \
889 __entry->offset = offset; \
890 __entry->count = count; \
892 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
893 "offset 0x%llx count %zd", \
894 MAJOR(__entry->dev), MINOR(__entry->dev), \
901 DEFINE_SIMPLE_IO_EVENT(xfs_delalloc_enospc
);
902 DEFINE_SIMPLE_IO_EVENT(xfs_unwritten_convert
);
905 TRACE_EVENT(xfs_itruncate_start
,
906 TP_PROTO(struct xfs_inode
*ip
, xfs_fsize_t new_size
, int flag
,
907 xfs_off_t toss_start
, xfs_off_t toss_finish
),
908 TP_ARGS(ip
, new_size
, flag
, toss_start
, toss_finish
),
911 __field(xfs_ino_t
, ino
)
912 __field(xfs_fsize_t
, size
)
913 __field(xfs_fsize_t
, new_size
)
914 __field(xfs_off_t
, toss_start
)
915 __field(xfs_off_t
, toss_finish
)
919 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
920 __entry
->ino
= ip
->i_ino
;
921 __entry
->size
= ip
->i_d
.di_size
;
922 __entry
->new_size
= new_size
;
923 __entry
->toss_start
= toss_start
;
924 __entry
->toss_finish
= toss_finish
;
925 __entry
->flag
= flag
;
927 TP_printk("dev %d:%d ino 0x%llx %s size 0x%llx new_size 0x%llx "
928 "toss start 0x%llx toss finish 0x%llx",
929 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
931 __print_flags(__entry
->flag
, "|", XFS_ITRUNC_FLAGS
),
935 __entry
->toss_finish
)
938 DECLARE_EVENT_CLASS(xfs_itrunc_class
,
939 TP_PROTO(struct xfs_inode
*ip
, xfs_fsize_t new_size
),
940 TP_ARGS(ip
, new_size
),
943 __field(xfs_ino_t
, ino
)
944 __field(xfs_fsize_t
, size
)
945 __field(xfs_fsize_t
, new_size
)
948 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
949 __entry
->ino
= ip
->i_ino
;
950 __entry
->size
= ip
->i_d
.di_size
;
951 __entry
->new_size
= new_size
;
953 TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx",
954 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
960 #define DEFINE_ITRUNC_EVENT(name) \
961 DEFINE_EVENT(xfs_itrunc_class, name, \
962 TP_PROTO(struct xfs_inode *ip, xfs_fsize_t new_size), \
963 TP_ARGS(ip, new_size))
964 DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_start
);
965 DEFINE_ITRUNC_EVENT(xfs_itruncate_finish_end
);
967 TRACE_EVENT(xfs_pagecache_inval
,
968 TP_PROTO(struct xfs_inode
*ip
, xfs_off_t start
, xfs_off_t finish
),
969 TP_ARGS(ip
, start
, finish
),
972 __field(xfs_ino_t
, ino
)
973 __field(xfs_fsize_t
, size
)
974 __field(xfs_off_t
, start
)
975 __field(xfs_off_t
, finish
)
978 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
979 __entry
->ino
= ip
->i_ino
;
980 __entry
->size
= ip
->i_d
.di_size
;
981 __entry
->start
= start
;
982 __entry
->finish
= finish
;
984 TP_printk("dev %d:%d ino 0x%llx size 0x%llx start 0x%llx finish 0x%llx",
985 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
992 TRACE_EVENT(xfs_bunmap
,
993 TP_PROTO(struct xfs_inode
*ip
, xfs_fileoff_t bno
, xfs_filblks_t len
,
994 int flags
, unsigned long caller_ip
),
995 TP_ARGS(ip
, bno
, len
, flags
, caller_ip
),
998 __field(xfs_ino_t
, ino
)
999 __field(xfs_fsize_t
, size
)
1000 __field(xfs_fileoff_t
, bno
)
1001 __field(xfs_filblks_t
, len
)
1002 __field(unsigned long, caller_ip
)
1006 __entry
->dev
= VFS_I(ip
)->i_sb
->s_dev
;
1007 __entry
->ino
= ip
->i_ino
;
1008 __entry
->size
= ip
->i_d
.di_size
;
1011 __entry
->caller_ip
= caller_ip
;
1012 __entry
->flags
= flags
;
1014 TP_printk("dev %d:%d ino 0x%llx size 0x%llx bno 0x%llx len 0x%llx"
1015 "flags %s caller %pf",
1016 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1021 __print_flags(__entry
->flags
, "|", XFS_BMAPI_FLAGS
),
1022 (void *)__entry
->caller_ip
)
1026 TRACE_EVENT(xfs_alloc_busy
,
1027 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agblock_t agbno
,
1028 xfs_extlen_t len
, int slot
),
1029 TP_ARGS(mp
, agno
, agbno
, len
, slot
),
1032 __field(xfs_agnumber_t
, agno
)
1033 __field(xfs_agblock_t
, agbno
)
1034 __field(xfs_extlen_t
, len
)
1038 __entry
->dev
= mp
->m_super
->s_dev
;
1039 __entry
->agno
= agno
;
1040 __entry
->agbno
= agbno
;
1042 __entry
->slot
= slot
;
1044 TP_printk("dev %d:%d agno %u agbno %u len %u slot %d",
1045 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1053 #define XFS_BUSY_STATES \
1057 TRACE_EVENT(xfs_alloc_unbusy
,
1058 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
,
1059 int slot
, int found
),
1060 TP_ARGS(mp
, agno
, slot
, found
),
1063 __field(xfs_agnumber_t
, agno
)
1068 __entry
->dev
= mp
->m_super
->s_dev
;
1069 __entry
->agno
= agno
;
1070 __entry
->slot
= slot
;
1071 __entry
->found
= found
;
1073 TP_printk("dev %d:%d agno %u slot %d %s",
1074 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1077 __print_symbolic(__entry
->found
, XFS_BUSY_STATES
))
1080 TRACE_EVENT(xfs_alloc_busysearch
,
1081 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agblock_t agbno
,
1082 xfs_extlen_t len
, xfs_lsn_t lsn
),
1083 TP_ARGS(mp
, agno
, agbno
, len
, lsn
),
1086 __field(xfs_agnumber_t
, agno
)
1087 __field(xfs_agblock_t
, agbno
)
1088 __field(xfs_extlen_t
, len
)
1089 __field(xfs_lsn_t
, lsn
)
1092 __entry
->dev
= mp
->m_super
->s_dev
;
1093 __entry
->agno
= agno
;
1094 __entry
->agbno
= agbno
;
1098 TP_printk("dev %d:%d agno %u agbno %u len %u force lsn 0x%llx",
1099 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1106 TRACE_EVENT(xfs_agf
,
1107 TP_PROTO(struct xfs_mount
*mp
, struct xfs_agf
*agf
, int flags
,
1108 unsigned long caller_ip
),
1109 TP_ARGS(mp
, agf
, flags
, caller_ip
),
1112 __field(xfs_agnumber_t
, agno
)
1114 __field(__u32
, length
)
1115 __field(__u32
, bno_root
)
1116 __field(__u32
, cnt_root
)
1117 __field(__u32
, bno_level
)
1118 __field(__u32
, cnt_level
)
1119 __field(__u32
, flfirst
)
1120 __field(__u32
, fllast
)
1121 __field(__u32
, flcount
)
1122 __field(__u32
, freeblks
)
1123 __field(__u32
, longest
)
1124 __field(unsigned long, caller_ip
)
1127 __entry
->dev
= mp
->m_super
->s_dev
;
1128 __entry
->agno
= be32_to_cpu(agf
->agf_seqno
),
1129 __entry
->flags
= flags
;
1130 __entry
->length
= be32_to_cpu(agf
->agf_length
),
1131 __entry
->bno_root
= be32_to_cpu(agf
->agf_roots
[XFS_BTNUM_BNO
]),
1132 __entry
->cnt_root
= be32_to_cpu(agf
->agf_roots
[XFS_BTNUM_CNT
]),
1133 __entry
->bno_level
=
1134 be32_to_cpu(agf
->agf_levels
[XFS_BTNUM_BNO
]),
1135 __entry
->cnt_level
=
1136 be32_to_cpu(agf
->agf_levels
[XFS_BTNUM_CNT
]),
1137 __entry
->flfirst
= be32_to_cpu(agf
->agf_flfirst
),
1138 __entry
->fllast
= be32_to_cpu(agf
->agf_fllast
),
1139 __entry
->flcount
= be32_to_cpu(agf
->agf_flcount
),
1140 __entry
->freeblks
= be32_to_cpu(agf
->agf_freeblks
),
1141 __entry
->longest
= be32_to_cpu(agf
->agf_longest
);
1142 __entry
->caller_ip
= caller_ip
;
1144 TP_printk("dev %d:%d agno %u flags %s length %u roots b %u c %u "
1145 "levels b %u c %u flfirst %u fllast %u flcount %u "
1146 "freeblks %u longest %u caller %pf",
1147 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1149 __print_flags(__entry
->flags
, "|", XFS_AGF_FLAGS
),
1160 (void *)__entry
->caller_ip
)
1163 TRACE_EVENT(xfs_free_extent
,
1164 TP_PROTO(struct xfs_mount
*mp
, xfs_agnumber_t agno
, xfs_agblock_t agbno
,
1165 xfs_extlen_t len
, bool isfl
, int haveleft
, int haveright
),
1166 TP_ARGS(mp
, agno
, agbno
, len
, isfl
, haveleft
, haveright
),
1169 __field(xfs_agnumber_t
, agno
)
1170 __field(xfs_agblock_t
, agbno
)
1171 __field(xfs_extlen_t
, len
)
1173 __field(int, haveleft
)
1174 __field(int, haveright
)
1177 __entry
->dev
= mp
->m_super
->s_dev
;
1178 __entry
->agno
= agno
;
1179 __entry
->agbno
= agbno
;
1181 __entry
->isfl
= isfl
;
1182 __entry
->haveleft
= haveleft
;
1183 __entry
->haveright
= haveright
;
1185 TP_printk("dev %d:%d agno %u agbno %u len %u isfl %d %s",
1186 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1192 (__entry
->haveright
? "both" : "left") :
1193 (__entry
->haveright
? "right" : "none"))
1197 DECLARE_EVENT_CLASS(xfs_alloc_class
,
1198 TP_PROTO(struct xfs_alloc_arg
*args
),
1202 __field(xfs_agnumber_t
, agno
)
1203 __field(xfs_agblock_t
, agbno
)
1204 __field(xfs_extlen_t
, minlen
)
1205 __field(xfs_extlen_t
, maxlen
)
1206 __field(xfs_extlen_t
, mod
)
1207 __field(xfs_extlen_t
, prod
)
1208 __field(xfs_extlen_t
, minleft
)
1209 __field(xfs_extlen_t
, total
)
1210 __field(xfs_extlen_t
, alignment
)
1211 __field(xfs_extlen_t
, minalignslop
)
1212 __field(xfs_extlen_t
, len
)
1213 __field(short, type
)
1214 __field(short, otype
)
1215 __field(char, wasdel
)
1216 __field(char, wasfromfl
)
1218 __field(char, userdata
)
1219 __field(xfs_fsblock_t
, firstblock
)
1222 __entry
->dev
= args
->mp
->m_super
->s_dev
;
1223 __entry
->agno
= args
->agno
;
1224 __entry
->agbno
= args
->agbno
;
1225 __entry
->minlen
= args
->minlen
;
1226 __entry
->maxlen
= args
->maxlen
;
1227 __entry
->mod
= args
->mod
;
1228 __entry
->prod
= args
->prod
;
1229 __entry
->minleft
= args
->minleft
;
1230 __entry
->total
= args
->total
;
1231 __entry
->alignment
= args
->alignment
;
1232 __entry
->minalignslop
= args
->minalignslop
;
1233 __entry
->len
= args
->len
;
1234 __entry
->type
= args
->type
;
1235 __entry
->otype
= args
->otype
;
1236 __entry
->wasdel
= args
->wasdel
;
1237 __entry
->wasfromfl
= args
->wasfromfl
;
1238 __entry
->isfl
= args
->isfl
;
1239 __entry
->userdata
= args
->userdata
;
1240 __entry
->firstblock
= args
->firstblock
;
1242 TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u "
1243 "prod %u minleft %u total %u alignment %u minalignslop %u "
1244 "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d "
1245 "userdata %d firstblock 0x%llx",
1246 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1256 __entry
->minalignslop
,
1258 __print_symbolic(__entry
->type
, XFS_ALLOC_TYPES
),
1259 __print_symbolic(__entry
->otype
, XFS_ALLOC_TYPES
),
1264 __entry
->firstblock
)
1267 #define DEFINE_ALLOC_EVENT(name) \
1268 DEFINE_EVENT(xfs_alloc_class, name, \
1269 TP_PROTO(struct xfs_alloc_arg *args), \
1271 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done
);
1272 DEFINE_ALLOC_EVENT(xfs_alloc_exact_error
);
1273 DEFINE_ALLOC_EVENT(xfs_alloc_near_nominleft
);
1274 DEFINE_ALLOC_EVENT(xfs_alloc_near_first
);
1275 DEFINE_ALLOC_EVENT(xfs_alloc_near_greater
);
1276 DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser
);
1277 DEFINE_ALLOC_EVENT(xfs_alloc_near_error
);
1278 DEFINE_ALLOC_EVENT(xfs_alloc_size_neither
);
1279 DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry
);
1280 DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft
);
1281 DEFINE_ALLOC_EVENT(xfs_alloc_size_done
);
1282 DEFINE_ALLOC_EVENT(xfs_alloc_size_error
);
1283 DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist
);
1284 DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough
);
1285 DEFINE_ALLOC_EVENT(xfs_alloc_small_done
);
1286 DEFINE_ALLOC_EVENT(xfs_alloc_small_error
);
1287 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_badargs
);
1288 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_nofix
);
1289 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_noagbp
);
1290 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_loopfailed
);
1291 DEFINE_ALLOC_EVENT(xfs_alloc_vextent_allfailed
);
1293 DECLARE_EVENT_CLASS(xfs_dir2_class
,
1294 TP_PROTO(struct xfs_da_args
*args
),
1298 __field(xfs_ino_t
, ino
)
1299 __dynamic_array(char, name
, args
->namelen
)
1300 __field(int, namelen
)
1301 __field(xfs_dahash_t
, hashval
)
1302 __field(xfs_ino_t
, inumber
)
1303 __field(int, op_flags
)
1306 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1307 __entry
->ino
= args
->dp
->i_ino
;
1309 memcpy(__get_str(name
), args
->name
, args
->namelen
);
1310 __entry
->namelen
= args
->namelen
;
1311 __entry
->hashval
= args
->hashval
;
1312 __entry
->inumber
= args
->inumber
;
1313 __entry
->op_flags
= args
->op_flags
;
1315 TP_printk("dev %d:%d ino 0x%llx name %.*s namelen %d hashval 0x%x "
1316 "inumber 0x%llx op_flags %s",
1317 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1320 __entry
->namelen
? __get_str(name
) : NULL
,
1324 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
))
1327 #define DEFINE_DIR2_EVENT(name) \
1328 DEFINE_EVENT(xfs_dir2_class, name, \
1329 TP_PROTO(struct xfs_da_args *args), \
1331 DEFINE_DIR2_EVENT(xfs_dir2_sf_addname
);
1332 DEFINE_DIR2_EVENT(xfs_dir2_sf_create
);
1333 DEFINE_DIR2_EVENT(xfs_dir2_sf_lookup
);
1334 DEFINE_DIR2_EVENT(xfs_dir2_sf_replace
);
1335 DEFINE_DIR2_EVENT(xfs_dir2_sf_removename
);
1336 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino4
);
1337 DEFINE_DIR2_EVENT(xfs_dir2_sf_toino8
);
1338 DEFINE_DIR2_EVENT(xfs_dir2_sf_to_block
);
1339 DEFINE_DIR2_EVENT(xfs_dir2_block_addname
);
1340 DEFINE_DIR2_EVENT(xfs_dir2_block_lookup
);
1341 DEFINE_DIR2_EVENT(xfs_dir2_block_replace
);
1342 DEFINE_DIR2_EVENT(xfs_dir2_block_removename
);
1343 DEFINE_DIR2_EVENT(xfs_dir2_block_to_sf
);
1344 DEFINE_DIR2_EVENT(xfs_dir2_block_to_leaf
);
1345 DEFINE_DIR2_EVENT(xfs_dir2_leaf_addname
);
1346 DEFINE_DIR2_EVENT(xfs_dir2_leaf_lookup
);
1347 DEFINE_DIR2_EVENT(xfs_dir2_leaf_replace
);
1348 DEFINE_DIR2_EVENT(xfs_dir2_leaf_removename
);
1349 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_block
);
1350 DEFINE_DIR2_EVENT(xfs_dir2_leaf_to_node
);
1351 DEFINE_DIR2_EVENT(xfs_dir2_node_addname
);
1352 DEFINE_DIR2_EVENT(xfs_dir2_node_lookup
);
1353 DEFINE_DIR2_EVENT(xfs_dir2_node_replace
);
1354 DEFINE_DIR2_EVENT(xfs_dir2_node_removename
);
1355 DEFINE_DIR2_EVENT(xfs_dir2_node_to_leaf
);
1357 DECLARE_EVENT_CLASS(xfs_dir2_space_class
,
1358 TP_PROTO(struct xfs_da_args
*args
, int idx
),
1362 __field(xfs_ino_t
, ino
)
1363 __field(int, op_flags
)
1367 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1368 __entry
->ino
= args
->dp
->i_ino
;
1369 __entry
->op_flags
= args
->op_flags
;
1372 TP_printk("dev %d:%d ino 0x%llx op_flags %s index %d",
1373 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1375 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
),
1379 #define DEFINE_DIR2_SPACE_EVENT(name) \
1380 DEFINE_EVENT(xfs_dir2_space_class, name, \
1381 TP_PROTO(struct xfs_da_args *args, int idx), \
1383 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_add
);
1384 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_leafn_remove
);
1385 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_grow_inode
);
1386 DEFINE_DIR2_SPACE_EVENT(xfs_dir2_shrink_inode
);
1388 TRACE_EVENT(xfs_dir2_leafn_moveents
,
1389 TP_PROTO(struct xfs_da_args
*args
, int src_idx
, int dst_idx
, int count
),
1390 TP_ARGS(args
, src_idx
, dst_idx
, count
),
1393 __field(xfs_ino_t
, ino
)
1394 __field(int, op_flags
)
1395 __field(int, src_idx
)
1396 __field(int, dst_idx
)
1400 __entry
->dev
= VFS_I(args
->dp
)->i_sb
->s_dev
;
1401 __entry
->ino
= args
->dp
->i_ino
;
1402 __entry
->op_flags
= args
->op_flags
;
1403 __entry
->src_idx
= src_idx
;
1404 __entry
->dst_idx
= dst_idx
;
1405 __entry
->count
= count
;
1407 TP_printk("dev %d:%d ino 0x%llx op_flags %s "
1408 "src_idx %d dst_idx %d count %d",
1409 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1411 __print_flags(__entry
->op_flags
, "|", XFS_DA_OP_FLAGS
),
1417 #endif /* _TRACE_XFS_H */
1419 #undef TRACE_INCLUDE_PATH
1420 #define TRACE_INCLUDE_PATH .
1421 #define TRACE_INCLUDE_FILE xfs_trace
1422 #include <trace/define_trace.h>