diff mbox series

[06/10] trace-cmd library: Inherit compression algorithm from input file

Message ID 20210422073902.484953-7-tz.stoyanov@gmail.com (mailing list archive)
State Superseded
Headers show
Series Add trace file compression | expand

Commit Message

Tzvetomir Stoyanov (VMware) April 22, 2021, 7:38 a.m. UTC
When a new trace file output handler is allocated, based on given trace
file input handler - use the same compression algorithm.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 lib/trace-cmd/trace-output.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c
index 9d603cfe..75cf143d 100644
--- a/lib/trace-cmd/trace-output.c
+++ b/lib/trace-cmd/trace-output.c
@@ -1026,6 +1026,7 @@  static int select_file_version(struct tracecmd_output *handle, struct tracecmd_i
 {
 	if (ihandle) {
 		handle->file_version = tracecmd_get_file_version(ihandle);
+		handle->compress_proto = tracecmd_get_file_comperssion(ihandle);
 	} else if (file_version > 0) {
 		handle->file_version = file_version;
 	} else {
@@ -1769,6 +1770,7 @@  struct tracecmd_output *tracecmd_get_output_handle_fd(int fd)
 	tep_ref(handle->pevent);
 	handle->page_size = tracecmd_page_size(ihandle);
 	handle->file_version = tracecmd_get_file_version(ihandle);
+	handle->compress_proto = tracecmd_get_file_comperssion(ihandle);
 	list_head_init(&handle->options);
 
 	tracecmd_close(ihandle);