[PATCH v1] drivers/perf: apple_m1: add known PMU events
Marc Zyngier
maz at kernel.org
Tue Jun 18 09:58:48 PDT 2024
On Tue, 18 Jun 2024 16:56:48 +0100,
Yangyu Chen <cyy at cyyself.name> wrote:
>
>
>
> > 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.
No trouble on my side. I'm just painfully aware that this is a legal
landmine, and that what is perfectly allowed in one country may be a
punishable offence in another. And since I'm not a lawyer, I want to
see crystal clear things in writing.
>
> >
> > 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]
Even better: teach the perf tool to directly consume the plist file,
but don't distribute the file or its content. People owning such a
machine can fish the file from the machine itself (or the installer
can extract it from the OS image as if it was firmware data).
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list