diff options
author | Chao Yu <chao2.yu@samsung.com> | 2014-12-23 03:35:21 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-01-09 20:02:25 -0500 |
commit | 3e1c8f125eeea0f8111e2b9131162bfba32c6381 (patch) | |
tree | 07d2fd5840e028e9baece4b8bc552198734eee88 | |
parent | 09eb483e895f36fd002e88c878e9578c359aa468 (diff) |
f2fs: cleanup trace event of f2fs_submit_page_{m,}bio with DECLARE_EVENT_CLASS
This patch adds missing parameter _type_ for trace_f2fs_submit_page_bio, then
use DECLARE_EVENT_CLASS/DEFINE_EVENT_CONDITION pair to cleanup some trace event
code related to f2fs_submit_page_{m,}bio.
Additionally, after we remove redundant code, size of code can be reduced:
text data bss dec hex filename
176787 8712 56 185555 2d4d3 f2fs.ko.org
174408 8648 56 183112 2cb48 f2fs.ko
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fs/f2fs/data.c | 4 | ||||
-rw-r--r-- | include/trace/events/f2fs.h | 115 |
2 files changed, 53 insertions, 66 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 20aa3c355a0e..7953bc279205 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -137,7 +137,7 @@ int f2fs_submit_page_bio(struct f2fs_sb_info *sbi, struct page *page, | |||
137 | { | 137 | { |
138 | struct bio *bio; | 138 | struct bio *bio; |
139 | 139 | ||
140 | trace_f2fs_submit_page_bio(page, fio->blk_addr, fio->rw); | 140 | trace_f2fs_submit_page_bio(page, fio->blk_addr, fio->rw, fio->type); |
141 | f2fs_trace_ios(page, fio, 0); | 141 | f2fs_trace_ios(page, fio, 0); |
142 | 142 | ||
143 | /* Allocate a new bio */ | 143 | /* Allocate a new bio */ |
@@ -190,7 +190,7 @@ alloc_new: | |||
190 | f2fs_trace_ios(page, fio, 0); | 190 | f2fs_trace_ios(page, fio, 0); |
191 | 191 | ||
192 | up_write(&io->io_rwsem); | 192 | up_write(&io->io_rwsem); |
193 | trace_f2fs_submit_page_mbio(page, fio->rw, fio->type, fio->blk_addr); | 193 | trace_f2fs_submit_page_mbio(page, fio->blk_addr, fio->rw, fio->type); |
194 | } | 194 | } |
195 | 195 | ||
196 | /* | 196 | /* |
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index bbc4de9baef7..553311f14f6c 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h | |||
@@ -440,38 +440,6 @@ TRACE_EVENT(f2fs_truncate_partial_nodes, | |||
440 | __entry->err) | 440 | __entry->err) |
441 | ); | 441 | ); |
442 | 442 | ||
443 | TRACE_EVENT_CONDITION(f2fs_submit_page_bio, | ||
444 | |||
445 | TP_PROTO(struct page *page, sector_t blkaddr, int type), | ||
446 | |||
447 | TP_ARGS(page, blkaddr, type), | ||
448 | |||
449 | TP_CONDITION(page->mapping), | ||
450 | |||
451 | TP_STRUCT__entry( | ||
452 | __field(dev_t, dev) | ||
453 | __field(ino_t, ino) | ||
454 | __field(pgoff_t, index) | ||
455 | __field(sector_t, blkaddr) | ||
456 | __field(int, type) | ||
457 | ), | ||
458 | |||
459 | TP_fast_assign( | ||
460 | __entry->dev = page->mapping->host->i_sb->s_dev; | ||
461 | __entry->ino = page->mapping->host->i_ino; | ||
462 | __entry->index = page->index; | ||
463 | __entry->blkaddr = blkaddr; | ||
464 | __entry->type = type; | ||
465 | ), | ||
466 | |||
467 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " | ||
468 | "blkaddr = 0x%llx, bio_type = %s%s", | ||
469 | show_dev_ino(__entry), | ||
470 | (unsigned long)__entry->index, | ||
471 | (unsigned long long)__entry->blkaddr, | ||
472 | show_bio_type(__entry->type)) | ||
473 | ); | ||
474 | |||
475 | TRACE_EVENT(f2fs_get_data_block, | 443 | TRACE_EVENT(f2fs_get_data_block, |
476 | TP_PROTO(struct inode *inode, sector_t iblock, | 444 | TP_PROTO(struct inode *inode, sector_t iblock, |
477 | struct buffer_head *bh, int ret), | 445 | struct buffer_head *bh, int ret), |
@@ -680,6 +648,57 @@ TRACE_EVENT(f2fs_reserve_new_block, | |||
680 | __entry->ofs_in_node) | 648 | __entry->ofs_in_node) |
681 | ); | 649 | ); |
682 | 650 | ||
651 | DECLARE_EVENT_CLASS(f2fs__submit_page_bio, | ||
652 | |||
653 | TP_PROTO(struct page *page, block_t blkaddr, int rw, int type), | ||
654 | |||
655 | TP_ARGS(page, blkaddr, rw, type), | ||
656 | |||
657 | TP_STRUCT__entry( | ||
658 | __field(dev_t, dev) | ||
659 | __field(ino_t, ino) | ||
660 | __field(pgoff_t, index) | ||
661 | __field(block_t, blkaddr) | ||
662 | __field(int, rw) | ||
663 | __field(int, type) | ||
664 | ), | ||
665 | |||
666 | TP_fast_assign( | ||
667 | __entry->dev = page->mapping->host->i_sb->s_dev; | ||
668 | __entry->ino = page->mapping->host->i_ino; | ||
669 | __entry->index = page->index; | ||
670 | __entry->blkaddr = blkaddr; | ||
671 | __entry->rw = rw; | ||
672 | __entry->type = type; | ||
673 | ), | ||
674 | |||
675 | TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " | ||
676 | "blkaddr = 0x%llx, rw = %s%s, type = %s", | ||
677 | show_dev_ino(__entry), | ||
678 | (unsigned long)__entry->index, | ||
679 | (unsigned long long)__entry->blkaddr, | ||
680 | show_bio_type(__entry->rw), | ||
681 | show_block_type(__entry->type)) | ||
682 | ); | ||
683 | |||
684 | DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio, | ||
685 | |||
686 | TP_PROTO(struct page *page, block_t blkaddr, int rw, int type), | ||
687 | |||
688 | TP_ARGS(page, blkaddr, rw, type), | ||
689 | |||
690 | TP_CONDITION(page->mapping) | ||
691 | ); | ||
692 | |||
693 | DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_mbio, | ||
694 | |||
695 | TP_PROTO(struct page *page, block_t blkaddr, int rw, int type), | ||
696 | |||
697 | TP_ARGS(page, blkaddr, rw, type), | ||
698 | |||
699 | TP_CONDITION(page->mapping) | ||
700 | ); | ||
701 | |||
683 | DECLARE_EVENT_CLASS(f2fs__submit_bio, | 702 | DECLARE_EVENT_CLASS(f2fs__submit_bio, |
684 | 703 | ||
685 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), | 704 | TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio), |
@@ -916,38 +935,6 @@ TRACE_EVENT(f2fs_writepages, | |||
916 | __entry->for_sync) | 935 | __entry->for_sync) |
917 | ); | 936 | ); |
918 | 937 | ||
919 | TRACE_EVENT(f2fs_submit_page_mbio, | ||
920 | |||
921 | TP_PROTO(struct page *page, int rw, int type, block_t blk_addr), | ||
922 | |||
923 | TP_ARGS(page, rw, type, blk_addr), | ||
924 | |||
925 | TP_STRUCT__entry( | ||
926 | __field(dev_t, dev) | ||
927 | __field(ino_t, ino) | ||
928 | __field(int, rw) | ||
929 | __field(int, type) | ||
930 | __field(pgoff_t, index) | ||
931 | __field(block_t, block) | ||
932 | ), | ||
933 | |||
934 | TP_fast_assign( | ||
935 | __entry->dev = page->mapping->host->i_sb->s_dev; | ||
936 | __entry->ino = page->mapping->host->i_ino; | ||
937 | __entry->rw = rw; | ||
938 | __entry->type = type; | ||
939 | __entry->index = page->index; | ||
940 | __entry->block = blk_addr; | ||
941 | ), | ||
942 | |||
943 | TP_printk("dev = (%d,%d), ino = %lu, %s%s, %s, index = %lu, blkaddr = 0x%llx", | ||
944 | show_dev_ino(__entry), | ||
945 | show_bio_type(__entry->rw), | ||
946 | show_block_type(__entry->type), | ||
947 | (unsigned long)__entry->index, | ||
948 | (unsigned long long)__entry->block) | ||
949 | ); | ||
950 | |||
951 | TRACE_EVENT(f2fs_write_checkpoint, | 938 | TRACE_EVENT(f2fs_write_checkpoint, |
952 | 939 | ||
953 | TP_PROTO(struct super_block *sb, int reason, char *msg), | 940 | TP_PROTO(struct super_block *sb, int reason, char *msg), |