diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 140699a9a8a7..2074e5b7766b 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <trace/events/sched.h> | 32 | #include <trace/events/sched.h> |
33 | 33 | ||
34 | #include <asm/ftrace.h> | 34 | #include <asm/ftrace.h> |
35 | #include <asm/setup.h> | ||
35 | 36 | ||
36 | #include "trace_output.h" | 37 | #include "trace_output.h" |
37 | #include "trace_stat.h" | 38 | #include "trace_stat.h" |
@@ -2369,6 +2370,45 @@ void ftrace_set_notrace(unsigned char *buf, int len, int reset) | |||
2369 | ftrace_set_regex(buf, len, reset, 0); | 2370 | ftrace_set_regex(buf, len, reset, 0); |
2370 | } | 2371 | } |
2371 | 2372 | ||
2373 | /* | ||
2374 | * command line interface to allow users to set filters on boot up. | ||
2375 | */ | ||
2376 | #define FTRACE_FILTER_SIZE COMMAND_LINE_SIZE | ||
2377 | static char ftrace_notrace_buf[FTRACE_FILTER_SIZE] __initdata; | ||
2378 | static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata; | ||
2379 | |||
2380 | static int __init set_ftrace_notrace(char *str) | ||
2381 | { | ||
2382 | strncpy(ftrace_notrace_buf, str, FTRACE_FILTER_SIZE); | ||
2383 | return 1; | ||
2384 | } | ||
2385 | __setup("ftrace_notrace=", set_ftrace_notrace); | ||
2386 | |||
2387 | static int __init set_ftrace_filter(char *str) | ||
2388 | { | ||
2389 | strncpy(ftrace_filter_buf, str, FTRACE_FILTER_SIZE); | ||
2390 | return 1; | ||
2391 | } | ||
2392 | __setup("ftrace_filter=", set_ftrace_filter); | ||
2393 | |||
2394 | static void __init set_ftrace_early_filter(char *buf, int enable) | ||
2395 | { | ||
2396 | char *func; | ||
2397 | |||
2398 | while (buf) { | ||
2399 | func = strsep(&buf, ","); | ||
2400 | ftrace_set_regex(func, strlen(func), 0, enable); | ||
2401 | } | ||
2402 | } | ||
2403 | |||
2404 | static void __init set_ftrace_early_filters(void) | ||
2405 | { | ||
2406 | if (ftrace_filter_buf[0]) | ||
2407 | set_ftrace_early_filter(ftrace_filter_buf, 1); | ||
2408 | if (ftrace_notrace_buf[0]) | ||
2409 | set_ftrace_early_filter(ftrace_notrace_buf, 0); | ||
2410 | } | ||
2411 | |||
2372 | static int | 2412 | static int |
2373 | ftrace_regex_release(struct inode *inode, struct file *file, int enable) | 2413 | ftrace_regex_release(struct inode *inode, struct file *file, int enable) |
2374 | { | 2414 | { |
@@ -2829,6 +2869,8 @@ void __init ftrace_init(void) | |||
2829 | if (ret) | 2869 | if (ret) |
2830 | pr_warning("Failed to register trace ftrace module notifier\n"); | 2870 | pr_warning("Failed to register trace ftrace module notifier\n"); |
2831 | 2871 | ||
2872 | set_ftrace_early_filters(); | ||
2873 | |||
2832 | return; | 2874 | return; |
2833 | failed: | 2875 | failed: |
2834 | ftrace_disabled = 1; | 2876 | ftrace_disabled = 1; |