tracing: filter fix for TRACE_EVENT_FORMAT events
authorTom Zanussi <tzanussi@gmail.com>
Thu, 26 Mar 2009 06:24:34 +0000 (01:24 -0500)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Mar 2009 08:13:14 +0000 (09:13 +0100)
Impact: fix crash (hang) when using TRACE_EVENT_FORMAT filter files

filters are only hooked up to the tracepoint events defined using
TRACE_EVENT but not the tracers that use TRACE_EVENT_FORMAT, such
as ftrace.

Do not display the filter files at all for TRACE_EVENT_FORMAT events
for the time being.

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1237878882.8339.61.camel@charm-linux>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/trace_events.c

index d132997ab7562c24c64af41efb59ddfe7bf5276d..64ec4d278ffbcd56b94d0d161b855914756f3e0b 100644 (file)
@@ -680,7 +680,6 @@ static struct dentry *
 event_subsystem_dir(const char *name, struct dentry *d_events)
 {
        struct event_subsystem *system;
-       struct dentry *entry;
 
        /* First see if we did not already create this dir */
        list_for_each_entry(system, &event_subsystems, list) {
@@ -709,12 +708,6 @@ event_subsystem_dir(const char *name, struct dentry *d_events)
 
        system->preds = NULL;
 
-       entry = debugfs_create_file("filter", 0644, system->entry, system,
-                                   &ftrace_subsystem_filter_fops);
-       if (!entry)
-               pr_warning("Could not create debugfs "
-                          "'%s/filter' entry\n", name);
-
        return system->entry;
 }
 
@@ -770,14 +763,13 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events)
                                   " events/%s\n", call->name);
                        return ret;
                }
+               entry = debugfs_create_file("filter", 0644, call->dir, call,
+                                           &ftrace_event_filter_fops);
+               if (!entry)
+                       pr_warning("Could not create debugfs "
+                                  "'%s/filter' entry\n", call->name);
        }
 
-       entry = debugfs_create_file("filter", 0644, call->dir, call,
-                                   &ftrace_event_filter_fops);
-       if (!entry)
-               pr_warning("Could not create debugfs "
-                          "'%s/filter' entry\n", call->name);
-
        /* A trace may not want to export its format */
        if (!call->show_format)
                return 0;