aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ftrace.h19
-rw-r--r--kernel/trace/trace.c16
2 files changed, 18 insertions, 17 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index f53b975e32fa..018af16bce5c 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -157,7 +157,24 @@ static inline void __ftrace_enabled_restore(int enabled)
157#ifdef CONFIG_TRACING 157#ifdef CONFIG_TRACING
158extern void 158extern void
159ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); 159ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3);
160# define ftrace_printk(x...) __ftrace_printk(_THIS_IP_, x) 160
161/**
162 * ftrace_printk - printf formatting in the ftrace buffer
163 * @fmt: the printf format for printing
164 *
165 * Note: __ftrace_printk is an internal function for ftrace_printk and
166 * the @ip is passed in via the ftrace_printk macro.
167 *
168 * This function allows a kernel developer to debug fast path sections
169 * that printk is not appropriate for. By scattering in various
170 * printk like tracing in the code, a developer can quickly see
171 * where problems are occurring.
172 *
173 * This is intended as a debugging tool for the developer only.
174 * Please refrain from leaving ftrace_printks scattered around in
175 * your code.
176 */
177# define ftrace_printk(fmt...) __ftrace_printk(_THIS_IP_, fmt)
161extern int 178extern int
162__ftrace_printk(unsigned long ip, const char *fmt, ...) 179__ftrace_printk(unsigned long ip, const char *fmt, ...)
163 __attribute__ ((format (printf, 2, 3))); 180 __attribute__ ((format (printf, 2, 3)));
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index a917bea82715..2597e7e49c35 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3075,22 +3075,6 @@ static __init void tracer_init_debugfs(void)
3075 (sizeof(struct trace_field) - offsetof(struct trace_field, print.buf)) 3075 (sizeof(struct trace_field) - offsetof(struct trace_field, print.buf))
3076#define TRACE_CONT_BUF_SIZE sizeof(struct trace_field) 3076#define TRACE_CONT_BUF_SIZE sizeof(struct trace_field)
3077 3077
3078/**
3079 * ftrace_printk - printf formatting in the ftrace buffer
3080 * @fmt - the printf format for printing.
3081 *
3082 * Note: __ftrace_printk is an internal function for ftrace_printk and
3083 * the @ip is passed in via the ftrace_printk macro.
3084 *
3085 * This function allows a kernel developer to debug fast path sections
3086 * that printk is not appropriate for. By scattering in various
3087 * printk like tracing in the code, a developer can quickly see
3088 * where problems are occurring.
3089 *
3090 * This is intended as a debugging tool for the developer only.
3091 * Please reframe from leaving ftrace_printks scattered around in
3092 * your code.
3093 */
3094int __ftrace_printk(unsigned long ip, const char *fmt, ...) 3078int __ftrace_printk(unsigned long ip, const char *fmt, ...)
3095{ 3079{
3096 struct trace_array *tr = &global_trace; 3080 struct trace_array *tr = &global_trace;