summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch')
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch b/meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch
new file mode 100644
index 0000000000..eeec755cb9
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch
@@ -0,0 +1,49 @@
1Upstream-Status: Backport
2
3From 414f4dba2d77f3014755aa58937efb22a4789e9f Mon Sep 17 00:00:00 2001
4From: Maynard Johnson <maynardj@us.ibm.com>
5Date: Fri, 21 Dec 2012 08:27:37 -0600
6Subject: [PATCH] Change configure to look for libpfm4 function first; then
7 fallback to libpfm3
8
9This change only affects ppc64 architecture, since it's the only
10architecture that uses libpfm to obtain the event hex code to pass
11to perf_event_open.
12
13There were bugs in libpfm3 pertaining to POWER7 event definitions that
14have been fixed in libpfm4. So it's likely that some IBM POWER7 users
15may want to install libpfm4 and build oprofile to link with it. For
16example, if libpfm4 were installed in /usr/local, the user would invoke
17oprofile's configure thusly:
18
19LDFLAGS="-L/usr/local/lib64" CPPFLAGS="-I/usr/local/include" ./configure
20
21But if the user happens to also have libpfm3 already installed in /usr,
22then the current order of config tests would result in choosing the libpfm3
23library. This logic seems wrong. The configure checking should go from most
24recent to older library versions. This patch changes the order of checking
25so the libpfm4 library would be found first.
26
27Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
28---
29 configure.ac | 4 ++--
30 1 file changed, 2 insertions(+), 2 deletions(-)
31
32diff --git a/configure.ac b/configure.ac
33index 3078393..a9b1ee4 100644
34--- a/configure.ac
35+++ b/configure.ac
36@@ -160,8 +160,8 @@ if test "$HAVE_PERF_EVENTS" = "1"; then
37 arch="`uname -m`"
38 if test "$arch" = "ppc64" || test "$arch" = "ppc"; then
39 AC_CHECK_HEADER(perfmon/pfmlib.h,,[AC_MSG_ERROR([pfmlib.h not found; usually provided in papi devel package])])
40- AC_CHECK_LIB(pfm,pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1', [
41- AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1',
42+ AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1', [
43+ AC_CHECK_LIB(pfm, pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1',
44 [AC_MSG_ERROR([libpfm not found; usually provided in papi devel package])])])
45 PFM_LIB="-lpfm"
46 AC_DEFINE_UNQUOTED(HAVE_LIBPFM3, $HAVE_LIBPFM3, [Define to 1 if using libpfm3; 0 if using newer libpfm])
47--
481.7.9.7
49