Commit 1177e436 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Steven Rostedt

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.dkSigned-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent d79ac28f
...@@ -383,7 +383,7 @@ event_trigger_print(const char *name, struct seq_file *m, ...@@ -383,7 +383,7 @@ event_trigger_print(const char *name, struct seq_file *m,
if (filter_str) if (filter_str)
seq_printf(m, " if %s\n", filter_str); seq_printf(m, " if %s\n", filter_str);
else else
seq_puts(m, "\n"); seq_putc(m, '\n');
return 0; return 0;
} }
...@@ -1105,7 +1105,7 @@ event_enable_trigger_print(struct seq_file *m, struct event_trigger_ops *ops, ...@@ -1105,7 +1105,7 @@ event_enable_trigger_print(struct seq_file *m, struct event_trigger_ops *ops,
if (data->filter_str) if (data->filter_str)
seq_printf(m, " if %s\n", data->filter_str); seq_printf(m, " if %s\n", data->filter_str);
else else
seq_puts(m, "\n"); seq_putc(m, '\n');
return 0; return 0;
} }
......
...@@ -1407,7 +1407,7 @@ static void __print_graph_headers_flags(struct seq_file *s, u32 flags) ...@@ -1407,7 +1407,7 @@ static void __print_graph_headers_flags(struct seq_file *s, u32 flags)
print_lat_header(s, flags); print_lat_header(s, flags);
/* 1st line */ /* 1st line */
seq_puts(s, "#"); seq_putc(s, '#');
if (flags & TRACE_GRAPH_PRINT_ABS_TIME) if (flags & TRACE_GRAPH_PRINT_ABS_TIME)
seq_puts(s, " TIME "); seq_puts(s, " TIME ");
if (flags & TRACE_GRAPH_PRINT_CPU) if (flags & TRACE_GRAPH_PRINT_CPU)
...@@ -1421,7 +1421,7 @@ static void __print_graph_headers_flags(struct seq_file *s, u32 flags) ...@@ -1421,7 +1421,7 @@ static void __print_graph_headers_flags(struct seq_file *s, u32 flags)
seq_puts(s, " FUNCTION CALLS\n"); seq_puts(s, " FUNCTION CALLS\n");
/* 2nd line */ /* 2nd line */
seq_puts(s, "#"); seq_putc(s, '#');
if (flags & TRACE_GRAPH_PRINT_ABS_TIME) if (flags & TRACE_GRAPH_PRINT_ABS_TIME)
seq_puts(s, " | "); seq_puts(s, " | ");
if (flags & TRACE_GRAPH_PRINT_CPU) if (flags & TRACE_GRAPH_PRINT_CPU)
......
...@@ -1030,7 +1030,7 @@ print_kprobe_event(struct trace_iterator *iter, int flags, ...@@ -1030,7 +1030,7 @@ print_kprobe_event(struct trace_iterator *iter, int flags,
if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET)) if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET))
goto partial; goto partial;
if (!trace_seq_puts(s, ")")) if (!trace_seq_putc(s, ')'))
goto partial; goto partial;
data = (u8 *)&field[1]; data = (u8 *)&field[1];
...@@ -1039,7 +1039,7 @@ print_kprobe_event(struct trace_iterator *iter, int flags, ...@@ -1039,7 +1039,7 @@ print_kprobe_event(struct trace_iterator *iter, int flags,
data + tp->args[i].offset, field)) data + tp->args[i].offset, field))
goto partial; goto partial;
if (!trace_seq_puts(s, "\n")) if (!trace_seq_putc(s, '\n'))
goto partial; goto partial;
return TRACE_TYPE_HANDLED; return TRACE_TYPE_HANDLED;
...@@ -1072,7 +1072,7 @@ print_kretprobe_event(struct trace_iterator *iter, int flags, ...@@ -1072,7 +1072,7 @@ print_kretprobe_event(struct trace_iterator *iter, int flags,
if (!seq_print_ip_sym(s, field->func, flags & ~TRACE_ITER_SYM_OFFSET)) if (!seq_print_ip_sym(s, field->func, flags & ~TRACE_ITER_SYM_OFFSET))
goto partial; goto partial;
if (!trace_seq_puts(s, ")")) if (!trace_seq_putc(s, ')'))
goto partial; goto partial;
data = (u8 *)&field[1]; data = (u8 *)&field[1];
...@@ -1081,7 +1081,7 @@ print_kretprobe_event(struct trace_iterator *iter, int flags, ...@@ -1081,7 +1081,7 @@ print_kretprobe_event(struct trace_iterator *iter, int flags,
data + tp->args[i].offset, field)) data + tp->args[i].offset, field))
goto partial; goto partial;
if (!trace_seq_puts(s, "\n")) if (!trace_seq_putc(s, '\n'))
goto partial; goto partial;
return TRACE_TYPE_HANDLED; return TRACE_TYPE_HANDLED;
......
...@@ -305,7 +305,7 @@ static int t_show(struct seq_file *m, void *v) ...@@ -305,7 +305,7 @@ static int t_show(struct seq_file *m, void *v)
seq_puts(m, "\\t"); seq_puts(m, "\\t");
break; break;
case '\\': case '\\':
seq_puts(m, "\\"); seq_putc(m, '\\');
break; break;
case '"': case '"':
seq_puts(m, "\\\""); seq_puts(m, "\\\"");
......
...@@ -872,7 +872,7 @@ print_uprobe_event(struct trace_iterator *iter, int flags, struct trace_event *e ...@@ -872,7 +872,7 @@ print_uprobe_event(struct trace_iterator *iter, int flags, struct trace_event *e
goto partial; goto partial;
} }
if (trace_seq_puts(s, "\n")) if (trace_seq_putc(s, '\n'))
return TRACE_TYPE_HANDLED; return TRACE_TYPE_HANDLED;
partial: partial:
......
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