From: Maynard J. <may...@us...> - 2012-12-03 22:45:38
|
Fix "falling back to legacy" message so it appears at appropriate time This problem was reported by Tony Jones <to...@su...>. The configure script allows the user to pass a location to kernel headers (via --with-kernel option) such that, even if the running kernel does not have perf_events support, it may be possible to build operf (e.g., in cross-compile environments). But the message 'This kernel does not have perf_events support; falling back to legacy oprofile' was being displayed inappropriately in such cases. This patch changes the configure script so that the "falling back to legacy oprofile" message will only be displayed if we're running on a kernel that does not have perf_events support AND the user does not pass specify the "--with-kernel" option. Signed-off-by: Maynard Johnson <may...@us...> --- configure.ac | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 18d1169..4c58bd2 100644 --- a/configure.ac +++ b/configure.ac @@ -74,14 +74,8 @@ AC_MSG_CHECKING([kernel version supports perf_events]) if test "$KERNELDIR" != ""; then KINC="$KERNELDIR/include" fi -AX_KERNEL_VERSION(2, 6, 31, <=, kernel_has_perf_events_support="yes", -kernel_has_perf_events_support="no") - -if test "$kernel_has_perf_events_support" = "no"; then - AC_MSG_RESULT([This kernel does not have perf_events support; falling back to legacy oprofile]) -else - AC_MSG_RESULT([This kernel has perf_events support]) -fi +AX_KERNEL_VERSION(2, 6, 31, <=, [AC_MSG_RESULT("yes"); kernel_has_perf_events_support="yes"], +[AC_MSG_RESULT("no"); kernel_has_perf_events_support="no"]) if test "$KERNELDIR" == ""; then PERF_EVENT_H="/usr/include/linux/perf_event.h" @@ -117,6 +111,10 @@ if test "$PERF_EVENT_H_EXISTS" = "yes"; then rm -f test-for-PERF_GUEST* else HAVE_PERF_EVENTS='0' + if test "$kernel_has_perf_events_support" = "no"; then + AC_MSG_RESULT([No perf_events support available; falling back to legacy oprofile]) + fi + fi AC_DEFINE_UNQUOTED(HAVE_PERF_EVENTS, $HAVE_PERF_EVENTS, [Kernel support for perf_events exists]) -- 1.7.1 |