|
17 | 17 | #include <linux/ctype.h> |
18 | 18 | #include <linux/delay.h> |
19 | 19 |
|
| 20 | +#include <asm/setup.h> |
| 21 | + |
20 | 22 | #include "trace_output.h" |
21 | 23 |
|
22 | 24 | #define TRACE_SYSTEM "TRACE_SYSTEM" |
@@ -1133,13 +1135,27 @@ struct notifier_block trace_module_nb = { |
1133 | 1135 | extern struct ftrace_event_call __start_ftrace_events[]; |
1134 | 1136 | extern struct ftrace_event_call __stop_ftrace_events[]; |
1135 | 1137 |
|
| 1138 | +static char bootup_event_buf[COMMAND_LINE_SIZE] __initdata; |
| 1139 | + |
| 1140 | +static __init int setup_trace_event(char *str) |
| 1141 | +{ |
| 1142 | + strlcpy(bootup_event_buf, str, COMMAND_LINE_SIZE); |
| 1143 | + ring_buffer_expanded = 1; |
| 1144 | + tracing_selftest_disabled = 1; |
| 1145 | + |
| 1146 | + return 1; |
| 1147 | +} |
| 1148 | +__setup("trace_event=", setup_trace_event); |
| 1149 | + |
1136 | 1150 | static __init int event_trace_init(void) |
1137 | 1151 | { |
1138 | 1152 | struct ftrace_event_call *call; |
1139 | 1153 | struct dentry *d_tracer; |
1140 | 1154 | struct dentry *entry; |
1141 | 1155 | struct dentry *d_events; |
1142 | 1156 | int ret; |
| 1157 | + char *buf = bootup_event_buf; |
| 1158 | + char *token; |
1143 | 1159 |
|
1144 | 1160 | d_tracer = tracing_init_dentry(); |
1145 | 1161 | if (!d_tracer) |
@@ -1185,6 +1201,19 @@ static __init int event_trace_init(void) |
1185 | 1201 | &ftrace_event_format_fops); |
1186 | 1202 | } |
1187 | 1203 |
|
| 1204 | + while (true) { |
| 1205 | + token = strsep(&buf, ","); |
| 1206 | + |
| 1207 | + if (!token) |
| 1208 | + break; |
| 1209 | + if (!*token) |
| 1210 | + continue; |
| 1211 | + |
| 1212 | + ret = ftrace_set_clr_event(token, 1); |
| 1213 | + if (ret) |
| 1214 | + pr_warning("Failed to enable trace event: %s\n", token); |
| 1215 | + } |
| 1216 | + |
1188 | 1217 | ret = register_module_notifier(&trace_module_nb); |
1189 | 1218 | if (ret) |
1190 | 1219 | pr_warning("Failed to register trace events module notifier\n"); |
@@ -1392,10 +1421,10 @@ static __init void event_trace_self_test_with_function(void) |
1392 | 1421 |
|
1393 | 1422 | static __init int event_trace_self_tests_init(void) |
1394 | 1423 | { |
1395 | | - |
1396 | | - event_trace_self_tests(); |
1397 | | - |
1398 | | - event_trace_self_test_with_function(); |
| 1424 | + if (!tracing_selftest_disabled) { |
| 1425 | + event_trace_self_tests(); |
| 1426 | + event_trace_self_test_with_function(); |
| 1427 | + } |
1399 | 1428 |
|
1400 | 1429 | return 0; |
1401 | 1430 | } |
|
0 commit comments