From a7fde09a78a8ae40b81cfb5096c3cefef6c078c9 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Tue, 14 Jul 2015 15:32:41 +0300 Subject: [PATCH] perf auxtrace: Fix misplaced check for HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT Move the checking for HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT for AUX area mmaps until after checking if such mmaps are used anyway. Reported-by: Alexey Brodkin Signed-off-by: Adrian Hunter Tested-by: Alexey Brodkin Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Vineet Gupta Cc: linux-arch@vger.kernel.org Link: http://lkml.kernel.org/r/55A5023C.7020907@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/auxtrace.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 7e7405c9b936..83d9dd96fe08 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -53,11 +53,6 @@ int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, { struct perf_event_mmap_page *pc = userpg; -#if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT) - pr_err("Cannot use AUX area tracing mmaps\n"); - return -1; -#endif - WARN_ONCE(mm->base, "Uninitialized auxtrace_mmap\n"); mm->userpg = userpg; @@ -73,6 +68,11 @@ int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, return 0; } +#if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT) + pr_err("Cannot use AUX area tracing mmaps\n"); + return -1; +#endif + pc->aux_offset = mp->offset; pc->aux_size = mp->len; -- 2.39.5