From 4de6f9b17c6dd8d50ddb3050a091fae83e91bb71 Mon Sep 17 00:00:00 2001 From: Matthew McClintock Date: Thu, 17 Jan 2013 20:23:23 +0000 Subject: oprofile: backport patches to fix ppc build issues Fixes: | operf_utils.cpp: In function 'bool _op_get_event_codes(std::vector*)': | operf_utils.cpp:151:21: error: 'pfm_initialize' was not declared in this scope | operf_utils.cpp:151:26: error: 'PFM_SUCCESS' was not declared in this scope | operf_utils.cpp:166:45: error: 'PFM_PLM3' was not declared in this scope | operf_utils.cpp:166:55: error: 'PFM_OS_NONE' was not declared in this scope | operf_utils.cpp:166:72: error: 'pfm_get_os_event_encoding' was not declared in this scope | operf_utils.cpp:167:14: error: 'PFM_SUCCESS' was not declared in this scope [YOCTO #3717] (From OE-Core rev: 121cb96964fe2f374d814bf39036119bd63b9589) Signed-off-by: Matthew McClintock Signed-off-by: Richard Purdie --- ...igure-to-look-for-libpfm4-function-first-.patch | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch (limited to 'meta/recipes-kernel/oprofile/oprofile/0001-Change-configure-to-look-for-libpfm4-function-first-.patch') 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 @@ +Upstream-Status: Backport + +From 414f4dba2d77f3014755aa58937efb22a4789e9f Mon Sep 17 00:00:00 2001 +From: Maynard Johnson +Date: Fri, 21 Dec 2012 08:27:37 -0600 +Subject: [PATCH] Change configure to look for libpfm4 function first; then + fallback to libpfm3 + +This change only affects ppc64 architecture, since it's the only +architecture that uses libpfm to obtain the event hex code to pass +to perf_event_open. + +There were bugs in libpfm3 pertaining to POWER7 event definitions that +have been fixed in libpfm4. So it's likely that some IBM POWER7 users +may want to install libpfm4 and build oprofile to link with it. For +example, if libpfm4 were installed in /usr/local, the user would invoke +oprofile's configure thusly: + +LDFLAGS="-L/usr/local/lib64" CPPFLAGS="-I/usr/local/include" ./configure + +But if the user happens to also have libpfm3 already installed in /usr, +then the current order of config tests would result in choosing the libpfm3 +library. This logic seems wrong. The configure checking should go from most +recent to older library versions. This patch changes the order of checking +so the libpfm4 library would be found first. + +Signed-off-by: Maynard Johnson +--- + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 3078393..a9b1ee4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -160,8 +160,8 @@ if test "$HAVE_PERF_EVENTS" = "1"; then + arch="`uname -m`" + if test "$arch" = "ppc64" || test "$arch" = "ppc"; then + AC_CHECK_HEADER(perfmon/pfmlib.h,,[AC_MSG_ERROR([pfmlib.h not found; usually provided in papi devel package])]) +- AC_CHECK_LIB(pfm,pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1', [ +- AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1', ++ AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1', [ ++ AC_CHECK_LIB(pfm, pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1', + [AC_MSG_ERROR([libpfm not found; usually provided in papi devel package])])]) + PFM_LIB="-lpfm" + AC_DEFINE_UNQUOTED(HAVE_LIBPFM3, $HAVE_LIBPFM3, [Define to 1 if using libpfm3; 0 if using newer libpfm]) +-- +1.7.9.7 + -- cgit v1.2.3-54-g00ecf