tracing: Only allow trace_array_printk() to be used by instances

To prevent default "trace_printks()" from spamming the top level tracing
ring buffer, only allow trace instances to use trace_array_printk() (which
can be used without the trace_printk() start up warning).
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 9ebcfadb
......@@ -3346,12 +3346,16 @@ int trace_array_printk(struct trace_array *tr,
int ret;
va_list ap;
if (!(global_trace.trace_flags & TRACE_ITER_PRINTK))
return 0;
if (!tr)
return -ENOENT;
/* This is only allowed for created instances */
if (tr == &global_trace)
return 0;
if (!(tr->trace_flags & TRACE_ITER_PRINTK))
return 0;
va_start(ap, fmt);
ret = trace_array_vprintk(tr, ip, fmt, ap);
va_end(ap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment