Re: [PATCH 2/7] perf: Create a symlink for a PMU

Liang, Kan
2021-06-25T16:18:33Z

On 6/25/2021 11:57 AM, Liang, Kan wrote:
>
>
> On 6/25/2021 11:44 AM, Andi Kleen wrote:
>>
>>> We have an attribute "caps/pmu_name" for the core PMU. Maybe we
>>> should add it for uncore PMU as well. For example,
>>>
>>> $ cat /sys/devices/uncore_type_0_0/caps/pmu_name
>>> cha_0
>>>
>>> Userspace tool can get clues about what type_0_0 is.
>>
>> It would break all the old tools, but I suppose it could work for
>> updated tools.
>>
>
> Right, users have to update their perf tool to use the new name,
> uncore_cha_0.

I think the above example is misleading. Let me rephrase.
Here is what I'm planing to do in V2.

With the V2 platform-specific patch, uncore driver will only create a
meaningful uncore name, e.g., uncore_cha_0.

An attribute "caps/pmu_name" is also created to indicate the previous
name. For example,

$ cat /sys/devices/uncore_cha_0/caps/pmu_name
type_0_0

If any users use the old numeric name, they have to update either their
script or a perf tool which supports "caps/pmu_name".

In the future, if the users already use a perf tool which supports
"caps/pmu_name", nothing needs to be updated. The old numeric name
should just work.

Thanks,
Kan