perf env: Add perf_env__cpuid, perf_env__{nr_}pmu_mappings
authorKim Phillips <kim.phillips@amd.com>
Tue, 17 Aug 2021 22:15:07 +0000 (17:15 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 10 Sep 2021 14:45:19 +0000 (11:45 -0300)
commit9fe8895a27a840095281864803b128ddc26dcd30
treeed7ed3e65d2d5ab2690efa73458afb87cd38f5b2
parentd2930ede5218be28413a00130a6895d14393c325
perf env: Add perf_env__cpuid, perf_env__{nr_}pmu_mappings

To be used by IBS raw data display: It needs the recorder's cpuid in
order to determine which errata workarounds to apply to the data, and
the pmu_mappings are needed in order to figure out which PMU sample
type is IBS Fetch vs. IBS Op.

When not available from perf.data, we assume local operation, and
retrieve cpuid and pmu mappings directly from the running system.

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Stephane Eranian <eranian@google.com>
Link: https //lore.kernel.org/r/20210817221509.88391-2-kim.phillips@amd.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/env.c
tools/perf/util/env.h