aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-11-08 15:42:12 -0500
committerSteven Rostedt <rostedt@goodmis.org>2014-11-14 07:55:55 -0500
commit1177e4364154a00baf2c9eb72fd960f0c5a8de84 (patch)
tree9556d5742714cbc84c4ac5100319bb088487062d
parentd79ac28fde9c245473ba5f337341eb5823c7ebfc (diff)
trace: Replace single-character seq_puts with seq_putc
Printing a single character to a seqfile might as well be done with seq_putc instead of seq_puts; this avoids a strlen() call and a memory access. It also shaves another few bytes off the generated code. Link: http://lkml.kernel.org/r/1415479332-25944-4-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_events_trigger.c4
-rw-r--r--kernel/trace/trace_functions_graph.c4
-rw-r--r--kernel/trace/trace_kprobe.c8
-rw-r--r--kernel/trace/trace_printk.c2
-rw-r--r--kernel/trace/trace_uprobe.c2
5 files changed, 10 insertions, 10 deletions
diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
index 3d89ffc66740..8712df9decb4 100644
--- a/kernel/trace/trace_events_trigger.c
+++ b/kernel/trace/trace_events_trigger.c
@@ -383,7 +383,7 @@ event_trigger_print(const char *name, struct seq_file *m,
383 if (filter_str) 383 if (filter_str)
384 seq_printf(m, " if %s\n", filter_str); 384 seq_printf(m, " if %s\n", filter_str);
385 else 385 else
386 seq_puts(m, "\n"); 386 seq_putc(m, '\n');
387 387
388 return 0; 388 return 0;
389} 389}
@@ -1105,7 +1105,7 @@ event_enable_trigger_print(struct seq_file *m, struct event_trigger_ops *ops,
1105 if (data->filter_str) 1105 if (data->filter_str)
1106 seq_printf(m, " if %s\n", data->filter_str); 1106 seq_printf(m, " if %s\n", data->filter_str);
1107 else 1107 else
1108 seq_puts(m, "\n"); 1108 seq_putc(m, '\n');
1109 1109
1110 return 0; 1110 return 0;
1111} 1111}
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 29ba611e6f57..a82d1d3bd76d 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -1407,7 +1407,7 @@ static void __print_graph_headers_flags(struct seq_file *s, u32 flags)
1407 print_lat_header(s, flags); 1407 print_lat_header(s, flags);
1408 1408
1409 /* 1st line */ 1409 /* 1st line */
1410 seq_puts(s, "#"); 1410 seq_putc(s, '#');
1411 if (flags & TRACE_GRAPH_PRINT_ABS_TIME) 1411 if (flags & TRACE_GRAPH_PRINT_ABS_TIME)
1412 seq_puts(s, " TIME "); 1412 seq_puts(s, " TIME ");
1413 if (flags & TRACE_GRAPH_PRINT_CPU) 1413 if (flags & TRACE_GRAPH_PRINT_CPU)
@@ -1421,7 +1421,7 @@ static void __print_graph_headers_flags(struct seq_file *s, u32 flags)
1421 seq_puts(s, " FUNCTION CALLS\n"); 1421 seq_puts(s, " FUNCTION CALLS\n");
1422 1422
1423 /* 2nd line */ 1423 /* 2nd line */
1424 seq_puts(s, "#"); 1424 seq_putc(s, '#');
1425 if (flags & TRACE_GRAPH_PRINT_ABS_TIME) 1425 if (flags & TRACE_GRAPH_PRINT_ABS_TIME)
1426 seq_puts(s, " | "); 1426 seq_puts(s, " | ");
1427 if (flags & TRACE_GRAPH_PRINT_CPU) 1427 if (flags & TRACE_GRAPH_PRINT_CPU)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 240d27ddf82e..ef7e7f16ed1a 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -1030,7 +1030,7 @@ print_kprobe_event(struct trace_iterator *iter, int flags,
1030 if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET)) 1030 if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET))
1031 goto partial; 1031 goto partial;
1032 1032
1033 if (!trace_seq_puts(s, ")")) 1033 if (!trace_seq_putc(s, ')'))
1034 goto partial; 1034 goto partial;
1035 1035
1036 data = (u8 *)&field[1]; 1036 data = (u8 *)&field[1];
@@ -1039,7 +1039,7 @@ print_kprobe_event(struct trace_iterator *iter, int flags,
1039 data + tp->args[i].offset, field)) 1039 data + tp->args[i].offset, field))
1040 goto partial; 1040 goto partial;
1041 1041
1042 if (!trace_seq_puts(s, "\n")) 1042 if (!trace_seq_putc(s, '\n'))
1043 goto partial; 1043 goto partial;
1044 1044
1045 return TRACE_TYPE_HANDLED; 1045 return TRACE_TYPE_HANDLED;
@@ -1072,7 +1072,7 @@ print_kretprobe_event(struct trace_iterator *iter, int flags,
1072 if (!seq_print_ip_sym(s, field->func, flags & ~TRACE_ITER_SYM_OFFSET)) 1072 if (!seq_print_ip_sym(s, field->func, flags & ~TRACE_ITER_SYM_OFFSET))
1073 goto partial; 1073 goto partial;
1074 1074
1075 if (!trace_seq_puts(s, ")")) 1075 if (!trace_seq_putc(s, ')'))
1076 goto partial; 1076 goto partial;
1077 1077
1078 data = (u8 *)&field[1]; 1078 data = (u8 *)&field[1];
@@ -1081,7 +1081,7 @@ print_kretprobe_event(struct trace_iterator *iter, int flags,
1081 data + tp->args[i].offset, field)) 1081 data + tp->args[i].offset, field))
1082 goto partial; 1082 goto partial;
1083 1083
1084 if (!trace_seq_puts(s, "\n")) 1084 if (!trace_seq_putc(s, '\n'))
1085 goto partial; 1085 goto partial;
1086 1086
1087 return TRACE_TYPE_HANDLED; 1087 return TRACE_TYPE_HANDLED;
diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c
index 2900817ba65c..c4e70b6bd7fa 100644
--- a/kernel/trace/trace_printk.c
+++ b/kernel/trace/trace_printk.c
@@ -305,7 +305,7 @@ static int t_show(struct seq_file *m, void *v)
305 seq_puts(m, "\\t"); 305 seq_puts(m, "\\t");
306 break; 306 break;
307 case '\\': 307 case '\\':
308 seq_puts(m, "\\"); 308 seq_putc(m, '\\');
309 break; 309 break;
310 case '"': 310 case '"':
311 seq_puts(m, "\\\""); 311 seq_puts(m, "\\\"");
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index d22117beedd0..e35327c787f7 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -872,7 +872,7 @@ print_uprobe_event(struct trace_iterator *iter, int flags, struct trace_event *e
872 goto partial; 872 goto partial;
873 } 873 }
874 874
875 if (trace_seq_puts(s, "\n")) 875 if (trace_seq_putc(s, '\n'))
876 return TRACE_TYPE_HANDLED; 876 return TRACE_TYPE_HANDLED;
877 877
878partial: 878partial: