From: Dmitry Ilvokhin <d@ilvokhin.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
Nick Terrell <terrelln@fb.com>, David Sterba <dsterba@suse.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
kernel-team@meta.com, Farid Zakaria <fmzakari@meta.com>,
Dmitry Ilvokhin <d@ilvokhin.com>
Subject: [PATCH v3 0/2] perf record: fix multi-record Zstd compression
Date: Wed, 8 Jul 2026 13:38:32 +0000 [thread overview]
Message-ID: <cover.1783513665.git.d@ilvokhin.com> (raw)
Fix a 'perf record -z' regression that aborts recording and writes a perf.data
that cannot be decompressed (see full analysis in patch 2).
v2 -> v3:
- Dropped "perf record: Avoid overrunning the zstd output buffer" and "perf
record: Don't store raw data on zstd compression failure": both are now fixed
in perf-tools-next.
- Added "perf record: Return the written size from process_comp_header()", a
no-functional-change prep patch, so the fix's per-record padding can't
overrun 'dst'
- Removed blank line from record+zstd_comp_decomp_multi_record.sh between test
description and license (Namhyung Kim).
- Added missing <string.h> include (Sashiko).
- Rebased onto perf-tools-next (Namhyung Kim).
v1 -> v2:
- Patch 2 ("perf record: Avoid overrunning the zstd output buffer"):
rework the overly strict output buffer check to pass the remaining dst
size to process_comp_header() and bail only when a record won't fit
(Sashiko).
v1: https://lore.kernel.org/all/cover.1781797544.git.d@ilvokhin.com/
v2: https://lore.kernel.org/all/cover.1782743187.git.d@ilvokhin.com/
Dmitry Ilvokhin (2):
perf record: Return the written size from process_comp_header()
perf record: Fix multiple PERF_RECORD_COMPRESSED2 records per push
tools/perf/builtin-record.c | 49 +++++++++------
.../record+zstd_comp_decomp_multi_record.sh | 63 +++++++++++++++++++
tools/perf/util/compress.h | 6 +-
tools/perf/util/zstd.c | 25 ++++----
4 files changed, 111 insertions(+), 32 deletions(-)
create mode 100755 tools/perf/tests/shell/record+zstd_comp_decomp_multi_record.sh
--
2.53.0-Meta
next reply other threads:[~2026-07-08 13:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 13:38 Dmitry Ilvokhin [this message]
2026-07-08 13:38 ` [PATCH v3 1/2] perf record: Return the written size from process_comp_header() Dmitry Ilvokhin
2026-07-08 13:54 ` sashiko-bot
2026-07-08 13:38 ` [PATCH v3 2/2] perf record: Fix multiple PERF_RECORD_COMPRESSED2 records per push Dmitry Ilvokhin
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=cover.1783513665.git.d@ilvokhin.com \
--to=d@ilvokhin.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dsterba@suse.com \
--cc=fmzakari@meta.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=kernel-team@meta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox