]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
tracing/ftrace: provide the macro task_curr_ret_stack()
authorFrederic Weisbecker <fweisbec@gmail.com>
Thu, 4 Dec 2008 22:51:23 +0000 (23:51 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 5 Dec 2008 13:47:44 +0000 (14:47 +0100)
Impact: cleanup

As suggested by Steven Rostedt, this patch provide a new macro
task_curr_ret_stack() to move the cpp conditionnal CONFIG into
the linux/ftrace.h headers.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/ftrace.h
kernel/trace/trace.c

index b295d3106bfe3540aab66d0c50e54355a0c8a425..b9b4d0a22d10b6209a5f4dd0b0b3f1c44ea26278 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/types.h>
 #include <linux/kallsyms.h>
 #include <linux/bitops.h>
+#include <linux/sched.h>
 
 #ifdef CONFIG_FUNCTION_TRACER
 
@@ -387,9 +388,19 @@ extern void unregister_ftrace_graph(void);
 
 extern void ftrace_graph_init_task(struct task_struct *t);
 extern void ftrace_graph_exit_task(struct task_struct *t);
+
+static inline int task_curr_ret_stack(struct task_struct *t)
+{
+       return t->curr_ret_stack;
+}
 #else
 static inline void ftrace_graph_init_task(struct task_struct *t) { }
 static inline void ftrace_graph_exit_task(struct task_struct *t) { }
+
+static inline int task_curr_ret_stack(struct task_struct *tsk)
+{
+       return -1;
+}
 #endif
 
 #ifdef CONFIG_TRACING
index 5dca6ef1fbeb703c0c0f5111ac594bdec925a95d..7a93c663e52ae8682c19ae13475045dcb4ca9d19 100644 (file)
@@ -3657,13 +3657,7 @@ int __ftrace_printk(unsigned long ip, const char *fmt, ...)
                return 0;
 
        va_start(ap, fmt);
-
-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
-       ret = trace_vprintk(ip, current->curr_ret_stack, fmt, ap);
-#else
-       ret = trace_vprintk(ip, -1, fmt, ap);
-#endif
-
+       ret = trace_vprintk(ip, task_curr_ret_stack(current), fmt, ap);
        va_end(ap);
        return ret;
 }