diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-01-23 09:06:23 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-26 08:40:53 -0500 |
commit | 9011262a37cb438f0fa9394b5e83840db8f9680a (patch) | |
tree | e79b5e6ff2499047f95fd99d7f9e90b62c6ae2cf | |
parent | 5ce1b1ed27d4ab1d81b8543a96f488bba2071576 (diff) |
ftrace: add ftrace_vprintk
Impact: new helper function
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/linux/ftrace.h | 8 | ||||
-rw-r--r-- | kernel/trace/trace.c | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 9f7880d87c39..7840e718c6c7 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -302,6 +302,9 @@ ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); | |||
302 | extern int | 302 | extern int |
303 | __ftrace_printk(unsigned long ip, const char *fmt, ...) | 303 | __ftrace_printk(unsigned long ip, const char *fmt, ...) |
304 | __attribute__ ((format (printf, 2, 3))); | 304 | __attribute__ ((format (printf, 2, 3))); |
305 | # define ftrace_vprintk(fmt, ap) __ftrace_printk(_THIS_IP_, fmt, ap) | ||
306 | extern int | ||
307 | __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); | ||
305 | extern void ftrace_dump(void); | 308 | extern void ftrace_dump(void); |
306 | #else | 309 | #else |
307 | static inline void | 310 | static inline void |
@@ -317,6 +320,11 @@ ftrace_printk(const char *fmt, ...) | |||
317 | { | 320 | { |
318 | return 0; | 321 | return 0; |
319 | } | 322 | } |
323 | static inline int | ||
324 | ftrace_vprintk(const char *fmt, va_list ap) | ||
325 | { | ||
326 | return 0; | ||
327 | } | ||
320 | static inline void ftrace_dump(void) { } | 328 | static inline void ftrace_dump(void) { } |
321 | #endif | 329 | #endif |
322 | 330 | ||
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 2129ab9d2a48..2f8ac1f008f5 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2951,6 +2951,15 @@ int __ftrace_printk(unsigned long ip, const char *fmt, ...) | |||
2951 | } | 2951 | } |
2952 | EXPORT_SYMBOL_GPL(__ftrace_printk); | 2952 | EXPORT_SYMBOL_GPL(__ftrace_printk); |
2953 | 2953 | ||
2954 | int __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap) | ||
2955 | { | ||
2956 | if (!(trace_flags & TRACE_ITER_PRINTK)) | ||
2957 | return 0; | ||
2958 | |||
2959 | return trace_vprintk(ip, task_curr_ret_stack(current), fmt, ap); | ||
2960 | } | ||
2961 | EXPORT_SYMBOL_GPL(__ftrace_vprintk); | ||
2962 | |||
2954 | static int trace_panic_handler(struct notifier_block *this, | 2963 | static int trace_panic_handler(struct notifier_block *this, |
2955 | unsigned long event, void *unused) | 2964 | unsigned long event, void *unused) |
2956 | { | 2965 | { |