Re: [PATCH v8 00/12] perf: enable compression of record mode trace to save storage space
From: Jiri Olsa
Date: Fri Mar 15 2019 - 08:28:17 EST
On Thu, Mar 14, 2019 at 02:26:23PM +0300, Alexey Budankov wrote:
>
> The patch set implements runtime trace compression (-z option) in
> record mode and trace auto decompression in report and inject modes.
> Streaming Zstd API [1] is used for compression and decompression of
> data that come from kernel mmaped data buffers.
>
> Usage of implemented -z,--compression_level=n option provides ~3-5x
> avg. trace file size reduction on variety of tested workloads what
> saves storage space on larger server systems where trace file size
> can easily reach several tens or even hundreds of GiBs, especially
> when profiling with dwarf-based stacks and tracing of context switches.
> Default option value is 1 (fastest compression).
>
> Implemented --mmap-flush option can be used to specify minimal size
> of data chunk that is extracted from mmaped kernel buffer to store
> into a trace. The option is independent from -z setting and doesn't
> vary with compression level. The default option value is 1 byte what
> means every time trace writing thread finds some new data in the
> mmaped buffer the data is extracted, possibly compressed and written
> to a trace. The option serves two purposes the first one is to increase
> the compression ratio of trace data and the second one is to avoid
> live-lock self tool process monitoring in system wide (-a) profiling
> mode. Profiling in system wide mode with compression (-a -z) can
> additionally induce data into the kernel buffers along with the data
> from monitored processes. If performance data rate and volume from
> the monitored processes is high then trace streaming and compression
> activity in the tool is also high. It can lead to subtle live-lock
> effect of endless activity when compression of single new byte from
> some of mmaped kernel buffer induces the next single byte at some
> mmaped buffer. So perf tool thread never stops on polling event file
> descriptors. Varying data chunk size to be extracted from mmap buffers
> allows avoiding live-locking self monitoring in system wide mode and
> makes mmap buffers polling loop configurable.
>
> $ tools/perf/perf record -z -e cycles -- matrix.gcc
> $ tools/perf/perf record --aio -z -e cycles -- matrix.gcc
> $ tools/perf/perf record -z --mmap-flush 1024 -e cycles -- matrix.gcc
> $ tools/perf/perf record --aio -z --mmap-flush 1K -e cycles -- matrix.gcc
hi,
I'm getting error with -z:
[root@krava perf]# ./perf record -z ./perf bench sched messaging -l 10000
# Running 'sched/messaging' benchmark:
# 20 sender and receiver processes per group
# 10 groups == 400 processes run
Total time: 18.775 [sec]
[ perf record: Woken up 57 times to write data ]
0x5228 [0]: failed to process type: 81
[ perf record: Captured and wrote 6.453 MB perf.data, compressed (original 21.486 MB, ratio is 3.340) ]
jirka