Skip to content

Commit

Permalink
libperf test evsel: Fix build error on !x86 architectures
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shunsuke Nakamura authored and Arnaldo Carvalho de Melo committed Oct 14, 2021
1 parent 8e820f9 commit f304c8d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/lib/perf/tests/test-evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f304c8d

Please sign in to comment.