Skip to contentSkip to conversation

trace-cmd library: When the compression algorithm is none do no compression

PATCH New Steven Rostedt 1 participant 1 message Apr 6, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd library: When the compression algorithm is none do no compression

From: "Steven Rostedt (Google)" <[email protected]>

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.

---
 lib/trace-cmd/trace-input.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/trace-cmd/trace-input.c +4 -1
index 425c6077d88e..90bfa0f32984 100644
@@ -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);
Signature · 1 line
2.35.1