[PATCH v1] drivers/perf: apple_m1: add known PMU events

Yangyu Chen cyy at cyyself.name
Tue Jun 18 08:56:48 PDT 2024



> On Jun 18, 2024, at 22:03, Marc Zyngier <maz at kernel.org> wrote:
> 
> On Tue, 18 Jun 2024 14:49:48 +0100,
> Yangyu Chen <cyy at cyyself.name> wrote:
>> 
>> This patch adds known PMU events that can be found on /usr/share/kpep in
>> macOS. The m1_pmu_events and m1_pmu_event_affinity are generated from
>> the script [1], which consumes the plist file from Apple. And then added
>> these events to m1_pmu_perf_map and m1_pmu_event_attrs with Apple's
>> documentation [2].
>> 
>> Link: https://github.com/cyyself/m1-pmu-gen [1]
>> Link: https://developer.apple.com/download/apple-silicon-cpu-optimization-guide/ [2]
> 
> This needs registration, and is thus impossible to freely visit.
> 
>> Signed-off-by: Yangyu Chen <cyy at cyyself.name>
> 
> What is the licence applicable to the original source file? Does it
> explicitly allow redistribution in any form?
> 

Oh. It's my fault. Sorry for the trouble caused.

> 
> Other than the licensing concern, why should we bloat the kernel with
> more of this stuff when everything is moving towards a bunch of JSON
> files (tools/perf/pmu-events/arch/arm64).
> 

Thanks for this hint. So, the thing to do might be to provide a
generator that consumes Apple files and then generates a kernel
patch for Linux perf tools to use rather than provide such details
directly in the source code as you said from [1].

Link: https://lore.kernel.org/lkml/87czn18zev.wl-maz@kernel.org/ [1]

> M.
> 
> -- 
> Without deviation from the norm, progress is not possible.





More information about the linux-arm-kernel mailing list