From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30646 invoked by alias); 6 Aug 2015 14:14:42 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 30634 invoked by uid 89); 6 Aug 2015 14:14:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_50,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Aug 2015 14:14:39 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 06 Aug 2015 07:14:37 -0700 X-ExtLoop1: 1 Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by orsmga003.jf.intel.com with ESMTP; 06 Aug 2015 07:14:36 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX109.ger.corp.intel.com (163.33.3.23) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 6 Aug 2015 15:14:35 +0100 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.131]) by irsmsx112.ger.corp.intel.com ([10.108.20.5]) with mapi id 14.03.0224.002; Thu, 6 Aug 2015 15:14:35 +0100 From: "Metzger, Markus T" To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH] configure: check for perf_event.h version Date: Thu, 06 Aug 2015 14:14:00 -0000 Message-ID: References: <1438866405-22616-1-git-send-email-markus.t.metzger@intel.com> <55C365B2.4010906@redhat.com> In-Reply-To: <55C365B2.4010906@redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00150.txt.bz2 > -----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 >=20 > 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. >=20 >=20 > > 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}" =3D no; then > > AC_MSG_WARN([Intel(R) Processor Trace support disabled; some > features may be unavailable.]) > > HAVE_LIBIPT=3Dno > > else > > + AC_PREPROC_IFELSE(AC_LANG_SOURCE([[ > > +#include > > +#ifdef PERF_ATTR_SIZE_VER5 > > +# error > > +#endif >=20 > 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? : >=20 > 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=3Dno. 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