aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-06-12 12:23:50 -0400
committerSteven Rostedt <rostedt@goodmis.org>2014-07-01 07:13:43 -0400
commit0d7d9a16ce112687487fadb2b490519b45f6c70e (patch)
tree922106d89d496b31949eff36d28b2f060077ad37 /kernel/trace
parent3448bac32953f051be91cef6d67025869f08dc4d (diff)
tracing: Add ftrace_graph_notrace boot parameter
The ftrace_graph_notrace option is for specifying notrace filter for function graph tracer at boot time. It can be altered after boot using set_graph_notrace file on the debugfs. Link: http://lkml.kernel.org/p/1402590233-22321-2-git-send-email-namhyung@kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/ftrace.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 232b898eebbd..17885a27281c 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3884,6 +3884,7 @@ __setup("ftrace_filter=", set_ftrace_filter);
3884 3884
3885#ifdef CONFIG_FUNCTION_GRAPH_TRACER 3885#ifdef CONFIG_FUNCTION_GRAPH_TRACER
3886static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata; 3886static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata;
3887static char ftrace_graph_notrace_buf[FTRACE_FILTER_SIZE] __initdata;
3887static int ftrace_set_func(unsigned long *array, int *idx, int size, char *buffer); 3888static int ftrace_set_func(unsigned long *array, int *idx, int size, char *buffer);
3888 3889
3889static int __init set_graph_function(char *str) 3890static int __init set_graph_function(char *str)
@@ -3893,16 +3894,29 @@ static int __init set_graph_function(char *str)
3893} 3894}
3894__setup("ftrace_graph_filter=", set_graph_function); 3895__setup("ftrace_graph_filter=", set_graph_function);
3895 3896
3896static void __init set_ftrace_early_graph(char *buf) 3897static int __init set_graph_notrace_function(char *str)
3898{
3899 strlcpy(ftrace_graph_notrace_buf, str, FTRACE_FILTER_SIZE);
3900 return 1;
3901}
3902__setup("ftrace_graph_notrace=", set_graph_notrace_function);
3903
3904static void __init set_ftrace_early_graph(char *buf, int enable)
3897{ 3905{
3898 int ret; 3906 int ret;
3899 char *func; 3907 char *func;
3908 unsigned long *table = ftrace_graph_funcs;
3909 int *count = &ftrace_graph_count;
3910
3911 if (!enable) {
3912 table = ftrace_graph_notrace_funcs;
3913 count = &ftrace_graph_notrace_count;
3914 }
3900 3915
3901 while (buf) { 3916 while (buf) {
3902 func = strsep(&buf, ","); 3917 func = strsep(&buf, ",");
3903 /* we allow only one expression at a time */ 3918 /* we allow only one expression at a time */
3904 ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count, 3919 ret = ftrace_set_func(table, count, FTRACE_GRAPH_MAX_FUNCS, func);
3905 FTRACE_GRAPH_MAX_FUNCS, func);
3906 if (ret) 3920 if (ret)
3907 printk(KERN_DEBUG "ftrace: function %s not " 3921 printk(KERN_DEBUG "ftrace: function %s not "
3908 "traceable\n", func); 3922 "traceable\n", func);
@@ -3931,7 +3945,9 @@ static void __init set_ftrace_early_filters(void)
3931 ftrace_set_early_filter(&global_ops, ftrace_notrace_buf, 0); 3945 ftrace_set_early_filter(&global_ops, ftrace_notrace_buf, 0);
3932#ifdef CONFIG_FUNCTION_GRAPH_TRACER 3946#ifdef CONFIG_FUNCTION_GRAPH_TRACER
3933 if (ftrace_graph_buf[0]) 3947 if (ftrace_graph_buf[0])
3934 set_ftrace_early_graph(ftrace_graph_buf); 3948 set_ftrace_early_graph(ftrace_graph_buf, 1);
3949 if (ftrace_graph_notrace_buf[0])
3950 set_ftrace_early_graph(ftrace_graph_notrace_buf, 0);
3935#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 3951#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
3936} 3952}
3937 3953