|
@@ -78,6 +78,10 @@ ftrace_func_t ftrace_trace_function __read_mostly = ftrace_stub;
|
|
|
ftrace_func_t __ftrace_trace_function __read_mostly = ftrace_stub;
|
|
|
ftrace_func_t ftrace_pid_function __read_mostly = ftrace_stub;
|
|
|
|
|
|
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
|
|
|
+static int ftrace_set_func(unsigned long *array, int *idx, char *buffer);
|
|
|
+#endif
|
|
|
+
|
|
|
static void ftrace_list_func(unsigned long ip, unsigned long parent_ip)
|
|
|
{
|
|
|
struct ftrace_ops *op = ftrace_list;
|
|
@@ -2243,6 +2247,7 @@ void ftrace_set_notrace(unsigned char *buf, int len, int reset)
|
|
|
#define FTRACE_FILTER_SIZE COMMAND_LINE_SIZE
|
|
|
static char ftrace_notrace_buf[FTRACE_FILTER_SIZE] __initdata;
|
|
|
static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata;
|
|
|
+static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata;
|
|
|
|
|
|
static int __init set_ftrace_notrace(char *str)
|
|
|
{
|
|
@@ -2258,6 +2263,31 @@ static int __init set_ftrace_filter(char *str)
|
|
|
}
|
|
|
__setup("ftrace_filter=", set_ftrace_filter);
|
|
|
|
|
|
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
|
|
|
+static int __init set_graph_function(char *str)
|
|
|
+{
|
|
|
+ strncpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+__setup("ftrace_graph_filter=", set_graph_function);
|
|
|
+
|
|
|
+static void __init set_ftrace_early_graph(char *buf)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+ char *func;
|
|
|
+
|
|
|
+ while (buf) {
|
|
|
+ func = strsep(&buf, ",");
|
|
|
+ /* we allow only one expression at a time */
|
|
|
+ ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count,
|
|
|
+ func);
|
|
|
+ if (ret)
|
|
|
+ printk(KERN_DEBUG "ftrace: function %s not "
|
|
|
+ "traceable\n", func);
|
|
|
+ }
|
|
|
+}
|
|
|
+#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
|
|
|
+
|
|
|
static void __init set_ftrace_early_filter(char *buf, int enable)
|
|
|
{
|
|
|
char *func;
|
|
@@ -2274,6 +2304,10 @@ static void __init set_ftrace_early_filters(void)
|
|
|
set_ftrace_early_filter(ftrace_filter_buf, 1);
|
|
|
if (ftrace_notrace_buf[0])
|
|
|
set_ftrace_early_filter(ftrace_notrace_buf, 0);
|
|
|
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
|
|
|
+ if (ftrace_graph_buf[0])
|
|
|
+ set_ftrace_early_graph(ftrace_graph_buf);
|
|
|
+#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
|
|
|
}
|
|
|
|
|
|
static int
|