From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] trace-cmd listen: Do not compress for v1 of the msg protocol
Date: Sat, 21 May 2022 16:47:45 -0400 [thread overview]
Message-ID: <20220521164745.54897f01@gandalf.local.home> (raw)
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
The v1 of the msg protocol cannot handle compression being sent across
the network. Do not compress if the listener can only handle the v1 message
protocol.
Fixes: 3f8447b1e2f97 ("trace-cmd library: Add support for compression algorithms")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
tracecmd/trace-record.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index f8d2bad70566..c770f698019f 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3780,19 +3780,18 @@ setup_connection(struct buffer_instance *instance, struct common_record_context
if (ret)
goto error;
} else {
+ /*
+ * V3 can handle compression, but V1 can not.
+ * Set the file version back to 6.
+ */
+ ctx->file_version = FILE_VERSION_MIN;
+ ctx->compression = false;
network_handle = tracecmd_output_create_fd(msg_handle->fd);
if (!network_handle)
goto error;
if (tracecmd_output_set_version(network_handle, ctx->file_version))
goto error;
- if (ctx->compression) {
- if (tracecmd_output_set_compression(network_handle, ctx->compression))
- goto error;
- } else if (ctx->file_version >= FILE_VERSION_COMPRESSION) {
- tracecmd_output_set_compression(network_handle, "any");
- }
-
if (tracecmd_output_write_headers(network_handle, listed_events))
goto error;
tracecmd_set_quiet(network_handle, quiet);
--
2.35.1
reply other threads:[~2022-05-21 20:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220521164745.54897f01@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).