From: Markus Metzger <markus.t.metzger@intel.com>
To: palves@redhat.com
Cc: gdb-patches@sourceware.org
Subject: [PATCH] configure: check for perf_event.h version
Date: Thu, 06 Aug 2015 13:06:00 -0000 [thread overview]
Message-ID: <1438866405-22616-1-git-send-email-markus.t.metzger@intel.com> (raw)
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.
2015-08-06 Markus Metzger <markus.t.metzger@intel.com>
gdb/
* configure.ac: Check for PERF_ATTR_SIZE_VER5 in linux/perf_event.h
* configure: Regenerate.
---
gdb/configure | 27 ++++++++++++++++++++++++++-
gdb/configure.ac | 14 ++++++++++++++
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/gdb/configure b/gdb/configure
index e1b778b..ddff555 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -1558,7 +1558,8 @@ Optional Packages:
(auto/yes/no/<python-program>)
--with-guile[=GUILE] include guile support
(auto/yes/no/<guile-version>/<pkg-config-program>)
- --with-intel-pt include Intel(R) Processor Trace support (auto/yes/no)
+ --with-intel-pt include Intel(R) Processor Trace support
+ (auto/yes/no)
--with-libipt-prefix[=DIR] search for libipt in DIR/include and DIR/lib
--without-libipt-prefix don't search for libipt in includedir and libdir
--without-included-regex
@@ -9732,6 +9733,30 @@ if test "${with_intel_pt}" = no; then
$as_echo "$as_me: WARNING: Intel(R) Processor Trace support disabled; some features may be unavailable." >&2;}
HAVE_LIBIPT=no
else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <linux/perf_event.h>
+#ifdef PERF_ATTR_SIZE_VER5
+# error
+#endif
+
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ perf_event=no
+else
+ perf_event=yes
+fi
+rm -f conftest.err conftest.$ac_ext
+ if test "$perf_event" != yes; then
+ if test "$with_intel_pt" = yes; then
+ as_fn_error "linux/perf_event.h missing or too old" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&5
+$as_echo "$as_me: WARNING: linux/perf_event.h missing or too old; some features may be unavailable." >&2;}
+ fi
+ fi
+
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
+ ]]), [perf_event=no], [perf_event=yes])
+ if test "$perf_event" != yes; then
+ if test "$with_intel_pt" = yes; then
+ AC_MSG_ERROR([linux/perf_event.h missing or too old])
+ else
+ AC_MSG_WARN([linux/perf_event.h missing or too old; some features may be unavailable.])
+ fi
+ fi
+
AC_LIB_HAVE_LINKFLAGS([ipt], [], [#include "intel-pt.h"], [pt_insn_alloc_decoder (0);])
if test "$HAVE_LIBIPT" != yes; then
if test "$with_intel_pt" = yes; then
--
1.8.3.1
next reply other threads:[~2015-08-06 13:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-06 13:06 Markus Metzger [this message]
2015-08-06 14:03 ` Pedro Alves
2015-08-06 14:14 ` Metzger, Markus T
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=1438866405-22616-1-git-send-email-markus.t.metzger@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