On Fri, 2013-05-24 at 02:03 +0530, naresh.kamboju@linaro.org wrote:
From: Naresh Kamboju naresh.kamboju@linaro.org
I have noticed kernel crash while reading trace file.
'cat /sys/kernel/debug/tracing/trace'
The reason of the kernel crash is few bits in trace.c is missing from Merge tag
'trace-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
in to linux-linaro. Those are like "struct trace_array *tr " replaced with
"struct trace_buffer *buf" and respective changes.
I have applied this patch and tested on linux-linaro branch no more
kernel crash reported and trace data is back again.
Reviewed-by: Jon Medhurst tixy@linaro.org
Good catch Naresh. I've cc'd John Stultz as it looks like these problems
were introduced with the merge of mainline Linux into the
linaro-android-3.10-experimental and this patch should be added to that.
Considering the amount of churn in the trace code in 3.10, I wouldn't be
100% confident that we've found all the conflicts with the Android trace
patches, but this patch does fix the crashes we were seeing.
--
Tixy
> kernel/trace/trace.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index e4cc806..a68084e 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -2361,9 +2361,9 @@ static void print_func_help_header(struct trace_buffer *buf, struct seq_file *m)
> seq_puts(m, "# | | | | |\n");
> }
>
> -static void print_func_help_header_tgid(struct trace_array *tr, struct seq_file *m)
> +static void print_func_help_header_tgid(struct trace_buffer *buf, struct seq_file *m)
> {
> - print_event_info(tr, m);
> + print_event_info(buf, m);
> seq_puts(m, "# TASK-PID TGID CPU# TIMESTAMP FUNCTION\n");
> seq_puts(m, "# | | | | | |\n");
> }
> @@ -2380,9 +2380,9 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file
> seq_puts(m, "# | | | |||| | |\n");
> }
>
> -static void print_func_help_header_irq_tgid(struct trace_array *tr, struct seq_file *m)
> +static void print_func_help_header_irq_tgid(struct trace_buffer *buf, struct seq_file *m)
> {
> - print_event_info(tr, m);
> + print_event_info(buf, m);
> seq_puts(m, "# _-----=> irqs-off\n");
> seq_puts(m, "# / _----=> need-resched\n");
> seq_puts(m, "# | / _---=> hardirq/softirq\n");
> @@ -2693,14 +2693,14 @@ void trace_default_header(struct seq_file *m)
> if (!(trace_flags & TRACE_ITER_VERBOSE)) {
> if (trace_flags & TRACE_ITER_IRQ_INFO)
> if (trace_flags & TRACE_ITER_TGID)
> - print_func_help_header_irq_tgid(iter->tr, m);
> + print_func_help_header_irq_tgid(iter->trace_buffer, m);
> else
> - print_func_help_header_irq(iter->tr, m);
> + print_func_help_header_irq(iter->trace_buffer, m);
> else
> if (trace_flags & TRACE_ITER_TGID)
> - print_func_help_header_tgid(iter->tr, m);
> + print_func_help_header_tgid(iter->trace_buffer, m);
> else
> - print_func_help_header(iter->tr, m);
> + print_func_help_header(iter->trace_buffer, m);
> }
> }
> }