aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fs-writeback.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-01-11 16:06:37 -0500
committerJens Axboe <axboe@kernel.dk>2013-01-14 09:00:36 -0500
commit9fb0a7da0c528d9bd49b597aa63b1fe2216c7203 (patch)
tree146b065709010fd41f4a48e8a494b65b965fc0e8 /fs/fs-writeback.c
parent5305cb830834549b9203ad4d009ad5483c5e293f (diff)
writeback: add more tracepoints
Add tracepoints for page dirtying, writeback_single_inode start, inode dirtying and writeback. For the latter two inode events, a pair of events are defined to denote start and end of the operations (the starting one has _start suffix and the one w/o suffix happens after the operation is complete). These inode ops are FS specific and can be non-trivial and having enclosing tracepoints is useful for external tracers. This is part of tracepoint additions to improve visiblity into dirtying / writeback operations for io tracer and userland. v2: writeback_dirty_inode[_start] TPs may be called for files on pseudo FSes w/ unregistered bdi. Check whether bdi->dev is %NULL before dereferencing. v3: buffer dirtying moved to a block TP. Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r--fs/fs-writeback.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 310972b72a66..359494ea1bde 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -318,8 +318,14 @@ static void queue_io(struct bdi_writeback *wb, struct wb_writeback_work *work)
318 318
319static int write_inode(struct inode *inode, struct writeback_control *wbc) 319static int write_inode(struct inode *inode, struct writeback_control *wbc)
320{ 320{
321 if (inode->i_sb->s_op->write_inode && !is_bad_inode(inode)) 321 int ret;
322 return inode->i_sb->s_op->write_inode(inode, wbc); 322
323 if (inode->i_sb->s_op->write_inode && !is_bad_inode(inode)) {
324 trace_writeback_write_inode_start(inode, wbc);
325 ret = inode->i_sb->s_op->write_inode(inode, wbc);
326 trace_writeback_write_inode(inode, wbc);
327 return ret;
328 }
323 return 0; 329 return 0;
324} 330}
325 331
@@ -450,6 +456,8 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
450 456
451 WARN_ON(!(inode->i_state & I_SYNC)); 457 WARN_ON(!(inode->i_state & I_SYNC));
452 458
459 trace_writeback_single_inode_start(inode, wbc, nr_to_write);
460
453 ret = do_writepages(mapping, wbc); 461 ret = do_writepages(mapping, wbc);
454 462
455 /* 463 /*
@@ -1150,8 +1158,12 @@ void __mark_inode_dirty(struct inode *inode, int flags)
1150 * dirty the inode itself 1158 * dirty the inode itself
1151 */ 1159 */
1152 if (flags & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) { 1160 if (flags & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
1161 trace_writeback_dirty_inode_start(inode, flags);
1162
1153 if (sb->s_op->dirty_inode) 1163 if (sb->s_op->dirty_inode)
1154 sb->s_op->dirty_inode(inode, flags); 1164 sb->s_op->dirty_inode(inode, flags);
1165
1166 trace_writeback_dirty_inode(inode, flags);
1155 } 1167 }
1156 1168
1157 /* 1169 /*