]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
eeec755cb97bb2986fa3c1d391676b3a9510d738
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 Upstream-Status: Backport
2
3 From 414f4dba2d77f3014755aa58937efb22a4789e9f Mon Sep 17 00:00:00 2001
4 From: Maynard Johnson <maynardj@us.ibm.com>
5 Date: Fri, 21 Dec 2012 08:27:37 -0600
6 Subject: [PATCH] Change configure to look for libpfm4 function first; then
7 fallback to libpfm3
8
9 This change only affects ppc64 architecture, since it's the only
10 architecture that uses libpfm to obtain the event hex code to pass
11 to perf_event_open.
12
13 There were bugs in libpfm3 pertaining to POWER7 event definitions that
14 have been fixed in libpfm4. So it's likely that some IBM POWER7 users
15 may want to install libpfm4 and build oprofile to link with it. For
16 example, if libpfm4 were installed in /usr/local, the user would invoke
17 oprofile's configure thusly:
18
19 LDFLAGS="-L/usr/local/lib64" CPPFLAGS="-I/usr/local/include" ./configure
20
21 But if the user happens to also have libpfm3 already installed in /usr,
22 then the current order of config tests would result in choosing the libpfm3
23 library. This logic seems wrong. The configure checking should go from most
24 recent to older library versions. This patch changes the order of checking
25 so the libpfm4 library would be found first.
26
27 Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
28 ---
29 configure.ac | 4 ++--
30 1 file changed, 2 insertions(+), 2 deletions(-)
31
32 diff --git a/configure.ac b/configure.ac
33 index 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 --
48 1.7.9.7
49