]> git.baikalelectronics.ru Git - kernel.git/commitdiff
libperf test evsel: Fix build error on !x86 architectures
authorShunsuke Nakamura <nakamura.shun@fujitsu.com>
Wed, 6 Oct 2021 09:57:03 +0000 (18:57 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 14 Oct 2021 18:41:35 +0000 (15:41 -0300)
In test_stat_user_read, following build error occurs except i386 and
x86_64 architectures:

tests/test-evsel.c:129:31: error: variable 'pc' set but not used [-Werror=unused-but-set-variable]
  struct perf_event_mmap_page *pc;

Fix build error.

Signed-off-by: Shunsuke Nakamura <nakamura.shun@fujitsu.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20211006095703.477826-1-nakamura.shun@fujitsu.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/perf/tests/test-evsel.c

index a184e4861627e73999c03ec50073fd6c92203891..9abd4c0bf6db16d7bd46a35582f9ecfd65e1da35 100644 (file)
@@ -148,6 +148,7 @@ static int test_stat_user_read(int event)
        __T("failed to mmap evsel", err == 0);
 
        pc = perf_evsel__mmap_base(evsel, 0, 0);
+       __T("failed to get mmapped address", pc);
 
 #if defined(__i386__) || defined(__x86_64__)
        __T("userspace counter access not supported", pc->cap_user_rdpmc);