Re: [PATCH v1] perf jevents: Fix build issue in '*/' in event descriptions

From: Arnaldo Carvalho de Melo
Date: Tue Dec 10 2024 - 14:58:44 EST


On Tue, Dec 10, 2024 at 11:24:28AM -0800, Ian Rogers wrote:
> On Tue, Dec 10, 2024 at 11:17 AM Arnaldo Carvalho de Melo
> <acme@xxxxxxxxxx> wrote:
> >
> > On Tue, Dec 10, 2024 at 10:15:30AM -0300, Arnaldo Carvalho de Melo wrote:
> > > On Mon, Dec 09, 2024 at 01:29:15PM -0800, Ian Rogers wrote:
> > > > On Mon, Dec 9, 2024 at 12:28 PM Arnaldo Carvalho de Melo
> > > > <acme@xxxxxxxxxx> wrote:
> > > > >
> > > > > On Mon, Dec 09, 2024 at 10:35:34AM -0800, Ian Rogers wrote:
> > > > > > On Wed, Nov 13, 2024 at 8:56 AM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> > > > > > >
> > > > > > > For big string offsets we output comments for what string the offset
> > > > > > > is for. If the string contains a '*/' as seen in Intel Arrowlake event
> > > > > > > descriptions, then this causes C parsing issues for the generated
> > > > > > > pmu-events.c. Catch such '*/' values and escape to avoid this.
> > > > > > >
> > > > > > > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> > > > > >
> > > > > > Ping.
> > > > >
> > > > > A fixes: is missing, probably this should go via perf-tools, i.e. for
> > > > > this merge window?
> > > >
> > > > We don't yet have arrowlake events/metrics, should there be a fixes?
> > >
> > > Ok, thanks for the clarification.
> > >
> > > > I'm just preparing the patches for the latest vendor json from Intel,
> > > > but they will depend on this. I suspect given the size of the vendor
> > > > json it will miss the current merge window.
> > >
> > > Probably best to have big patches via perf-tools-next at this point in
> > > time.
> >
> > I'm seeing this after applying:
> >
> > /home/acme/git/perf-tools-next/tools/perf/pmu-events/jevents.py:434: SyntaxWarning: invalid escape sequence '\*'
> > return s.replace('*/', '\*\/')
>
> It likely needs to be:
> ```
> return s.replace('*/', r'\*\/')
> ```
> note the r. Could you test for me?

Sure.

- Arnaldo