summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2013-03-09 06:40:58 +0100
committerSteven Rostedt <rostedt@goodmis.org>2013-03-15 05:35:56 +0100
commitca268da6e415448a43138e1abc5d5f057af319d7 (patch)
tree33fcaf68989e12fca96ad86bdece7eaac16d1545 /kernel/trace/trace.h
parenttracing: Optimize trace_printk() with one arg to use trace_puts() (diff)
downloadlinux-ca268da6e415448a43138e1abc5d5f057af319d7.tar.xz
linux-ca268da6e415448a43138e1abc5d5f057af319d7.zip
tracing: Add internal ftrace trace_puts() for ftrace to use
There's a few places that ftrace uses trace_printk() for internal use, but this requires context (normal, softirq, irq, NMI) buffers to keep things lockless. But the trace_puts() does not, as it can write the string directly into the ring buffer. Make a internal helper for trace_puts() and have the internal functions use that. This way the extra context buffers are not used. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index d5764a8532e2..0e430b401ab6 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1040,6 +1040,17 @@ void trace_printk_start_comm(void);
int trace_keep_overwrite(struct tracer *tracer, u32 mask, int set);
int set_tracer_flag(struct trace_array *tr, unsigned int mask, int enabled);
+/*
+ * Normal trace_printk() and friends allocates special buffers
+ * to do the manipulation, as well as saves the print formats
+ * into sections to display. But the trace infrastructure wants
+ * to use these without the added overhead at the price of being
+ * a bit slower (used mainly for warnings, where we don't care
+ * about performance). The internal_trace_puts() is for such
+ * a purpose.
+ */
+#define internal_trace_puts(str) __trace_puts(_THIS_IP_, str, strlen(str))
+
#undef FTRACE_ENTRY
#define FTRACE_ENTRY(call, struct_name, id, tstruct, print, filter) \
extern struct ftrace_event_call \