diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-13 06:03:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-13 06:03:08 -0400 |
commit | 1bac0497ef9af8d933860672223e38bd6ac4934a (patch) | |
tree | 8e569b0e7ed977a4659002632362855cc245990f /kernel | |
parent | 2c96c142e941041973faab20ca3b82d57f435c5e (diff) | |
parent | bf7c5b43a12614847b83f507fb169ad30640e406 (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.c | 34 | ||||
-rw-r--r-- | kernel/trace/trace.c | 4 | ||||
-rw-r--r-- | kernel/trace/trace.h | 4 |
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; | |||
78 | ftrace_func_t __ftrace_trace_function __read_mostly = ftrace_stub; | 78 | ftrace_func_t __ftrace_trace_function __read_mostly = ftrace_stub; |
79 | ftrace_func_t ftrace_pid_function __read_mostly = ftrace_stub; | 79 | ftrace_func_t ftrace_pid_function __read_mostly = ftrace_stub; |
80 | 80 | ||
81 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
82 | static int ftrace_set_func(unsigned long *array, int *idx, char *buffer); | ||
83 | #endif | ||
84 | |||
81 | static void ftrace_list_func(unsigned long ip, unsigned long parent_ip) | 85 | static 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 |
2244 | static char ftrace_notrace_buf[FTRACE_FILTER_SIZE] __initdata; | 2248 | static char ftrace_notrace_buf[FTRACE_FILTER_SIZE] __initdata; |
2245 | static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata; | 2249 | static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata; |
2250 | static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata; | ||
2246 | 2251 | ||
2247 | static int __init set_ftrace_notrace(char *str) | 2252 | static 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 | ||
2267 | static 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 | |||
2274 | static 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 | |||
2261 | static void __init set_ftrace_early_filter(char *buf, int enable) | 2291 | static 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 | ||
2279 | static int | 2313 | static 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); | |||
129 | static char bootup_tracer_buf[MAX_TRACER_SIZE] __initdata; | 129 | static char bootup_tracer_buf[MAX_TRACER_SIZE] __initdata; |
130 | static char *default_bootup_tracer; | 130 | static char *default_bootup_tracer; |
131 | 131 | ||
132 | static int __init set_ftrace(char *str) | 132 | static 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 | ||
142 | static int __init set_ftrace_dump_on_oops(char *str) | 142 | static 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 |
486 | static inline int ftrace_trace_addr(unsigned long addr) | ||
487 | { | ||
488 | return 1; | ||
489 | } | ||
490 | static inline int ftrace_graph_addr(unsigned long addr) | 486 | static inline int ftrace_graph_addr(unsigned long addr) |
491 | { | 487 | { |
492 | return 1; | 488 | return 1; |