diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-11-08 15:42:10 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-11-13 21:32:19 -0500 |
commit | fa6f0cc751d377af3f4f1484bceb47dc10163753 (patch) | |
tree | 4605e7d420b5847228a78373737653e5563c7da1 /kernel/trace/trace_branch.c | |
parent | 8520dedbbf7578a397ecdfcf6ab83f775f914cfe (diff) |
tracing: Replace seq_printf by simpler equivalents
Using seq_printf to print a simple string or a single character is a
lot more expensive than it needs to be, since seq_puts and seq_putc
exist.
These patches do
seq_printf(m, s) -> seq_puts(m, s)
seq_printf(m, "%s", s) -> seq_puts(m, s)
seq_printf(m, "%c", c) -> seq_putc(m, c)
Subsequent patches will simplify further.
Link: http://lkml.kernel.org/r/1415479332-25944-2-git-send-email-linux@rasmusvillemoes.dk
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_branch.c')
-rw-r--r-- | kernel/trace/trace_branch.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index 697fb9bac8f0..126c622e4f42 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c | |||
@@ -233,12 +233,12 @@ extern unsigned long __stop_annotated_branch_profile[]; | |||
233 | 233 | ||
234 | static int annotated_branch_stat_headers(struct seq_file *m) | 234 | static int annotated_branch_stat_headers(struct seq_file *m) |
235 | { | 235 | { |
236 | seq_printf(m, " correct incorrect %% "); | 236 | seq_puts(m, " correct incorrect % "); |
237 | seq_printf(m, " Function " | 237 | seq_puts(m, " Function " |
238 | " File Line\n" | 238 | " File Line\n" |
239 | " ------- --------- - " | 239 | " ------- --------- - " |
240 | " -------- " | 240 | " -------- " |
241 | " ---- ----\n"); | 241 | " ---- ----\n"); |
242 | return 0; | 242 | return 0; |
243 | } | 243 | } |
244 | 244 | ||
@@ -274,7 +274,7 @@ static int branch_stat_show(struct seq_file *m, void *v) | |||
274 | 274 | ||
275 | seq_printf(m, "%8lu %8lu ", p->correct, p->incorrect); | 275 | seq_printf(m, "%8lu %8lu ", p->correct, p->incorrect); |
276 | if (percent < 0) | 276 | if (percent < 0) |
277 | seq_printf(m, " X "); | 277 | seq_puts(m, " X "); |
278 | else | 278 | else |
279 | seq_printf(m, "%3ld ", percent); | 279 | seq_printf(m, "%3ld ", percent); |
280 | seq_printf(m, "%-30.30s %-20.20s %d\n", p->func, f, p->line); | 280 | seq_printf(m, "%-30.30s %-20.20s %d\n", p->func, f, p->line); |
@@ -362,12 +362,12 @@ extern unsigned long __stop_branch_profile[]; | |||
362 | 362 | ||
363 | static int all_branch_stat_headers(struct seq_file *m) | 363 | static int all_branch_stat_headers(struct seq_file *m) |
364 | { | 364 | { |
365 | seq_printf(m, " miss hit %% "); | 365 | seq_puts(m, " miss hit % "); |
366 | seq_printf(m, " Function " | 366 | seq_puts(m, " Function " |
367 | " File Line\n" | 367 | " File Line\n" |
368 | " ------- --------- - " | 368 | " ------- --------- - " |
369 | " -------- " | 369 | " -------- " |
370 | " ---- ----\n"); | 370 | " ---- ----\n"); |
371 | return 0; | 371 | return 0; |
372 | } | 372 | } |
373 | 373 | ||