[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z1dS6HrfkVS4OeZz@x1>
Date: Mon, 9 Dec 2024 17:28:24 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>,
John Garry <john.g.garry@...cle.com>,
Sandipan Das <sandipan.das@....com>, Xu Yang <xu.yang_2@....com>,
Benjamin Gray <bgray@...ux.ibm.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] perf jevents: Fix build issue in '*/' in event
descriptions
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@...gle.com> 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@...gle.com>
>
> Ping.
A fixes: is missing, probably this should go via perf-tools, i.e. for
this merge window?
- Arnaldo
> Thanks,
> Ian
>
> > ---
> > tools/perf/pmu-events/jevents.py | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
> > index 6e71b09dbc2a..028cf3c43881 100755
> > --- a/tools/perf/pmu-events/jevents.py
> > +++ b/tools/perf/pmu-events/jevents.py
> > @@ -430,8 +430,11 @@ class JsonEvent:
> > def to_c_string(self, metric: bool) -> str:
> > """Representation of the event as a C struct initializer."""
> >
> > + def fix_comment(s: str) -> str:
> > + return s.replace('*/', '\*\/')
> > +
> > s = self.build_c_string(metric)
> > - return f'{{ { _bcs.offsets[s] } }}, /* {s} */\n'
> > + return f'{{ { _bcs.offsets[s] } }}, /* {fix_comment(s)} */\n'
> >
> >
> > @lru_cache(maxsize=None)
> > --
> > 2.47.0.277.g8800431eea-goog
> >
Powered by blists - more mailing lists