aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
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
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')
-rw-r--r--kernel/trace/ftrace.c34
-rw-r--r--kernel/trace/trace.c4
-rw-r--r--kernel/trace/trace.h4
3 files changed, 36 insertions, 6 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
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c820b0310a12..4311ec3062f0 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 365fb19d9e11..f22a7ac32380 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;