Commit 785c4bcc authored by Lukas Czerner's avatar Lukas Czerner Committed by Jan Kara

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: default avatarLukas Czerner <lczerner@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 5220cc93
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/quotaops.h> #include <linux/quotaops.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <trace/events/ext3.h>
/* /*
* balloc.c contains the blocks allocation and deallocation routines * 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,6 +162,7 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group)
desc = ext3_get_group_desc(sb, block_group, NULL); desc = ext3_get_group_desc(sb, block_group, NULL);
if (!desc) if (!desc)
return NULL; return NULL;
trace_ext3_read_block_bitmap(sb, block_group);
bitmap_blk = le32_to_cpu(desc->bg_block_bitmap); bitmap_blk = le32_to_cpu(desc->bg_block_bitmap);
bh = sb_getblk(sb, bitmap_blk); bh = sb_getblk(sb, bitmap_blk);
if (unlikely(!bh)) { if (unlikely(!bh)) {
...@@ -351,6 +353,7 @@ void ext3_rsv_window_add(struct super_block *sb, ...@@ -351,6 +353,7 @@ void ext3_rsv_window_add(struct super_block *sb,
struct rb_node * parent = NULL; struct rb_node * parent = NULL;
struct ext3_reserve_window_node *this; struct ext3_reserve_window_node *this;
trace_ext3_rsv_window_add(sb, rsv);
while (*p) while (*p)
{ {
parent = *p; parent = *p;
...@@ -476,8 +479,10 @@ void ext3_discard_reservation(struct inode *inode) ...@@ -476,8 +479,10 @@ void ext3_discard_reservation(struct inode *inode)
rsv = &block_i->rsv_window_node; rsv = &block_i->rsv_window_node;
if (!rsv_is_empty(&rsv->rsv_window)) { if (!rsv_is_empty(&rsv->rsv_window)) {
spin_lock(rsv_lock); spin_lock(rsv_lock);
if (!rsv_is_empty(&rsv->rsv_window)) if (!rsv_is_empty(&rsv->rsv_window)) {
trace_ext3_discard_reservation(inode, rsv);
rsv_window_remove(inode->i_sb, rsv); rsv_window_remove(inode->i_sb, rsv);
}
spin_unlock(rsv_lock); spin_unlock(rsv_lock);
} }
} }
...@@ -683,14 +688,10 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb, ...@@ -683,14 +688,10 @@ void ext3_free_blocks_sb(handle_t *handle, struct super_block *sb,
void ext3_free_blocks(handle_t *handle, struct inode *inode, void ext3_free_blocks(handle_t *handle, struct inode *inode,
ext3_fsblk_t block, unsigned long count) ext3_fsblk_t block, unsigned long count)
{ {
struct super_block * sb; struct super_block *sb = inode->i_sb;
unsigned long dquot_freed_blocks; unsigned long dquot_freed_blocks;
sb = inode->i_sb; trace_ext3_free_blocks(inode, block, count);
if (!sb) {
printk ("ext3_free_blocks: nonexistent device");
return;
}
ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks); ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks);
if (dquot_freed_blocks) if (dquot_freed_blocks)
dquot_free_block(inode, dquot_freed_blocks); dquot_free_block(inode, dquot_freed_blocks);
...@@ -1136,6 +1137,7 @@ static int alloc_new_reservation(struct ext3_reserve_window_node *my_rsv, ...@@ -1136,6 +1137,7 @@ static int alloc_new_reservation(struct ext3_reserve_window_node *my_rsv,
else else
start_block = grp_goal + group_first_block; start_block = grp_goal + group_first_block;
trace_ext3_alloc_new_reservation(sb, start_block);
size = my_rsv->rsv_goal_size; size = my_rsv->rsv_goal_size;
if (!rsv_is_empty(&my_rsv->rsv_window)) { if (!rsv_is_empty(&my_rsv->rsv_window)) {
...@@ -1230,8 +1232,11 @@ static int alloc_new_reservation(struct ext3_reserve_window_node *my_rsv, ...@@ -1230,8 +1232,11 @@ static int alloc_new_reservation(struct ext3_reserve_window_node *my_rsv,
* check if the first free block is within the * check if the first free block is within the
* free space we just reserved * free space we just reserved
*/ */
if (start_block >= my_rsv->rsv_start && start_block <= my_rsv->rsv_end) if (start_block >= my_rsv->rsv_start &&
start_block <= my_rsv->rsv_end) {
trace_ext3_reserved(sb, start_block, my_rsv);
return 0; /* success */ return 0; /* success */
}
/* /*
* if the first free bit we found is out of the reservable space * if the first free bit we found is out of the reservable space
* continue search for next reservable space, * continue search for next reservable space,
...@@ -1514,10 +1519,6 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode, ...@@ -1514,10 +1519,6 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
*errp = -ENOSPC; *errp = -ENOSPC;
sb = inode->i_sb; sb = inode->i_sb;
if (!sb) {
printk("ext3_new_block: nonexistent device");
return 0;
}
/* /*
* Check quota for allocation of this block. * Check quota for allocation of this block.
...@@ -1528,8 +1529,10 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode, ...@@ -1528,8 +1529,10 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
return 0; return 0;
} }
trace_ext3_request_blocks(inode, goal, num);
sbi = EXT3_SB(sb); sbi = EXT3_SB(sb);
es = EXT3_SB(sb)->s_es; es = sbi->s_es;
ext3_debug("goal=%lu.\n", goal); ext3_debug("goal=%lu.\n", goal);
/* /*
* Allocate a block from reservation only when * Allocate a block from reservation only when
...@@ -1742,6 +1745,10 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode, ...@@ -1742,6 +1745,10 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
brelse(bitmap_bh); brelse(bitmap_bh);
dquot_free_block(inode, *count-num); dquot_free_block(inode, *count-num);
*count = num; *count = num;
trace_ext3_allocate_blocks(inode, goal, num,
(unsigned long long)ret_block);
return ret_block; return ret_block;
io_error: io_error:
...@@ -1996,6 +2003,7 @@ ext3_grpblk_t ext3_trim_all_free(struct super_block *sb, unsigned int group, ...@@ -1996,6 +2003,7 @@ ext3_grpblk_t ext3_trim_all_free(struct super_block *sb, unsigned int group,
if ((next - start) < minblocks) if ((next - start) < minblocks)
goto free_extent; goto free_extent;
trace_ext3_discard_blocks(sb, discard_block, next - start);
/* Send the TRIM command down to the device */ /* Send the TRIM command down to the device */
err = sb_issue_discard(sb, discard_block, next - start, err = sb_issue_discard(sb, discard_block, next - start,
GFP_NOFS, 0); GFP_NOFS, 0);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/jbd.h> #include <linux/jbd.h>
#include <linux/ext3_fs.h> #include <linux/ext3_fs.h>
#include <linux/ext3_jbd.h> #include <linux/ext3_jbd.h>
#include <trace/events/ext3.h>
/* /*
* akpm: A new design for ext3_sync_file(). * akpm: A new design for ext3_sync_file().
...@@ -51,10 +52,13 @@ int ext3_sync_file(struct file *file, int datasync) ...@@ -51,10 +52,13 @@ int ext3_sync_file(struct file *file, int datasync)
int ret, needs_barrier = 0; int ret, needs_barrier = 0;
tid_t commit_tid; tid_t commit_tid;
J_ASSERT(ext3_journal_current_handle() == NULL);
trace_ext3_sync_file_enter(file, datasync);
if (inode->i_sb->s_flags & MS_RDONLY) if (inode->i_sb->s_flags & MS_RDONLY)
return 0; return 0;
J_ASSERT(ext3_journal_current_handle() == NULL);
/* /*
* data=writeback,ordered: * data=writeback,ordered:
...@@ -70,8 +74,10 @@ int ext3_sync_file(struct file *file, int datasync) ...@@ -70,8 +74,10 @@ int ext3_sync_file(struct file *file, int datasync)
* (they were dirtied by commit). But that's OK - the blocks are * (they were dirtied by commit). But that's OK - the blocks are
* safe in-journal, which is all fsync() needs to ensure. * safe in-journal, which is all fsync() needs to ensure.
*/ */
if (ext3_should_journal_data(inode)) if (ext3_should_journal_data(inode)) {
return ext3_force_commit(inode->i_sb); ret = ext3_force_commit(inode->i_sb);
goto out;
}
if (datasync) if (datasync)
commit_tid = atomic_read(&ei->i_datasync_tid); commit_tid = atomic_read(&ei->i_datasync_tid);
...@@ -91,5 +97,8 @@ int ext3_sync_file(struct file *file, int datasync) ...@@ -91,5 +97,8 @@ int ext3_sync_file(struct file *file, int datasync)
*/ */
if (needs_barrier) if (needs_barrier)
blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
out:
trace_ext3_sync_file_exit(inode, ret);
return ret; return ret;
} }
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <trace/events/ext3.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
...@@ -118,6 +119,7 @@ void ext3_free_inode (handle_t *handle, struct inode * inode) ...@@ -118,6 +119,7 @@ void ext3_free_inode (handle_t *handle, struct inode * inode)
ino = inode->i_ino; ino = inode->i_ino;
ext3_debug ("freeing inode %lu\n", ino); ext3_debug ("freeing inode %lu\n", ino);
trace_ext3_free_inode(inode);
is_directory = S_ISDIR(inode->i_mode); is_directory = S_ISDIR(inode->i_mode);
...@@ -426,6 +428,7 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, ...@@ -426,6 +428,7 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir,
return ERR_PTR(-EPERM); return ERR_PTR(-EPERM);
sb = dir->i_sb; sb = dir->i_sb;
trace_ext3_request_inode(dir, mode);
inode = new_inode(sb); inode = new_inode(sb);
if (!inode) if (!inode)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -601,6 +604,7 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, ...@@ -601,6 +604,7 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir,
} }
ext3_debug("allocating inode %lu\n", inode->i_ino); ext3_debug("allocating inode %lu\n", inode->i_ino);
trace_ext3_allocate_inode(inode, dir, mode);
goto really_out; goto really_out;
fail: fail:
ext3_std_error(sb, err); ext3_std_error(sb, err);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/bio.h> #include <linux/bio.h>
#include <linux/fiemap.h> #include <linux/fiemap.h>
#include <linux/namei.h> #include <linux/namei.h>
#include <trace/events/ext3.h>
#include "xattr.h" #include "xattr.h"
#include "acl.h" #include "acl.h"
...@@ -70,6 +71,7 @@ int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode, ...@@ -70,6 +71,7 @@ int ext3_forget(handle_t *handle, int is_metadata, struct inode *inode,
might_sleep(); might_sleep();
trace_ext3_forget(inode, is_metadata, blocknr);
BUFFER_TRACE(bh, "enter"); BUFFER_TRACE(bh, "enter");
jbd_debug(4, "forgetting bh %p: is_metadata = %d, mode %o, " jbd_debug(4, "forgetting bh %p: is_metadata = %d, mode %o, "
...@@ -198,6 +200,7 @@ void ext3_evict_inode (struct inode *inode) ...@@ -198,6 +200,7 @@ void ext3_evict_inode (struct inode *inode)
handle_t *handle; handle_t *handle;
int want_delete = 0; int want_delete = 0;
trace_ext3_evict_inode(inode);
if (!inode->i_nlink && !is_bad_inode(inode)) { if (!inode->i_nlink && !is_bad_inode(inode)) {
dquot_initialize(inode); dquot_initialize(inode);
want_delete = 1; want_delete = 1;
...@@ -842,6 +845,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, ...@@ -842,6 +845,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
ext3_fsblk_t first_block = 0; ext3_fsblk_t first_block = 0;
trace_ext3_get_blocks_enter(inode, iblock, maxblocks, create);
J_ASSERT(handle != NULL || create == 0); J_ASSERT(handle != NULL || create == 0);
depth = ext3_block_to_path(inode,iblock,offsets,&blocks_to_boundary); depth = ext3_block_to_path(inode,iblock,offsets,&blocks_to_boundary);
...@@ -970,6 +974,9 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, ...@@ -970,6 +974,9 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
} }
BUFFER_TRACE(bh_result, "returned"); BUFFER_TRACE(bh_result, "returned");
out: out:
trace_ext3_get_blocks_exit(inode, iblock,
depth ? le32_to_cpu(chain[depth-1].key) : 0,
count, err);
return err; return err;
} }
...@@ -1217,6 +1224,8 @@ static int ext3_write_begin(struct file *file, struct address_space *mapping, ...@@ -1217,6 +1224,8 @@ static int ext3_write_begin(struct file *file, struct address_space *mapping,
* we allocate blocks but write fails for some reason */ * we allocate blocks but write fails for some reason */
int needed_blocks = ext3_writepage_trans_blocks(inode) + 1; int needed_blocks = ext3_writepage_trans_blocks(inode) + 1;
trace_ext3_write_begin(inode, pos, len, flags);
index = pos >> PAGE_CACHE_SHIFT; index = pos >> PAGE_CACHE_SHIFT;
from = pos & (PAGE_CACHE_SIZE - 1); from = pos & (PAGE_CACHE_SIZE - 1);
to = from + len; to = from + len;
...@@ -1332,6 +1341,7 @@ static int ext3_ordered_write_end(struct file *file, ...@@ -1332,6 +1341,7 @@ static int ext3_ordered_write_end(struct file *file,
unsigned from, to; unsigned from, to;
int ret = 0, ret2; int ret = 0, ret2;
trace_ext3_ordered_write_end(inode, pos, len, copied);
copied = block_write_end(file, mapping, pos, len, copied, page, fsdata); copied = block_write_end(file, mapping, pos, len, copied, page, fsdata);
from = pos & (PAGE_CACHE_SIZE - 1); from = pos & (PAGE_CACHE_SIZE - 1);
...@@ -1367,6 +1377,7 @@ static int ext3_writeback_write_end(struct file *file, ...@@ -1367,6 +1377,7 @@ static int ext3_writeback_write_end(struct file *file,
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
int ret; int ret;
trace_ext3_writeback_write_end(inode, pos, len, copied);
copied = block_write_end(file, mapping, pos, len, copied, page, fsdata); copied = block_write_end(file, mapping, pos, len, copied, page, fsdata);
update_file_sizes(inode, pos, copied); update_file_sizes(inode, pos, copied);
/* /*
...@@ -1395,6 +1406,7 @@ static int ext3_journalled_write_end(struct file *file, ...@@ -1395,6 +1406,7 @@ static int ext3_journalled_write_end(struct file *file,
int partial = 0; int partial = 0;
unsigned from, to; unsigned from, to;
trace_ext3_journalled_write_end(inode, pos, len, copied);
from = pos & (PAGE_CACHE_SIZE - 1); from = pos & (PAGE_CACHE_SIZE - 1);
to = from + len; to = from + len;
...@@ -1577,6 +1589,7 @@ static int ext3_ordered_writepage(struct page *page, ...@@ -1577,6 +1589,7 @@ static int ext3_ordered_writepage(struct page *page,
if (ext3_journal_current_handle()) if (ext3_journal_current_handle())
goto out_fail; goto out_fail;
trace_ext3_ordered_writepage(page);
if (!page_has_buffers(page)) { if (!page_has_buffers(page)) {
create_empty_buffers(page, inode->i_sb->s_blocksize, create_empty_buffers(page, inode->i_sb->s_blocksize,
(1 << BH_Dirty)|(1 << BH_Uptodate)); (1 << BH_Dirty)|(1 << BH_Uptodate));
...@@ -1647,6 +1660,7 @@ static int ext3_writeback_writepage(struct page *page, ...@@ -1647,6 +1660,7 @@ static int ext3_writeback_writepage(struct page *page,
if (ext3_journal_current_handle()) if (ext3_journal_current_handle())
goto out_fail; goto out_fail;
trace_ext3_writeback_writepage(page);
if (page_has_buffers(page)) { if (page_has_buffers(page)) {
if (!walk_page_buffers(NULL, page_buffers(page), 0, if (!walk_page_buffers(NULL, page_buffers(page), 0,
PAGE_CACHE_SIZE, NULL, buffer_unmapped)) { PAGE_CACHE_SIZE, NULL, buffer_unmapped)) {
...@@ -1689,6 +1703,7 @@ static int ext3_journalled_writepage(struct page *page, ...@@ -1689,6 +1703,7 @@ static int ext3_journalled_writepage(struct page *page,
if (ext3_journal_current_handle()) if (ext3_journal_current_handle())
goto no_write; goto no_write;
trace_ext3_journalled_writepage(page);
handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode)); handle = ext3_journal_start(inode, ext3_writepage_trans_blocks(inode));
if (IS_ERR(handle)) { if (IS_ERR(handle)) {
ret = PTR_ERR(handle); ret = PTR_ERR(handle);
...@@ -1739,6 +1754,7 @@ static int ext3_journalled_writepage(struct page *page, ...@@ -1739,6 +1754,7 @@ static int ext3_journalled_writepage(struct page *page,
static int ext3_readpage(struct file *file, struct page *page) static int ext3_readpage(struct file *file, struct page *page)
{ {
trace_ext3_readpage(page);
return mpage_readpage(page, ext3_get_block); return mpage_readpage(page, ext3_get_block);
} }
...@@ -1753,6 +1769,8 @@ static void ext3_invalidatepage(struct page *page, unsigned long offset) ...@@ -1753,6 +1769,8 @@ static void ext3_invalidatepage(struct page *page, unsigned long offset)
{ {
journal_t *journal = EXT3_JOURNAL(page->mapping->host); journal_t *journal = EXT3_JOURNAL(page->mapping->host);
trace_ext3_invalidatepage(page, offset);
/* /*
* If it's a full truncate we just forget about the pending dirtying * If it's a full truncate we just forget about the pending dirtying
*/ */
...@@ -1766,6 +1784,7 @@ static int ext3_releasepage(struct page *page, gfp_t wait) ...@@ -1766,6 +1784,7 @@ static int ext3_releasepage(struct page *page, gfp_t wait)
{ {
journal_t *journal = EXT3_JOURNAL(page->mapping->host); journal_t *journal = EXT3_JOURNAL(page->mapping->host);
trace_ext3_releasepage(page);
WARN_ON(PageChecked(page)); WARN_ON(PageChecked(page));
if (!page_has_buffers(page)) if (!page_has_buffers(page))
return 0; return 0;
...@@ -1794,6 +1813,8 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, ...@@ -1794,6 +1813,8 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
size_t count = iov_length(iov, nr_segs); size_t count = iov_length(iov, nr_segs);
int retries = 0; int retries = 0;
trace_ext3_direct_IO_enter(inode, offset, iov_length(iov, nr_segs), rw);
if (rw == WRITE) { if (rw == WRITE) {
loff_t final_size = offset + count; loff_t final_size = offset + count;
...@@ -1868,6 +1889,8 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb, ...@@ -1868,6 +1889,8 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
ret = err; ret = err;
} }
out: out:
trace_ext3_direct_IO_exit(inode, offset,
iov_length(iov, nr_segs), rw, ret);
return ret; return ret;
} }
...@@ -2446,6 +2469,8 @@ void ext3_truncate(struct inode *inode) ...@@ -2446,6 +2469,8 @@ void ext3_truncate(struct inode *inode)
unsigned blocksize = inode->i_sb->s_blocksize; unsigned blocksize = inode->i_sb->s_blocksize;
struct page *page; struct page *page;
trace_ext3_truncate_enter(inode);
if (!ext3_can_truncate(inode)) if (!ext3_can_truncate(inode))
goto out_notrans; goto out_notrans;
...@@ -2597,6 +2622,7 @@ void ext3_truncate(struct inode *inode) ...@@ -2597,6 +2622,7 @@ void ext3_truncate(struct inode *inode)
ext3_orphan_del(handle, inode); ext3_orphan_del(handle, inode);
ext3_journal_stop(handle); ext3_journal_stop(handle);
trace_ext3_truncate_exit(inode);
return; return;
out_notrans: out_notrans:
/* /*
...@@ -2605,6 +2631,7 @@ void ext3_truncate(struct inode *inode) ...@@ -2605,6 +2631,7 @@ void ext3_truncate(struct inode *inode)
*/ */
if (inode->i_nlink) if (inode->i_nlink)
ext3_orphan_del(NULL, inode); ext3_orphan_del(NULL, inode);
trace_ext3_truncate_exit(inode);
} }
static ext3_fsblk_t ext3_get_inode_block(struct super_block *sb, static ext3_fsblk_t ext3_get_inode_block(struct super_block *sb,
...@@ -2746,6 +2773,7 @@ static int __ext3_get_inode_loc(struct inode *inode, ...@@ -2746,6 +2773,7 @@ static int __ext3_get_inode_loc(struct inode *inode,
* has in-inode xattrs, or we don't have this inode in memory. * has in-inode xattrs, or we don't have this inode in memory.
* Read the block from disk. * Read the block from disk.
*/ */
trace_ext3_load_inode(inode);
get_bh(bh); get_bh(bh);
bh->b_end_io = end_buffer_read_sync; bh->b_end_io = end_buffer_read_sync;
submit_bh(READ_META, bh); submit_bh(READ_META, bh);
...@@ -3372,6 +3400,7 @@ int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode) ...@@ -3372,6 +3400,7 @@ int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode)
int err; int err;
might_sleep(); might_sleep();
trace_ext3_mark_inode_dirty(inode, _RET_IP_);
err = ext3_reserve_inode_write(handle, inode, &iloc); err = ext3_reserve_inode_write(handle, inode, &iloc);
if (!err) if (!err)
err = ext3_mark_iloc_dirty(handle, inode, &iloc); err = ext3_mark_iloc_dirty(handle, inode, &iloc);
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/quotaops.h> #include <linux/quotaops.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/bio.h> #include <linux/bio.h>
#include <trace/events/ext3.h>
#include "namei.h" #include "namei.h"
#include "xattr.h" #include "xattr.h"
...@@ -2144,6 +2145,7 @@ static int ext3_unlink(struct inode * dir, struct dentry *dentry) ...@@ -2144,6 +2145,7 @@ static int ext3_unlink(struct inode * dir, struct dentry *dentry)
struct ext3_dir_entry_2 * de; struct ext3_dir_entry_2 * de;
handle_t *handle; handle_t *handle;
trace_ext3_unlink_enter(dir, dentry);
/* Initialize quotas before so that eventual writes go /* Initialize quotas before so that eventual writes go
* in separate transaction */ * in separate transaction */
dquot_initialize(dir); dquot_initialize(dir);
...@@ -2189,6 +2191,7 @@ static int ext3_unlink(struct inode * dir, struct dentry *dentry) ...@@ -2189,6 +2191,7 @@ static int ext3_unlink(struct inode * dir, struct dentry *dentry)
end_unlink: end_unlink:
ext3_journal_stop(handle); ext3_journal_stop(handle);
brelse (bh); brelse (bh);
trace_ext3_unlink_exit(dentry, retval);
return retval; return retval;
} }
......
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
#include "acl.h" #include "acl.h"
#include "namei.h" #include "namei.h"
#define CREATE_TRACE_POINTS
#include <trace/events/ext3.h>
#ifdef CONFIG_EXT3_DEFAULTS_TO_ORDERED #ifdef CONFIG_EXT3_DEFAULTS_TO_ORDERED
#define EXT3_MOUNT_DEFAULT_DATA_MODE EXT3_MOUNT_ORDERED_DATA #define EXT3_MOUNT_DEFAULT_DATA_MODE EXT3_MOUNT_ORDERED_DATA
#else #else
...@@ -497,6 +500,14 @@ static struct inode *ext3_alloc_inode(struct super_block *sb) ...@@ -497,6 +500,14 @@ static struct inode *ext3_alloc_inode(struct super_block *sb)
return &ei->vfs_inode; return &ei->vfs_inode;
} }
static int ext3_drop_inode(struct inode *inode)
{
int drop = generic_drop_inode(inode);
trace_ext3_drop_inode(inode, drop);
return drop;
}
static void ext3_i_callback(struct rcu_head *head) static void ext3_i_callback(struct rcu_head *head)
{ {
struct inode *inode = container_of(head, struct inode, i_rcu); struct inode *inode = container_of(head, struct inode, i_rcu);
...@@ -788,6 +799,7 @@ static const struct super_operations ext3_sops = { ...@@ -788,6 +799,7 @@ static const struct super_operations ext3_sops = {
.destroy_inode = ext3_destroy_inode, .destroy_inode = ext3_destroy_inode,
.write_inode = ext3_write_inode, .write_inode = ext3_write_inode,
.dirty_inode = ext3_dirty_inode, .dirty_inode = ext3_dirty_inode,
.drop_inode = ext3_drop_inode,
.evict_inode = ext3_evict_inode, .evict_inode = ext3_evict_inode,
.put_super = ext3_put_super, .put_super = ext3_put_super,
.sync_fs = ext3_sync_fs, .sync_fs = ext3_sync_fs,
...@@ -2507,6 +2519,7 @@ static int ext3_sync_fs(struct super_block *sb, int wait) ...@@ -2507,6 +2519,7 @@ static int ext3_sync_fs(struct super_block *sb, int wait)
{ {
tid_t target; tid_t target;
trace_ext3_sync_fs(sb, wait);
if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) { if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) {
if (wait) if (wait)
log_wait_commit(EXT3_SB(sb)->s_journal, target); log_wait_commit(EXT3_SB(sb)->s_journal, target);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment