aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kernel-parameters.txt17
-rw-r--r--kernel/trace/ftrace.c42
2 files changed, 57 insertions, 2 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 9243dd84f4d6..fcd3bfbe74e8 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -751,12 +751,25 @@ and is between 256 and 4096 characters. It is defined in the file
751 ia64_pal_cache_flush instead of SAL_CACHE_FLUSH. 751 ia64_pal_cache_flush instead of SAL_CACHE_FLUSH.
752 752
753 ftrace=[tracer] 753 ftrace=[tracer]
754 [ftrace] will set and start the specified tracer 754 [FTRACE] will set and start the specified tracer
755 as early as possible in order to facilitate early 755 as early as possible in order to facilitate early
756 boot debugging. 756 boot debugging.
757 757
758 ftrace_dump_on_oops 758 ftrace_dump_on_oops
759 [ftrace] will dump the trace buffers on oops. 759 [FTRACE] will dump the trace buffers on oops.
760
761 ftrace_filter=[function-list]
762 [FTRACE] Limit the functions traced by the function
763 tracer at boot up. function-list is a comma separated
764 list of functions. This list can be changed at run
765 time by the set_ftrace_filter file in the debugfs
766 tracing directory.
767
768 ftrace_notrace=[function-list]
769 [FTRACE] Do not trace the functions specified in
770 function-list. This list can be changed at run time
771 by the set_ftrace_notrace file in the debugfs
772 tracing directory.
760 773
761 gamecon.map[2|3]= 774 gamecon.map[2|3]=
762 [HW,JOY] Multisystem joystick and NES/SNES/PSX pad 775 [HW,JOY] Multisystem joystick and NES/SNES/PSX pad
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
2377static char ftrace_notrace_buf[FTRACE_FILTER_SIZE] __initdata;
2378static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata;
2379
2380static 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
2387static 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
2394static 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
2404static 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
2372static int 2412static int
2373ftrace_regex_release(struct inode *inode, struct file *file, int enable) 2413ftrace_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;