[for-next][PATCH 6/9] tracing: Merge consecutive seq_puts calls

2014-11-14 Thread Steven Rostedt
From: Rasmus Villemoes 

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-li...@rasmusvillemoes.dk

Signed-off-by: Rasmus Villemoes 
Signed-off-by: Steven Rostedt 
---
 kernel/trace/trace.c| 64 ++---
 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,
 
 static void print_lat_help_header(struct seq_file *m)
 {
-   seq_puts(m, "#  _--=> CPU#\n");
-   seq_puts(m, "# / _-=> irqs-off\n");
-   seq_puts(m, "#| / _=> need-resched\n");
-   seq_puts(m, "#|| / _---=> hardirq/softirq \n");
-   seq_puts(m, "#||| / _--=> preempt-depth   \n");
-   seq_puts(m, "# / delay \n");
-   seq_puts(m, "#  cmd pid   | time  |   caller  \n");
-   seq_puts(m, "# \\   /  |  \\|   /   \n");
+   seq_puts(m, "#  _--=> CPU#\n"
+   "# / _-=> irqs-off\n"
+   "#| / _=> need-resched\n"
+   "#|| / _---=> hardirq/softirq \n"
+   "#||| / _--=> preempt-depth   \n"
+   "# / delay\n"
+   "#  cmd pid   | time  |   caller  \n"
+   "# \\   /  |  \\|   / \n");
 }
 
 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)
 {
print_event_info(buf, m);
-   seq_puts(m, "#   TASK-PID   CPU#  TIMESTAMP  FUNCTION\n");
-   seq_puts(m, "#  | |   |  | |\n");
+   seq_puts(m, "#   TASK-PID   CPU#  TIMESTAMP  FUNCTION\n"
+   "#  | |   |  | |\n");
 }
 
 static void print_func_help_header_irq(struct trace_buffer *buf, struct 
seq_file *m)
 {
print_event_info(buf, m);
-   seq_puts(m, "#  _-=> irqs-off\n");
-   seq_puts(m, "# / _=> need-resched\n");
-   seq_puts(m, "#| / _---=> 
hardirq/softirq\n");
-   seq_puts(m, "#|| / _--=> preempt-depth\n");
-   seq_puts(m, "#||| / delay\n");
-   seq_puts(m, "#   TASK-PID   CPU#  TIMESTAMP  
FUNCTION\n");
-   seq_puts(m, "#  | |   |      | |\n");
+   seq_puts(m, "#  _-=> irqs-off\n"
+   "# / _=> need-resched\n"
+   "#| / _---=> hardirq/softirq\n"
+   "#|| / _--=> preempt-depth\n"
+   "#||| / delay\n"
+   "#   TASK-PID   CPU#  TIMESTAMP  FUNCTION\n"
+   "#  | |   |      | |\n");
 }
 
 void
@@ -2860,34 +2860,34 @@ static void test_ftrace_alive(struct seq_file *m)
 {
if (!ftrace_is_dead())
return;
-   seq_puts(m, "# WARNING: FUNCTION TRACING IS CORRUPTED\n");
-   seq_puts(m, "#  MAY BE MISSING FUNCTION EVENTS\n");
+   seq_puts(m, "# WARNING: FUNCTION TRACING IS CORRUPTED\n"
+   "#  MAY BE MISSING FUNCTION EVENTS\n");
 }
 
 #ifdef CONFIG_TRACER_MAX_TRACE
 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 1 > snapshot : Allocates snapshot buffer, if not 
already allocated.\n");
-   seq_puts(m, "#  Takes a snapshot of the main 
buffer.\n");
-   seq_puts(m, "# 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");
-   seq_puts(m, "#   is not a '0' or '1')\n");
+   seq_puts(m, "# echo 0 > snapshot : Clears and frees snapshot buffer\n"
+ 

[for-next][PATCH 6/9] tracing: Merge consecutive seq_puts calls

2014-11-14 Thread Steven Rostedt
From: Rasmus Villemoes li...@rasmusvillemoes.dk

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-li...@rasmusvillemoes.dk

Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
Signed-off-by: Steven Rostedt rost...@goodmis.org
---
 kernel/trace/trace.c| 64 ++---
 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,
 
 static void print_lat_help_header(struct seq_file *m)
 {
-   seq_puts(m, #  _--= CPU#\n);
-   seq_puts(m, # / _-= irqs-off\n);
-   seq_puts(m, #| / _= need-resched\n);
-   seq_puts(m, #|| / _---= hardirq/softirq \n);
-   seq_puts(m, #||| / _--= preempt-depth   \n);
-   seq_puts(m, # / delay \n);
-   seq_puts(m, #  cmd pid   | time  |   caller  \n);
-   seq_puts(m, # \\   /  |  \\|   /   \n);
+   seq_puts(m, #  _--= CPU#\n
+   # / _-= irqs-off\n
+   #| / _= need-resched\n
+   #|| / _---= hardirq/softirq \n
+   #||| / _--= preempt-depth   \n
+   # / delay\n
+   #  cmd pid   | time  |   caller  \n
+   # \\   /  |  \\|   / \n);
 }
 
 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)
 {
print_event_info(buf, m);
-   seq_puts(m, #   TASK-PID   CPU#  TIMESTAMP  FUNCTION\n);
-   seq_puts(m, #  | |   |  | |\n);
+   seq_puts(m, #   TASK-PID   CPU#  TIMESTAMP  FUNCTION\n
+   #  | |   |  | |\n);
 }
 
 static void print_func_help_header_irq(struct trace_buffer *buf, struct 
seq_file *m)
 {
print_event_info(buf, m);
-   seq_puts(m, #  _-= irqs-off\n);
-   seq_puts(m, # / _= need-resched\n);
-   seq_puts(m, #| / _---= 
hardirq/softirq\n);
-   seq_puts(m, #|| / _--= preempt-depth\n);
-   seq_puts(m, #||| / delay\n);
-   seq_puts(m, #   TASK-PID   CPU#  TIMESTAMP  
FUNCTION\n);
-   seq_puts(m, #  | |   |      | |\n);
+   seq_puts(m, #  _-= irqs-off\n
+   # / _= need-resched\n
+   #| / _---= hardirq/softirq\n
+   #|| / _--= preempt-depth\n
+   #||| / delay\n
+   #   TASK-PID   CPU#  TIMESTAMP  FUNCTION\n
+   #  | |   |      | |\n);
 }
 
 void
@@ -2860,34 +2860,34 @@ static void test_ftrace_alive(struct seq_file *m)
 {
if (!ftrace_is_dead())
return;
-   seq_puts(m, # WARNING: FUNCTION TRACING IS CORRUPTED\n);
-   seq_puts(m, #  MAY BE MISSING FUNCTION EVENTS\n);
+   seq_puts(m, # WARNING: FUNCTION TRACING IS CORRUPTED\n
+   #  MAY BE MISSING FUNCTION EVENTS\n);
 }
 
 #ifdef CONFIG_TRACER_MAX_TRACE
 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 1  snapshot : Allocates snapshot buffer, if not 
already allocated.\n);
-   seq_puts(m, #  Takes a snapshot of the main 
buffer.\n);
-   seq_puts(m, # 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);
-   seq_puts(m, #   is not a '0' or '1')\n);
+   seq_puts(m, # echo 0  snapshot : Clears and frees snapshot buffer\n
+   # echo 1  snapshot :