V3 version of Jan's Extent Status Cache improvements
[ext4-patch-queue.git] / add-lazytime-tracepoints
blobbeda9fad5fc7b685a359c91e083ef33ef8abc487
1 vfs: add lazytime tracepoints for better debugging
3 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
4 ---
5  fs/fs-writeback.c | 5 ++++-
6  fs/inode.c        | 5 +++++
7  2 files changed, 9 insertions(+), 1 deletion(-)
9 diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
10 index eb04277..cab2d6d 100644
11 --- a/fs/fs-writeback.c
12 +++ b/fs/fs-writeback.c
13 @@ -27,6 +27,7 @@
14  #include <linux/backing-dev.h>
15  #include <linux/tracepoint.h>
16  #include <linux/device.h>
17 +#include <trace/events/fs.h>
18  #include "internal.h"
20  /*
21 @@ -1304,8 +1305,10 @@ static void flush_sb_dirty_time(struct super_block *sb)
22                 iput(old_inode);
23                 old_inode = inode;
25 -               if (dirty_time)
26 +               if (dirty_time) {
27 +                       trace_fs_lazytime_flush(inode);
28                         mark_inode_dirty(inode);
29 +               }
30                 cond_resched();
31                 spin_lock(&inode_sb_list_lock);
32         }
33 diff --git a/fs/inode.c b/fs/inode.c
34 index 321c7d7..bd6e0e6 100644
35 --- a/fs/inode.c
36 +++ b/fs/inode.c
37 @@ -20,6 +20,9 @@
38  #include <linux/list_lru.h>
39  #include "internal.h"
41 +#define CREATE_TRACE_POINTS
42 +#include <trace/events/fs.h>
44  /*
45   * Inode locking rules:
46   *
47 @@ -544,6 +547,7 @@ static void evict(struct inode *inode)
48                         mark_inode_dirty(inode);
49                         inode->i_sb->s_op->write_inode(inode, &wbc);
50                 }
51 +               trace_fs_lazytime_evict(inode);
52         }
54         if (!list_empty(&inode->i_wb_list))
55 @@ -1550,6 +1554,7 @@ static int update_time(struct inode *inode, struct timespec *time, int flags)
56                         inode->i_state |= I_DIRTY_TIME;
57                         spin_unlock(&inode->i_lock);
58                         inode->i_ts_dirty_day = days_since_boot;
59 +                       trace_fs_lazytime_defer(inode);
60                         return 0;
61                 }
62         }