diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-04-05 11:36:50 -0400 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-04-11 20:13:17 -0400 |
commit | 49b0447e197840b1352d4284c7646c6750099985 (patch) | |
tree | f0d572c925fd935ad54eebf554ec4fb7c76b95a7 | |
parent | 6e136e46032ea6286e051fc50ff8be8142784124 (diff) | |
download | trace-cmd-49b0447e197840b1352d4284c7646c6750099985.tar.gz |
trace-cmd library: When the compression algorithm is none do no compression
If there is no compression algorithm, do not even bother trying to do
compression. Just turn it off. This is not a bug, it is more of an
optimization.
Link: https://lore.kernel.org/linux-trace-devel/20220405113650.188bf8bf@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r-- | lib/trace-cmd/trace-input.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c index 425c6077..90bfa0f3 100644 --- a/lib/trace-cmd/trace-input.c +++ b/lib/trace-cmd/trace-input.c @@ -4278,7 +4278,10 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd, int flags) if (!zver) goto failed_read; - if (strcmp(zname, "none")) { + if (strcmp(zname, "none") == 0) { + handle->read_zpage = false; + handle->flags &= ~TRACECMD_FL_COMPRESSION; + } else { handle->compress = tracecmd_compress_alloc(zname, zver, handle->fd, handle->pevent, NULL); |