diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-06-17 11:48:11 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-06-17 11:48:11 -0400 |
commit | 9bffad1ed2a003a355ed1b42424a0ae3575275ed (patch) | |
tree | 9016e7b0e04a0e5319680f9e1f89fc1abb13c765 | |
parent | 879c5e6b7cb4c689d08ca9b2e353d8ab3dc425d5 (diff) |
ext4: convert instrumentation from markers to tracepoints
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | fs/ext4/fsync.c | 8 | ||||
-rw-r--r-- | fs/ext4/ialloc.c | 15 | ||||
-rw-r--r-- | fs/ext4/inode.c | 69 | ||||
-rw-r--r-- | fs/ext4/mballoc.c | 77 | ||||
-rw-r--r-- | fs/ext4/mballoc.h | 1 | ||||
-rw-r--r-- | fs/ext4/super.c | 6 | ||||
-rw-r--r-- | include/trace/events/ext4.h | 719 |
7 files changed, 774 insertions, 121 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index 5afe4370840..83cf6415f59 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c | |||
@@ -28,10 +28,12 @@ | |||
28 | #include <linux/writeback.h> | 28 | #include <linux/writeback.h> |
29 | #include <linux/jbd2.h> | 29 | #include <linux/jbd2.h> |
30 | #include <linux/blkdev.h> | 30 | #include <linux/blkdev.h> |
31 | #include <linux/marker.h> | 31 | |
32 | #include "ext4.h" | 32 | #include "ext4.h" |
33 | #include "ext4_jbd2.h" | 33 | #include "ext4_jbd2.h" |
34 | 34 | ||
35 | #include <trace/events/ext4.h> | ||
36 | |||
35 | /* | 37 | /* |
36 | * akpm: A new design for ext4_sync_file(). | 38 | * akpm: A new design for ext4_sync_file(). |
37 | * | 39 | * |
@@ -52,9 +54,7 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync) | |||
52 | 54 | ||
53 | J_ASSERT(ext4_journal_current_handle() == NULL); | 55 | J_ASSERT(ext4_journal_current_handle() == NULL); |
54 | 56 | ||
55 | trace_mark(ext4_sync_file, "dev %s datasync %d ino %ld parent %ld", | 57 | trace_ext4_sync_file(file, dentry, datasync); |
56 | inode->i_sb->s_id, datasync, inode->i_ino, | ||
57 | dentry->d_parent->d_inode->i_ino); | ||
58 | 58 | ||
59 | /* | 59 | /* |
60 | * data=writeback: | 60 | * data=writeback: |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 3743bd849bc..7d502f3be91 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -23,11 +23,14 @@ | |||
23 | #include <linux/bitops.h> | 23 | #include <linux/bitops.h> |
24 | #include <linux/blkdev.h> | 24 | #include <linux/blkdev.h> |
25 | #include <asm/byteorder.h> | 25 | #include <asm/byteorder.h> |
26 | |||
26 | #include "ext4.h" | 27 | #include "ext4.h" |
27 | #include "ext4_jbd2.h" | 28 | #include "ext4_jbd2.h" |
28 | #include "xattr.h" | 29 | #include "xattr.h" |
29 | #include "acl.h" | 30 | #include "acl.h" |
30 | 31 | ||
32 | #include <trace/events/ext4.h> | ||
33 | |||
31 | /* | 34 | /* |
32 | * ialloc.c contains the inodes allocation and deallocation routines | 35 | * ialloc.c contains the inodes allocation and deallocation routines |
33 | */ | 36 | */ |
@@ -208,11 +211,7 @@ void ext4_free_inode(handle_t *handle, struct inode *inode) | |||
208 | 211 | ||
209 | ino = inode->i_ino; | 212 | ino = inode->i_ino; |
210 | ext4_debug("freeing inode %lu\n", ino); | 213 | ext4_debug("freeing inode %lu\n", ino); |
211 | trace_mark(ext4_free_inode, | 214 | trace_ext4_free_inode(inode); |
212 | "dev %s ino %lu mode %d uid %lu gid %lu bocks %llu", | ||
213 | sb->s_id, inode->i_ino, inode->i_mode, | ||
214 | (unsigned long) inode->i_uid, (unsigned long) inode->i_gid, | ||
215 | (unsigned long long) inode->i_blocks); | ||
216 | 215 | ||
217 | /* | 216 | /* |
218 | * Note: we must free any quota before locking the superblock, | 217 | * Note: we must free any quota before locking the superblock, |
@@ -815,8 +814,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode) | |||
815 | 814 | ||
816 | sb = dir->i_sb; | 815 | sb = dir->i_sb; |
817 | ngroups = ext4_get_groups_count(sb); | 816 | ngroups = ext4_get_groups_count(sb); |
818 | trace_mark(ext4_request_inode, "dev %s dir %lu mode %d", sb->s_id, | 817 | trace_ext4_request_inode(dir, mode); |
819 | dir->i_ino, mode); | ||
820 | inode = new_inode(sb); | 818 | inode = new_inode(sb); |
821 | if (!inode) | 819 | if (!inode) |
822 | return ERR_PTR(-ENOMEM); | 820 | return ERR_PTR(-ENOMEM); |
@@ -1047,8 +1045,7 @@ got: | |||
1047 | } | 1045 | } |
1048 | 1046 | ||
1049 | ext4_debug("allocating inode %lu\n", inode->i_ino); | 1047 | ext4_debug("allocating inode %lu\n", inode->i_ino); |
1050 | trace_mark(ext4_allocate_inode, "dev %s ino %lu dir %lu mode %d", | 1048 | trace_ext4_allocate_inode(inode, dir, mode); |
1051 | sb->s_id, inode->i_ino, dir->i_ino, mode); | ||
1052 | goto really_out; | 1049 | goto really_out; |
1053 | fail: | 1050 | fail: |
1054 | ext4_std_error(sb, err); | 1051 | ext4_std_error(sb, err); |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 875db944b22..2418ad36eab 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -37,11 +37,14 @@ | |||
37 | #include <linux/namei.h> | 37 | #include <linux/namei.h> |
38 | #include <linux/uio.h> | 38 | #include <linux/uio.h> |
39 | #include <linux/bio.h> | 39 | #include <linux/bio.h> |
40 | |||
40 | #include "ext4_jbd2.h" | 41 | #include "ext4_jbd2.h" |
41 | #include "xattr.h" | 42 | #include "xattr.h" |
42 | #include "acl.h" | 43 | #include "acl.h" |
43 | #include "ext4_extents.h" | 44 | #include "ext4_extents.h" |
44 | 45 | ||
46 | #include <trace/events/ext4.h> | ||
47 | |||
45 | #define MPAGE_DA_EXTENT_TAIL 0x01 | 48 | #define MPAGE_DA_EXTENT_TAIL 0x01 |
46 | 49 | ||
47 | static inline int ext4_begin_ordered_truncate(struct inode *inode, | 50 | static inline int ext4_begin_ordered_truncate(struct inode *inode, |
@@ -1466,10 +1469,7 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping, | |||
1466 | pgoff_t index; | 1469 | pgoff_t index; |
1467 | unsigned from, to; | 1470 | unsigned from, to; |
1468 | 1471 | ||
1469 | trace_mark(ext4_write_begin, | 1472 | trace_ext4_write_begin(inode, pos, len, flags); |
1470 | "dev %s ino %lu pos %llu len %u flags %u", | ||
1471 | inode->i_sb->s_id, inode->i_ino, | ||
1472 | (unsigned long long) pos, len, flags); | ||
1473 | /* | 1473 | /* |
1474 | * Reserve one block more for addition to orphan list in case | 1474 | * Reserve one block more for addition to orphan list in case |
1475 | * we allocate blocks but write fails for some reason | 1475 | * we allocate blocks but write fails for some reason |
@@ -1611,10 +1611,7 @@ static int ext4_ordered_write_end(struct file *file, | |||
1611 | struct inode *inode = mapping->host; | 1611 | struct inode *inode = mapping->host; |
1612 | int ret = 0, ret2; | 1612 | int ret = 0, ret2; |
1613 | 1613 | ||
1614 | trace_mark(ext4_ordered_write_end, | 1614 | trace_ext4_ordered_write_end(inode, pos, len, copied); |
1615 | "dev %s ino %lu pos %llu len %u copied %u", | ||
1616 | inode->i_sb->s_id, inode->i_ino, | ||
1617 | (unsigned long long) pos, len, copied); | ||
1618 | ret = ext4_jbd2_file_inode(handle, inode); | 1615 | ret = ext4_jbd2_file_inode(handle, inode); |
1619 | 1616 | ||
1620 | if (ret == 0) { | 1617 | if (ret == 0) { |
@@ -1658,10 +1655,7 @@ static int ext4_writeback_write_end(struct file *file, | |||
1658 | struct inode *inode = mapping->host; | 1655 | struct inode *inode = mapping->host; |
1659 | int ret = 0, ret2; | 1656 | int ret = 0, ret2; |
1660 | 1657 | ||
1661 | trace_mark(ext4_writeback_write_end, | 1658 | trace_ext4_writeback_write_end(inode, pos, len, copied); |
1662 | "dev %s ino %lu pos %llu len %u copied %u", | ||
1663 | inode->i_sb->s_id, inode->i_ino, | ||
1664 | (unsigned long long) pos, len, copied); | ||
1665 | ret2 = ext4_generic_write_end(file, mapping, pos, len, copied, | 1659 | ret2 = ext4_generic_write_end(file, mapping, pos, len, copied, |
1666 | page, fsdata); | 1660 | page, fsdata); |
1667 | copied = ret2; | 1661 | copied = ret2; |
@@ -1705,10 +1699,7 @@ static int ext4_journalled_write_end(struct file *file, | |||
1705 | unsigned from, to; | 1699 | unsigned from, to; |
1706 | loff_t new_i_size; | 1700 | loff_t new_i_size; |
1707 | 1701 | ||
1708 | trace_mark(ext4_journalled_write_end, | 1702 | trace_ext4_journalled_write_end(inode, pos, len, copied); |
1709 | "dev %s ino %lu pos %llu len %u copied %u", | ||
1710 | inode->i_sb->s_id, inode->i_ino, | ||
1711 | (unsigned long long) pos, len, copied); | ||
1712 | from = pos & (PAGE_CACHE_SIZE - 1); | 1703 | from = pos & (PAGE_CACHE_SIZE - 1); |
1713 | to = from + len; | 1704 | to = from + len; |
1714 | 1705 | ||
@@ -2554,9 +2545,7 @@ static int ext4_da_writepage(struct page *page, | |||
2554 | struct buffer_head *page_bufs; | 2545 | struct buffer_head *page_bufs; |
2555 | struct inode *inode = page->mapping->host; | 2546 | struct inode *inode = page->mapping->host; |
2556 | 2547 | ||
2557 | trace_mark(ext4_da_writepage, | 2548 | trace_ext4_da_writepage(inode, page); |
2558 | "dev %s ino %lu page_index %lu", | ||
2559 | inode->i_sb->s_id, inode->i_ino, page->index); | ||
2560 | size = i_size_read(inode); | 2549 | size = i_size_read(inode); |
2561 | if (page->index == size >> PAGE_CACHE_SHIFT) | 2550 | if (page->index == size >> PAGE_CACHE_SHIFT) |
2562 | len = size & ~PAGE_CACHE_MASK; | 2551 | len = size & ~PAGE_CACHE_MASK; |
@@ -2667,19 +2656,7 @@ static int ext4_da_writepages(struct address_space *mapping, | |||
2667 | int needed_blocks, ret = 0, nr_to_writebump = 0; | 2656 | int needed_blocks, ret = 0, nr_to_writebump = 0; |
2668 | struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb); | 2657 | struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb); |
2669 | 2658 | ||
2670 | trace_mark(ext4_da_writepages, | 2659 | trace_ext4_da_writepages(inode, wbc); |
2671 | "dev %s ino %lu nr_t_write %ld " | ||
2672 | "pages_skipped %ld range_start %llu " | ||
2673 | "range_end %llu nonblocking %d " | ||
2674 | "for_kupdate %d for_reclaim %d " | ||
2675 | "for_writepages %d range_cyclic %d", | ||
2676 | inode->i_sb->s_id, inode->i_ino, | ||
2677 | wbc->nr_to_write, wbc->pages_skipped, | ||
2678 | (unsigned long long) wbc->range_start, | ||
2679 | (unsigned long long) wbc->range_end, | ||
2680 | wbc->nonblocking, wbc->for_kupdate, | ||
2681 | wbc->for_reclaim, wbc->for_writepages, | ||
2682 | wbc->range_cyclic); | ||
2683 | 2660 | ||
2684 | /* | 2661 | /* |
2685 | * No pages to write? This is mainly a kludge to avoid starting | 2662 | * No pages to write? This is mainly a kludge to avoid starting |
@@ -2845,14 +2822,7 @@ out_writepages: | |||
2845 | if (!no_nrwrite_index_update) | 2822 | if (!no_nrwrite_index_update) |
2846 | wbc->no_nrwrite_index_update = 0; | 2823 | wbc->no_nrwrite_index_update = 0; |
2847 | wbc->nr_to_write -= nr_to_writebump; | 2824 | wbc->nr_to_write -= nr_to_writebump; |
2848 | trace_mark(ext4_da_writepage_result, | 2825 | trace_ext4_da_writepages_result(inode, wbc, ret, pages_written); |
2849 | "dev %s ino %lu ret %d pages_written %d " | ||
2850 | "pages_skipped %ld congestion %d " | ||
2851 | "more_io %d no_nrwrite_index_update %d", | ||
2852 | inode->i_sb->s_id, inode->i_ino, ret, | ||
2853 | pages_written, wbc->pages_skipped, | ||
2854 | wbc->encountered_congestion, wbc->more_io, | ||
2855 | wbc->no_nrwrite_index_update); | ||
2856 | return ret; | 2826 | return ret; |
2857 | } | 2827 | } |
2858 | 2828 | ||
@@ -2904,11 +2874,7 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping, | |||
2904 | len, flags, pagep, fsdata); | 2874 | len, flags, pagep, fsdata); |
2905 | } | 2875 | } |
2906 | *fsdata = (void *)0; | 2876 | *fsdata = (void *)0; |
2907 | 2877 | trace_ext4_da_write_begin(inode, pos, len, flags); | |
2908 | trace_mark(ext4_da_write_begin, | ||
2909 | "dev %s ino %lu pos %llu len %u flags %u", | ||
2910 | inode->i_sb->s_id, inode->i_ino, | ||
2911 | (unsigned long long) pos, len, flags); | ||
2912 | retry: | 2878 | retry: |
2913 | /* | 2879 | /* |
2914 | * With delayed allocation, we don't log the i_disksize update | 2880 | * With delayed allocation, we don't log the i_disksize update |
@@ -3001,10 +2967,7 @@ static int ext4_da_write_end(struct file *file, | |||
3001 | } | 2967 | } |
3002 | } | 2968 | } |
3003 | 2969 | ||
3004 | trace_mark(ext4_da_write_end, | 2970 | trace_ext4_da_write_end(inode, pos, len, copied); |
3005 | "dev %s ino %lu pos %llu len %u copied %u", | ||
3006 | inode->i_sb->s_id, inode->i_ino, | ||
3007 | (unsigned long long) pos, len, copied); | ||
3008 | start = pos & (PAGE_CACHE_SIZE - 1); | 2971 | start = pos & (PAGE_CACHE_SIZE - 1); |
3009 | end = start + copied - 1; | 2972 | end = start + copied - 1; |
3010 | 2973 | ||
@@ -3255,9 +3218,7 @@ static int ext4_normal_writepage(struct page *page, | |||
3255 | loff_t size = i_size_read(inode); | 3218 | loff_t size = i_size_read(inode); |
3256 | loff_t len; | 3219 | loff_t len; |
3257 | 3220 | ||
3258 | trace_mark(ext4_normal_writepage, | 3221 | trace_ext4_normal_writepage(inode, page); |
3259 | "dev %s ino %lu page_index %lu", | ||
3260 | inode->i_sb->s_id, inode->i_ino, page->index); | ||
3261 | J_ASSERT(PageLocked(page)); | 3222 | J_ASSERT(PageLocked(page)); |
3262 | if (page->index == size >> PAGE_CACHE_SHIFT) | 3223 | if (page->index == size >> PAGE_CACHE_SHIFT) |
3263 | len = size & ~PAGE_CACHE_MASK; | 3224 | len = size & ~PAGE_CACHE_MASK; |
@@ -3343,9 +3304,7 @@ static int ext4_journalled_writepage(struct page *page, | |||
3343 | loff_t size = i_size_read(inode); | 3304 | loff_t size = i_size_read(inode); |
3344 | loff_t len; | 3305 | loff_t len; |
3345 | 3306 | ||
3346 | trace_mark(ext4_journalled_writepage, | 3307 | trace_ext4_journalled_writepage(inode, page); |
3347 | "dev %s ino %lu page_index %lu", | ||
3348 | inode->i_sb->s_id, inode->i_ino, page->index); | ||
3349 | J_ASSERT(PageLocked(page)); | 3308 | J_ASSERT(PageLocked(page)); |
3350 | if (page->index == size >> PAGE_CACHE_SHIFT) | 3309 | if (page->index == size >> PAGE_CACHE_SHIFT) |
3351 | len = size & ~PAGE_CACHE_MASK; | 3310 | len = size & ~PAGE_CACHE_MASK; |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index ed8482e22c0..8d98070b48f 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -22,6 +22,8 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include "mballoc.h" | 24 | #include "mballoc.h" |
25 | #include <trace/events/ext4.h> | ||
26 | |||
25 | /* | 27 | /* |
26 | * MUSTDO: | 28 | * MUSTDO: |
27 | * - test ext4_ext_search_left() and ext4_ext_search_right() | 29 | * - test ext4_ext_search_left() and ext4_ext_search_right() |
@@ -340,8 +342,6 @@ static void ext4_mb_generate_from_freelist(struct super_block *sb, void *bitmap, | |||
340 | ext4_group_t group); | 342 | ext4_group_t group); |
341 | static void release_blocks_on_commit(journal_t *journal, transaction_t *txn); | 343 | static void release_blocks_on_commit(journal_t *journal, transaction_t *txn); |
342 | 344 | ||
343 | |||
344 | |||
345 | static inline void *mb_correct_addr_and_bit(int *bit, void *addr) | 345 | static inline void *mb_correct_addr_and_bit(int *bit, void *addr) |
346 | { | 346 | { |
347 | #if BITS_PER_LONG == 64 | 347 | #if BITS_PER_LONG == 64 |
@@ -2859,9 +2859,8 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn) | |||
2859 | discard_block = (ext4_fsblk_t) entry->group * EXT4_BLOCKS_PER_GROUP(sb) | 2859 | discard_block = (ext4_fsblk_t) entry->group * EXT4_BLOCKS_PER_GROUP(sb) |
2860 | + entry->start_blk | 2860 | + entry->start_blk |
2861 | + le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block); | 2861 | + le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block); |
2862 | trace_mark(ext4_discard_blocks, "dev %s blk %llu count %u", | 2862 | trace_ext4_discard_blocks(sb, (unsigned long long)discard_block, |
2863 | sb->s_id, (unsigned long long) discard_block, | 2863 | entry->count); |
2864 | entry->count); | ||
2865 | sb_issue_discard(sb, discard_block, entry->count); | 2864 | sb_issue_discard(sb, discard_block, entry->count); |
2866 | 2865 | ||
2867 | kmem_cache_free(ext4_free_ext_cachep, entry); | 2866 | kmem_cache_free(ext4_free_ext_cachep, entry); |
@@ -3629,10 +3628,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac) | |||
3629 | 3628 | ||
3630 | mb_debug("new inode pa %p: %llu/%u for %u\n", pa, | 3629 | mb_debug("new inode pa %p: %llu/%u for %u\n", pa, |
3631 | pa->pa_pstart, pa->pa_len, pa->pa_lstart); | 3630 | pa->pa_pstart, pa->pa_len, pa->pa_lstart); |
3632 | trace_mark(ext4_mb_new_inode_pa, | 3631 | trace_ext4_mb_new_inode_pa(ac, pa); |
3633 | "dev %s ino %lu pstart %llu len %u lstart %u", | ||
3634 | sb->s_id, ac->ac_inode->i_ino, | ||
3635 | pa->pa_pstart, pa->pa_len, pa->pa_lstart); | ||
3636 | 3632 | ||
3637 | ext4_mb_use_inode_pa(ac, pa); | 3633 | ext4_mb_use_inode_pa(ac, pa); |
3638 | atomic_add(pa->pa_free, &EXT4_SB(sb)->s_mb_preallocated); | 3634 | atomic_add(pa->pa_free, &EXT4_SB(sb)->s_mb_preallocated); |
@@ -3691,9 +3687,8 @@ ext4_mb_new_group_pa(struct ext4_allocation_context *ac) | |||
3691 | pa->pa_type = MB_GROUP_PA; | 3687 | pa->pa_type = MB_GROUP_PA; |
3692 | 3688 | ||
3693 | mb_debug("new group pa %p: %llu/%u for %u\n", pa, | 3689 | mb_debug("new group pa %p: %llu/%u for %u\n", pa, |
3694 | pa->pa_pstart, pa->pa_len, pa->pa_lstart); | 3690 | pa->pa_pstart, pa->pa_len, pa->pa_lstart); |
3695 | trace_mark(ext4_mb_new_group_pa, "dev %s pstart %llu len %u lstart %u", | 3691 | trace_ext4_mb_new_group_pa(ac, pa); |
3696 | sb->s_id, pa->pa_pstart, pa->pa_len, pa->pa_lstart); | ||
3697 | 3692 | ||
3698 | ext4_mb_use_group_pa(ac, pa); | 3693 | ext4_mb_use_group_pa(ac, pa); |
3699 | atomic_add(pa->pa_free, &EXT4_SB(sb)->s_mb_preallocated); | 3694 | atomic_add(pa->pa_free, &EXT4_SB(sb)->s_mb_preallocated); |
@@ -3783,10 +3778,8 @@ ext4_mb_release_inode_pa(struct ext4_buddy *e4b, struct buffer_head *bitmap_bh, | |||
3783 | ext4_mb_store_history(ac); | 3778 | ext4_mb_store_history(ac); |
3784 | } | 3779 | } |
3785 | 3780 | ||
3786 | trace_mark(ext4_mb_release_inode_pa, | 3781 | trace_ext4_mb_release_inode_pa(ac, pa, grp_blk_start + bit, |
3787 | "dev %s ino %lu block %llu count %u", | 3782 | next - bit); |
3788 | sb->s_id, pa->pa_inode->i_ino, grp_blk_start + bit, | ||
3789 | next - bit); | ||
3790 | mb_free_blocks(pa->pa_inode, e4b, bit, next - bit); | 3783 | mb_free_blocks(pa->pa_inode, e4b, bit, next - bit); |
3791 | bit = next + 1; | 3784 | bit = next + 1; |
3792 | } | 3785 | } |
@@ -3820,8 +3813,7 @@ ext4_mb_release_group_pa(struct ext4_buddy *e4b, | |||
3820 | if (ac) | 3813 | if (ac) |
3821 | ac->ac_op = EXT4_MB_HISTORY_DISCARD; | 3814 | ac->ac_op = EXT4_MB_HISTORY_DISCARD; |
3822 | 3815 | ||
3823 | trace_mark(ext4_mb_release_group_pa, "dev %s pstart %llu len %d", | 3816 | trace_ext4_mb_release_group_pa(ac, pa); |
3824 | sb->s_id, pa->pa_pstart, pa->pa_len); | ||
3825 | BUG_ON(pa->pa_deleted == 0); | 3817 | BUG_ON(pa->pa_deleted == 0); |
3826 | ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, &bit); | 3818 | ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, &bit); |
3827 | BUG_ON(group != e4b->bd_group && pa->pa_len != 0); | 3819 | BUG_ON(group != e4b->bd_group && pa->pa_len != 0); |
@@ -3889,6 +3881,8 @@ ext4_mb_discard_group_preallocations(struct super_block *sb, | |||
3889 | 3881 | ||
3890 | INIT_LIST_HEAD(&list); | 3882 | INIT_LIST_HEAD(&list); |
3891 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); | 3883 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); |
3884 | if (ac) | ||
3885 | ac->ac_sb = sb; | ||
3892 | repeat: | 3886 | repeat: |
3893 | ext4_lock_group(sb, group); | 3887 | ext4_lock_group(sb, group); |
3894 | list_for_each_entry_safe(pa, tmp, | 3888 | list_for_each_entry_safe(pa, tmp, |
@@ -3987,12 +3981,15 @@ void ext4_discard_preallocations(struct inode *inode) | |||
3987 | } | 3981 | } |
3988 | 3982 | ||
3989 | mb_debug("discard preallocation for inode %lu\n", inode->i_ino); | 3983 | mb_debug("discard preallocation for inode %lu\n", inode->i_ino); |
3990 | trace_mark(ext4_discard_preallocations, "dev %s ino %lu", sb->s_id, | 3984 | trace_ext4_discard_preallocations(inode); |
3991 | inode->i_ino); | ||
3992 | 3985 | ||
3993 | INIT_LIST_HEAD(&list); | 3986 | INIT_LIST_HEAD(&list); |
3994 | 3987 | ||
3995 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); | 3988 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); |
3989 | if (ac) { | ||
3990 | ac->ac_sb = sb; | ||
3991 | ac->ac_inode = inode; | ||
3992 | } | ||
3996 | repeat: | 3993 | repeat: |
3997 | /* first, collect all pa's in the inode */ | 3994 | /* first, collect all pa's in the inode */ |
3998 | spin_lock(&ei->i_prealloc_lock); | 3995 | spin_lock(&ei->i_prealloc_lock); |
@@ -4276,6 +4273,8 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb, | |||
4276 | 4273 | ||
4277 | INIT_LIST_HEAD(&discard_list); | 4274 | INIT_LIST_HEAD(&discard_list); |
4278 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); | 4275 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); |
4276 | if (ac) | ||
4277 | ac->ac_sb = sb; | ||
4279 | 4278 | ||
4280 | spin_lock(&lg->lg_prealloc_lock); | 4279 | spin_lock(&lg->lg_prealloc_lock); |
4281 | list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[order], | 4280 | list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[order], |
@@ -4445,8 +4444,7 @@ static int ext4_mb_discard_preallocations(struct super_block *sb, int needed) | |||
4445 | int ret; | 4444 | int ret; |
4446 | int freed = 0; | 4445 | int freed = 0; |
4447 | 4446 | ||
4448 | trace_mark(ext4_mb_discard_preallocations, "dev %s needed %d", | 4447 | trace_ext4_mb_discard_preallocations(sb, needed); |
4449 | sb->s_id, needed); | ||
4450 | for (i = 0; i < ngroups && needed > 0; i++) { | 4448 | for (i = 0; i < ngroups && needed > 0; i++) { |
4451 | ret = ext4_mb_discard_group_preallocations(sb, i, needed); | 4449 | ret = ext4_mb_discard_group_preallocations(sb, i, needed); |
4452 | freed += ret; | 4450 | freed += ret; |
@@ -4475,17 +4473,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, | |||
4475 | sb = ar->inode->i_sb; | 4473 | sb = ar->inode->i_sb; |
4476 | sbi = EXT4_SB(sb); | 4474 | sbi = EXT4_SB(sb); |
4477 | 4475 | ||
4478 | trace_mark(ext4_request_blocks, "dev %s flags %u len %u ino %lu " | 4476 | trace_ext4_request_blocks(ar); |
4479 | "lblk %llu goal %llu lleft %llu lright %llu " | ||
4480 | "pleft %llu pright %llu ", | ||
4481 | sb->s_id, ar->flags, ar->len, | ||
4482 | ar->inode ? ar->inode->i_ino : 0, | ||
4483 | (unsigned long long) ar->logical, | ||
4484 | (unsigned long long) ar->goal, | ||
4485 | (unsigned long long) ar->lleft, | ||
4486 | (unsigned long long) ar->lright, | ||
4487 | (unsigned long long) ar->pleft, | ||
4488 | (unsigned long long) ar->pright); | ||
4489 | 4477 | ||
4490 | /* | 4478 | /* |
4491 | * For delayed allocation, we could skip the ENOSPC and | 4479 | * For delayed allocation, we could skip the ENOSPC and |
@@ -4521,7 +4509,10 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, | |||
4521 | } | 4509 | } |
4522 | 4510 | ||
4523 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); | 4511 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); |
4524 | if (!ac) { | 4512 | if (ac) { |
4513 | ac->ac_sb = sb; | ||
4514 | ac->ac_inode = ar->inode; | ||
4515 | } else { | ||
4525 | ar->len = 0; | 4516 | ar->len = 0; |
4526 | *errp = -ENOMEM; | 4517 | *errp = -ENOMEM; |
4527 | goto out1; | 4518 | goto out1; |
@@ -4594,18 +4585,7 @@ out3: | |||
4594 | reserv_blks); | 4585 | reserv_blks); |
4595 | } | 4586 | } |
4596 | 4587 | ||
4597 | trace_mark(ext4_allocate_blocks, | 4588 | trace_ext4_allocate_blocks(ar, (unsigned long long)block); |
4598 | "dev %s block %llu flags %u len %u ino %lu " | ||
4599 | "logical %llu goal %llu lleft %llu lright %llu " | ||
4600 | "pleft %llu pright %llu ", | ||
4601 | sb->s_id, (unsigned long long) block, | ||
4602 | ar->flags, ar->len, ar->inode ? ar->inode->i_ino : 0, | ||
4603 | (unsigned long long) ar->logical, | ||
4604 | (unsigned long long) ar->goal, | ||
4605 | (unsigned long long) ar->lleft, | ||
4606 | (unsigned long long) ar->lright, | ||
4607 | (unsigned long long) ar->pleft, | ||
4608 | (unsigned long long) ar->pright); | ||
4609 | 4589 | ||
4610 | return block; | 4590 | return block; |
4611 | } | 4591 | } |
@@ -4740,10 +4720,7 @@ void ext4_mb_free_blocks(handle_t *handle, struct inode *inode, | |||
4740 | } | 4720 | } |
4741 | 4721 | ||
4742 | ext4_debug("freeing block %lu\n", block); | 4722 | ext4_debug("freeing block %lu\n", block); |
4743 | trace_mark(ext4_free_blocks, | 4723 | trace_ext4_free_blocks(inode, block, count, metadata); |
4744 | "dev %s block %llu count %lu metadata %d ino %lu", | ||
4745 | sb->s_id, (unsigned long long) block, count, metadata, | ||
4746 | inode ? inode->i_ino : 0); | ||
4747 | 4724 | ||
4748 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); | 4725 | ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); |
4749 | if (ac) { | 4726 | if (ac) { |
diff --git a/fs/ext4/mballoc.h b/fs/ext4/mballoc.h index 75e34f69215..c96bb19f58f 100644 --- a/fs/ext4/mballoc.h +++ b/fs/ext4/mballoc.h | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
20 | #include <linux/version.h> | 20 | #include <linux/version.h> |
21 | #include <linux/blkdev.h> | 21 | #include <linux/blkdev.h> |
22 | #include <linux/marker.h> | ||
23 | #include <linux/mutex.h> | 22 | #include <linux/mutex.h> |
24 | #include "ext4_jbd2.h" | 23 | #include "ext4_jbd2.h" |
25 | #include "ext4.h" | 24 | #include "ext4.h" |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 012c4251397..e8f0b2af460 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/seq_file.h> | 37 | #include <linux/seq_file.h> |
38 | #include <linux/proc_fs.h> | 38 | #include <linux/proc_fs.h> |
39 | #include <linux/ctype.h> | 39 | #include <linux/ctype.h> |
40 | #include <linux/marker.h> | ||
41 | #include <linux/log2.h> | 40 | #include <linux/log2.h> |
42 | #include <linux/crc16.h> | 41 | #include <linux/crc16.h> |
43 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
@@ -47,6 +46,9 @@ | |||
47 | #include "xattr.h" | 46 | #include "xattr.h" |
48 | #include "acl.h" | 47 | #include "acl.h" |
49 | 48 | ||
49 | #define CREATE_TRACE_POINTS | ||
50 | #include <trace/events/ext4.h> | ||
51 | |||
50 | static int default_mb_history_length = 1000; | 52 | static int default_mb_history_length = 1000; |
51 | 53 | ||
52 | module_param_named(default_mb_history_length, default_mb_history_length, | 54 | module_param_named(default_mb_history_length, default_mb_history_length, |
@@ -3346,7 +3348,7 @@ static int ext4_sync_fs(struct super_block *sb, int wait) | |||
3346 | int ret = 0; | 3348 | int ret = 0; |
3347 | tid_t target; | 3349 | tid_t target; |
3348 | 3350 | ||
3349 | trace_mark(ext4_sync_fs, "dev %s wait %d", sb->s_id, wait); | 3351 | trace_ext4_sync_fs(sb, wait); |
3350 | if (jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, &target)) { | 3352 | if (jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, &target)) { |
3351 | if (wait) | 3353 | if (wait) |
3352 | jbd2_log_wait_commit(EXT4_SB(sb)->s_journal, target); | 3354 | jbd2_log_wait_commit(EXT4_SB(sb)->s_journal, target); |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h new file mode 100644 index 00000000000..acf4cc9cd36 --- /dev/null +++ b/include/trace/events/ext4.h | |||
@@ -0,0 +1,719 @@ | |||
1 | #if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ) | ||
2 | #define _TRACE_EXT4_H | ||
3 | |||
4 | #undef TRACE_SYSTEM | ||
5 | #define TRACE_SYSTEM ext4 | ||
6 | |||
7 | #include <linux/writeback.h> | ||
8 | #include "../../../fs/ext4/ext4.h" | ||
9 | #include "../../../fs/ext4/mballoc.h" | ||
10 | #include <linux/tracepoint.h> | ||
11 | |||
12 | TRACE_EVENT(ext4_free_inode, | ||
13 | TP_PROTO(struct inode *inode), | ||
14 | |||
15 | TP_ARGS(inode), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __field( dev_t, dev ) | ||
19 | __field( ino_t, ino ) | ||
20 | __field( umode_t, mode ) | ||
21 | __field( uid_t, uid ) | ||
22 | __field( gid_t, gid ) | ||
23 | __field( blkcnt_t, blocks ) | ||
24 | ), | ||
25 | |||
26 | TP_fast_assign( | ||
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; | ||
33 | ), | ||
34 | |||
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, __entry->blocks) | ||
38 | ); | ||
39 | |||
40 | TRACE_EVENT(ext4_request_inode, | ||
41 | TP_PROTO(struct inode *dir, int mode), | ||
42 | |||
43 | TP_ARGS(dir, mode), | ||
44 | |||
45 | TP_STRUCT__entry( | ||
46 | __field( dev_t, dev ) | ||
47 | __field( ino_t, dir ) | ||
48 | __field( umode_t, mode ) | ||
49 | ), | ||
50 | |||
51 | TP_fast_assign( | ||
52 | __entry->dev = dir->i_sb->s_dev; | ||
53 | __entry->dir = dir->i_ino; | ||
54 | __entry->mode = mode; | ||
55 | ), | ||
56 | |||
57 | TP_printk("dev %s dir %lu mode %d", | ||
58 | jbd2_dev_to_name(__entry->dev), __entry->dir, __entry->mode) | ||
59 | ); | ||
60 | |||
61 | TRACE_EVENT(ext4_allocate_inode, | ||
62 | TP_PROTO(struct inode *inode, struct inode *dir, int mode), | ||
63 | |||
64 | TP_ARGS(inode, dir, mode), | ||
65 | |||
66 | TP_STRUCT__entry( | ||
67 | __field( dev_t, dev ) | ||
68 | __field( ino_t, ino ) | ||
69 | __field( ino_t, dir ) | ||
70 | __field( umode_t, mode ) | ||
71 | ), | ||
72 | |||
73 | TP_fast_assign( | ||
74 | __entry->dev = inode->i_sb->s_dev; | ||
75 | __entry->ino = inode->i_ino; | ||
76 | __entry->dir = dir->i_ino; | ||
77 | __entry->mode = mode; | ||
78 | ), | ||
79 | |||
80 | TP_printk("dev %s ino %lu dir %lu mode %d", | ||
81 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->dir, __entry->mode) | ||
82 | ); | ||
83 | |||
84 | TRACE_EVENT(ext4_write_begin, | ||
85 | |||
86 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
87 | unsigned int flags), | ||
88 | |||
89 | TP_ARGS(inode, pos, len, flags), | ||
90 | |||
91 | TP_STRUCT__entry( | ||
92 | __field( dev_t, dev ) | ||
93 | __field( ino_t, ino ) | ||
94 | __field( loff_t, pos ) | ||
95 | __field( unsigned int, len ) | ||
96 | __field( unsigned int, flags ) | ||
97 | ), | ||
98 | |||
99 | TP_fast_assign( | ||
100 | __entry->dev = inode->i_sb->s_dev; | ||
101 | __entry->ino = inode->i_ino; | ||
102 | __entry->pos = pos; | ||
103 | __entry->len = len; | ||
104 | __entry->flags = flags; | ||
105 | ), | ||
106 | |||
107 | TP_printk("dev %s ino %lu pos %llu len %u flags %u", | ||
108 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
109 | __entry->flags) | ||
110 | ); | ||
111 | |||
112 | TRACE_EVENT(ext4_ordered_write_end, | ||
113 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
114 | unsigned int copied), | ||
115 | |||
116 | TP_ARGS(inode, pos, len, copied), | ||
117 | |||
118 | TP_STRUCT__entry( | ||
119 | __field( dev_t, dev ) | ||
120 | __field( ino_t, ino ) | ||
121 | __field( loff_t, pos ) | ||
122 | __field( unsigned int, len ) | ||
123 | __field( unsigned int, copied ) | ||
124 | ), | ||
125 | |||
126 | TP_fast_assign( | ||
127 | __entry->dev = inode->i_sb->s_dev; | ||
128 | __entry->ino = inode->i_ino; | ||
129 | __entry->pos = pos; | ||
130 | __entry->len = len; | ||
131 | __entry->copied = copied; | ||
132 | ), | ||
133 | |||
134 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | ||
135 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
136 | __entry->copied) | ||
137 | ); | ||
138 | |||
139 | TRACE_EVENT(ext4_writeback_write_end, | ||
140 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
141 | unsigned int copied), | ||
142 | |||
143 | TP_ARGS(inode, pos, len, copied), | ||
144 | |||
145 | TP_STRUCT__entry( | ||
146 | __field( dev_t, dev ) | ||
147 | __field( ino_t, ino ) | ||
148 | __field( loff_t, pos ) | ||
149 | __field( unsigned int, len ) | ||
150 | __field( unsigned int, copied ) | ||
151 | ), | ||
152 | |||
153 | TP_fast_assign( | ||
154 | __entry->dev = inode->i_sb->s_dev; | ||
155 | __entry->ino = inode->i_ino; | ||
156 | __entry->pos = pos; | ||
157 | __entry->len = len; | ||
158 | __entry->copied = copied; | ||
159 | ), | ||
160 | |||
161 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | ||
162 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
163 | __entry->copied) | ||
164 | ); | ||
165 | |||
166 | TRACE_EVENT(ext4_journalled_write_end, | ||
167 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
168 | unsigned int copied), | ||
169 | TP_ARGS(inode, pos, len, copied), | ||
170 | |||
171 | TP_STRUCT__entry( | ||
172 | __field( dev_t, dev ) | ||
173 | __field( ino_t, ino ) | ||
174 | __field( loff_t, pos ) | ||
175 | __field( unsigned int, len ) | ||
176 | __field( unsigned int, copied ) | ||
177 | ), | ||
178 | |||
179 | TP_fast_assign( | ||
180 | __entry->dev = inode->i_sb->s_dev; | ||
181 | __entry->ino = inode->i_ino; | ||
182 | __entry->pos = pos; | ||
183 | __entry->len = len; | ||
184 | __entry->copied = copied; | ||
185 | ), | ||
186 | |||
187 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | ||
188 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
189 | __entry->copied) | ||
190 | ); | ||
191 | |||
192 | TRACE_EVENT(ext4_da_writepage, | ||
193 | TP_PROTO(struct inode *inode, struct page *page), | ||
194 | |||
195 | TP_ARGS(inode, page), | ||
196 | |||
197 | TP_STRUCT__entry( | ||
198 | __field( dev_t, dev ) | ||
199 | __field( ino_t, ino ) | ||
200 | __field( pgoff_t, index ) | ||
201 | |||
202 | ), | ||
203 | |||
204 | TP_fast_assign( | ||
205 | __entry->dev = inode->i_sb->s_dev; | ||
206 | __entry->ino = inode->i_ino; | ||
207 | __entry->index = page->index; | ||
208 | ), | ||
209 | |||
210 | TP_printk("dev %s ino %lu page_index %lu", | ||
211 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->index) | ||
212 | ); | ||
213 | |||
214 | TRACE_EVENT(ext4_da_writepages, | ||
215 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), | ||
216 | |||
217 | TP_ARGS(inode, wbc), | ||
218 | |||
219 | TP_STRUCT__entry( | ||
220 | __field( dev_t, dev ) | ||
221 | __field( ino_t, ino ) | ||
222 | __field( long, nr_to_write ) | ||
223 | __field( long, pages_skipped ) | ||
224 | __field( loff_t, range_start ) | ||
225 | __field( loff_t, range_end ) | ||
226 | __field( char, nonblocking ) | ||
227 | __field( char, for_kupdate ) | ||
228 | __field( char, for_reclaim ) | ||
229 | __field( char, for_writepages ) | ||
230 | __field( char, range_cyclic ) | ||
231 | ), | ||
232 | |||
233 | TP_fast_assign( | ||
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->for_writepages = wbc->for_writepages; | ||
244 | __entry->range_cyclic = wbc->range_cyclic; | ||
245 | ), | ||
246 | |||
247 | 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", | ||
248 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->nr_to_write, | ||
249 | __entry->pages_skipped, __entry->range_start, | ||
250 | __entry->range_end, __entry->nonblocking, | ||
251 | __entry->for_kupdate, __entry->for_reclaim, | ||
252 | __entry->for_writepages, __entry->range_cyclic) | ||
253 | ); | ||
254 | |||
255 | TRACE_EVENT(ext4_da_writepages_result, | ||
256 | TP_PROTO(struct inode *inode, struct writeback_control *wbc, | ||
257 | int ret, int pages_written), | ||
258 | |||
259 | TP_ARGS(inode, wbc, ret, pages_written), | ||
260 | |||
261 | TP_STRUCT__entry( | ||
262 | __field( dev_t, dev ) | ||
263 | __field( ino_t, ino ) | ||
264 | __field( int, ret ) | ||
265 | __field( int, pages_written ) | ||
266 | __field( long, pages_skipped ) | ||
267 | __field( char, encountered_congestion ) | ||
268 | __field( char, more_io ) | ||
269 | __field( char, no_nrwrite_index_update ) | ||
270 | ), | ||
271 | |||
272 | TP_fast_assign( | ||
273 | __entry->dev = inode->i_sb->s_dev; | ||
274 | __entry->ino = inode->i_ino; | ||
275 | __entry->ret = ret; | ||
276 | __entry->pages_written = pages_written; | ||
277 | __entry->pages_skipped = wbc->pages_skipped; | ||
278 | __entry->encountered_congestion = wbc->encountered_congestion; | ||
279 | __entry->more_io = wbc->more_io; | ||
280 | __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update; | ||
281 | ), | ||
282 | |||
283 | TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d", | ||
284 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->ret, | ||
285 | __entry->pages_written, __entry->pages_skipped, | ||
286 | __entry->encountered_congestion, __entry->more_io, | ||
287 | __entry->no_nrwrite_index_update) | ||
288 | ); | ||
289 | |||
290 | TRACE_EVENT(ext4_da_write_begin, | ||
291 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
292 | unsigned int flags), | ||
293 | |||
294 | TP_ARGS(inode, pos, len, flags), | ||
295 | |||
296 | TP_STRUCT__entry( | ||
297 | __field( dev_t, dev ) | ||
298 | __field( ino_t, ino ) | ||
299 | __field( loff_t, pos ) | ||
300 | __field( unsigned int, len ) | ||
301 | __field( unsigned int, flags ) | ||
302 | ), | ||
303 | |||
304 | TP_fast_assign( | ||
305 | __entry->dev = inode->i_sb->s_dev; | ||
306 | __entry->ino = inode->i_ino; | ||
307 | __entry->pos = pos; | ||
308 | __entry->len = len; | ||
309 | __entry->flags = flags; | ||
310 | ), | ||
311 | |||
312 | TP_printk("dev %s ino %lu pos %llu len %u flags %u", | ||
313 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
314 | __entry->flags) | ||
315 | ); | ||
316 | |||
317 | TRACE_EVENT(ext4_da_write_end, | ||
318 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
319 | unsigned int copied), | ||
320 | |||
321 | TP_ARGS(inode, pos, len, copied), | ||
322 | |||
323 | TP_STRUCT__entry( | ||
324 | __field( dev_t, dev ) | ||
325 | __field( ino_t, ino ) | ||
326 | __field( loff_t, pos ) | ||
327 | __field( unsigned int, len ) | ||
328 | __field( unsigned int, copied ) | ||
329 | ), | ||
330 | |||
331 | TP_fast_assign( | ||
332 | __entry->dev = inode->i_sb->s_dev; | ||
333 | __entry->ino = inode->i_ino; | ||
334 | __entry->pos = pos; | ||
335 | __entry->len = len; | ||
336 | __entry->copied = copied; | ||
337 | ), | ||
338 | |||
339 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | ||
340 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
341 | __entry->copied) | ||
342 | ); | ||
343 | |||
344 | TRACE_EVENT(ext4_normal_writepage, | ||
345 | TP_PROTO(struct inode *inode, struct page *page), | ||
346 | |||
347 | TP_ARGS(inode, page), | ||
348 | |||
349 | TP_STRUCT__entry( | ||
350 | __field( dev_t, dev ) | ||
351 | __field( ino_t, ino ) | ||
352 | __field( pgoff_t, index ) | ||
353 | ), | ||
354 | |||
355 | TP_fast_assign( | ||
356 | __entry->dev = inode->i_sb->s_dev; | ||
357 | __entry->ino = inode->i_ino; | ||
358 | __entry->index = page->index; | ||
359 | ), | ||
360 | |||
361 | TP_printk("dev %s ino %lu page_index %lu", | ||
362 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->index) | ||
363 | ); | ||
364 | |||
365 | TRACE_EVENT(ext4_journalled_writepage, | ||
366 | TP_PROTO(struct inode *inode, struct page *page), | ||
367 | |||
368 | TP_ARGS(inode, page), | ||
369 | |||
370 | TP_STRUCT__entry( | ||
371 | __field( dev_t, dev ) | ||
372 | __field( ino_t, ino ) | ||
373 | __field( pgoff_t, index ) | ||
374 | |||
375 | ), | ||
376 | |||
377 | TP_fast_assign( | ||
378 | __entry->dev = inode->i_sb->s_dev; | ||
379 | __entry->ino = inode->i_ino; | ||
380 | __entry->index = page->index; | ||
381 | ), | ||
382 | |||
383 | TP_printk("dev %s ino %lu page_index %lu", | ||
384 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->index) | ||
385 | ); | ||
386 | |||
387 | TRACE_EVENT(ext4_discard_blocks, | ||
388 | TP_PROTO(struct super_block *sb, unsigned long long blk, | ||
389 | unsigned long long count), | ||
390 | |||
391 | TP_ARGS(sb, blk, count), | ||
392 | |||
393 | TP_STRUCT__entry( | ||
394 | __field( dev_t, dev ) | ||
395 | __field( __u64, blk ) | ||
396 | __field( __u64, count ) | ||
397 | |||
398 | ), | ||
399 | |||
400 | TP_fast_assign( | ||
401 | __entry->dev = sb->s_dev; | ||
402 | __entry->blk = blk; | ||
403 | __entry->count = count; | ||
404 | ), | ||
405 | |||
406 | TP_printk("dev %s blk %llu count %llu", | ||
407 | jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count) | ||
408 | ); | ||
409 | |||
410 | TRACE_EVENT(ext4_mb_new_inode_pa, | ||
411 | TP_PROTO(struct ext4_allocation_context *ac, | ||
412 | struct ext4_prealloc_space *pa), | ||
413 | |||
414 | TP_ARGS(ac, pa), | ||
415 | |||
416 | TP_STRUCT__entry( | ||
417 | __field( dev_t, dev ) | ||
418 | __field( ino_t, ino ) | ||
419 | __field( __u64, pa_pstart ) | ||
420 | __field( __u32, pa_len ) | ||
421 | __field( __u64, pa_lstart ) | ||
422 | |||
423 | ), | ||
424 | |||
425 | TP_fast_assign( | ||
426 | __entry->dev = ac->ac_sb->s_dev; | ||
427 | __entry->ino = ac->ac_inode->i_ino; | ||
428 | __entry->pa_pstart = pa->pa_pstart; | ||
429 | __entry->pa_len = pa->pa_len; | ||
430 | __entry->pa_lstart = pa->pa_lstart; | ||
431 | ), | ||
432 | |||
433 | TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", | ||
434 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pa_pstart, | ||
435 | __entry->pa_len, __entry->pa_lstart) | ||
436 | ); | ||
437 | |||
438 | TRACE_EVENT(ext4_mb_new_group_pa, | ||
439 | TP_PROTO(struct ext4_allocation_context *ac, | ||
440 | struct ext4_prealloc_space *pa), | ||
441 | |||
442 | TP_ARGS(ac, pa), | ||
443 | |||
444 | TP_STRUCT__entry( | ||
445 | __field( dev_t, dev ) | ||
446 | __field( ino_t, ino ) | ||
447 | __field( __u64, pa_pstart ) | ||
448 | __field( __u32, pa_len ) | ||
449 | __field( __u64, pa_lstart ) | ||
450 | |||
451 | ), | ||
452 | |||
453 | TP_fast_assign( | ||
454 | __entry->dev = ac->ac_sb->s_dev; | ||
455 | __entry->ino = ac->ac_inode->i_ino; | ||
456 | __entry->pa_pstart = pa->pa_pstart; | ||
457 | __entry->pa_len = pa->pa_len; | ||
458 | __entry->pa_lstart = pa->pa_lstart; | ||
459 | ), | ||
460 | |||
461 | TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", | ||
462 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pa_pstart, | ||
463 | __entry->pa_len, __entry->pa_lstart) | ||
464 | ); | ||
465 | |||
466 | TRACE_EVENT(ext4_mb_release_inode_pa, | ||
467 | TP_PROTO(struct ext4_allocation_context *ac, | ||
468 | struct ext4_prealloc_space *pa, | ||
469 | unsigned long long block, unsigned int count), | ||
470 | |||
471 | TP_ARGS(ac, pa, block, count), | ||
472 | |||
473 | TP_STRUCT__entry( | ||
474 | __field( dev_t, dev ) | ||
475 | __field( ino_t, ino ) | ||
476 | __field( __u64, block ) | ||
477 | __field( __u32, count ) | ||
478 | |||
479 | ), | ||
480 | |||
481 | TP_fast_assign( | ||
482 | __entry->dev = ac->ac_sb->s_dev; | ||
483 | __entry->ino = ac->ac_inode->i_ino; | ||
484 | __entry->block = block; | ||
485 | __entry->count = count; | ||
486 | ), | ||
487 | |||
488 | TP_printk("dev %s ino %lu block %llu count %u", | ||
489 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->block, | ||
490 | __entry->count) | ||
491 | ); | ||
492 | |||
493 | TRACE_EVENT(ext4_mb_release_group_pa, | ||
494 | TP_PROTO(struct ext4_allocation_context *ac, | ||
495 | struct ext4_prealloc_space *pa), | ||
496 | |||
497 | TP_ARGS(ac, pa), | ||
498 | |||
499 | TP_STRUCT__entry( | ||
500 | __field( dev_t, dev ) | ||
501 | __field( ino_t, ino ) | ||
502 | __field( __u64, pa_pstart ) | ||
503 | __field( __u32, pa_len ) | ||
504 | |||
505 | ), | ||
506 | |||
507 | TP_fast_assign( | ||
508 | __entry->dev = ac->ac_sb->s_dev; | ||
509 | __entry->ino = ac->ac_inode->i_ino; | ||
510 | __entry->pa_pstart = pa->pa_pstart; | ||
511 | __entry->pa_len = pa->pa_len; | ||
512 | ), | ||
513 | |||
514 | TP_printk("dev %s pstart %llu len %u", | ||
515 | jbd2_dev_to_name(__entry->dev), __entry->pa_pstart, __entry->pa_len) | ||
516 | ); | ||
517 | |||
518 | TRACE_EVENT(ext4_discard_preallocations, | ||
519 | TP_PROTO(struct inode *inode), | ||
520 | |||
521 | TP_ARGS(inode), | ||
522 | |||
523 | TP_STRUCT__entry( | ||
524 | __field( dev_t, dev ) | ||
525 | __field( ino_t, ino ) | ||
526 | |||
527 | ), | ||
528 | |||
529 | TP_fast_assign( | ||
530 | __entry->dev = inode->i_sb->s_dev; | ||
531 | __entry->ino = inode->i_ino; | ||
532 | ), | ||
533 | |||
534 | TP_printk("dev %s ino %lu", | ||
535 | jbd2_dev_to_name(__entry->dev), __entry->ino) | ||
536 | ); | ||
537 | |||
538 | TRACE_EVENT(ext4_mb_discard_preallocations, | ||
539 | TP_PROTO(struct super_block *sb, int needed), | ||
540 | |||
541 | TP_ARGS(sb, needed), | ||
542 | |||
543 | TP_STRUCT__entry( | ||
544 | __field( dev_t, dev ) | ||
545 | __field( int, needed ) | ||
546 | |||
547 | ), | ||
548 | |||
549 | TP_fast_assign( | ||
550 | __entry->dev = sb->s_dev; | ||
551 | __entry->needed = needed; | ||
552 | ), | ||
553 | |||
554 | TP_printk("dev %s needed %d", | ||
555 | jbd2_dev_to_name(__entry->dev), __entry->needed) | ||
556 | ); | ||
557 | |||
558 | TRACE_EVENT(ext4_request_blocks, | ||
559 | TP_PROTO(struct ext4_allocation_request *ar), | ||
560 | |||
561 | TP_ARGS(ar), | ||
562 | |||
563 | TP_STRUCT__entry( | ||
564 | __field( dev_t, dev ) | ||
565 | __field( ino_t, ino ) | ||
566 | __field( unsigned int, flags ) | ||
567 | __field( unsigned int, len ) | ||
568 | __field( __u64, logical ) | ||
569 | __field( __u64, goal ) | ||
570 | __field( __u64, lleft ) | ||
571 | __field( __u64, lright ) | ||
572 | __field( __u64, pleft ) | ||
573 | __field( __u64, pright ) | ||
574 | ), | ||
575 | |||
576 | TP_fast_assign( | ||
577 | __entry->dev = ar->inode->i_sb->s_dev; | ||
578 | __entry->ino = ar->inode->i_ino; | ||
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; | ||
587 | ), | ||
588 | |||
589 | TP_printk("dev %s ino %lu flags %u len %u 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, | ||
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) | ||
598 | ); | ||
599 | |||
600 | TRACE_EVENT(ext4_allocate_blocks, | ||
601 | TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block), | ||
602 | |||
603 | TP_ARGS(ar, block), | ||
604 | |||
605 | TP_STRUCT__entry( | ||
606 | __field( dev_t, dev ) | ||
607 | __field( ino_t, ino ) | ||
608 | __field( __u64, block ) | ||
609 | __field( unsigned int, flags ) | ||
610 | __field( unsigned int, len ) | ||
611 | __field( __u64, logical ) | ||
612 | __field( __u64, goal ) | ||
613 | __field( __u64, lleft ) | ||
614 | __field( __u64, lright ) | ||
615 | __field( __u64, pleft ) | ||
616 | __field( __u64, pright ) | ||
617 | ), | ||
618 | |||
619 | TP_fast_assign( | ||
620 | __entry->dev = ar->inode->i_sb->s_dev; | ||
621 | __entry->ino = ar->inode->i_ino; | ||
622 | __entry->block = block; | ||
623 | __entry->flags = ar->flags; | ||
624 | __entry->len = ar->len; | ||
625 | __entry->logical = ar->logical; | ||
626 | __entry->goal = ar->goal; | ||
627 | __entry->lleft = ar->lleft; | ||
628 | __entry->lright = ar->lright; | ||
629 | __entry->pleft = ar->pleft; | ||
630 | __entry->pright = ar->pright; | ||
631 | ), | ||
632 | |||
633 | TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", | ||
634 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->flags, | ||
635 | __entry->len, __entry->block, | ||
636 | (unsigned long long) __entry->logical, | ||
637 | (unsigned long long) __entry->goal, | ||
638 | (unsigned long long) __entry->lleft, | ||
639 | (unsigned long long) __entry->lright, | ||
640 | (unsigned long long) __entry->pleft, | ||
641 | (unsigned long long) __entry->pright) | ||
642 | ); | ||
643 | |||
644 | TRACE_EVENT(ext4_free_blocks, | ||
645 | TP_PROTO(struct inode *inode, __u64 block, unsigned long count, | ||
646 | int metadata), | ||
647 | |||
648 | TP_ARGS(inode, block, count, metadata), | ||
649 | |||
650 | TP_STRUCT__entry( | ||
651 | __field( dev_t, dev ) | ||
652 | __field( ino_t, ino ) | ||
653 | __field( __u64, block ) | ||
654 | __field( unsigned long, count ) | ||
655 | __field( int, metadata ) | ||
656 | |||
657 | ), | ||
658 | |||
659 | TP_fast_assign( | ||
660 | __entry->dev = inode->i_sb->s_dev; | ||
661 | __entry->ino = inode->i_ino; | ||
662 | __entry->block = block; | ||
663 | __entry->count = count; | ||
664 | __entry->metadata = metadata; | ||
665 | ), | ||
666 | |||
667 | TP_printk("dev %s ino %lu block %llu count %lu metadata %d", | ||
668 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->block, | ||
669 | __entry->count, __entry->metadata) | ||
670 | ); | ||
671 | |||
672 | TRACE_EVENT(ext4_sync_file, | ||
673 | TP_PROTO(struct file *file, struct dentry *dentry, int datasync), | ||
674 | |||
675 | TP_ARGS(file, dentry, datasync), | ||
676 | |||
677 | TP_STRUCT__entry( | ||
678 | __field( dev_t, dev ) | ||
679 | __field( ino_t, ino ) | ||
680 | __field( ino_t, parent ) | ||
681 | __field( int, datasync ) | ||
682 | ), | ||
683 | |||
684 | TP_fast_assign( | ||
685 | __entry->dev = dentry->d_inode->i_sb->s_dev; | ||
686 | __entry->ino = dentry->d_inode->i_ino; | ||
687 | __entry->datasync = datasync; | ||
688 | __entry->parent = dentry->d_parent->d_inode->i_ino; | ||
689 | ), | ||
690 | |||
691 | TP_printk("dev %s ino %ld parent %ld datasync %d ", | ||
692 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->parent, | ||
693 | __entry->datasync) | ||
694 | ); | ||
695 | |||
696 | TRACE_EVENT(ext4_sync_fs, | ||
697 | TP_PROTO(struct super_block *sb, int wait), | ||
698 | |||
699 | TP_ARGS(sb, wait), | ||
700 | |||
701 | TP_STRUCT__entry( | ||
702 | __field( dev_t, dev ) | ||
703 | __field( int, wait ) | ||
704 | |||
705 | ), | ||
706 | |||
707 | TP_fast_assign( | ||
708 | __entry->dev = sb->s_dev; | ||
709 | __entry->wait = wait; | ||
710 | ), | ||
711 | |||
712 | TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry->dev), | ||
713 | __entry->wait) | ||
714 | ); | ||
715 | |||
716 | #endif /* _TRACE_EXT4_H */ | ||
717 | |||
718 | /* This part must be outside protection */ | ||
719 | #include <trace/define_trace.h> | ||