Skip to content

perf record: fix multi-record Zstd compression

Dmitry Ilvokhin linux-perf-users lkml 3 versions – Applied

Status from this message: Applied to perf-tools-next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyApplied
  2. v23 patches 2 repliesSuperseded
  3. v13 patches 1 replySuperseded

Changes in v3 from the cover letter

- 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).

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2perf record: Return the written size from process_comp_header()tools/perf/builtin-record.c tools/perf/util/compress.h tools/perf/util/zstd.c+31 -170 replies
2/2perf record: Fix multiple PERF_RECORD_COMPRESSED2 records per pushtools/perf/builtin-record.c tools/perf/tests/shell/record+zstd_comp_decomp_multi_record.sh+83 -180 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] perf record: fix multi-record Zstd compression

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/[email protected]/
v2: https://lore.kernel.org/all/[email protected]/

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
Signature · 1 line
2.53.0-Meta