summaryrefslogtreecommitdiff
path: root/kernel/trace/blktrace.c
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2017-01-31 14:53:20 -0800
committerJens Axboe <axboe@fb.com>2017-02-02 10:20:16 -0700
commit18fbda91c6370d520278db9ee1e768b59ef5c4ab (patch)
tree24a7e92d1dd90533dd783ea87abf13cf55284049 /kernel/trace/blktrace.c
parenta428d314ebcf65842fd64ad850c02c280586e74d (diff)
downloadlwn-18fbda91c6370d520278db9ee1e768b59ef5c4ab.tar.gz
lwn-18fbda91c6370d520278db9ee1e768b59ef5c4ab.zip
block: use same block debugfs directory for blk-mq and blktrace
When I added the blk-mq debugging information to debugfs, I didn't notice that blktrace also creates a "block" directory in debugfs. Make them use the same dentry, now created in the core block code. Based on a patch from Jens. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'kernel/trace/blktrace.c')
-rw-r--r--kernel/trace/blktrace.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 84763e0c83cf..8cea91d248d9 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -28,6 +28,8 @@
#include <linux/uaccess.h>
#include <linux/list.h>
+#include "../../block/blk.h"
+
#include <trace/events/block.h>
#include "trace_output.h"
@@ -292,9 +294,6 @@ record_it:
local_irq_restore(flags);
}
-static struct dentry *blk_tree_root;
-static DEFINE_MUTEX(blk_tree_mutex);
-
static void blk_trace_free(struct blk_trace *bt)
{
debugfs_remove(bt->msg_file);
@@ -468,17 +467,10 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
ret = -ENOENT;
- mutex_lock(&blk_tree_mutex);
- if (!blk_tree_root) {
- blk_tree_root = debugfs_create_dir("block", NULL);
- if (!blk_tree_root) {
- mutex_unlock(&blk_tree_mutex);
- goto err;
- }
- }
- mutex_unlock(&blk_tree_mutex);
+ if (!blk_debugfs_root)
+ goto err;
- dir = debugfs_create_dir(buts->name, blk_tree_root);
+ dir = debugfs_create_dir(buts->name, blk_debugfs_root);
if (!dir)
goto err;