Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Lalit Maganti" <lalitmaganti@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf python: Accept events larger than union perf_event
Date: Sun, 18 Oct 2026 07:48:14 +0000	[thread overview]
Message-ID: <sashiko-outbox-176006@kernel.org> (raw)
In-Reply-To: <20261018074528.974953-1-lalitmaganti@gmail.com>

> Samples recorded with --call-graph dwarf carry a copy of the user stack
> and are larger than union perf_event, so session.process_events()
> fails on the first one:
> 
>   $ perf record --call-graph dwarf -- ./workload
>   $ python3 tools/perf/python/stackcollapse.py
>   ...
>   TypeError: Unexpected event size: 4168 < 8424
> 
> This makes all the standalone scripts unusable on such recordings.
> 
> pyrf_event__new() rejects events larger than union perf_event, which
> guarded the copy into the union that pyrf_event used to embed. Since
> commit 2c672ffdad4b ("perf python: Lazily copy events and samples from
> process_events") the event is borrowed, or copied to a buffer of
> header.size bytes when a callback keeps it, so nothing depends on the
> event fitting in the union any more. Remove the check.
> 
> With this, stackcollapse.py and flamegraph.py process a DWARF recording
> of a two-thread workload, with the same per-symbol sample counts as
> perf script, also when the callback keeps the events after returning.
> 
> Assisted-by: LLM
> Signed-off-by: Lalit Maganti <lalitmaganti@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261018074528.974953-1-lalitmaganti@gmail.com?part=1


      reply	other threads:[~2026-10-18  7:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18  7:45 [PATCH] perf python: Accept events larger than union perf_event Lalit Maganti
2026-10-18  7:48 ` sashiko-bot [this message]

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=sashiko-outbox-176006@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=lalitmaganti@gmail.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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