perf pmu: Warn about invalid config for all PMUs and configs
authorIan Rogers <irogers@google.com>
Thu, 1 Jun 2023 02:36:44 +0000 (19:36 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 1 Jun 2023 20:20:26 +0000 (17:20 -0300)
commitb9f010328c0f5af017b0fb9ca24a5c531bc3c682
tree08052c512df96c66a79b10b80e52ed5ba8bbd58a
parent68c250434125f94dddcff7e9faf392fa96773ac3
perf pmu: Warn about invalid config for all PMUs and configs

Don't just check the raw PMU type, the only core PMU on homogeneous x86,
check raw and all dynamically added PMUs. Extend the
perf_pmu__warn_invalid_config to check all 4 config values.

Rather than process the format list once per event, store the computed
masks for each config value.

Don't ignore the mask being zero, which is likely for config2 and
config3, add config_masks_present so config values can be ignored only
when no format information is present.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Link: https://lore.kernel.org/r/20230601023644.587584-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/parse-events.c
tools/perf/util/pmu.c
tools/perf/util/pmu.h