summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-10 17:04:02 +0100
committerSteven Rostedt <srostedt@redhat.com>2009-03-10 17:04:02 +0100
commit2314c4ae1461c9e8b26cf8b9a851f280bc5769e1 (patch)
treec6f55179012c6997f77fa523f542efdfd1104c24 /kernel/trace/trace_events.c
parenttracing: do not allow modifying the ftrace events via the event files (diff)
downloadlinux-2314c4ae1461c9e8b26cf8b9a851f280bc5769e1.tar.xz
linux-2314c4ae1461c9e8b26cf8b9a851f280bc5769e1.zip
tracing: add back the available_events file
The event directory files type and available_types were no longer needed with the new TRACE_EVENT_FORMAT macros, they were deleted. But by accident the available_events file was also removed. This patch brings it back. Reported-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r--kernel/trace/trace_events.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 85ec10fbb38d..769dfd00fc85 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -428,6 +428,13 @@ static const struct seq_operations show_set_event_seq_ops = {
.stop = t_stop,
};
+static const struct file_operations ftrace_avail_fops = {
+ .open = ftrace_event_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
static const struct file_operations ftrace_set_event_fops = {
.open = ftrace_event_seq_open,
.read = seq_read,
@@ -569,6 +576,13 @@ static __init int event_trace_init(void)
if (!d_tracer)
return 0;
+ entry = debugfs_create_file("available_events", 0444, d_tracer,
+ (void *)&show_event_seq_ops,
+ &ftrace_avail_fops);
+ if (!entry)
+ pr_warning("Could not create debugfs "
+ "'available_events' entry\n");
+
entry = debugfs_create_file("set_event", 0644, d_tracer,
(void *)&show_set_event_seq_ops,
&ftrace_set_event_fops);