aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kernel-parameters.txt7
-rw-r--r--kernel/trace/ftrace.c34
-rw-r--r--kernel/trace/trace.c4
-rw-r--r--kernel/trace/trace.h4
4 files changed, 43 insertions, 6 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 6fa7292947e..1dc4b9cc20e 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -778,6 +778,13 @@ and is between 256 and 4096 characters. It is defined in the file
778 by the set_ftrace_notrace file in the debugfs 778 by the set_ftrace_notrace file in the debugfs
779 tracing directory. 779 tracing directory.
780 780
781 ftrace_graph_filter=[function-list]
782 [FTRACE] Limit the top level callers functions traced
783 by the function graph tracer at boot up.
784 function-list is a comma separated list of functions
785 that can be changed at run time by the
786 set_graph_function file in the debugfs tracing directory.
787
781 gamecon.map[2|3]= 788 gamecon.map[2|3]=
782 [HW,JOY] Multisystem joystick and NES/SNES/PSX pad 789 [HW,JOY] Multisystem joystick and NES/SNES/PSX pad
783 support via parallel port (up to 5 devices per port) 790 support via parallel port (up to 5 devices per port)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 1a7f6abd06b..45c965919cf 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -78,6 +78,10 @@ ftrace_func_t ftrace_trace_function __read_mostly = ftrace_stub;
78ftrace_func_t __ftrace_trace_function __read_mostly = ftrace_stub; 78ftrace_func_t __ftrace_trace_function __read_mostly = ftrace_stub;
79ftrace_func_t ftrace_pid_function __read_mostly = ftrace_stub; 79ftrace_func_t ftrace_pid_function __read_mostly = ftrace_stub;
80 80
81#ifdef CONFIG_FUNCTION_GRAPH_TRACER
82static int ftrace_set_func(unsigned long *array, int *idx, char *buffer);
83#endif
84
81static void ftrace_list_func(unsigned long ip, unsigned long parent_ip) 85static void ftrace_list_func(unsigned long ip, unsigned long parent_ip)
82{ 86{
83 struct ftrace_ops *op = ftrace_list; 87 struct ftrace_ops *op = ftrace_list;
@@ -2243,6 +2247,7 @@ void ftrace_set_notrace(unsigned char *buf, int len, int reset)
2243#define FTRACE_FILTER_SIZE COMMAND_LINE_SIZE 2247#define FTRACE_FILTER_SIZE COMMAND_LINE_SIZE
2244static char ftrace_notrace_buf[FTRACE_FILTER_SIZE] __initdata; 2248static char ftrace_notrace_buf[FTRACE_FILTER_SIZE] __initdata;
2245static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata; 2249static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata;
2250static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata;
2246 2251
2247static int __init set_ftrace_notrace(char *str) 2252static int __init set_ftrace_notrace(char *str)
2248{ 2253{
@@ -2258,6 +2263,31 @@ static int __init set_ftrace_filter(char *str)
2258} 2263}
2259__setup("ftrace_filter=", set_ftrace_filter); 2264__setup("ftrace_filter=", set_ftrace_filter);
2260 2265
2266#ifdef CONFIG_FUNCTION_GRAPH_TRACER
2267static int __init set_graph_function(char *str)
2268{
2269 strncpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
2270 return 1;
2271}
2272__setup("ftrace_graph_filter=", set_graph_function);
2273
2274static void __init set_ftrace_early_graph(char *buf)
2275{
2276 int ret;
2277 char *func;
2278
2279 while (buf) {
2280 func = strsep(&buf, ",");
2281 /* we allow only one expression at a time */
2282 ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count,
2283 func);
2284 if (ret)
2285 printk(KERN_DEBUG "ftrace: function %s not "
2286 "traceable\n", func);
2287 }
2288}
2289#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
2290
2261static void __init set_ftrace_early_filter(char *buf, int enable) 2291static void __init set_ftrace_early_filter(char *buf, int enable)
2262{ 2292{
2263 char *func; 2293 char *func;
@@ -2274,6 +2304,10 @@ static void __init set_ftrace_early_filters(void)
2274 set_ftrace_early_filter(ftrace_filter_buf, 1); 2304 set_ftrace_early_filter(ftrace_filter_buf, 1);
2275 if (ftrace_notrace_buf[0]) 2305 if (ftrace_notrace_buf[0])
2276 set_ftrace_early_filter(ftrace_notrace_buf, 0); 2306 set_ftrace_early_filter(ftrace_notrace_buf, 0);
2307#ifdef CONFIG_FUNCTION_GRAPH_TRACER
2308 if (ftrace_graph_buf[0])
2309 set_ftrace_early_graph(ftrace_graph_buf);
2310#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
2277} 2311}
2278 2312
2279static int 2313static int
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c820b0310a1..4311ec3062f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -129,7 +129,7 @@ static int tracing_set_tracer(const char *buf);
129static char bootup_tracer_buf[MAX_TRACER_SIZE] __initdata; 129static char bootup_tracer_buf[MAX_TRACER_SIZE] __initdata;
130static char *default_bootup_tracer; 130static char *default_bootup_tracer;
131 131
132static int __init set_ftrace(char *str) 132static int __init set_bootup_ftrace(char *str)
133{ 133{
134 strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE); 134 strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
135 default_bootup_tracer = bootup_tracer_buf; 135 default_bootup_tracer = bootup_tracer_buf;
@@ -137,7 +137,7 @@ static int __init set_ftrace(char *str)
137 ring_buffer_expanded = 1; 137 ring_buffer_expanded = 1;
138 return 1; 138 return 1;
139} 139}
140__setup("ftrace=", set_ftrace); 140__setup("ftrace=", set_bootup_ftrace);
141 141
142static int __init set_ftrace_dump_on_oops(char *str) 142static int __init set_ftrace_dump_on_oops(char *str)
143{ 143{
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 365fb19d9e1..f22a7ac3238 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -483,10 +483,6 @@ static inline int ftrace_graph_addr(unsigned long addr)
483 return 0; 483 return 0;
484} 484}
485#else 485#else
486static inline int ftrace_trace_addr(unsigned long addr)
487{
488 return 1;
489}
490static inline int ftrace_graph_addr(unsigned long addr) 486static inline int ftrace_graph_addr(unsigned long addr)
491{ 487{
492 return 1; 488 return 1;