aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2022-05-21 20:39:34 -0400
committerSteven Rostedt (Google) <rostedt@goodmis.org>2022-05-21 21:02:52 -0400
commit0dd483359fe51d5b681f67f624ccb3fe5195063e (patch)
treeada6490374a20c21bdd71ae700270fe9723f0d80
parente7574f26990b47b104aa3866e047eea3067c5f43 (diff)
downloadtrace-cmd-0dd483359fe51d5b681f67f624ccb3fe5195063e.tar.gz
trace-cmd record: Set the proper role when connected to a proxy
When a guest uses trace-cmd record to connect to the agent proxy on the host, it needs to set its role to "GUEST" when initializing the time synchronization protocols. Link: https://lore.kernel.org/linux-trace-devel/20220522003935.196466-4-rostedt@goodmis.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--tracecmd/trace-record.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index b43f3272..ce20402a 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3905,7 +3905,11 @@ static void connect_to_agent(struct common_record_context *ctx,
die("Failed to connect to host %s:%u",
instance->name, instance->port);
} else {
- role = TRACECMD_TIME_SYNC_ROLE_HOST;
+ /* If connecting to a proxy, then this is the guest */
+ if (is_proxy(ctx->instance))
+ role = TRACECMD_TIME_SYNC_ROLE_GUEST;
+ else
+ role = TRACECMD_TIME_SYNC_ROLE_HOST;
sd = trace_vsock_open(instance->cid, instance->port);
if (sd < 0)
die("Failed to connect to vsocket @%u:%u",