Re: [RFC][PATCH 02/23 v4] tracing: Add trace_seq_has_overflowed() and trace_handle_return()
From: Steven Rostedt
Date: Fri Nov 14 2014 - 13:22:48 EST
On Fri, 14 Nov 2014 12:25:23 +0100
Petr Mladek <pmladek@xxxxxxx> wrote:
> > @@ -193,7 +184,6 @@ int ftrace_raw_output_prep(struct trace_iterator *iter,
> > struct trace_seq *s = &iter->seq;
> > struct trace_seq *p = &iter->tmp_seq;
> > struct trace_entry *entry;
> > - int ret;
> >
> > event = container_of(trace_event, struct ftrace_event_call, event);
> > entry = iter->ent;
> > @@ -204,8 +194,9 @@ int ftrace_raw_output_prep(struct trace_iterator *iter,
> > }
> >
> > trace_seq_init(p);
> > - ret = trace_seq_printf(s, "%s: ", ftrace_event_name(event));
> > - if (!ret)
> > + trace_seq_printf(s, "%s: ", ftrace_event_name(event));
> > +
> > + if (trace_seq_has_overflowed(s))
> > return TRACE_TYPE_PARTIAL_LINE;
> >
> > return 0;
>
> This looks like a bug in the original code. It returns 0 in each case
> because TRACE_TYPE_PARTIAL_LINE == 0. I guess that the last three
> lines should get replaced by
>
> return trace_handle_return(s);
>
> as it is done in the other functions.
Here's the fix for this:
-- Steve