[Crash-utility] [PATCH] Fix for the "trace.c" extension module
Dave Anderson
anderson at redhat.com
Sat Apr 15 18:00:39 UTC 2017
----- Original Message -----
>
>
> ----- Original Message -----
> > Fix for the "trace.c" extension module due to upstream
> > changes in kernel/trace/ring_buffer.c which changes the size of
> > ring_buffer_per_cpu.nr_pages field from an int to a long.
> > ---
> > extensions/trace.c | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/extensions/trace.c b/extensions/trace.c
> > index a93abdc..dfa8be9 100644
> > --- a/extensions/trace.c
> > +++ b/extensions/trace.c
> > @@ -96,7 +96,7 @@ struct ring_buffer_per_cpu {
> > ulong real_head_page;
> >
> > int head_page_index;
> > - unsigned int nr_pages;
> > + unsigned long nr_pages;
> > ulong *pages;
> >
> > ulong *linear_pages;
> > @@ -430,7 +430,13 @@ static int ftrace_init_buffers(struct
> > ring_buffer_per_cpu *buffers,
> > buffer_read_value(overrun);
> > buffer_read_value(entries);
> > if (per_cpu_buffer_sizes) {
> > - buffer_read_value(nr_pages);
> > + if (MEMBER_SIZE("ring_buffer_per_cpu", "nr_pages") == sizeof(unsigned int)) {
> > + unsigned int tmp_nr_pages;
> > + read_value(tmp_nr_pages, buffers[i].kaddr, ring_buffer_per_cpu, nr_pages);
> > + buffers[i].nr_pages = (unsigned long) tmp_nr_pages;
> > + } else {
> > + buffer_read_value(nr_pages);
> > + }
> > pages = buffers[i].nr_pages;
> > } else
> > buffers[i].nr_pages = pages;
> > --
> > 1.8.3.1
> >
>
> Thanks, and as I mentioned to you in the associated bugzilla, I will add the ".ring_buffer_read"
> patch for big-endian ppc64.
>
> Dave
Both patches are now queued for crash-7.1.9:
https://github.com/crash-utility/crash/commit/58fff92459057c594932cbd210aca0b275bd7b12
https://github.com/crash-utility/crash/commit/78330fc5fb384dd67918636777968f3db08f9aa4
Thanks,
Dave
More information about the Crash-utility
mailing list