]> Pileus Git - ~andy/linux/blobdiff - kernel/trace/trace_events.c
tracing: Do not add event files for modules that fail tracepoints
[~andy/linux] / kernel / trace / trace_events.c
index e71ffd4eccb5b4d7a7b0234dd72e525b1c647550..f3989ceb5cd5aa7cbfae069015e8d915d6eb4c59 100644 (file)
@@ -1777,6 +1777,16 @@ static void trace_module_add_events(struct module *mod)
 {
        struct ftrace_event_call **call, **start, **end;
 
+       if (!mod->num_trace_events)
+               return;
+
+       /* Don't add infrastructure for mods without tracepoints */
+       if (trace_module_has_bad_taint(mod)) {
+               pr_err("%s: module has bad taint, not creating trace events\n",
+                      mod->name);
+               return;
+       }
+
        start = mod->trace_events;
        end = mod->trace_events + mod->num_trace_events;