From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Chun-Tse Shao <ctshao@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>,
linux-kernel@vger.kernel.org, peterz@infradead.org,
mingo@redhat.com, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
kan.liang@linux.intel.com, terrelln@fb.com, leo.yan@arm.com,
james.clark@linaro.org, christophe.leroy@csgroup.eu,
ben.gainey@arm.com, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 1/2] perf record: Add 8-byte aligned event type PERF_RECORD_COMPRESSED2
Date: Fri, 16 May 2025 16:16:34 -0300 [thread overview]
Message-ID: <aCePEgXqcfQ9BCQy@x1> (raw)
In-Reply-To: <CAJpZYjVeMrjN09kaVCBs97q8_hnsgwwo7s0C0ctL5Kt0_FknBQ@mail.gmail.com>
On Fri, May 16, 2025 at 10:10:27AM -0700, Chun-Tse Shao wrote:
> Ping.
>
> For suggestions from Namhyung and Arnaldo, it was merged in:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/commit/?h=perf-tools-next&id=b1b26ce8bb0eab1d058353ab6fa1a2b652a9a020
Testing it now, fixed up this:
+It is deprecated and new files should use PERF_RECORD_COMPRESSED2 to gurantee
guarantee
+8-byte alignment.
- Arnaldo
> Thanks,
> CT
>
> On Mon, Mar 17, 2025 at 10:13 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > Hello,
> >
> > On Mon, Mar 17, 2025 at 06:49:32PM -0300, Arnaldo Carvalho de Melo wrote:
> > > On Mon, Mar 17, 2025 at 02:45:39PM -0700, Chun-Tse Shao wrote:
> > > > On Mon, Mar 17, 2025 at 1:35 PM Arnaldo Carvalho de Melo
> > > > <acme@kernel.org> wrote:
> > > > >
> > > > > On Mon, Mar 17, 2025 at 09:46:40AM -0700, Namhyung Kim wrote:
> > > > > > On Mon, Mar 17, 2025 at 01:17:46PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > > > On Mon, Mar 17, 2025 at 12:52:09PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > > > > Checking the discussion and the patch.
> > > > > > >
> > > > > > > My first impression yesterday when I saw this on the smartphone was: how
> > > > > > > will an old perf binary handle the new PERF_RECORD_COMPRESSED2? Will it
> > > > > > > ignore it while emitting a warning, since it can be skipped and then
> > > > > > > what we will get a partial view?
> > > > > > >
> > > > > > > Having some session output showing how an older perf binary handles
> > > > > > > PERF_RECORD_COMPRESS2 would be informative.
> > > > > >
> > > > > > I think it'll show the below warning:
> > > > > >
> > > > > > <offset> [<size>]: failed to process type: 83
> > > > >
> > > > > Right that is what I got:
> > > > >
> > > > > ⬢ [acme@toolbox perf-tools-next]$ perf.old script -i /tmp/perf.data.ck8
> > > > > 0xbf0 [0x250]: failed to process type: 83 [Invalid argument]
> > > > > ⬢ [acme@toolbox perf-tools-next]$
> > > > >
> > > > > I think we should change that to something more informative, like:
> > > > >
> > > > > 0xbf0 [0x250]: failed to process unknown type 83, please update perf.
> >
> > That would be nice, but there are cases it can fail even without new
> > record formats. So it should also check if the type number is greater
> > than or equal to the max.
> >
> > > > >
> > > > > And then does it stop at that record it doesn't grok?
> > > > >
> > > > > if ((skip = perf_session__process_event(session, event, head, "pipe")) < 0) {
> > > > > pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n",
> > > > > head, event->header.size, event->header.type);
> > > > > err = -EINVAL;
> > > > > goto out_err;
> > > > > }
> > > > >
> > > > > head += size;
> > > > >
> > > > > So we're stopping there.
> > > > >
> > > > > Maybe we can just warn and skip?
> > > >
> > > > Thank you Arnaldo, it is a good suggestion and I will work on this later.
> > >
> > > Thank you for considering that, really appreciated!
> >
> > It would be hard to process misaligned data though. Probably we also
> > want to add a check to make sure it's properly aligned.
> >
> > Thanks,
> > Namhyung
> >
> > >
> > > perf deals with so much stuff and code flux that all the help that we
> > > can get is what is needed for it to continue to be relevant and useful.
> > >
> > > After all what is the point of a tool that produces bad results? :-)
> > >
> > > - Arnaldo
> > >
> > > > -CT
> > > >
> > > > >
> > > > > Anyway, the series as is seems ok.
> > > > >
> > > > > I'll test a bit more and send my Tested-by
> > > > >
> > > > > - Arnaldo
next prev parent reply other threads:[~2025-05-16 19:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 18:32 [PATCH v2 1/2] perf record: Add 8-byte aligned event type PERF_RECORD_COMPRESSED2 Chun-Tse Shao
2025-03-03 18:32 ` [PATCH v2 2/2] perf record: Fix a asan runtime error in util/maps.c Chun-Tse Shao
2025-03-15 1:27 ` [PATCH v2 1/2] perf record: Add 8-byte aligned event type PERF_RECORD_COMPRESSED2 Namhyung Kim
2025-03-17 15:52 ` Arnaldo Carvalho de Melo
2025-03-17 16:17 ` Arnaldo Carvalho de Melo
2025-03-17 16:32 ` Ian Rogers
2025-03-17 19:36 ` Arnaldo Carvalho de Melo
2025-03-17 20:24 ` Arnaldo Carvalho de Melo
2025-03-17 16:46 ` Namhyung Kim
2025-03-17 20:35 ` Arnaldo Carvalho de Melo
2025-03-17 21:45 ` Chun-Tse Shao
2025-03-17 21:49 ` Arnaldo Carvalho de Melo
2025-03-18 5:13 ` Namhyung Kim
2025-05-16 17:10 ` Chun-Tse Shao
2025-05-16 19:16 ` Arnaldo Carvalho de Melo [this message]
2025-05-16 21:44 ` Chun-Tse Shao
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=aCePEgXqcfQ9BCQy@x1 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ben.gainey@arm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=ctshao@google.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@arm.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=terrelln@fb.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.