perf test: Re-add pmu-event uncore PMU alias test
authorJohn Garry <john.garry@huawei.com>
Thu, 29 Jul 2021 13:56:22 +0000 (21:56 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 10 Aug 2021 17:44:51 +0000 (14:44 -0300)
commit5a65c0c8f6fd5e0708e52131940f2306a3be4e55
tree4a4fff083553287c3c79552a734c4e6844ccc9ef
parent5806099a2e2ab36fa7a7705faaf3d7296b701e67
perf test: Re-add pmu-event uncore PMU alias test

Add support to match aliases for uncore PMUs.

Since we cannot rely on the PMUs being present on the host system, use
fake PMUs.

The following conditions in the test are ensures:

- Expected count of aliases created

- All aliases can be matched to an expected alias in
  perf_pmu_test_pmu.aliases

This will catch the condition fixed in commit c47a5599eda3 ("perf tools:
Fix pattern matching for same substring in different PMU type"), where
excess events were created for a PMU. It will also fix the scenario
inadvertently broken there, where no aliases were created for aliases
with multiple tokens.

Signed-off-by: John Garry <john.garry@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxarm@huawei.com
Link: https //lore.kernel.org/r/1627566986-30605-8-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/pmu-events.c