From: Alexandre Ghiti Date: Wed, 2 Aug 2023 08:03:28 +0000 (+0200) Subject: perf tests mmap-basic: Adapt for riscv X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=10da1b8ed79f7fca4e46c926ef109b753f290976;p=linux.git perf tests mmap-basic: Adapt for riscv riscv now supports mmaping hardware counters to userspace so adapt the test to run on this architecture. Reviewed-by: Andrew Jones Reviewed-by: Atish Patra Reviewed-by: Ian Rogers Signed-off-by: Alexandre Ghiti Cc: Albert Ou Cc: Alexander Shishkin Cc: Anup Patel Cc: Atish Patra Cc: Ingo Molnar Cc: Jiri Olsa Cc: Jonathan Corbet Cc: Mark Rutland Cc: Namhyung Kim Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Peter Zijlstra Cc: Rob Herring Cc: Rémi Denis-Courmont Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Cc: linux-riscv@lists.infradead.org Link: https://lore.kernel.org/r/20230802080328.1213905-11-alexghiti@rivosinc.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index e68ca62297566..886a13a77a162 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -284,7 +284,8 @@ static struct test_case tests__basic_mmap[] = { "permissions"), TEST_CASE_REASON("User space counter reading of instructions", mmap_user_read_instr, -#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) +#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ + (defined(__riscv) && __riscv_xlen == 64) "permissions" #else "unsupported" @@ -292,7 +293,8 @@ static struct test_case tests__basic_mmap[] = { ), TEST_CASE_REASON("User space counter reading of cycles", mmap_user_read_cycles, -#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) +#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ + (defined(__riscv) && __riscv_xlen == 64) "permissions" #else "unsupported"