tracing: Simplify printf'ing in seq_print_sym
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Mon, 29 Oct 2018 22:35:42 +0000 (23:35 +0100)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sat, 22 Dec 2018 13:21:06 +0000 (08:21 -0500)
commitbea6957d5cd7cbb327083d3bcf080133ee63ef65
tree459cde1b613bb3f0263a74b405e70ba2361b78a5
parentcc9f59fb3bc455984404dbab8be16f156a47d023
tracing: Simplify printf'ing in seq_print_sym

trace_seq_printf(..., "%s", ...) can be done with trace_seq_puts()
instead, avoiding printf overhead. In the second instance, the string
we're copying was just created from an snprintf() to a stack buffer, so
we might as well do that printf directly. This naturally leads to moving
the declaration of the str buffer inside the CONFIG_KALLSYMS guard,
which in turn will make gcc inline the function for !CONFIG_KALLSYMS (it
only has a single caller, but the huge stack frame seems to make gcc not
inline it for CONFIG_KALLSYMS).

Link: http://lkml.kernel.org/r/20181029223542.26175-4-linux@rasmusvillemoes.dk
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_output.c