Skip to content

Commit cc31004

Browse files
committed
tracefs: Add directory /sys/kernel/tracing
When tracefs is configured, have the directory /sys/kernel/tracing appear just like /sys/kernel/debug appears when debugfs is configured. This will give a consistent place for system admins to mount tracefs. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent f76180b commit cc31004

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/tracefs/inode.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/module.h>
1717
#include <linux/fs.h>
1818
#include <linux/mount.h>
19+
#include <linux/kobject.h>
1920
#include <linux/namei.h>
2021
#include <linux/tracefs.h>
2122
#include <linux/fsnotify.h>
@@ -509,10 +510,16 @@ bool tracefs_initialized(void)
509510
return tracefs_registered;
510511
}
511512

513+
static struct kobject *trace_kobj;
514+
512515
static int __init tracefs_init(void)
513516
{
514517
int retval;
515518

519+
trace_kobj = kobject_create_and_add("tracing", kernel_kobj);
520+
if (!trace_kobj)
521+
return -EINVAL;
522+
516523
retval = register_filesystem(&trace_fs_type);
517524
if (!retval)
518525
tracefs_registered = true;

0 commit comments

Comments
 (0)