Commit 183742f0 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt

tracing: Do not use return values of trace_seq_printf() in syscall tracing

The functions trace_seq_printf() and friends will not be returning values
soon and will be void functions. To know if they succeeded or not, the
functions trace_seq_has_overflowed() and trace_handle_return() should be
used instead.
Reviewed-by: default avatarPetr Mladek <pmladek@suse.cz>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 8579a107
...@@ -114,7 +114,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags, ...@@ -114,7 +114,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags,
struct trace_entry *ent = iter->ent; struct trace_entry *ent = iter->ent;
struct syscall_trace_enter *trace; struct syscall_trace_enter *trace;
struct syscall_metadata *entry; struct syscall_metadata *entry;
int i, ret, syscall; int i, syscall;
trace = (typeof(trace))ent; trace = (typeof(trace))ent;
syscall = trace->nr; syscall = trace->nr;
...@@ -128,35 +128,28 @@ print_syscall_enter(struct trace_iterator *iter, int flags, ...@@ -128,35 +128,28 @@ print_syscall_enter(struct trace_iterator *iter, int flags,
goto end; goto end;
} }
ret = trace_seq_printf(s, "%s(", entry->name); trace_seq_printf(s, "%s(", entry->name);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
for (i = 0; i < entry->nb_args; i++) { for (i = 0; i < entry->nb_args; i++) {
if (trace_seq_has_overflowed(s))
goto end;
/* parameter types */ /* parameter types */
if (trace_flags & TRACE_ITER_VERBOSE) { if (trace_flags & TRACE_ITER_VERBOSE)
ret = trace_seq_printf(s, "%s ", entry->types[i]); trace_seq_printf(s, "%s ", entry->types[i]);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
}
/* parameter values */ /* parameter values */
ret = trace_seq_printf(s, "%s: %lx%s", entry->args[i], trace_seq_printf(s, "%s: %lx%s", entry->args[i],
trace->args[i], trace->args[i],
i == entry->nb_args - 1 ? "" : ", "); i == entry->nb_args - 1 ? "" : ", ");
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
} }
ret = trace_seq_putc(s, ')'); trace_seq_putc(s, ')');
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
end: end:
ret = trace_seq_putc(s, '\n'); trace_seq_putc(s, '\n');
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
return TRACE_TYPE_HANDLED; return trace_handle_return(s);
} }
static enum print_line_t static enum print_line_t
...@@ -168,7 +161,6 @@ print_syscall_exit(struct trace_iterator *iter, int flags, ...@@ -168,7 +161,6 @@ print_syscall_exit(struct trace_iterator *iter, int flags,
struct syscall_trace_exit *trace; struct syscall_trace_exit *trace;
int syscall; int syscall;
struct syscall_metadata *entry; struct syscall_metadata *entry;
int ret;
trace = (typeof(trace))ent; trace = (typeof(trace))ent;
syscall = trace->nr; syscall = trace->nr;
...@@ -176,7 +168,7 @@ print_syscall_exit(struct trace_iterator *iter, int flags, ...@@ -176,7 +168,7 @@ print_syscall_exit(struct trace_iterator *iter, int flags,
if (!entry) { if (!entry) {
trace_seq_putc(s, '\n'); trace_seq_putc(s, '\n');
return TRACE_TYPE_HANDLED; goto out;
} }
if (entry->exit_event->event.type != ent->type) { if (entry->exit_event->event.type != ent->type) {
...@@ -184,12 +176,11 @@ print_syscall_exit(struct trace_iterator *iter, int flags, ...@@ -184,12 +176,11 @@ print_syscall_exit(struct trace_iterator *iter, int flags,
return TRACE_TYPE_UNHANDLED; return TRACE_TYPE_UNHANDLED;
} }
ret = trace_seq_printf(s, "%s -> 0x%lx\n", entry->name, trace_seq_printf(s, "%s -> 0x%lx\n", entry->name,
trace->ret); trace->ret);
if (!ret)
return TRACE_TYPE_PARTIAL_LINE;
return TRACE_TYPE_HANDLED; out:
return trace_handle_return(s);
} }
extern char *__bad_type_size(void); extern char *__bad_type_size(void);
......
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