Re: [PATCH v1] perf pmu: Add PMU alias support

From: John Garry
Date: Fri Jul 23 2021 - 07:46:55 EST


On 23/07/2021 07:56, Jin, Yao wrote:

Use the real name,
  $ perf stat -e uncore_cha_2/event=1/ -x,
    4044879584,,uncore_cha_2/event=1/,2528059205,100.00,,

Use the alias,
  $ perf stat -e uncore_type_0_2/event=1/ -x,
    3659675336,,uncore_type_0_2/event=1/,2287306455,100.00,,

Having a self-test case would be nice. And it's questionable why this goes in x86 code.


OK, I will add test cases for uncore PMU alias.


JFYI, I am doing a bit of a rewrite of tests/pmu-events.c to tighten it up to catch cases like those fixed and also broke in "perf tools: Fix pattern matching for same substring in different pmu type".

For why it's now only x86 specific code, my understanding is, currently x86 has this usage case, we can further extend it to other ARCHs and make it a generic way in future.

Generally that is not how things are done, but I'm not the maintainer ...

Thanks,
john