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, for_writepages
)
231 __field( char, range_cyclic
)
235 __entry
->dev
= inode
->i_sb
->s_dev
;
236 __entry
->ino
= inode
->i_ino
;
237 __entry
->nr_to_write
= wbc
->nr_to_write
;
238 __entry
->pages_skipped
= wbc
->pages_skipped
;
239 __entry
->range_start
= wbc
->range_start
;
240 __entry
->range_end
= wbc
->range_end
;
241 __entry
->nonblocking
= wbc
->nonblocking
;
242 __entry
->for_kupdate
= wbc
->for_kupdate
;
243 __entry
->for_reclaim
= wbc
->for_reclaim
;
244 __entry
->for_writepages
= wbc
->for_writepages
;
245 __entry
->range_cyclic
= wbc
->range_cyclic
;
248 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 for_writepages %d range_cyclic %d",
249 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->nr_to_write
,
250 __entry
->pages_skipped
, __entry
->range_start
,
251 __entry
->range_end
, __entry
->nonblocking
,
252 __entry
->for_kupdate
, __entry
->for_reclaim
,
253 __entry
->for_writepages
, __entry
->range_cyclic
)
256 TRACE_EVENT(ext4_da_writepages_result
,
257 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
,
258 int ret
, int pages_written
),
260 TP_ARGS(inode
, wbc
, ret
, pages_written
),
263 __field( dev_t
, dev
)
264 __field( ino_t
, ino
)
266 __field( int, pages_written
)
267 __field( long, pages_skipped
)
268 __field( char, encountered_congestion
)
269 __field( char, more_io
)
270 __field( char, no_nrwrite_index_update
)
274 __entry
->dev
= inode
->i_sb
->s_dev
;
275 __entry
->ino
= inode
->i_ino
;
277 __entry
->pages_written
= pages_written
;
278 __entry
->pages_skipped
= wbc
->pages_skipped
;
279 __entry
->encountered_congestion
= wbc
->encountered_congestion
;
280 __entry
->more_io
= wbc
->more_io
;
281 __entry
->no_nrwrite_index_update
= wbc
->no_nrwrite_index_update
;
284 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d",
285 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->ret
,
286 __entry
->pages_written
, __entry
->pages_skipped
,
287 __entry
->encountered_congestion
, __entry
->more_io
,
288 __entry
->no_nrwrite_index_update
)
291 TRACE_EVENT(ext4_da_write_begin
,
292 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
295 TP_ARGS(inode
, pos
, len
, flags
),
298 __field( dev_t
, dev
)
299 __field( ino_t
, ino
)
300 __field( loff_t
, pos
)
301 __field( unsigned int, len
)
302 __field( unsigned int, flags
)
306 __entry
->dev
= inode
->i_sb
->s_dev
;
307 __entry
->ino
= inode
->i_ino
;
310 __entry
->flags
= flags
;
313 TP_printk("dev %s ino %lu pos %llu len %u flags %u",
314 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pos
, __entry
->len
,
318 TRACE_EVENT(ext4_da_write_end
,
319 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
320 unsigned int copied
),
322 TP_ARGS(inode
, pos
, len
, copied
),
325 __field( dev_t
, dev
)
326 __field( ino_t
, ino
)
327 __field( loff_t
, pos
)
328 __field( unsigned int, len
)
329 __field( unsigned int, copied
)
333 __entry
->dev
= inode
->i_sb
->s_dev
;
334 __entry
->ino
= inode
->i_ino
;
337 __entry
->copied
= copied
;
340 TP_printk("dev %s ino %lu pos %llu len %u copied %u",
341 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pos
, __entry
->len
,
345 TRACE_EVENT(ext4_discard_blocks
,
346 TP_PROTO(struct super_block
*sb
, unsigned long long blk
,
347 unsigned long long count
),
349 TP_ARGS(sb
, blk
, count
),
352 __field( dev_t
, dev
)
353 __field( __u64
, blk
)
354 __field( __u64
, count
)
359 __entry
->dev
= sb
->s_dev
;
361 __entry
->count
= count
;
364 TP_printk("dev %s blk %llu count %llu",
365 jbd2_dev_to_name(__entry
->dev
), __entry
->blk
, __entry
->count
)
368 TRACE_EVENT(ext4_mb_new_inode_pa
,
369 TP_PROTO(struct ext4_allocation_context
*ac
,
370 struct ext4_prealloc_space
*pa
),
375 __field( dev_t
, dev
)
376 __field( ino_t
, ino
)
377 __field( __u64
, pa_pstart
)
378 __field( __u32
, pa_len
)
379 __field( __u64
, pa_lstart
)
384 __entry
->dev
= ac
->ac_sb
->s_dev
;
385 __entry
->ino
= ac
->ac_inode
->i_ino
;
386 __entry
->pa_pstart
= pa
->pa_pstart
;
387 __entry
->pa_len
= pa
->pa_len
;
388 __entry
->pa_lstart
= pa
->pa_lstart
;
391 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
392 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pa_pstart
,
393 __entry
->pa_len
, __entry
->pa_lstart
)
396 TRACE_EVENT(ext4_mb_new_group_pa
,
397 TP_PROTO(struct ext4_allocation_context
*ac
,
398 struct ext4_prealloc_space
*pa
),
403 __field( dev_t
, dev
)
404 __field( ino_t
, ino
)
405 __field( __u64
, pa_pstart
)
406 __field( __u32
, pa_len
)
407 __field( __u64
, pa_lstart
)
412 __entry
->dev
= ac
->ac_sb
->s_dev
;
413 __entry
->ino
= ac
->ac_inode
->i_ino
;
414 __entry
->pa_pstart
= pa
->pa_pstart
;
415 __entry
->pa_len
= pa
->pa_len
;
416 __entry
->pa_lstart
= pa
->pa_lstart
;
419 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
420 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->pa_pstart
,
421 __entry
->pa_len
, __entry
->pa_lstart
)
424 TRACE_EVENT(ext4_mb_release_inode_pa
,
425 TP_PROTO(struct ext4_allocation_context
*ac
,
426 struct ext4_prealloc_space
*pa
,
427 unsigned long long block
, unsigned int count
),
429 TP_ARGS(ac
, pa
, block
, count
),
432 __field( dev_t
, dev
)
433 __field( ino_t
, ino
)
434 __field( __u64
, block
)
435 __field( __u32
, count
)
440 __entry
->dev
= ac
->ac_sb
->s_dev
;
441 __entry
->ino
= ac
->ac_inode
->i_ino
;
442 __entry
->block
= block
;
443 __entry
->count
= count
;
446 TP_printk("dev %s ino %lu block %llu count %u",
447 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->block
,
451 TRACE_EVENT(ext4_mb_release_group_pa
,
452 TP_PROTO(struct ext4_allocation_context
*ac
,
453 struct ext4_prealloc_space
*pa
),
458 __field( dev_t
, dev
)
459 __field( ino_t
, ino
)
460 __field( __u64
, pa_pstart
)
461 __field( __u32
, pa_len
)
466 __entry
->dev
= ac
->ac_sb
->s_dev
;
467 __entry
->ino
= ac
->ac_inode
->i_ino
;
468 __entry
->pa_pstart
= pa
->pa_pstart
;
469 __entry
->pa_len
= pa
->pa_len
;
472 TP_printk("dev %s pstart %llu len %u",
473 jbd2_dev_to_name(__entry
->dev
), __entry
->pa_pstart
, __entry
->pa_len
)
476 TRACE_EVENT(ext4_discard_preallocations
,
477 TP_PROTO(struct inode
*inode
),
482 __field( dev_t
, dev
)
483 __field( ino_t
, ino
)
488 __entry
->dev
= inode
->i_sb
->s_dev
;
489 __entry
->ino
= inode
->i_ino
;
492 TP_printk("dev %s ino %lu",
493 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
)
496 TRACE_EVENT(ext4_mb_discard_preallocations
,
497 TP_PROTO(struct super_block
*sb
, int needed
),
502 __field( dev_t
, dev
)
503 __field( int, needed
)
508 __entry
->dev
= sb
->s_dev
;
509 __entry
->needed
= needed
;
512 TP_printk("dev %s needed %d",
513 jbd2_dev_to_name(__entry
->dev
), __entry
->needed
)
516 TRACE_EVENT(ext4_request_blocks
,
517 TP_PROTO(struct ext4_allocation_request
*ar
),
522 __field( dev_t
, dev
)
523 __field( ino_t
, ino
)
524 __field( unsigned int, flags
)
525 __field( unsigned int, len
)
526 __field( __u64
, logical
)
527 __field( __u64
, goal
)
528 __field( __u64
, lleft
)
529 __field( __u64
, lright
)
530 __field( __u64
, pleft
)
531 __field( __u64
, pright
)
535 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
536 __entry
->ino
= ar
->inode
->i_ino
;
537 __entry
->flags
= ar
->flags
;
538 __entry
->len
= ar
->len
;
539 __entry
->logical
= ar
->logical
;
540 __entry
->goal
= ar
->goal
;
541 __entry
->lleft
= ar
->lleft
;
542 __entry
->lright
= ar
->lright
;
543 __entry
->pleft
= ar
->pleft
;
544 __entry
->pright
= ar
->pright
;
547 TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
548 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->flags
,
550 (unsigned long long) __entry
->logical
,
551 (unsigned long long) __entry
->goal
,
552 (unsigned long long) __entry
->lleft
,
553 (unsigned long long) __entry
->lright
,
554 (unsigned long long) __entry
->pleft
,
555 (unsigned long long) __entry
->pright
)
558 TRACE_EVENT(ext4_allocate_blocks
,
559 TP_PROTO(struct ext4_allocation_request
*ar
, unsigned long long block
),
564 __field( dev_t
, dev
)
565 __field( ino_t
, ino
)
566 __field( __u64
, block
)
567 __field( unsigned int, flags
)
568 __field( unsigned int, len
)
569 __field( __u64
, logical
)
570 __field( __u64
, goal
)
571 __field( __u64
, lleft
)
572 __field( __u64
, lright
)
573 __field( __u64
, pleft
)
574 __field( __u64
, pright
)
578 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
579 __entry
->ino
= ar
->inode
->i_ino
;
580 __entry
->block
= block
;
581 __entry
->flags
= ar
->flags
;
582 __entry
->len
= ar
->len
;
583 __entry
->logical
= ar
->logical
;
584 __entry
->goal
= ar
->goal
;
585 __entry
->lleft
= ar
->lleft
;
586 __entry
->lright
= ar
->lright
;
587 __entry
->pleft
= ar
->pleft
;
588 __entry
->pright
= ar
->pright
;
591 TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
592 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->flags
,
593 __entry
->len
, __entry
->block
,
594 (unsigned long long) __entry
->logical
,
595 (unsigned long long) __entry
->goal
,
596 (unsigned long long) __entry
->lleft
,
597 (unsigned long long) __entry
->lright
,
598 (unsigned long long) __entry
->pleft
,
599 (unsigned long long) __entry
->pright
)
602 TRACE_EVENT(ext4_free_blocks
,
603 TP_PROTO(struct inode
*inode
, __u64 block
, unsigned long count
,
606 TP_ARGS(inode
, block
, count
, metadata
),
609 __field( dev_t
, dev
)
610 __field( ino_t
, ino
)
611 __field( __u64
, block
)
612 __field( unsigned long, count
)
613 __field( int, metadata
)
618 __entry
->dev
= inode
->i_sb
->s_dev
;
619 __entry
->ino
= inode
->i_ino
;
620 __entry
->block
= block
;
621 __entry
->count
= count
;
622 __entry
->metadata
= metadata
;
625 TP_printk("dev %s ino %lu block %llu count %lu metadata %d",
626 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->block
,
627 __entry
->count
, __entry
->metadata
)
630 TRACE_EVENT(ext4_sync_file
,
631 TP_PROTO(struct file
*file
, struct dentry
*dentry
, int datasync
),
633 TP_ARGS(file
, dentry
, datasync
),
636 __field( dev_t
, dev
)
637 __field( ino_t
, ino
)
638 __field( ino_t
, parent
)
639 __field( int, datasync
)
643 __entry
->dev
= dentry
->d_inode
->i_sb
->s_dev
;
644 __entry
->ino
= dentry
->d_inode
->i_ino
;
645 __entry
->datasync
= datasync
;
646 __entry
->parent
= dentry
->d_parent
->d_inode
->i_ino
;
649 TP_printk("dev %s ino %ld parent %ld datasync %d ",
650 jbd2_dev_to_name(__entry
->dev
), __entry
->ino
, __entry
->parent
,
654 TRACE_EVENT(ext4_sync_fs
,
655 TP_PROTO(struct super_block
*sb
, int wait
),
660 __field( dev_t
, dev
)
666 __entry
->dev
= sb
->s_dev
;
667 __entry
->wait
= wait
;
670 TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry
->dev
),
674 #endif /* _TRACE_EXT4_H */
676 /* This part must be outside protection */
677 #include <trace/define_trace.h>