diff options
| author | Dmitry Ilvokhin <d@ilvokhin.com> | 2026-07-08 13:38:33 +0000 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2026-07-13 13:25:16 -0700 |
| commit | 757155c142f2bc9793e888ab101a5eea2d53f8f8 (patch) | |
| tree | 5ceb8cf8d71d82c2601f5535ec6323efd03eef85 /tools/perf/scripts/python | |
| parent | e83fd0f637c46d4abb0b0cb9d057268a018122b0 (diff) | |
perf record: Return the written size from process_comp_header()
process_comp_header() is called from zstd_compress_stream_to_records()
twice per record: once with data_size == 0 to write the record header,
and once with the payload size to finalize it. It returns the increment
it was passed, and the loop separately decides whether a record still
fits by comparing the remaining 'dst_size' against the header size.
With the fit check split from the code that writes the record,
process_comp_header() cannot reject a record on its own, so any bytes it
writes into 'dst' have to be bounds-checked by the caller instead of
where they are produced.
Pass the space left in 'dst' to process_comp_header(), let it return the
number of bytes written or -1 when the header does not fit, and account
the compressed payload in the loop.
No functional change intended.
Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
