From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> When the trace-cmd agent is passed the proxy flag "-P" with the guest CID that it can talk to, add it to the list of guests, as it should be able to find all the host tasks that control the guest. Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> --- tracecmd/trace-agent.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tracecmd/trace-agent.c b/tracecmd/trace-agent.c index 360079297b88..4430cb5506ff 100644 --- a/tracecmd/trace-agent.c +++ b/tracecmd/trace-agent.c @@ -22,6 +22,8 @@ #include "trace-local.h" #include "trace-msg.h" +#define GUEST_NAME "::GUEST::" + #define dprint(fmt, ...) tracecmd_debug(fmt, ##__VA_ARGS__) static void make_vsocks(int nr, int *fds, unsigned int *ports) @@ -377,6 +379,7 @@ enum { void trace_agent(int argc, char **argv) { + struct trace_guest *guest; bool do_daemon = false; unsigned int port = TRACE_AGENT_DEFAULT_PORT; const char *network = NULL; @@ -419,8 +422,11 @@ void trace_agent(int argc, char **argv) break; case 'P': proxy_id = atoi(optarg); - if (network) - die("-P cannot be used with -N"); + + guest = trace_get_guest(proxy_id, GUEST_NAME); + if (!guest) + die("Failed to allocate guest instance"); + break; case DO_DEBUG: tracecmd_set_debug(true); -- 2.35.1