This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] btrace: kernel address filtering
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 8 Sep 2015 12:19:37 +0000
- Subject: RE: [PATCH] btrace: kernel address filtering
- Authentication-results: sourceware.org; auth=none
- References: <1441122141-26033-1-git-send-email-markus dot t dot metzger at intel dot com> <55EEB763 dot 2060701 at redhat dot com>
> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Tuesday, September 8, 2015 12:25 PM
> To: Metzger, Markus T
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH] btrace: kernel address filtering
>
> On 09/01/2015 04:42 PM, Markus Metzger wrote:
>
> > --- a/gdb/nat/linux-btrace.h
> > +++ b/gdb/nat/linux-btrace.h
> > @@ -101,10 +101,11 @@ struct btrace_target_info
> > } variant;
> > #endif /* HAVE_LINUX_PERF_EVENT_H */
> >
> > - /* The size of a pointer in bits for this thread.
> > - The information is used to identify kernel addresses in order to skip
> > - records from/to kernel space. */
> > - int ptr_bits;
> > + /* The kernel start address.
> > + The information is used to tell kernel addresses from user addresses in
> > + order to skip records from kernel space. We assume that any address
> > + smaller than KERNEL_START is in user space. */
> > + uint64_t kernel_start;
>
> Is there a reason we need to store the kernel's start address on every
> thread?
I don't think we need to store it, at all. We had to store the ptr_bits since we
needed to fill them in later. But the kernel start address is computed, cached,
and used in nat/linux-btrace.c.
I'll send an updated patch.
thanks,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Prof. Dr. Hermann Eul
Chairperson of the Supervisory Board: Tiffany Doon Silva
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928