diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-11-08 15:42:11 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-11-13 21:33:34 -0500 |
commit | d79ac28fde9c245473ba5f337341eb5823c7ebfc (patch) | |
tree | 305d1499669f1f9b1f6dc1f7624249bdd124f231 | |
parent | fa6f0cc751d377af3f4f1484bceb47dc10163753 (diff) |
tracing: Merge consecutive seq_puts calls
Consecutive seq_puts calls with literal strings can be merged to a
single call. This reduces the size of the generated code, and can also
lead to slight .rodata reduction (because of fewer nul and padding
bytes). It should also shave a off a few clock cycles.
Link: http://lkml.kernel.org/r/1415479332-25944-3-git-send-email-linux@rasmusvillemoes.dk
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/trace/trace.c | 64 | ||||
-rw-r--r-- | kernel/trace/trace_branch.c | 14 |
2 files changed, 39 insertions, 39 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index a419db75152c..44d561426700 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2509,14 +2509,14 @@ get_total_entries(struct trace_buffer *buf, | |||
2509 | 2509 | ||
2510 | static void print_lat_help_header(struct seq_file *m) | 2510 | static void print_lat_help_header(struct seq_file *m) |
2511 | { | 2511 | { |
2512 | seq_puts(m, "# _------=> CPU# \n"); | 2512 | seq_puts(m, "# _------=> CPU# \n" |
2513 | seq_puts(m, "# / _-----=> irqs-off \n"); | 2513 | "# / _-----=> irqs-off \n" |
2514 | seq_puts(m, "# | / _----=> need-resched \n"); | 2514 | "# | / _----=> need-resched \n" |
2515 | seq_puts(m, "# || / _---=> hardirq/softirq \n"); | 2515 | "# || / _---=> hardirq/softirq \n" |
2516 | seq_puts(m, "# ||| / _--=> preempt-depth \n"); | 2516 | "# ||| / _--=> preempt-depth \n" |
2517 | seq_puts(m, "# |||| / delay \n"); | 2517 | "# |||| / delay \n" |
2518 | seq_puts(m, "# cmd pid ||||| time | caller \n"); | 2518 | "# cmd pid ||||| time | caller \n" |
2519 | seq_puts(m, "# \\ / ||||| \\ | / \n"); | 2519 | "# \\ / ||||| \\ | / \n"); |
2520 | } | 2520 | } |
2521 | 2521 | ||
2522 | static void print_event_info(struct trace_buffer *buf, struct seq_file *m) | 2522 | static void print_event_info(struct trace_buffer *buf, struct seq_file *m) |
@@ -2533,20 +2533,20 @@ static void print_event_info(struct trace_buffer *buf, struct seq_file *m) | |||
2533 | static void print_func_help_header(struct trace_buffer *buf, struct seq_file *m) | 2533 | static void print_func_help_header(struct trace_buffer *buf, struct seq_file *m) |
2534 | { | 2534 | { |
2535 | print_event_info(buf, m); | 2535 | print_event_info(buf, m); |
2536 | seq_puts(m, "# TASK-PID CPU# TIMESTAMP FUNCTION\n"); | 2536 | seq_puts(m, "# TASK-PID CPU# TIMESTAMP FUNCTION\n" |
2537 | seq_puts(m, "# | | | | |\n"); | 2537 | "# | | | | |\n"); |
2538 | } | 2538 | } |
2539 | 2539 | ||
2540 | static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file *m) | 2540 | static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file *m) |
2541 | { | 2541 | { |
2542 | print_event_info(buf, m); | 2542 | print_event_info(buf, m); |
2543 | seq_puts(m, "# _-----=> irqs-off\n"); | 2543 | seq_puts(m, "# _-----=> irqs-off\n" |
2544 | seq_puts(m, "# / _----=> need-resched\n"); | 2544 | "# / _----=> need-resched\n" |
2545 | seq_puts(m, "# | / _---=> hardirq/softirq\n"); | 2545 | "# | / _---=> hardirq/softirq\n" |
2546 | seq_puts(m, "# || / _--=> preempt-depth\n"); | 2546 | "# || / _--=> preempt-depth\n" |
2547 | seq_puts(m, "# ||| / delay\n"); | 2547 | "# ||| / delay\n" |
2548 | seq_puts(m, "# TASK-PID CPU# |||| TIMESTAMP FUNCTION\n"); | 2548 | "# TASK-PID CPU# |||| TIMESTAMP FUNCTION\n" |
2549 | seq_puts(m, "# | | | |||| | |\n"); | 2549 | "# | | | |||| | |\n"); |
2550 | } | 2550 | } |
2551 | 2551 | ||
2552 | void | 2552 | void |
@@ -2860,34 +2860,34 @@ static void test_ftrace_alive(struct seq_file *m) | |||
2860 | { | 2860 | { |
2861 | if (!ftrace_is_dead()) | 2861 | if (!ftrace_is_dead()) |
2862 | return; | 2862 | return; |
2863 | seq_puts(m, "# WARNING: FUNCTION TRACING IS CORRUPTED\n"); | 2863 | seq_puts(m, "# WARNING: FUNCTION TRACING IS CORRUPTED\n" |
2864 | seq_puts(m, "# MAY BE MISSING FUNCTION EVENTS\n"); | 2864 | "# MAY BE MISSING FUNCTION EVENTS\n"); |
2865 | } | 2865 | } |
2866 | 2866 | ||
2867 | #ifdef CONFIG_TRACER_MAX_TRACE | 2867 | #ifdef CONFIG_TRACER_MAX_TRACE |
2868 | static void show_snapshot_main_help(struct seq_file *m) | 2868 | static void show_snapshot_main_help(struct seq_file *m) |
2869 | { | 2869 | { |
2870 | seq_puts(m, "# echo 0 > snapshot : Clears and frees snapshot buffer\n"); | 2870 | seq_puts(m, "# echo 0 > snapshot : Clears and frees snapshot buffer\n" |
2871 | seq_puts(m, "# echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.\n"); | 2871 | "# echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.\n" |
2872 | seq_puts(m, "# Takes a snapshot of the main buffer.\n"); | 2872 | "# Takes a snapshot of the main buffer.\n" |
2873 | seq_puts(m, "# echo 2 > snapshot : Clears snapshot buffer (but does not allocate or free)\n"); | 2873 | "# echo 2 > snapshot : Clears snapshot buffer (but does not allocate or free)\n" |
2874 | seq_puts(m, "# (Doesn't have to be '2' works with any number that\n"); | 2874 | "# (Doesn't have to be '2' works with any number that\n" |
2875 | seq_puts(m, "# is not a '0' or '1')\n"); | 2875 | "# is not a '0' or '1')\n"); |
2876 | } | 2876 | } |
2877 | 2877 | ||
2878 | static void show_snapshot_percpu_help(struct seq_file *m) | 2878 | static void show_snapshot_percpu_help(struct seq_file *m) |
2879 | { | 2879 | { |
2880 | seq_puts(m, "# echo 0 > snapshot : Invalid for per_cpu snapshot file.\n"); | 2880 | seq_puts(m, "# echo 0 > snapshot : Invalid for per_cpu snapshot file.\n"); |
2881 | #ifdef CONFIG_RING_BUFFER_ALLOW_SWAP | 2881 | #ifdef CONFIG_RING_BUFFER_ALLOW_SWAP |
2882 | seq_puts(m, "# echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.\n"); | 2882 | seq_puts(m, "# echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.\n" |
2883 | seq_puts(m, "# Takes a snapshot of the main buffer for this cpu.\n"); | 2883 | "# Takes a snapshot of the main buffer for this cpu.\n"); |
2884 | #else | 2884 | #else |
2885 | seq_puts(m, "# echo 1 > snapshot : Not supported with this kernel.\n"); | 2885 | seq_puts(m, "# echo 1 > snapshot : Not supported with this kernel.\n" |
2886 | seq_puts(m, "# Must use main snapshot file to allocate.\n"); | 2886 | "# Must use main snapshot file to allocate.\n"); |
2887 | #endif | 2887 | #endif |
2888 | seq_puts(m, "# echo 2 > snapshot : Clears this cpu's snapshot buffer (but does not allocate)\n"); | 2888 | seq_puts(m, "# echo 2 > snapshot : Clears this cpu's snapshot buffer (but does not allocate)\n" |
2889 | seq_puts(m, "# (Doesn't have to be '2' works with any number that\n"); | 2889 | "# (Doesn't have to be '2' works with any number that\n" |
2890 | seq_puts(m, "# is not a '0' or '1')\n"); | 2890 | "# is not a '0' or '1')\n"); |
2891 | } | 2891 | } |
2892 | 2892 | ||
2893 | static void print_snapshot_help(struct seq_file *m, struct trace_iterator *iter) | 2893 | static void print_snapshot_help(struct seq_file *m, struct trace_iterator *iter) |
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index 126c622e4f42..a3916f68a1c7 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c | |||
@@ -164,9 +164,9 @@ static enum print_line_t trace_branch_print(struct trace_iterator *iter, | |||
164 | static void branch_print_header(struct seq_file *s) | 164 | static void branch_print_header(struct seq_file *s) |
165 | { | 165 | { |
166 | seq_puts(s, "# TASK-PID CPU# TIMESTAMP CORRECT" | 166 | seq_puts(s, "# TASK-PID CPU# TIMESTAMP CORRECT" |
167 | " FUNC:FILE:LINE\n"); | 167 | " FUNC:FILE:LINE\n" |
168 | seq_puts(s, "# | | | | | " | 168 | "# | | | | | " |
169 | " |\n"); | 169 | " |\n"); |
170 | } | 170 | } |
171 | 171 | ||
172 | static struct trace_event_functions trace_branch_funcs = { | 172 | static struct trace_event_functions trace_branch_funcs = { |
@@ -233,8 +233,8 @@ 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_puts(m, " correct incorrect % "); | 236 | seq_puts(m, " correct incorrect % " |
237 | seq_puts(m, " Function " | 237 | " Function " |
238 | " File Line\n" | 238 | " File Line\n" |
239 | " ------- --------- - " | 239 | " ------- --------- - " |
240 | " -------- " | 240 | " -------- " |
@@ -362,8 +362,8 @@ 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_puts(m, " miss hit % "); | 365 | seq_puts(m, " miss hit % " |
366 | seq_puts(m, " Function " | 366 | " Function " |
367 | " File Line\n" | 367 | " File Line\n" |
368 | " ------- --------- - " | 368 | " ------- --------- - " |
369 | " -------- " | 369 | " -------- " |