diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
| -rw-r--r-- | kernel/trace/ftrace.c | 34 | 
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; | |||
| 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 | 
