[PATCH v3 9/9] perf inject: enable COMPRESSED records decompression

Alexey Budankov
2019-02-26T06:28:38Z

Initialized decompression API so COMPRESSED records would be
decompressed into the resulting output data file.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
---
tools/perf/builtin-inject.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 9bb1f35d5cb7..5a5bc4207766 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -839,6 +839,9 @@ int cmd_inject(int argc, const char **argv)
if (inject.session == NULL)
return -1;

+ if (zstd_init(&(inject.session->zstd_data), 0) < 0)
+ pr_warning("Decompression initialization failed.\n");
+
if (inject.build_ids) {
/*
* to make sure the mmap records are ordered correctly
@@ -869,6 +872,7 @@ int cmd_inject(int argc, const char **argv)
ret = __cmd_inject(&inject);

out_delete:
+ zstd_fini(&(inject.session->zstd_data));
perf_session__delete(inject.session);
return ret;
}