]> git.itanic.dy.fi Git - linux-stable/commit
perf test: Simplify "object code reading" test
authorNamhyung Kim <namhyung@kernel.org>
Fri, 3 Nov 2023 19:55:41 +0000 (12:55 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 9 Nov 2023 16:49:33 +0000 (13:49 -0300)
commit89d5c48c34c8a552acd9a2e3ee504b2f06879fea
tree6f0b54763b3a1ef6bfc76874d6da934b0cd02756
parent9ffa6c7512ca7aaeb30e596e2c247cb1fae7123a
perf test: Simplify "object code reading" test

It tries cycles (or cpu-clock on s390) event with exclude_kernel bit to
open.  But other arch on a VM can fail with the hardware event and need
to fallback to the software event in the same way.

So let's get rid of the cpuid check and use generic fallback mechanism
using an array of event candidates.  Now event in the odd index excludes
the kernel so use that for the return value.

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: James Clark <james.clark@arm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Link: https://lore.kernel.org/r/20231103195541.67788-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/code-reading.c