diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-05-17 03:18:11 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-05-17 03:23:09 +0300 |
commit | df36d2572e0515dc190459489c159b78bb3a21fc (patch) | |
tree | 1d074dc77e12e3dc435e691a001ab4791526729d | |
parent | c5468a28efde5978644f1a7eef67780abcd16340 (diff) | |
download | linux-df36d2572e0515dc190459489c159b78bb3a21fc.tar.xz |
perf bench breakpoint: Fix build on 32-bit arches
Cast pointers to unsigned long instead of to uint64_t to avoid this
problem on 32-bit arches:
31 6.89 debian:experimental-x-mips : FAIL gcc version 11.2.0 (Debian 11.2.0-18)
bench/breakpoint.c: In function 'breakpoint_setup':
bench/breakpoint.c:56:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
56 | attr.bp_addr = (uint64_t)addr;
| ^
cc1: all warnings being treated as errors
make[3]: *** [/git/perf-5.18.0-rc7/tools/build/Makefile.build:139: bench] Error 2
Fixes: 68a6772f11dbb1ed ("perf bench: Add breakpoint benchmarks")
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Marco Elver <elver@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/YoLq1nHx1doi+VWl@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/bench/breakpoint.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/bench/breakpoint.c b/tools/perf/bench/breakpoint.c index 2f30a4df551f..41385f89ffc7 100644 --- a/tools/perf/bench/breakpoint.c +++ b/tools/perf/bench/breakpoint.c @@ -53,7 +53,7 @@ static int breakpoint_setup(void *addr) attr.inherit = 1; attr.exclude_kernel = 1; attr.exclude_hv = 1; - attr.bp_addr = (uint64_t)addr; + attr.bp_addr = (unsigned long)addr; attr.bp_type = HW_BREAKPOINT_RW; attr.bp_len = HW_BREAKPOINT_LEN_1; return syscall(SYS_perf_event_open, &attr, 0, -1, -1, 0); |