perf pmus: Check if we can encode the PMU number in perf_event_attr.type
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Jun 2023 22:01:34 +0000 (19:01 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Jun 2023 22:01:34 +0000 (19:01 -0300)
commit82fe2e45cdb00de4fa648050ae33bdadf9b3294a
tree454abe377728c1b52fcc5582564cc214b7dc96f0
parente2be06662c1f310b60a3929f3fc944809c067307
perf pmus: Check if we can encode the PMU number in perf_event_attr.type

In some architectures we can't encode the PMU number in
perf_event_attr.type and thus can't just ask for the same event in
multiple CPUs (and thus PMUs), that is what we want in hybrid systems
but we can't when that encoding isn't understood by the kernel, such as
in ARM64's big.LITTLE.

If that is the case, fallback to the previous behaviour till we find a
better solution to have consistent output accross architectures with
hybrid CPU configurations.

Co-developed-with: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@arm.com>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/linux-perf-users/ZIzYgImv61OGK1wA@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/pmus.c