diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2020-07-16 15:21:42 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-07-21 17:01:23 +0300 |
commit | 9d1ebe9a98c1d7bf7cfbe1dba0052230c042ecdb (patch) | |
tree | 31848682b2d3fa358f43d7116085ab29b4cc58ad /tools/testing/selftests/powerpc/pmu | |
parent | 482b9b3948675df60c015b2155011c1f93234992 (diff) | |
download | linux-9d1ebe9a98c1d7bf7cfbe1dba0052230c042ecdb.tar.xz |
selftests/powerpc: Run per_event_excludes test on Power8 or later
The per_event_excludes test wants to run on Power8 or later. But
currently it checks that AT_BASE_PLATFORM *equals* power8, which means
it only runs on Power8.
Fix it to check for the ISA 2.07 feature, which will be set on Power8
and later CPUs.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200716122142.3776261-1-mpe@ellerman.id.au
Diffstat (limited to 'tools/testing/selftests/powerpc/pmu')
-rw-r--r-- | tools/testing/selftests/powerpc/pmu/per_event_excludes.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/testing/selftests/powerpc/pmu/per_event_excludes.c b/tools/testing/selftests/powerpc/pmu/per_event_excludes.c index 2756fe2efdc5..2d37942bf72b 100644 --- a/tools/testing/selftests/powerpc/pmu/per_event_excludes.c +++ b/tools/testing/selftests/powerpc/pmu/per_event_excludes.c @@ -12,6 +12,8 @@ #include <string.h> #include <sys/prctl.h> +#include <asm/cputable.h> + #include "event.h" #include "lib.h" #include "utils.h" @@ -23,12 +25,9 @@ static int per_event_excludes(void) { struct event *e, events[4]; - char *platform; int i; - platform = (char *)get_auxv_entry(AT_BASE_PLATFORM); - FAIL_IF(!platform); - SKIP_IF(strcmp(platform, "power8") != 0); + SKIP_IF(!have_hwcap2(PPC_FEATURE2_ARCH_2_07)); /* * We need to create the events disabled, otherwise the running/enabled |