@@ -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);
@@ -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);
Add tracepoints to enable filesystem freeze/thaw trace events. Signed-off-by: Frank Sorenson <sorenson@redhat.com> --- fs/block_dev.c | 13 +++++++++++++ fs/super.c | 10 ++++++++++ 2 files changed, 23 insertions(+)