The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v3 0/2] perf record: fix multi-record Zstd compression
@ 2026-07-08 13:38 Dmitry Ilvokhin
  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:38 ` [PATCH v3 2/2] perf record: Fix multiple PERF_RECORD_COMPRESSED2 records per push Dmitry Ilvokhin
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Ilvokhin @ 2026-07-08 13:38 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Nick Terrell,
	David Sterba
  Cc: linux-kernel, linux-perf-users, kernel-team, Farid Zakaria,
	Dmitry Ilvokhin

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-08 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 13:38 [PATCH v3 0/2] perf record: fix multi-record Zstd compression Dmitry Ilvokhin
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:38 ` [PATCH v3 2/2] perf record: Fix multiple PERF_RECORD_COMPRESSED2 records per push Dmitry Ilvokhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox