2 #define TRACE_SYSTEM ext4
4 #if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/writeback.h>
8 #include "../../../fs/ext4/ext4.h"
9 #include "../../../fs/ext4/mballoc.h"
10 #include <linux/tracepoint.h>
12 TRACE_EVENT(ext4_free_inode
,
13 TP_PROTO(struct inode
*inode
),
20 __field( umode_t
, mode
)
23 __field( blkcnt_t
, blocks
)
27 __entry
->dev
= inode
->i_sb
->s_dev
;
28 __entry
->ino
= inode
->i_ino
;
29 __entry
->mode
= inode
->i_mode
;
30 __entry
->uid
= inode
->i_uid
;
31 __entry
->gid
= inode
->i_gid
;
32 __entry
->blocks
= inode
->i_blocks
;
35 TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu",
36 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->mode
,
37 __entry
->uid
, __entry
->gid
,
38 (unsigned long long) __entry
->blocks
)
41 TRACE_EVENT(ext4_request_inode
,
42 TP_PROTO(struct inode
*dir
, int mode
),
49 __field( umode_t
, mode
)
53 __entry
->dev
= dir
->i_sb
->s_dev
;
54 __entry
->dir
= dir
->i_ino
;
58 TP_printk("dev %s dir %lu mode %d",
59 jbd2_dev_to_name(__entry
->dev
), __entry
->dir
, __entry
->mode
)
62 TRACE_EVENT(ext4_allocate_inode
,
63 TP_PROTO(struct inode
*inode
, struct inode
*dir
, int mode
),
65 TP_ARGS(inode
, dir
, mode
),
71 __field( umode_t
, mode
)
75 __entry
->dev
= inode
->i_sb
->s_dev
;
76 __entry
->ino
= inode
->i_ino
;
77 __entry
->dir
= dir
->i_ino
;
81 TP_printk("dev %s ino %lu dir %lu mode %d",
82 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->dir
, __entry
->mode
)
85 TRACE_EVENT(ext4_write_begin
,
87 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
90 TP_ARGS(inode
, pos
, len
, flags
),
95 __field( loff_t
, pos
)
96 __field( unsigned int, len
)
97 __field( unsigned int, flags
)
101 __entry
->dev
= inode
->i_sb
->s_dev
;
102 __entry
->ino
= inode
->i_ino
;
105 __entry
->flags
= flags
;
108 TP_printk("dev %s ino %lu pos %llu len %u flags %u",
109 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pos
, __entry
->len
,
113 TRACE_EVENT(ext4_ordered_write_end
,
114 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
115 unsigned int copied
),
117 TP_ARGS(inode
, pos
, len
, copied
),
120 __field( dev_t
, dev
)
121 __field( ino_t
, ino
)
122 __field( loff_t
, pos
)
123 __field( unsigned int, len
)
124 __field( unsigned int, copied
)
128 __entry
->dev
= inode
->i_sb
->s_dev
;
129 __entry
->ino
= inode
->i_ino
;
132 __entry
->copied
= copied
;
135 TP_printk("dev %s ino %lu pos %llu len %u copied %u",
136 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pos
, __entry
->len
,
140 TRACE_EVENT(ext4_writeback_write_end
,
141 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
142 unsigned int copied
),
144 TP_ARGS(inode
, pos
, len
, copied
),
147 __field( dev_t
, dev
)
148 __field( ino_t
, ino
)
149 __field( loff_t
, pos
)
150 __field( unsigned int, len
)
151 __field( unsigned int, copied
)
155 __entry
->dev
= inode
->i_sb
->s_dev
;
156 __entry
->ino
= inode
->i_ino
;
159 __entry
->copied
= copied
;
162 TP_printk("dev %s ino %lu pos %llu len %u copied %u",
163 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pos
, __entry
->len
,
167 TRACE_EVENT(ext4_journalled_write_end
,
168 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
169 unsigned int copied
),
170 TP_ARGS(inode
, pos
, len
, copied
),
173 __field( dev_t
, dev
)
174 __field( ino_t
, ino
)
175 __field( loff_t
, pos
)
176 __field( unsigned int, len
)
177 __field( unsigned int, copied
)
181 __entry
->dev
= inode
->i_sb
->s_dev
;
182 __entry
->ino
= inode
->i_ino
;
185 __entry
->copied
= copied
;
188 TP_printk("dev %s ino %lu pos %llu len %u copied %u",
189 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pos
, __entry
->len
,
193 TRACE_EVENT(ext4_writepage
,
194 TP_PROTO(struct inode
*inode
, struct page
*page
),
196 TP_ARGS(inode
, page
),
199 __field( dev_t
, dev
)
200 __field( ino_t
, ino
)
201 __field( pgoff_t
, index
)
206 __entry
->dev
= inode
->i_sb
->s_dev
;
207 __entry
->ino
= inode
->i_ino
;
208 __entry
->index
= page
->index
;
211 TP_printk("dev %s ino %lu page_index %lu",
212 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->index
)
215 TRACE_EVENT(ext4_da_writepages
,
216 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
221 __field( dev_t
, dev
)
222 __field( ino_t
, ino
)
223 __field( long, nr_to_write
)
224 __field( long, pages_skipped
)
225 __field( loff_t
, range_start
)
226 __field( loff_t
, range_end
)
227 __field( char, nonblocking
)
228 __field( char, for_kupdate
)
229 __field( char, for_reclaim
)
230 __field( char, range_cyclic
)
234 __entry
->dev
= inode
->i_sb
->s_dev
;
235 __entry
->ino
= inode
->i_ino
;
236 __entry
->nr_to_write
= wbc
->nr_to_write
;
237 __entry
->pages_skipped
= wbc
->pages_skipped
;
238 __entry
->range_start
= wbc
->range_start
;
239 __entry
->range_end
= wbc
->range_end
;
240 __entry
->nonblocking
= wbc
->nonblocking
;
241 __entry
->for_kupdate
= wbc
->for_kupdate
;
242 __entry
->for_reclaim
= wbc
->for_reclaim
;
243 __entry
->range_cyclic
= wbc
->range_cyclic
;
246 TP_printk("dev %s ino %lu nr_t_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d",
247 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->nr_to_write
,
248 __entry
->pages_skipped
, __entry
->range_start
,
249 __entry
->range_end
, __entry
->nonblocking
,
250 __entry
->for_kupdate
, __entry
->for_reclaim
,
251 __entry
->range_cyclic
)
254 TRACE_EVENT(ext4_da_writepages_result
,
255 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
,
256 int ret
, int pages_written
),
258 TP_ARGS(inode
, wbc
, ret
, pages_written
),
261 __field( dev_t
, dev
)
262 __field( ino_t
, ino
)
264 __field( int, pages_written
)
265 __field( long, pages_skipped
)
266 __field( char, encountered_congestion
)
267 __field( char, more_io
)
268 __field( char, no_nrwrite_index_update
)
272 __entry
->dev
= inode
->i_sb
->s_dev
;
273 __entry
->ino
= inode
->i_ino
;
275 __entry
->pages_written
= pages_written
;
276 __entry
->pages_skipped
= wbc
->pages_skipped
;
277 __entry
->encountered_congestion
= wbc
->encountered_congestion
;
278 __entry
->more_io
= wbc
->more_io
;
279 __entry
->no_nrwrite_index_update
= wbc
->no_nrwrite_index_update
;
282 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d",
283 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->ret
,
284 __entry
->pages_written
, __entry
->pages_skipped
,
285 __entry
->encountered_congestion
, __entry
->more_io
,
286 __entry
->no_nrwrite_index_update
)
289 TRACE_EVENT(ext4_da_write_begin
,
290 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
293 TP_ARGS(inode
, pos
, len
, flags
),
296 __field( dev_t
, dev
)
297 __field( ino_t
, ino
)
298 __field( loff_t
, pos
)
299 __field( unsigned int, len
)
300 __field( unsigned int, flags
)
304 __entry
->dev
= inode
->i_sb
->s_dev
;
305 __entry
->ino
= inode
->i_ino
;
308 __entry
->flags
= flags
;
311 TP_printk("dev %s ino %lu pos %llu len %u flags %u",
312 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pos
, __entry
->len
,
316 TRACE_EVENT(ext4_da_write_end
,
317 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
318 unsigned int copied
),
320 TP_ARGS(inode
, pos
, len
, copied
),
323 __field( dev_t
, dev
)
324 __field( ino_t
, ino
)
325 __field( loff_t
, pos
)
326 __field( unsigned int, len
)
327 __field( unsigned int, copied
)
331 __entry
->dev
= inode
->i_sb
->s_dev
;
332 __entry
->ino
= inode
->i_ino
;
335 __entry
->copied
= copied
;
338 TP_printk("dev %s ino %lu pos %llu len %u copied %u",
339 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pos
, __entry
->len
,
343 TRACE_EVENT(ext4_discard_blocks
,
344 TP_PROTO(struct super_block
*sb
, unsigned long long blk
,
345 unsigned long long count
),
347 TP_ARGS(sb
, blk
, count
),
350 __field( dev_t
, dev
)
351 __field( __u64
, blk
)
352 __field( __u64
, count
)
357 __entry
->dev
= sb
->s_dev
;
359 __entry
->count
= count
;
362 TP_printk("dev %s blk %llu count %llu",
363 jbd2_dev_to_name(__entry
->dev
), __entry
->blk
, __entry
->count
)
366 TRACE_EVENT(ext4_mb_new_inode_pa
,
367 TP_PROTO(struct ext4_allocation_context
*ac
,
368 struct ext4_prealloc_space
*pa
),
373 __field( dev_t
, dev
)
374 __field( ino_t
, ino
)
375 __field( __u64
, pa_pstart
)
376 __field( __u32
, pa_len
)
377 __field( __u64
, pa_lstart
)
382 __entry
->dev
= ac
->ac_sb
->s_dev
;
383 __entry
->ino
= ac
->ac_inode
->i_ino
;
384 __entry
->pa_pstart
= pa
->pa_pstart
;
385 __entry
->pa_len
= pa
->pa_len
;
386 __entry
->pa_lstart
= pa
->pa_lstart
;
389 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
390 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pa_pstart
,
391 __entry
->pa_len
, __entry
->pa_lstart
)
394 TRACE_EVENT(ext4_mb_new_group_pa
,
395 TP_PROTO(struct ext4_allocation_context
*ac
,
396 struct ext4_prealloc_space
*pa
),
401 __field( dev_t
, dev
)
402 __field( ino_t
, ino
)
403 __field( __u64
, pa_pstart
)
404 __field( __u32
, pa_len
)
405 __field( __u64
, pa_lstart
)
410 __entry
->dev
= ac
->ac_sb
->s_dev
;
411 __entry
->ino
= ac
->ac_inode
->i_ino
;
412 __entry
->pa_pstart
= pa
->pa_pstart
;
413 __entry
->pa_len
= pa
->pa_len
;
414 __entry
->pa_lstart
= pa
->pa_lstart
;
417 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
418 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pa_pstart
,
419 __entry
->pa_len
, __entry
->pa_lstart
)
422 TRACE_EVENT(ext4_mb_release_inode_pa
,
423 TP_PROTO(struct ext4_allocation_context
*ac
,
424 struct ext4_prealloc_space
*pa
,
425 unsigned long long block
, unsigned int count
),
427 TP_ARGS(ac
, pa
, block
, count
),
430 __field( dev_t
, dev
)
431 __field( ino_t
, ino
)
432 __field( __u64
, block
)
433 __field( __u32
, count
)
438 __entry
->dev
= ac
->ac_sb
->s_dev
;
439 __entry
->ino
= ac
->ac_inode
->i_ino
;
440 __entry
->block
= block
;
441 __entry
->count
= count
;
444 TP_printk("dev %s ino %lu block %llu count %u",
445 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->block
,
449 TRACE_EVENT(ext4_mb_release_group_pa
,
450 TP_PROTO(struct ext4_allocation_context
*ac
,
451 struct ext4_prealloc_space
*pa
),
456 __field( dev_t
, dev
)
457 __field( ino_t
, ino
)
458 __field( __u64
, pa_pstart
)
459 __field( __u32
, pa_len
)
464 __entry
->dev
= ac
->ac_sb
->s_dev
;
465 __entry
->ino
= ac
->ac_inode
->i_ino
;
466 __entry
->pa_pstart
= pa
->pa_pstart
;
467 __entry
->pa_len
= pa
->pa_len
;
470 TP_printk("dev %s pstart %llu len %u",
471 jbd2_dev_to_name(__entry
->dev
), __entry
->pa_pstart
, __entry
->pa_len
)
474 TRACE_EVENT(ext4_discard_preallocations
,
475 TP_PROTO(struct inode
*inode
),
480 __field( dev_t
, dev
)
481 __field( ino_t
, ino
)
486 __entry
->dev
= inode
->i_sb
->s_dev
;
487 __entry
->ino
= inode
->i_ino
;
490 TP_printk("dev %s ino %lu",
491 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
)
494 TRACE_EVENT(ext4_mb_discard_preallocations
,
495 TP_PROTO(struct super_block
*sb
, int needed
),
500 __field( dev_t
, dev
)
501 __field( int, needed
)
506 __entry
->dev
= sb
->s_dev
;
507 __entry
->needed
= needed
;
510 TP_printk("dev %s needed %d",
511 jbd2_dev_to_name(__entry
->dev
), __entry
->needed
)
514 TRACE_EVENT(ext4_request_blocks
,
515 TP_PROTO(struct ext4_allocation_request
*ar
),
520 __field( dev_t
, dev
)
521 __field( ino_t
, ino
)
522 __field( unsigned int, flags
)
523 __field( unsigned int, len
)
524 __field( __u64
, logical
)
525 __field( __u64
, goal
)
526 __field( __u64
, lleft
)
527 __field( __u64
, lright
)
528 __field( __u64
, pleft
)
529 __field( __u64
, pright
)
533 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
534 __entry
->ino
= ar
->inode
->i_ino
;
535 __entry
->flags
= ar
->flags
;
536 __entry
->len
= ar
->len
;
537 __entry
->logical
= ar
->logical
;
538 __entry
->goal
= ar
->goal
;
539 __entry
->lleft
= ar
->lleft
;
540 __entry
->lright
= ar
->lright
;
541 __entry
->pleft
= ar
->pleft
;
542 __entry
->pright
= ar
->pright
;
545 TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
546 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->flags
,
548 (unsigned long long) __entry
->logical
,
549 (unsigned long long) __entry
->goal
,
550 (unsigned long long) __entry
->lleft
,
551 (unsigned long long) __entry
->lright
,
552 (unsigned long long) __entry
->pleft
,
553 (unsigned long long) __entry
->pright
)
556 TRACE_EVENT(ext4_allocate_blocks
,
557 TP_PROTO(struct ext4_allocation_request
*ar
, unsigned long long block
),
562 __field( dev_t
, dev
)
563 __field( ino_t
, ino
)
564 __field( __u64
, block
)
565 __field( unsigned int, flags
)
566 __field( unsigned int, len
)
567 __field( __u64
, logical
)
568 __field( __u64
, goal
)
569 __field( __u64
, lleft
)
570 __field( __u64
, lright
)
571 __field( __u64
, pleft
)
572 __field( __u64
, pright
)
576 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
577 __entry
->ino
= ar
->inode
->i_ino
;
578 __entry
->block
= block
;
579 __entry
->flags
= ar
->flags
;
580 __entry
->len
= ar
->len
;
581 __entry
->logical
= ar
->logical
;
582 __entry
->goal
= ar
->goal
;
583 __entry
->lleft
= ar
->lleft
;
584 __entry
->lright
= ar
->lright
;
585 __entry
->pleft
= ar
->pleft
;
586 __entry
->pright
= ar
->pright
;
589 TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
590 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->flags
,
591 __entry
->len
, __entry
->block
,
592 (unsigned long long) __entry
->logical
,
593 (unsigned long long) __entry
->goal
,
594 (unsigned long long) __entry
->lleft
,
595 (unsigned long long) __entry
->lright
,
596 (unsigned long long) __entry
->pleft
,
597 (unsigned long long) __entry
->pright
)
600 TRACE_EVENT(ext4_free_blocks
,
601 TP_PROTO(struct inode
*inode
, __u64 block
, unsigned long count
,
604 TP_ARGS(inode
, block
, count
, metadata
),
607 __field( dev_t
, dev
)
608 __field( ino_t
, ino
)
609 __field( __u64
, block
)
610 __field( unsigned long, count
)
611 __field( int, metadata
)
616 __entry
->dev
= inode
->i_sb
->s_dev
;
617 __entry
->ino
= inode
->i_ino
;
618 __entry
->block
= block
;
619 __entry
->count
= count
;
620 __entry
->metadata
= metadata
;
623 TP_printk("dev %s ino %lu block %llu count %lu metadata %d",
624 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->block
,
625 __entry
->count
, __entry
->metadata
)
628 TRACE_EVENT(ext4_sync_file
,
629 TP_PROTO(struct file
*file
, struct dentry
*dentry
, int datasync
),
631 TP_ARGS(file
, dentry
, datasync
),
634 __field( dev_t
, dev
)
635 __field( ino_t
, ino
)
636 __field( ino_t
, parent
)
637 __field( int, datasync
)
641 __entry
->dev
= dentry
->d_inode
->i_sb
->s_dev
;
642 __entry
->ino
= dentry
->d_inode
->i_ino
;
643 __entry
->datasync
= datasync
;
644 __entry
->parent
= dentry
->d_parent
->d_inode
->i_ino
;
647 TP_printk("dev %s ino %ld parent %ld datasync %d ",
648 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->parent
,
652 TRACE_EVENT(ext4_sync_fs
,
653 TP_PROTO(struct super_block
*sb
, int wait
),
658 __field( dev_t
, dev
)
664 __entry
->dev
= sb
->s_dev
;
665 __entry
->wait
= wait
;
668 TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry
->dev
),
672 #endif /* _TRACE_EXT4_H */
674 /* This part must be outside protection */
675 #include <trace/define_trace.h>