aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-10-13 06:03:08 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-13 06:03:08 -0400
commit1bac0497ef9af8d933860672223e38bd6ac4934a (patch)
tree8e569b0e7ed977a4659002632362855cc245990f /kernel/trace/ftrace.c
parent2c96c142e941041973faab20ca3b82d57f435c5e (diff)
parentbf7c5b43a12614847b83f507fb169ad30640e406 (diff)
Merge branch 'tracing/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into tracing/core
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 1a7f6abd06bf..45c965919cff 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