|
@@ -17,6 +17,8 @@
|
|
|
#include <linux/ctype.h>
|
|
|
#include <linux/delay.h>
|
|
|
|
|
|
+#include <asm/setup.h>
|
|
|
+
|
|
|
#include "trace_output.h"
|
|
|
|
|
|
#define TRACE_SYSTEM "TRACE_SYSTEM"
|
|
@@ -1133,6 +1135,18 @@ struct notifier_block trace_module_nb = {
|
|
|
extern struct ftrace_event_call __start_ftrace_events[];
|
|
|
extern struct ftrace_event_call __stop_ftrace_events[];
|
|
|
|
|
|
+static char bootup_event_buf[COMMAND_LINE_SIZE] __initdata;
|
|
|
+
|
|
|
+static __init int setup_trace_event(char *str)
|
|
|
+{
|
|
|
+ strlcpy(bootup_event_buf, str, COMMAND_LINE_SIZE);
|
|
|
+ ring_buffer_expanded = 1;
|
|
|
+ tracing_selftest_disabled = 1;
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+__setup("trace_event=", setup_trace_event);
|
|
|
+
|
|
|
static __init int event_trace_init(void)
|
|
|
{
|
|
|
struct ftrace_event_call *call;
|
|
@@ -1140,6 +1154,8 @@ static __init int event_trace_init(void)
|
|
|
struct dentry *entry;
|
|
|
struct dentry *d_events;
|
|
|
int ret;
|
|
|
+ char *buf = bootup_event_buf;
|
|
|
+ char *token;
|
|
|
|
|
|
d_tracer = tracing_init_dentry();
|
|
|
if (!d_tracer)
|
|
@@ -1185,6 +1201,19 @@ static __init int event_trace_init(void)
|
|
|
&ftrace_event_format_fops);
|
|
|
}
|
|
|
|
|
|
+ while (true) {
|
|
|
+ token = strsep(&buf, ",");
|
|
|
+
|
|
|
+ if (!token)
|
|
|
+ break;
|
|
|
+ if (!*token)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ ret = ftrace_set_clr_event(token, 1);
|
|
|
+ if (ret)
|
|
|
+ pr_warning("Failed to enable trace event: %s\n", token);
|
|
|
+ }
|
|
|
+
|
|
|
ret = register_module_notifier(&trace_module_nb);
|
|
|
if (ret)
|
|
|
pr_warning("Failed to register trace events module notifier\n");
|
|
@@ -1392,10 +1421,10 @@ static __init void event_trace_self_test_with_function(void)
|
|
|
|
|
|
static __init int event_trace_self_tests_init(void)
|
|
|
{
|
|
|
-
|
|
|
- event_trace_self_tests();
|
|
|
-
|
|
|
- event_trace_self_test_with_function();
|
|
|
+ if (!tracing_selftest_disabled) {
|
|
|
+ event_trace_self_tests();
|
|
|
+ event_trace_self_test_with_function();
|
|
|
+ }
|
|
|
|
|
|
return 0;
|
|
|
}
|