Add tracepoints to enable filesystem freeze/thaw trace events. Signed-off-by: Frank Sorenson <sorenson@xxxxxxxxxx> --- fs/block_dev.c | 13 +++++++++++++ fs/super.c | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/fs/block_dev.c b/fs/block_dev.c index 1207f40..095ef3e 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -32,6 +32,9 @@ #include <asm/uaccess.h> #include "internal.h" +#define CREATE_TRACE_POINTS +#include <trace/events/fs_bdev.h> + struct bdev_inode { struct block_device bdev; struct inode vfs_inode; @@ -228,6 +231,8 @@ struct super_block *freeze_bdev(struct block_device *bdev) struct super_block *sb; int error = 0; + trace_freeze_bdev_enter(bdev); + mutex_lock(&bdev->bd_fsfreeze_mutex); if (++bdev->bd_fsfreeze_count > 1) { /* @@ -258,6 +263,9 @@ out: sync_blockdev(bdev); out_unlock: mutex_unlock(&bdev->bd_fsfreeze_mutex); + + trace_freeze_bdev_exit(bdev, sb); + return sb; /* thaw_bdev releases s->s_umount */ } EXPORT_SYMBOL(freeze_bdev); @@ -273,6 +281,8 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb) { int error = -EINVAL; + trace_thaw_bdev_enter(bdev, sb); + mutex_lock(&bdev->bd_fsfreeze_mutex); if (!bdev->bd_fsfreeze_count) goto out; @@ -292,6 +302,9 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb) bdev->bd_fsfreeze_count++; out: mutex_unlock(&bdev->bd_fsfreeze_mutex); + + trace_thaw_bdev_exit(bdev, sb, error); + return error; } EXPORT_SYMBOL(thaw_bdev); diff --git a/fs/super.c b/fs/super.c index 5e9a974..70218ed 100644 --- a/fs/super.c +++ b/fs/super.c @@ -35,6 +35,8 @@ #include <linux/lockdep.h> #include "internal.h" +#define CREATE_TRACE_POINTS +#include <trace/events/fs.h> static LIST_HEAD(super_blocks); static DEFINE_SPINLOCK(sb_lock); @@ -1274,6 +1276,8 @@ int freeze_super(struct super_block *sb) { int ret = 0; + trace_freeze_super_enter(sb); + atomic_inc(&sb->s_active); down_write(&sb->s_umount); if (sb->s_writers.frozen != SB_UNFROZEN) { @@ -1326,6 +1330,8 @@ out_complete: out_unlock: up_write(&sb->s_umount); out: + trace_freeze_super_exit(sb, ret); + return ret; } EXPORT_SYMBOL(freeze_super); @@ -1340,6 +1346,8 @@ int thaw_super(struct super_block *sb) { int ret = 0; + trace_thaw_super_enter(sb); + down_write(&sb->s_umount); if (sb->s_writers.frozen == SB_UNFROZEN) { up_write(&sb->s_umount); @@ -1368,6 +1376,8 @@ out_wake: wake_up(&sb->s_writers.wait_unfrozen); deactivate_locked_super(sb); out: + trace_thaw_super_exit(sb, ret); + return ret; } EXPORT_SYMBOL(thaw_super); -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html