Commit d79ac28f authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Steven Rostedt

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.dkSigned-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent fa6f0cc7
...@@ -2509,14 +2509,14 @@ get_total_entries(struct trace_buffer *buf, ...@@ -2509,14 +2509,14 @@ get_total_entries(struct trace_buffer *buf,
static void print_lat_help_header(struct seq_file *m) static void print_lat_help_header(struct seq_file *m)
{ {
seq_puts(m, "# _------=> CPU# \n"); seq_puts(m, "# _------=> CPU# \n"
seq_puts(m, "# / _-----=> irqs-off \n"); "# / _-----=> irqs-off \n"
seq_puts(m, "# | / _----=> need-resched \n"); "# | / _----=> need-resched \n"
seq_puts(m, "# || / _---=> hardirq/softirq \n"); "# || / _---=> hardirq/softirq \n"
seq_puts(m, "# ||| / _--=> preempt-depth \n"); "# ||| / _--=> preempt-depth \n"
seq_puts(m, "# |||| / delay \n"); "# |||| / delay \n"
seq_puts(m, "# cmd pid ||||| time | caller \n"); "# cmd pid ||||| time | caller \n"
seq_puts(m, "# \\ / ||||| \\ | / \n"); "# \\ / ||||| \\ | / \n");
} }
static void print_event_info(struct trace_buffer *buf, struct seq_file *m) 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,20 +2533,20 @@ static void print_event_info(struct trace_buffer *buf, struct seq_file *m)
static void print_func_help_header(struct trace_buffer *buf, struct seq_file *m) static void print_func_help_header(struct trace_buffer *buf, struct seq_file *m)
{ {
print_event_info(buf, m); print_event_info(buf, m);
seq_puts(m, "# TASK-PID CPU# TIMESTAMP FUNCTION\n"); seq_puts(m, "# TASK-PID CPU# TIMESTAMP FUNCTION\n"
seq_puts(m, "# | | | | |\n"); "# | | | | |\n");
} }
static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file *m) static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file *m)
{ {
print_event_info(buf, m); print_event_info(buf, m);
seq_puts(m, "# _-----=> irqs-off\n"); seq_puts(m, "# _-----=> irqs-off\n"
seq_puts(m, "# / _----=> need-resched\n"); "# / _----=> need-resched\n"
seq_puts(m, "# | / _---=> hardirq/softirq\n"); "# | / _---=> hardirq/softirq\n"
seq_puts(m, "# || / _--=> preempt-depth\n"); "# || / _--=> preempt-depth\n"
seq_puts(m, "# ||| / delay\n"); "# ||| / delay\n"
seq_puts(m, "# TASK-PID CPU# |||| TIMESTAMP FUNCTION\n"); "# TASK-PID CPU# |||| TIMESTAMP FUNCTION\n"
seq_puts(m, "# | | | |||| | |\n"); "# | | | |||| | |\n");
} }
void void
...@@ -2860,34 +2860,34 @@ static void test_ftrace_alive(struct seq_file *m) ...@@ -2860,34 +2860,34 @@ static void test_ftrace_alive(struct seq_file *m)
{ {
if (!ftrace_is_dead()) if (!ftrace_is_dead())
return; return;
seq_puts(m, "# WARNING: FUNCTION TRACING IS CORRUPTED\n"); seq_puts(m, "# WARNING: FUNCTION TRACING IS CORRUPTED\n"
seq_puts(m, "# MAY BE MISSING FUNCTION EVENTS\n"); "# MAY BE MISSING FUNCTION EVENTS\n");
} }
#ifdef CONFIG_TRACER_MAX_TRACE #ifdef CONFIG_TRACER_MAX_TRACE
static void show_snapshot_main_help(struct seq_file *m) static void show_snapshot_main_help(struct seq_file *m)
{ {
seq_puts(m, "# echo 0 > snapshot : Clears and frees snapshot buffer\n"); seq_puts(m, "# echo 0 > snapshot : Clears and frees snapshot buffer\n"
seq_puts(m, "# echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.\n"); "# echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.\n"
seq_puts(m, "# Takes a snapshot of the main buffer.\n"); "# Takes a snapshot of the main buffer.\n"
seq_puts(m, "# echo 2 > snapshot : Clears snapshot buffer (but does not allocate or free)\n"); "# echo 2 > snapshot : Clears snapshot buffer (but does not allocate or free)\n"
seq_puts(m, "# (Doesn't have to be '2' works with any number that\n"); "# (Doesn't have to be '2' works with any number that\n"
seq_puts(m, "# is not a '0' or '1')\n"); "# is not a '0' or '1')\n");
} }
static void show_snapshot_percpu_help(struct seq_file *m) static void show_snapshot_percpu_help(struct seq_file *m)
{ {
seq_puts(m, "# echo 0 > snapshot : Invalid for per_cpu snapshot file.\n"); seq_puts(m, "# echo 0 > snapshot : Invalid for per_cpu snapshot file.\n");
#ifdef CONFIG_RING_BUFFER_ALLOW_SWAP #ifdef CONFIG_RING_BUFFER_ALLOW_SWAP
seq_puts(m, "# echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.\n"); seq_puts(m, "# echo 1 > snapshot : Allocates snapshot buffer, if not already allocated.\n"
seq_puts(m, "# Takes a snapshot of the main buffer for this cpu.\n"); "# Takes a snapshot of the main buffer for this cpu.\n");
#else #else
seq_puts(m, "# echo 1 > snapshot : Not supported with this kernel.\n"); seq_puts(m, "# echo 1 > snapshot : Not supported with this kernel.\n"
seq_puts(m, "# Must use main snapshot file to allocate.\n"); "# Must use main snapshot file to allocate.\n");
#endif #endif
seq_puts(m, "# echo 2 > snapshot : Clears this cpu's snapshot buffer (but does not allocate)\n"); seq_puts(m, "# echo 2 > snapshot : Clears this cpu's snapshot buffer (but does not allocate)\n"
seq_puts(m, "# (Doesn't have to be '2' works with any number that\n"); "# (Doesn't have to be '2' works with any number that\n"
seq_puts(m, "# is not a '0' or '1')\n"); "# is not a '0' or '1')\n");
} }
static void print_snapshot_help(struct seq_file *m, struct trace_iterator *iter) static void print_snapshot_help(struct seq_file *m, struct trace_iterator *iter)
......
...@@ -164,9 +164,9 @@ static enum print_line_t trace_branch_print(struct trace_iterator *iter, ...@@ -164,9 +164,9 @@ static enum print_line_t trace_branch_print(struct trace_iterator *iter,
static void branch_print_header(struct seq_file *s) static void branch_print_header(struct seq_file *s)
{ {
seq_puts(s, "# TASK-PID CPU# TIMESTAMP CORRECT" seq_puts(s, "# TASK-PID CPU# TIMESTAMP CORRECT"
" FUNC:FILE:LINE\n"); " FUNC:FILE:LINE\n"
seq_puts(s, "# | | | | | " "# | | | | | "
" |\n"); " |\n");
} }
static struct trace_event_functions trace_branch_funcs = { static struct trace_event_functions trace_branch_funcs = {
...@@ -233,8 +233,8 @@ extern unsigned long __stop_annotated_branch_profile[]; ...@@ -233,8 +233,8 @@ extern unsigned long __stop_annotated_branch_profile[];
static int annotated_branch_stat_headers(struct seq_file *m) static int annotated_branch_stat_headers(struct seq_file *m)
{ {
seq_puts(m, " correct incorrect % "); seq_puts(m, " correct incorrect % "
seq_puts(m, " Function " " Function "
" File Line\n" " File Line\n"
" ------- --------- - " " ------- --------- - "
" -------- " " -------- "
...@@ -362,8 +362,8 @@ extern unsigned long __stop_branch_profile[]; ...@@ -362,8 +362,8 @@ extern unsigned long __stop_branch_profile[];
static int all_branch_stat_headers(struct seq_file *m) static int all_branch_stat_headers(struct seq_file *m)
{ {
seq_puts(m, " miss hit % "); seq_puts(m, " miss hit % "
seq_puts(m, " Function " " Function "
" File Line\n" " File Line\n"
" ------- --------- - " " ------- --------- - "
" -------- " " -------- "
......
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