Commit 4282d606 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt

tracefs: Add new tracefs file system

Add a separate file system to handle the tracing directory. Currently it
is part of debugfs, but that is starting to show its limits.

One thing is that in order to access the tracing infrastructure, you need
to mount debugfs. As that includes debugging from all sorts of sub systems
in the kernel, it is not considered advisable to mount such an all
encompassing debugging system.

Having the tracing system in its own file systems gives access to the
tracing sub system without needing to include all other systems.

Another problem with tracing using the debugfs system is that the
instances use mkdir to create sub buffers. debugfs does not support mkdir
from userspace so to implement it, special hacks were used. By controlling
the file system that the tracing infrastructure uses, this can be properly
done without hacks.
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 09d23a1d
...@@ -118,6 +118,7 @@ obj-$(CONFIG_HOSTFS) += hostfs/ ...@@ -118,6 +118,7 @@ obj-$(CONFIG_HOSTFS) += hostfs/
obj-$(CONFIG_HPPFS) += hppfs/ obj-$(CONFIG_HPPFS) += hppfs/
obj-$(CONFIG_CACHEFILES) += cachefiles/ obj-$(CONFIG_CACHEFILES) += cachefiles/
obj-$(CONFIG_DEBUG_FS) += debugfs/ obj-$(CONFIG_DEBUG_FS) += debugfs/
obj-$(CONFIG_TRACING) += tracefs/
obj-$(CONFIG_OCFS2_FS) += ocfs2/ obj-$(CONFIG_OCFS2_FS) += ocfs2/
obj-$(CONFIG_BTRFS_FS) += btrfs/ obj-$(CONFIG_BTRFS_FS) += btrfs/
obj-$(CONFIG_GFS2_FS) += gfs2/ obj-$(CONFIG_GFS2_FS) += gfs2/
......
tracefs-objs := inode.o
obj-$(CONFIG_TRACING) += tracefs.o
This diff is collapsed.
/*
* tracefs.h - a pseudo file system for activating tracing
*
* Based on debugfs by: 2004 Greg Kroah-Hartman <greg@kroah.com>
*
* Copyright (C) 2014 Red Hat Inc, author: Steven Rostedt <srostedt@redhat.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation.
*
* tracefs is the file system that is used by the tracing infrastructure.
*
*/
#ifndef _TRACEFS_H_
#define _TRACEFS_H_
#include <linux/fs.h>
#include <linux/seq_file.h>
#include <linux/types.h>
struct file_operations;
#ifdef CONFIG_TRACING
struct dentry *tracefs_create_file(const char *name, umode_t mode,
struct dentry *parent, void *data,
const struct file_operations *fops);
struct dentry *tracefs_create_dir(const char *name, struct dentry *parent);
void tracefs_remove(struct dentry *dentry);
void tracefs_remove_recursive(struct dentry *dentry);
bool tracefs_initialized(void);
#endif /* CONFIG_TRACING */
#endif
...@@ -58,6 +58,8 @@ ...@@ -58,6 +58,8 @@
#define STACK_END_MAGIC 0x57AC6E9D #define STACK_END_MAGIC 0x57AC6E9D
#define TRACEFS_MAGIC 0x74726163
#define V9FS_MAGIC 0x01021997 #define V9FS_MAGIC 0x01021997
#define BDEVFS_MAGIC 0x62646576 #define BDEVFS_MAGIC 0x62646576
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment