public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	John Garry <john.g.garry@oracle.com>,
	Sandipan Das <sandipan.das@amd.com>, Xu Yang <xu.yang_2@nxp.com>,
	Benjamin Gray <bgray@linux.ibm.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] perf jevents: Fix build issue in '*/' in event descriptions
Date: Mon, 9 Dec 2024 17:28:24 -0300	[thread overview]
Message-ID: <Z1dS6HrfkVS4OeZz@x1> (raw)
In-Reply-To: <CAP-5=fWK-eeDEvE4+LeeScbHFecmc5+H8WB_5fepfrJJLZsF0Q@mail.gmail.com>

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@google.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@google.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
> >

  reply	other threads:[~2024-12-09 20:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 16:55 [PATCH v1] perf jevents: Fix build issue in '*/' in event descriptions Ian Rogers
2024-12-09 18:35 ` Ian Rogers
2024-12-09 20:28   ` Arnaldo Carvalho de Melo [this message]
2024-12-09 21:29     ` Ian Rogers
2024-12-10 13:15       ` Arnaldo Carvalho de Melo
2024-12-10 19:17         ` Arnaldo Carvalho de Melo
2024-12-10 19:24           ` Ian Rogers
2024-12-10 19:58             ` Arnaldo Carvalho de Melo
2024-12-10 20:01               ` Arnaldo Carvalho de Melo
2024-12-10 20:21                 ` Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z1dS6HrfkVS4OeZz@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bgray@linux.ibm.com \
    --cc=irogers@google.com \
    --cc=john.g.garry@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sandipan.das@amd.com \
    --cc=xu.yang_2@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox