Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH] configure: check for perf_event.h version
Date: Thu, 06 Aug 2015 14:14:00 -0000	[thread overview]
Message-ID: <A78C989F6D9628469189715575E55B2333190C1E@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <55C365B2.4010906@redhat.com>

> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Thursday, August 6, 2015 3:49 PM
> To: Metzger, Markus T
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH] configure: check for perf_event.h version
> 
> On 08/06/2015 02:06 PM, Markus Metzger wrote:
> > Intel(R) Processor Trace support requires a recent linux/perf_event.h
> header.
> >
> > When GDB is built on an older system, Intel(R) Processor Trace will not be
> > available and there is no indication in the configure and build log as to
> > what went wrong.
> >
> > Check for a compatible linux/perf_event.h at configure-time.
> 
> 
> > diff --git a/gdb/configure.ac b/gdb/configure.ac
> > index 905c27b..d867e85 100644
> > --- a/gdb/configure.ac
> > +++ b/gdb/configure.ac
> > @@ -1252,6 +1252,20 @@ if test "${with_intel_pt}" = no; then
> >    AC_MSG_WARN([Intel(R) Processor Trace support disabled; some
> features may be unavailable.])
> >    HAVE_LIBIPT=no
> >  else
> > +  AC_PREPROC_IFELSE(AC_LANG_SOURCE([[
> > +#include <linux/perf_event.h>
> > +#ifdef PERF_ATTR_SIZE_VER5
> > +# error
> > +#endif
> 
> Can you explain what kind of symbol PERF_ATTR_SIZE_VER5 is?
> From the patch, I understand that that is something that is _not_
> defined in the perf versions that are supposedly supported?
> (otherwise, I'd expect an #ifndef instead.)

It's a macro.  I took the double-negation approach from a similar
check for python_has_threads.  Maybe this wasn't such a good
idea.

We need the macro defined for Intel PT support.

> What about these? :
> 
> nat/linux-btrace.c:722:#if defined (PERF_ATTR_SIZE_VER5)
> nat/linux-btrace.c:739:#endif /* defined (PERF_ATTR_SIZE_VER5) */
> nat/linux-btrace.c:759:#if defined (PERF_ATTR_SIZE_VER5)
> nat/linux-btrace.c:872:#else /* !defined (PERF_ATTR_SIZE_VER5) */
> nat/linux-btrace.c:881:#endif /* !defined (PERF_ATTR_SIZE_VER5) */

Those are uses of this macro to make GDB build with Intel PT
support on systems that support it and without on systems that
don't.

The additional check in configure shall give a warning/error if the
System on which GDB is built does not support Intel PT - unless it
is disabled via --intel-pt=no.

Regards,
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


  reply	other threads:[~2015-08-06 14:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 13:06 Markus Metzger
2015-08-06 14:03 ` Pedro Alves
2015-08-06 14:14   ` Metzger, Markus T [this message]
2015-08-06 14:54     ` Pedro Alves
2015-08-06 15:00       ` Metzger, Markus T
2015-08-06 15:17         ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A78C989F6D9628469189715575E55B2333190C1E@IRSMSX104.ger.corp.intel.com \
    --to=markus.t.metzger@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox