aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-06-17 11:48:11 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-06-17 11:48:11 -0400
commit9bffad1ed2a003a355ed1b42424a0ae3575275ed (patch)
tree9016e7b0e04a0e5319680f9e1f89fc1abb13c765 /fs/ext4/inode.c
parent879c5e6b7cb4c689d08ca9b2e353d8ab3dc425d5 (diff)
ext4: convert instrumentation from markers to tracepoints
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c69
1 files changed, 14 insertions, 55 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 875db944b22f..2418ad36eab5 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
47static inline int ext4_begin_ordered_truncate(struct inode *inode, 50static 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);
2912retry: 2878retry:
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;