diff options
author | Lukas Czerner <lczerner@redhat.com> | 2011-05-23 12:33:01 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-06-25 11:29:51 -0400 |
commit | 785c4bcc0d88ff006a0b2120815a71e86ecf21ce (patch) | |
tree | 573607ada555ca3d6136a9ec7f922ee6fef1eda3 /fs/ext3 | |
parent | 5220cc9382e11ca955ce946ee6a5bac577bb14ff (diff) |
ext3: Add fixed tracepoints
This commit adds fixed tracepoints to the ext3 code. It is based on ext4
tracepoints, however due to the differences of both file systems, there
are some tracepoints missing (those for delaloc and for multi-block
allocator) and there are some ext3 specific as well (for reservation
windows).
Here is a list:
ext3_free_inode
ext3_request_inode
ext3_allocate_inode
ext3_evict_inode
ext3_drop_inode
ext3_mark_inode_dirty
ext3_write_begin
ext3_ordered_write_end
ext3_writeback_write_end
ext3_journalled_write_end
ext3_ordered_writepage
ext3_writeback_writepage
ext3_journalled_writepage
ext3_readpage
ext3_releasepage
ext3_invalidatepage
ext3_discard_blocks
ext3_request_blocks
ext3_allocate_blocks
ext3_free_blocks
ext3_sync_file_enter
ext3_sync_file_exit
ext3_sync_fs
ext3_rsv_window_add
ext3_discard_reservation
ext3_alloc_new_reservation
ext3_reserved
ext3_forget
ext3_read_block_bitmap
ext3_direct_IO_enter
ext3_direct_IO_exit
ext3_unlink_enter
ext3_unlink_exit
ext3_truncate_enter
ext3_truncate_exit
ext3_get_blocks_enter
ext3_get_blocks_exit
ext3_load_inode
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/balloc.c | 34 | ||||
-rw-r--r-- | fs/ext3/fsync.c | 15 | ||||
-rw-r--r-- | fs/ext3/ialloc.c | 4 | ||||
-rw-r--r-- | fs/ext3/inode.c | 29 | ||||
-rw-r--r-- | fs/ext3/namei.c | 3 | ||||
-rw-r--r-- | fs/ext3/super.c | 13 |
6 files changed, 82 insertions, 16 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index fe52297e31ad..f7d111e499ad 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/quotaops.h> | 21 | #include <linux/quotaops.h> |
22 | #include <linux/buffer_head.h> | 22 | #include <linux/buffer_head.h> |
23 | #include <linux/blkdev.h> | 23 | #include <linux/blkdev.h> |
24 | #include <trace/events/ext3.h> | ||
24 | 25 | ||
25 | /* | 26 | /* |
26 | * balloc.c contains the blocks allocation and deallocation routines | 27 | * balloc.c contains the blocks allocation and deallocation routines |
@@ -161,6 +162,7 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group) | |||
161 | desc = ext3_get_group_desc(sb, block_group, NULL); | 162 | desc = ext3_get_group_desc(sb, block_group, NULL); |
162 | if (!desc) | 163 | if (!desc) |
163 | return NULL; | 164 | return NULL; |
165 | trace_ext3_read_block_bitmap(sb, block_group); | ||
164 | bitmap_blk = le32_to_cpu(desc->bg_block_bitmap); | 166 | bitmap_blk = le32_to_cpu(desc->bg_block_bitmap); |
165 | bh = sb_getblk(sb, bitmap_blk); | 167 | bh = sb_getblk(sb, bitmap_blk); |
166 | if (unlikely(!bh)) { | 168 | if (unlikely(!bh)) { |
@@ -351,6 +353,7 @@ void ext3_rsv_window_add(struct super_block *sb, | |||
351 | struct rb_node * parent = NULL; | 353 | struct rb_node * parent = NULL; |
352 | struct ext3_reserve_window_node *this; | 354 | struct ext3_reserve_window_node *this; |
353 | 355 | ||
356 | trace_ext3_rsv_window_add(sb, rsv); | ||
354 | while (*p) | 357 | while (*p) |
355 | { | 358 | { |
356 | parent = *p; | 359 | parent = *p; |
@@ -476,8 +479,10 @@ void ext3_discard_reservation(struct inode *inode) | |||
476 | rsv = &block_i->rsv_window_node; | 479 | rsv = &block_i->rsv_window_node; |
477 | if (!rsv_is_empty(&rsv->rsv_window)) { | 480 | if (!rsv_is_empty(&rsv->rsv_window)) { |
478 | spin_lock(rsv_lock); | 481 | spin_lock(rsv_lock); |
479 | if (!rsv_is_empty(&rsv->rsv_window)) | 482 | if (!rsv_is_empty(&rsv->rsv_window)) { |
483 | trace_ext3_discard_reservation(inode, rsv); | ||
480 | rsv_window_remove(inode->i_sb, rsv); | 484 | rsv_window_remove(inode->i_sb, rsv); |
485 | } | ||
481 | spin_unlock(rsv_lock); | 486 | spin_unlock(rsv_lock); |
482 | } | 487 | } |
483 | } | 488 | } |
@@ -683,14 +688,10 @@ error_return: | |||
683 | void ext3_free_blocks(handle_t *handle, struct inode *inode, | 688 | void ext3_free_blocks(handle_t *handle, struct inode *inode, |
684 | ext3_fsblk_t block, unsigned long count) | 689 | ext3_fsblk_t block, unsigned long count) |
685 | { | 690 | { |
686 | struct super_block * sb; | 691 | struct super_block *sb = inode->i_sb; |
687 | unsigned long dquot_freed_blocks; | 692 | unsigned long dquot_freed_blocks; |
688 | 693 | ||
689 | sb = inode->i_sb; | 694 | trace_ext3_free_blocks(inode, block, count); |
690 | if (!sb) { | ||
691 | printk ("ext3_free_blocks: nonexistent device"); | ||
692 | return; | ||
693 | } | ||
694 | ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks); | 695 | ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks); |
695 | if (dquot_freed_blocks) | 696 | if (dquot_freed_blocks) |
696 | dquot_free_block(inode, dquot_freed_blocks); | 697 | dquot_free_block(inode, dquot_freed_blocks); |
@@ -1136,6 +1137,7 @@ static int alloc_new_reservation(struct ext3_reserve_window_node *my_rsv, | |||
1136 | else | 1137 | else |
1137 | start_block = grp_goal + group_first_block; | 1138 | start_block = grp_goal + group_first_block; |
1138 | 1139 | ||
1140 | trace_ext3_alloc_new_reservation(sb, start_block); | ||
1139 | size = my_rsv->rsv_goal_size; | 1141 | size = my_rsv->rsv_goal_size; |
1140 | 1142 | ||
1141 | if (!rsv_is_empty(&my_rsv->rsv_window)) { | 1143 | if (!rsv_is_empty(&my_rsv->rsv_window)) { |
@@ -1230,8 +1232,11 @@ retry: | |||
1230 | * check if the first free block is within the | 1232 | * check if the first free block is within the |
1231 | * free space we just reserved | 1233 | * free space we just reserved |
1232 | */ | 1234 | */ |
1233 | if (start_block >= my_rsv->rsv_start && start_block <= my_rsv->rsv_end) | 1235 | if (start_block >= my_rsv->rsv_start && |
1236 | start_block <= my_rsv->rsv_end) { | ||
1237 | trace_ext3_reserved(sb, start_block, my_rsv); | ||
1234 | return 0; /* success */ | 1238 | return 0; /* success */ |
1239 | } | ||
1235 | /* | 1240 | /* |
1236 | * if the first free bit we found is out of the reservable space | 1241 | * if the first free bit we found is out of the reservable space |
1237 | * continue search for next reservable space, | 1242 | * continue search for next reservable space, |
@@ -1514,10 +1519,6 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode, | |||
1514 | 1519 | ||
1515 | *errp = -ENOSPC; | 1520 | *errp = -ENOSPC; |
1516 | sb = inode->i_sb; | 1521 | sb = inode->i_sb; |
1517 | if (!sb) { | ||
1518 | printk("ext3_new_block: nonexistent device"); | ||
1519 | return 0; | ||
1520 | } | ||
1521 | 1522 | ||
1522 | /* | 1523 | /* |
1523 | * Check quota for allocation of this block. | 1524 | * Check quota for allocation of this block. |
@@ -1528,8 +1529,10 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode, | |||
1528 | return 0; | 1529 | return 0; |
1529 | } | 1530 | } |
1530 | 1531 | ||
1532 | trace_ext3_request_blocks(inode, goal, num); | ||
1533 | |||
1531 | sbi = EXT3_SB(sb); | 1534 | sbi = EXT3_SB(sb); |
1532 | es = EXT3_SB(sb)->s_es; | 1535 | es = sbi->s_es; |
1533 | ext3_debug("goal=%lu.\n", goal); | 1536 | ext3_debug("goal=%lu.\n", goal); |
1534 | /* | 1537 | /* |
1535 | * Allocate a block from reservation only when | 1538 | * Allocate a block from reservation only when |
@@ -1742,6 +1745,10 @@ allocated: | |||
1742 | brelse(bitmap_bh); | 1745 | brelse(bitmap_bh); |
1743 | dquot_free_block(inode, *count-num); | 1746 | dquot_free_block(inode, *count-num); |
1744 | *count = num; | 1747 | *count = num; |
1748 | |||
1749 | trace_ext3_allocate_blocks(inode, goal, num, | ||
1750 | (unsigned long long)ret_block); | ||
1751 | |||
1745 | return ret_block; | 1752 | return ret_block; |
1746 | 1753 | ||
1747 | io_error: | 1754 | io_error: |
@@ -1996,6 +2003,7 @@ ext3_grpblk_t ext3_trim_all_free(struct super_block *sb, unsigned int group, | |||
1996 | if ((next - start) < minblocks) | 2003 | if ((next - start) < minblocks) |
1997 | goto free_extent; | 2004 | goto free_extent; |
1998 | 2005 | ||
2006 | trace_ext3_discard_blocks(sb, discard_block, next - start); | ||
1999 | /* Send the TRIM command down to the device */ | 2007 | /* Send the TRIM command down to the device */ |
2000 | err = sb_issue_discard(sb, discard_block, next - start, | 2008 | err = sb_issue_discard(sb, discard_block, next - start, |
2001 | GFP_NOFS, 0); | 2009 | GFP_NOFS, 0); |
diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c index 09b13bb34c94..06a4394d2bc3 100644 --- a/fs/ext3/fsync.c +++ b/fs/ext3/fsync.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/jbd.h> | 30 | #include <linux/jbd.h> |
31 | #include <linux/ext3_fs.h> | 31 | #include <linux/ext3_fs.h> |
32 | #include <linux/ext3_jbd.h> | 32 | #include <linux/ext3_jbd.h> |
33 | #include <trace/events/ext3.h> | ||
33 | 34 | ||
34 | /* | 35 | /* |
35 | * akpm: A new design for ext3_sync_file(). | 36 | * akpm: A new design for ext3_sync_file(). |
@@ -51,10 +52,13 @@ int ext3_sync_file(struct file *file, int datasync) | |||
51 | int ret, needs_barrier = 0; | 52 | int ret, needs_barrier = 0; |
52 | tid_t commit_tid; | 53 | tid_t commit_tid; |
53 | 54 | ||
55 | J_ASSERT(ext3_journal_current_handle() == NULL); | ||
56 | |||
57 | trace_ext3_sync_file_enter(file, datasync); | ||
58 | |||
54 | if (inode->i_sb->s_flags & MS_RDONLY) | 59 | if (inode->i_sb->s_flags & MS_RDONLY) |
55 | return 0; | 60 | return 0; |
56 | 61 | ||
57 | J_ASSERT(ext3_journal_current_handle() == NULL); | ||
58 | 62 | ||
59 | /* | 63 | /* |
60 | * data=writeback,ordered: | 64 | * data=writeback,ordered: |
@@ -70,8 +74,10 @@ int ext3_sync_file(struct file *file, int datasync) | |||
70 | * (they were dirtied by commit). But that's OK - the blocks are | 74 | * (they were dirtied by commit). But that's OK - the blocks are |
71 | * safe in-journal, which is all fsync() needs to ensure. | 75 | * safe in-journal, which is all fsync() needs to ensure. |
72 | */ | 76 | */ |
73 | if (ext3_should_journal_data(inode)) | 77 | if (ext3_should_journal_data(inode)) { |
74 | return ext3_force_commit(inode->i_sb); | 78 | ret = ext3_force_commit(inode->i_sb); |
79 | goto out; | ||
80 | } | ||
75 | 81 | ||
76 | if (datasync) | 82 | if (datasync) |
77 | commit_tid = atomic_read(&ei->i_datasync_tid); | 83 | commit_tid = atomic_read(&ei->i_datasync_tid); |
@@ -91,5 +97,8 @@ int ext3_sync_file(struct file *file, int datasync) | |||
91 | */ | 97 | */ |
92 | if (needs_barrier) | 98 | if (needs_barrier) |
93 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); | 99 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); |
100 | |||
101 | out: | ||
102 | trace_ext3_sync_file_exit(inode, ret); | ||
94 | return ret; | 103 | return ret; |
95 | } | 104 | } |
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c index bfc2dc43681d..bf09cbf938cc 100644 --- a/fs/ext3/ialloc.c +++ b/fs/ext3/ialloc.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/buffer_head.h> | 23 | #include <linux/buffer_head.h> |
24 | #include <linux/random.h> | 24 | #include <linux/random.h> |
25 | #include <linux/bitops.h> | 25 | #include <linux/bitops.h> |
26 | #include <trace/events/ext3.h> | ||
26 | 27 | ||
27 | #include <asm/byteorder.h> | 28 | #include <asm/byteorder.h> |
28 | 29 | ||
@@ -118,6 +119,7 @@ void ext3_free_inode (handle_t *handle, struct inode * inode) | |||
118 | 119 | ||
119 | ino = inode->i_ino; | 120 | ino = inode->i_ino; |
120 | ext3_debug ("freeing inode %lu\n", ino); | 121 | ext3_debug ("freeing inode %lu\n", ino); |
122 | trace_ext3_free_inode(inode); | ||
121 | 123 | ||
122 | is_directory = S_ISDIR(inode->i_mode); | 124 | is_directory = S_ISDIR(inode->i_mode); |
123 | 125 | ||
@@ -426,6 +428,7 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, | |||
426 | return ERR_PTR(-EPERM); | 428 | return ERR_PTR(-EPERM); |
427 | 429 | ||
428 | sb = dir->i_sb; | 430 | sb = dir->i_sb; |
431 | trace_ext3_request_inode(dir, mode); | ||
429 | inode = new_inode(sb); | 432 | inode = new_inode(sb); |
430 | if (!inode) | 433 | if (!inode) |
431 | return ERR_PTR(-ENOMEM); | 434 | return ERR_PTR(-ENOMEM); |
@@ -601,6 +604,7 @@ got: | |||
601 | } | 604 | } |
602 | 605 | ||
603 | ext3_debug("allocating inode %lu\n", inode->i_ino); | 606 | ext3_debug("allocating inode %lu\n", inode->i_ino); |
607 | trace_ext3_allocate_inode(inode, dir, mode); | ||
604 | goto really_out; | 608 | goto really_out; |
605 | fail: | 609 | fail: |
606 | ext3_std_error(sb, err); | 610 | ext3_std_error(sb, err); |
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 3451d23c3bae..3aa05eebe0b8 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/bio.h> | 38 | #include <linux/bio.h> |
39 | #include <linux/fiemap.h> | 39 | #include <linux/fiemap.h> |
40 | #include <linux/namei.h> | 40 | #include <linux/namei.h> |
41 | #include <trace/events/ext3.h> | ||
41 | #include "xattr.h" | 42 | #include "xattr.h" |
42 | #include "acl.h" | 43 | #include "acl.h" |
43 | 44 | ||
@@ -70,6 +71,7 @@ int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode, | |||
70 | 71 | ||
71 | might_sleep(); | 72 | might_sleep(); |
72 | 73 | ||
74 | trace_ext3_forget(inode, is_metadata, blocknr); | ||
73 | BUFFER_TRACE(bh, "enter"); | 75 | BUFFER_TRACE(bh, "enter"); |
74 | 76 | ||
75 | jbd_debug(4, "forgetting bh %p: is_metadata = %d, mode %o, " | 77 | jbd_debug(4, "forgetting bh %p: is_metadata = %d, mode %o, " |
@@ -198,6 +200,7 @@ void ext3_evict_inode (struct inode *inode) | |||
198 | handle_t *handle; | 200 | handle_t *handle; |
199 | int want_delete = 0; | 201 | int want_delete = 0; |
200 | 202 | ||
203 | trace_ext3_evict_inode(inode); | ||
201 | if (!inode->i_nlink && !is_bad_inode(inode)) { | 204 | if (!inode->i_nlink && !is_bad_inode(inode)) { |
202 | dquot_initialize(inode); | 205 | dquot_initialize(inode); |
203 | want_delete = 1; | 206 | want_delete = 1; |
@@ -842,6 +845,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | |||
842 | ext3_fsblk_t first_block = 0; | 845 | ext3_fsblk_t first_block = 0; |
843 | 846 | ||
844 | 847 | ||
848 | trace_ext3_get_blocks_enter(inode, iblock, maxblocks, create); | ||
845 | J_ASSERT(handle != NULL || create == 0); | 849 | J_ASSERT(handle != NULL || create == 0); |
846 | depth = ext3_block_to_path(inode,iblock,offsets,&blocks_to_boundary); | 850 | depth = ext3_block_to_path(inode,iblock,offsets,&blocks_to_boundary); |
847 | 851 | ||
@@ -970,6 +974,9 @@ cleanup: | |||
970 | } | 974 | } |
971 | BUFFER_TRACE(bh_result, "returned"); | 975 | BUFFER_TRACE(bh_result, "returned"); |
972 | out: | 976 | out: |
977 | trace_ext3_get_blocks_exit(inode, iblock, | ||
978 | depth ? le32_to_cpu(chain[depth-1].key) : 0, | ||
979 | count, err); | ||
973 | return err; | 980 | return err; |
974 | } | 981 | } |
975 | 982 | ||
@@ -1217,6 +1224,8 @@ static int ext3_write_begin(struct file *file, struct address_space *mapping, | |||
1217 | * we allocate blocks but write fails for some reason */ | 1224 | * we allocate blocks but write fails for some reason */ |
1218 | int needed_blocks = ext3_writepage_trans_blocks(inode) + 1; | 1225 | int needed_blocks = ext3_writepage_trans_blocks(inode) + 1; |
1219 | 1226 | ||
1227 | trace_ext3_write_begin(inode, pos, len, flags); | ||
1228 | |||
1220 | index = pos >> PAGE_CACHE_SHIFT; | 1229 | index = pos >> PAGE_CACHE_SHIFT; |
1221 | from = pos & (PAGE_CACHE_SIZE - 1); | 1230 | from = pos & (PAGE_CACHE_SIZE - 1); |
1222 | to = from + len; | 1231 | to = from + len; |
@@ -1332,6 +1341,7 @@ static int ext3_ordered_write_end(struct file *file, | |||
1332 | unsigned from, to; | 1341 | unsigned from, to; |
1333 | int ret = 0, ret2; | 1342 | int ret = 0, ret2; |
1334 | 1343 | ||
1344 | trace_ext3_ordered_write_end(inode, pos, len, copied); | ||
1335 | copied = block_write_end(file, mapping, pos, len, copied, page, fsdata); | 1345 | copied = block_write_end(file, mapping, pos, len, copied, page, fsdata); |
1336 | 1346 | ||
1337 | from = pos & (PAGE_CACHE_SIZE - 1); | 1347 | from = pos & (PAGE_CACHE_SIZE - 1); |
@@ -1367,6 +1377,7 @@ static int ext3_writeback_write_end(struct file *file, | |||
1367 | struct inode *inode = file->f_mapping->host; | 1377 | struct inode *inode = file->f_mapping->host; |
1368 | int ret; | 1378 | int ret; |
1369 | 1379 | ||
1380 | trace_ext3_writeback_write_end(inode, pos, len, copied); | ||
1370 | copied = block_write_end(file, mapping, pos, len, copied, page, fsdata); | 1381 | copied = block_write_end(file, mapping, pos, len, copied, page, fsdata); |
1371 | update_file_sizes(inode, pos, copied); | 1382 | update_file_sizes(inode, pos, copied); |
1372 | /* | 1383 | /* |
@@ -1395,6 +1406,7 @@ static int ext3_journalled_write_end(struct file *file, | |||
1395 | int partial = 0; | 1406 | int partial = 0; |
1396 | unsigned from, to; | 1407 | unsigned from, to; |
1397 | 1408 | ||
1409 | trace_ext3_journalled_write_end(inode, pos, len, copied); | ||
1398 | from = pos & (PAGE_CACHE_SIZE - 1); | 1410 | from = pos & (PAGE_CACHE_SIZE - 1); |
1399 | to = from + len; | 1411 | to = from + len; |
1400 | 1412 | ||
@@ -1577,6 +1589,7 @@ static int ext3_ordered_writepage(struct page *page, | |||
1577 | if (ext3_journal_current_handle()) | 1589 | if (ext3_journal_current_handle()) |
1578 | goto out_fail; | 1590 | goto out_fail; |
1579 | 1591 | ||
1592 | trace_ext3_ordered_writepage(page); | ||
1580 | if (!page_has_buffers(page)) { | 1593 | if (!page_has_buffers(page)) { |
1581 | create_empty_buffers(page, inode->i_sb->s_blocksize, | 1594 | create_empty_buffers(page, inode->i_sb->s_blocksize, |
1582 | (1 << BH_Dirty)|(1 << BH_Uptodate)); | 1595 | (1 << BH_Dirty)|(1 << BH_Uptodate)); |
@@ -1647,6 +1660,7 @@ static int ext3_writeback_writepage(struct page *page, | |||
1647 | if (ext3_journal_current_handle()) | 1660 | if (ext3_journal_current_handle()) |
1648 | goto out_fail; | 1661 | goto out_fail; |
1649 | 1662 | ||
1663 | trace_ext3_writeback_writepage(page); | ||
1650 | if (page_has_buffers(page)) { | 1664 | if (page_has_buffers(page)) { |
1651 | if (!walk_page_buffers(NULL, page_buffers(page), 0, | 1665 | if (!walk_page_buffers(NULL, page_buffers(page), 0, |
1652 | PAGE_CACHE_SIZE, NULL, buffer_unmapped)) { | 1666 | PAGE_CACHE_SIZE, NULL, buffer_unmapped)) { |
@@ -1689,6 +1703,7 @@ static int ext3_journalled_writepage(struct page *page, | |||
1689 | if (ext3_journal_current_handle()) | 1703 | if (ext3_journal_current_handle()) |
1690 | goto no_write; | 1704 | goto no_write; |
1691 | 1705 | ||
1706 | trace_ext3_journalled_writepage(page); | ||
1692 | handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode)); | 1707 | handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode)); |
1693 | if (IS_ERR(handle)) { | 1708 | if (IS_ERR(handle)) { |
1694 | ret = PTR_ERR(handle); | 1709 | ret = PTR_ERR(handle); |
@@ -1739,6 +1754,7 @@ out_unlock: | |||
1739 | 1754 | ||
1740 | static int ext3_readpage(struct file *file, struct page *page) | 1755 | static int ext3_readpage(struct file *file, struct page *page) |
1741 | { | 1756 | { |
1757 | trace_ext3_readpage(page); | ||
1742 | return mpage_readpage(page, ext3_get_block); | 1758 | return mpage_readpage(page, ext3_get_block); |
1743 | } | 1759 | } |
1744 | 1760 | ||
@@ -1753,6 +1769,8 @@ static void ext3_invalidatepage(struct page *page, unsigned long offset) | |||
1753 | { | 1769 | { |
1754 | journal_t *journal = EXT3_JOURNAL(page->mapping->host); | 1770 | journal_t *journal = EXT3_JOURNAL(page->mapping->host); |
1755 | 1771 | ||
1772 | trace_ext3_invalidatepage(page, offset); | ||
1773 | |||
1756 | /* | 1774 | /* |
1757 | * If it's a full truncate we just forget about the pending dirtying | 1775 | * If it's a full truncate we just forget about the pending dirtying |
1758 | */ | 1776 | */ |
@@ -1766,6 +1784,7 @@ static int ext3_releasepage(struct page *page, gfp_t wait) | |||
1766 | { | 1784 | { |
1767 | journal_t *journal = EXT3_JOURNAL(page->mapping->host); | 1785 | journal_t *journal = EXT3_JOURNAL(page->mapping->host); |
1768 | 1786 | ||
1787 | trace_ext3_releasepage(page); | ||
1769 | WARN_ON(PageChecked(page)); | 1788 | WARN_ON(PageChecked(page)); |
1770 | if (!page_has_buffers(page)) | 1789 | if (!page_has_buffers(page)) |
1771 | return 0; | 1790 | return 0; |
@@ -1794,6 +1813,8 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, | |||
1794 | size_t count = iov_length(iov, nr_segs); | 1813 | size_t count = iov_length(iov, nr_segs); |
1795 | int retries = 0; | 1814 | int retries = 0; |
1796 | 1815 | ||
1816 | trace_ext3_direct_IO_enter(inode, offset, iov_length(iov, nr_segs), rw); | ||
1817 | |||
1797 | if (rw == WRITE) { | 1818 | if (rw == WRITE) { |
1798 | loff_t final_size = offset + count; | 1819 | loff_t final_size = offset + count; |
1799 | 1820 | ||
@@ -1868,6 +1889,8 @@ retry: | |||
1868 | ret = err; | 1889 | ret = err; |
1869 | } | 1890 | } |
1870 | out: | 1891 | out: |
1892 | trace_ext3_direct_IO_exit(inode, offset, | ||
1893 | iov_length(iov, nr_segs), rw, ret); | ||
1871 | return ret; | 1894 | return ret; |
1872 | } | 1895 | } |
1873 | 1896 | ||
@@ -2446,6 +2469,8 @@ void ext3_truncate(struct inode *inode) | |||
2446 | unsigned blocksize = inode->i_sb->s_blocksize; | 2469 | unsigned blocksize = inode->i_sb->s_blocksize; |
2447 | struct page *page; | 2470 | struct page *page; |
2448 | 2471 | ||
2472 | trace_ext3_truncate_enter(inode); | ||
2473 | |||
2449 | if (!ext3_can_truncate(inode)) | 2474 | if (!ext3_can_truncate(inode)) |
2450 | goto out_notrans; | 2475 | goto out_notrans; |
2451 | 2476 | ||
@@ -2597,6 +2622,7 @@ out_stop: | |||
2597 | ext3_orphan_del(handle, inode); | 2622 | ext3_orphan_del(handle, inode); |
2598 | 2623 | ||
2599 | ext3_journal_stop(handle); | 2624 | ext3_journal_stop(handle); |
2625 | trace_ext3_truncate_exit(inode); | ||
2600 | return; | 2626 | return; |
2601 | out_notrans: | 2627 | out_notrans: |
2602 | /* | 2628 | /* |
@@ -2605,6 +2631,7 @@ out_notrans: | |||
2605 | */ | 2631 | */ |
2606 | if (inode->i_nlink) | 2632 | if (inode->i_nlink) |
2607 | ext3_orphan_del(NULL, inode); | 2633 | ext3_orphan_del(NULL, inode); |
2634 | trace_ext3_truncate_exit(inode); | ||
2608 | } | 2635 | } |
2609 | 2636 | ||
2610 | static ext3_fsblk_t ext3_get_inode_block(struct super_block *sb, | 2637 | static ext3_fsblk_t ext3_get_inode_block(struct super_block *sb, |
@@ -2746,6 +2773,7 @@ make_io: | |||
2746 | * has in-inode xattrs, or we don't have this inode in memory. | 2773 | * has in-inode xattrs, or we don't have this inode in memory. |
2747 | * Read the block from disk. | 2774 | * Read the block from disk. |
2748 | */ | 2775 | */ |
2776 | trace_ext3_load_inode(inode); | ||
2749 | get_bh(bh); | 2777 | get_bh(bh); |
2750 | bh->b_end_io = end_buffer_read_sync; | 2778 | bh->b_end_io = end_buffer_read_sync; |
2751 | submit_bh(READ_META, bh); | 2779 | submit_bh(READ_META, bh); |
@@ -3372,6 +3400,7 @@ int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode) | |||
3372 | int err; | 3400 | int err; |
3373 | 3401 | ||
3374 | might_sleep(); | 3402 | might_sleep(); |
3403 | trace_ext3_mark_inode_dirty(inode, _RET_IP_); | ||
3375 | err = ext3_reserve_inode_write(handle, inode, &iloc); | 3404 | err = ext3_reserve_inode_write(handle, inode, &iloc); |
3376 | if (!err) | 3405 | if (!err) |
3377 | err = ext3_mark_iloc_dirty(handle, inode, &iloc); | 3406 | err = ext3_mark_iloc_dirty(handle, inode, &iloc); |
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 34b6d9bfc48a..51736a4ff0cd 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/quotaops.h> | 36 | #include <linux/quotaops.h> |
37 | #include <linux/buffer_head.h> | 37 | #include <linux/buffer_head.h> |
38 | #include <linux/bio.h> | 38 | #include <linux/bio.h> |
39 | #include <trace/events/ext3.h> | ||
39 | 40 | ||
40 | #include "namei.h" | 41 | #include "namei.h" |
41 | #include "xattr.h" | 42 | #include "xattr.h" |
@@ -2144,6 +2145,7 @@ static int ext3_unlink(struct inode * dir, struct dentry *dentry) | |||
2144 | struct ext3_dir_entry_2 * de; | 2145 | struct ext3_dir_entry_2 * de; |
2145 | handle_t *handle; | 2146 | handle_t *handle; |
2146 | 2147 | ||
2148 | trace_ext3_unlink_enter(dir, dentry); | ||
2147 | /* Initialize quotas before so that eventual writes go | 2149 | /* Initialize quotas before so that eventual writes go |
2148 | * in separate transaction */ | 2150 | * in separate transaction */ |
2149 | dquot_initialize(dir); | 2151 | dquot_initialize(dir); |
@@ -2189,6 +2191,7 @@ static int ext3_unlink(struct inode * dir, struct dentry *dentry) | |||
2189 | end_unlink: | 2191 | end_unlink: |
2190 | ext3_journal_stop(handle); | 2192 | ext3_journal_stop(handle); |
2191 | brelse (bh); | 2193 | brelse (bh); |
2194 | trace_ext3_unlink_exit(dentry, retval); | ||
2192 | return retval; | 2195 | return retval; |
2193 | } | 2196 | } |
2194 | 2197 | ||
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index aad153ef6b78..662290fb6fff 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -44,6 +44,9 @@ | |||
44 | #include "acl.h" | 44 | #include "acl.h" |
45 | #include "namei.h" | 45 | #include "namei.h" |
46 | 46 | ||
47 | #define CREATE_TRACE_POINTS | ||
48 | #include <trace/events/ext3.h> | ||
49 | |||
47 | #ifdef CONFIG_EXT3_DEFAULTS_TO_ORDERED | 50 | #ifdef CONFIG_EXT3_DEFAULTS_TO_ORDERED |
48 | #define EXT3_MOUNT_DEFAULT_DATA_MODE EXT3_MOUNT_ORDERED_DATA | 51 | #define EXT3_MOUNT_DEFAULT_DATA_MODE EXT3_MOUNT_ORDERED_DATA |
49 | #else | 52 | #else |
@@ -497,6 +500,14 @@ static struct inode *ext3_alloc_inode(struct super_block *sb) | |||
497 | return &ei->vfs_inode; | 500 | return &ei->vfs_inode; |
498 | } | 501 | } |
499 | 502 | ||
503 | static int ext3_drop_inode(struct inode *inode) | ||
504 | { | ||
505 | int drop = generic_drop_inode(inode); | ||
506 | |||
507 | trace_ext3_drop_inode(inode, drop); | ||
508 | return drop; | ||
509 | } | ||
510 | |||
500 | static void ext3_i_callback(struct rcu_head *head) | 511 | static void ext3_i_callback(struct rcu_head *head) |
501 | { | 512 | { |
502 | struct inode *inode = container_of(head, struct inode, i_rcu); | 513 | struct inode *inode = container_of(head, struct inode, i_rcu); |
@@ -788,6 +799,7 @@ static const struct super_operations ext3_sops = { | |||
788 | .destroy_inode = ext3_destroy_inode, | 799 | .destroy_inode = ext3_destroy_inode, |
789 | .write_inode = ext3_write_inode, | 800 | .write_inode = ext3_write_inode, |
790 | .dirty_inode = ext3_dirty_inode, | 801 | .dirty_inode = ext3_dirty_inode, |
802 | .drop_inode = ext3_drop_inode, | ||
791 | .evict_inode = ext3_evict_inode, | 803 | .evict_inode = ext3_evict_inode, |
792 | .put_super = ext3_put_super, | 804 | .put_super = ext3_put_super, |
793 | .sync_fs = ext3_sync_fs, | 805 | .sync_fs = ext3_sync_fs, |
@@ -2507,6 +2519,7 @@ static int ext3_sync_fs(struct super_block *sb, int wait) | |||
2507 | { | 2519 | { |
2508 | tid_t target; | 2520 | tid_t target; |
2509 | 2521 | ||
2522 | trace_ext3_sync_fs(sb, wait); | ||
2510 | if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) { | 2523 | if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) { |
2511 | if (wait) | 2524 | if (wait) |
2512 | log_wait_commit(EXT3_SB(sb)->s_journal, target); | 2525 | log_wait_commit(EXT3_SB(sb)->s_journal, target); |