perf session: Fix loading of compressed data split across adjacent records
authorAlexey Budankov <alexey.budankov@linux.intel.com>
Tue, 9 Jul 2019 14:48:14 +0000 (17:48 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 23 Jul 2019 12:04:03 +0000 (09:04 -0300)
commit872c8ee8f0f47222f7b10da96eea84d0486540a3
tree1c82ce180aa1dd6721511514ab31ab0ed2844034
parent146540fb545b8464ba1be298e3392daca0d183a2
perf session: Fix loading of compressed data split across adjacent records

Fix decompression failure found during the loading of compressed trace
collected on larger scale systems (>48 cores).

The error happened due to lack of decompression space for a mmaped
buffer data chunk split across adjacent PERF_RECORD_COMPRESSED records.

  $ perf report -i bt.16384.data --stats
  failed to decompress (B): 63869 -> 0 : Destination buffer is too small
  user stack dump failure
  Can't parse sample, err = -14
  0x2637e436 [0x4080]: failed to process type: 9
  Error:
  failed to process sample

  $ perf test 71
  71: Zstd perf.data compression/decompression              : Ok

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/4d839e1b-9c48-89c4-9702-a12217420611@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/session.c
tools/perf/util/session.h
tools/perf/util/zstd.c