Skip to content

Commit

Permalink
tracing: Fix return value of ftrace_raw_output_prep()
Browse files Browse the repository at this point in the history
If the trace_seq of ftrace_raw_output_prep() is full this function
returns TRACE_TYPE_PARTIAL_LINE, otherwise it returns zero.

The problem is that TRACE_TYPE_PARTIAL_LINE happens to be zero!

The thing is, the caller of ftrace_raw_output_prep() expects a
success to be zero. Change that to expect it to be
TRACE_TYPE_HANDLED.

Link: http://lkml.kernel.org/r/20141114112522.GA2988@dhcp128.suse.cz

Reminded-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (Red Hat) committed Nov 19, 2014
1 parent dba3944 commit 8e2e095
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/trace/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \
field = (typeof(field))iter->ent; \
\
ret = ftrace_raw_output_prep(iter, trace_event); \
if (ret) \
if (ret != TRACE_TYPE_HANDLED) \
return ret; \
\
trace_seq_printf(s, print); \
Expand Down
5 changes: 1 addition & 4 deletions kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@ int ftrace_raw_output_prep(struct trace_iterator *iter,
trace_seq_init(p);
trace_seq_printf(s, "%s: ", ftrace_event_name(event));

if (trace_seq_has_overflowed(s))
return TRACE_TYPE_PARTIAL_LINE;

return 0;
return trace_handle_return(s);
}
EXPORT_SYMBOL(ftrace_raw_output_prep);

Expand Down

0 comments on commit 8e2e095

Please sign in to comment.