Re: [PATCH 0/7] Rewrite jevents program in python

From: Ian Rogers
Date: Wed May 11 2022 - 09:51:29 EST


On Wed, May 11, 2022 at 12:35 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Wed, May 11, 2022 at 12:01:26AM -0700, Ian Rogers wrote:
>
> > The changes here switch from jevents.c to a rewrite in python called
> > jevents.py. This means there is a build time dependency on python, but
> > such a dependency already exists for asciidoc (used to generate perf's
> > man pages).
>
> You mean just building perf (not the docs) will now require snake stuff?
>
> That's very tedious :/ I don't typically have snakes on my machines.

Hi Peter,

You're right that after these changes python is a build requirement
for jevents. We could keep the C code around for the case that python
isn't there, but I want to do things like remove the string
relocations, sort the events by name so we don't linearly search, etc.
which would be a massive chore to keep alive on the C side. An
alternative would be to have an empty pmu-events.c file that is used
for this case. If you wanted to keep things in C and have jevents like
event names, you could use the empty version and link in libpfm4.

Thanks,
Ian