[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJpZYjV1Z_A08A1GSTLZwo7BCaJNGGD+Q06w2A1Uc9p1ihT=Tg@mail.gmail.com>
Date: Wed, 23 Apr 2025 15:46:21 -0700
From: Chun-Tse Shao <ctshao@...gle.com>
To: Ian Rogers <irogers@...gle.com>
Cc: linux-kernel@...r.kernel.org, Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, peterz@...radead.org, mingo@...hat.com,
mark.rutland@....com, alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
adrian.hunter@...el.com, kan.liang@...ux.intel.com, dvyukov@...gle.com,
ben.gainey@....com, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v4] perf report: Skip unsupported new event types
Ping.
Thanks,
CT
On Mon, Apr 14, 2025 at 10:43 AM Ian Rogers <irogers@...gle.com> wrote:
>
> On Mon, Apr 14, 2025 at 10:39 AM Chun-Tse Shao <ctshao@...gle.com> wrote:
> >
> > `perf report` currently halts with an error when encountering
> > unsupported new event types (`event.type >= PERF_RECORD_HEADER_MAX`).
> > This patch modifies the behavior to skip these samples and continue
> > processing the remaining events. Additionally, stops reporting if the
> > new event size is not 8-byte aligned.
> >
> > Signed-off-by: Chun-Tse Shao <ctshao@...gle.com>
> > Suggested-by: Arnaldo Carvalho de Melo <acme@...nel.org>
> > Suggested-by: Namhyung Kim <namhyung@...nel.org>
>
> Reviewed-by: Ian Rogers <irogers@...gle.com>
>
> Thanks,
> Ian
>
> > ---
> > tools/perf/util/session.c | 13 +++++++++++--
> > 1 file changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> > index 60fb9997ea0d..ba32f8461a4b 100644
> > --- a/tools/perf/util/session.c
> > +++ b/tools/perf/util/session.c
> > @@ -1639,8 +1639,17 @@ static s64 perf_session__process_event(struct perf_session *session,
> > if (session->header.needs_swap)
> > event_swap(event, evlist__sample_id_all(evlist));
> >
> > - if (event->header.type >= PERF_RECORD_HEADER_MAX)
> > - return -EINVAL;
> > + if (event->header.type >= PERF_RECORD_HEADER_MAX) {
> > + /* perf should not support unaligned event, stop here. */
> > + if (event->header.size % sizeof(u64))
> > + return -EINVAL;
> > +
> > + /* This perf is outdated and does not support the latest event type. */
> > + ui__warning("Unsupported type %u, please considering update perf.\n",
> > + event->header.type);
> > + /* Skip unsupported event by returning its size. */
> > + return event->header.size;
> > + }
> >
> > events_stats__inc(&evlist->stats, event->header.type);
> >
> > --
> > 2.49.0.604.gff1f9ca942-goog
> >
Powered by blists - more mailing lists