From: "Steven Rostedt (Red Hat)" <[email protected]>
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/[email protected]
Reminded-by: Petr Mladek <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
---
include/trace/ftrace.h | 2 +-
kernel/trace/trace_output.c | 5 +----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index f13471b5d27a..139b5067345b 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -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); \
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 163c11b6b8ff..723818bc83b4 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -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);
--
2.1.1
On Fri 2014-11-14 23:59:00, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <[email protected]>
>
> 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/[email protected]
>
> Reminded-by: Petr Mladek <[email protected]>
> Signed-off-by: Steven Rostedt <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Best Regards,
Petr