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 /kernel/trace/trace.c | |
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>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 64 |
1 files changed, 32 insertions, 32 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) |