diff mbox series

trace-cmd: Document new proxy args for {agent,record}

Message ID 20220804103729.1.Ia9701619f867f6acbec9e20bf89ed41979fcce87@changeid (mailing list archive)
State Accepted
Commit 1504f3f5d8b098b57f11024a9443d918dab9da88
Headers show
Series trace-cmd: Document new proxy args for {agent,record} | expand

Commit Message

Brian Norris Aug. 4, 2022, 5:37 p.m. UTC
Largely cribbed off the commit message introducing these:

4f9d216ee312 trace-cmd: Add agent proxy communications between record and agent

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
NB: I may not have all the vsock/VM/proxy lingo quite right, so feel
free to correct!

 Documentation/trace-cmd/trace-cmd-agent.1.txt  | 5 +++++
 Documentation/trace-cmd/trace-cmd-record.1.txt | 6 ++++++
 tracecmd/trace-usage.c                         | 9 +++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)

Comments

Steven Rostedt Aug. 4, 2022, 5:49 p.m. UTC | #1
On Thu,  4 Aug 2022 10:37:43 -0700
Brian Norris <briannorris@chromium.org> wrote:

> Largely cribbed off the commit message introducing these:
> 
> 4f9d216ee312 trace-cmd: Add agent proxy communications between record and agent
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
> NB: I may not have all the vsock/VM/proxy lingo quite right, so feel
> free to correct!

Content looks good. I'll fix up the change log though ;-)

Thanks!

-- Steve
Steven Rostedt Aug. 5, 2022, 3:47 p.m. UTC | #2
On Thu,  4 Aug 2022 10:37:43 -0700
Brian Norris <briannorris@chromium.org> wrote:

> Largely cribbed off the commit message introducing these:
> 
> 4f9d216ee312 trace-cmd: Add agent proxy communications between record and agent
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Applied. Thanks Brian!

-- Steve
diff mbox series

Patch

diff --git a/Documentation/trace-cmd/trace-cmd-agent.1.txt b/Documentation/trace-cmd/trace-cmd-agent.1.txt
index f247d41dcdb8..8c1721d023e6 100644
--- a/Documentation/trace-cmd/trace-cmd-agent.1.txt
+++ b/Documentation/trace-cmd/trace-cmd-agent.1.txt
@@ -32,6 +32,11 @@  OPTIONS
     This options causes trace-cmd agent to go into a daemon mode and run in
     the background.
 
+*-P* 'cid'::
+    Allow an agent to also act as a proxy server, where it can be run on a host
+    and connect with a guest. 'cid' is the context ID (see *vsock*(7)) of the
+    client (e.g., guest VM) it will allow to connect.
+
 *--verbose*[='level']::
      Set the log level. Supported log levels are "none", "critical", "error", "warning",
      "info", "debug", "all" or their identifiers "0", "1", "2", "3", "4", "5", "6". Setting the log
diff --git a/Documentation/trace-cmd/trace-cmd-record.1.txt b/Documentation/trace-cmd/trace-cmd-record.1.txt
index af3e776b1dce..b709e483ebe2 100644
--- a/Documentation/trace-cmd/trace-cmd-record.1.txt
+++ b/Documentation/trace-cmd/trace-cmd-record.1.txt
@@ -412,6 +412,12 @@  OPTIONS
     'name' - the name of the desired compression algorithms. Available algorithms can be listed with
     trace-cmd list -c
 
+*--proxy* 'vsocket'::
+    Use a vsocket proxy to reach the agent. Acts the same as *-A* (for an
+    agent) but will send the proxy connection to the agent. It is expected to
+    run on a privileged guest that the host is aware of (as denoted by the
+    'cid' in the *-P* option for the agent).
+
 EXAMPLES
 --------
 
diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c
index f809c1845cfa..42a8e7d1107d 100644
--- a/tracecmd/trace-usage.c
+++ b/tracecmd/trace-usage.c
@@ -19,7 +19,8 @@  static struct usage_help usage_help[] = {
 		"record a trace into a trace.dat file",
 		" %s record [-v][-e event [-f filter]][-p plugin][-F][-d][-D][-o file] \\\n"
 		"           [-q][-s usecs][-O option ][-l func][-g func][-n func] \\\n"
-		"           [-P pid][-N host:port][-t][-r prio][-b size][-B buf][command ...]\n"
+		"           [-P pid][-N host:port][-t][-r prio][-b size][-B buf] \\\n"
+		"           [--proxy vsock][command ...]\n"
 		"           [-m max][-C clock]\n"
 		"          -e run command with event enabled\n"
 		"          -f filter for previous -e event\n"
@@ -78,6 +79,8 @@  static struct usage_help usage_help[] = {
 		"                            none - do not compress the trace file\n"
 		"                            name - the name of the desired compression algorithms\n"
 		"                        available algorithms can be listed with trace-cmd list -c\n"
+		"          --proxy vsocket to reach the agent. Acts the same as -A (for an agent)\n"
+		"              but will send the proxy connection to the agent.\n"
 	},
 	{
 		"set",
@@ -331,13 +334,15 @@  static struct usage_help usage_help[] = {
 	{
 		"agent",
 		"listen on a vsocket for trace clients",
-		" %s agent -p port[-D]\n"
+		" %s agent -p port[-D][-N][-P cid]\n"
 		"          Creates a vsocket to listen for clients.\n"
 		"          -N Connect to IP via TCP instead of vsockets\n"
 		"             *** Insecure setting, only use on a trusted network ***\n"
 		"             ***   Only use if the client is totally trusted.    ***\n"
 		"          -p port number to listen on.\n"
 		"          -D run in daemon mode.\n"
+		"          -P Also act as a proxy server, with a single client denoted\n"
+		"             by a context ID (cid).\n"
 		"          --verbose 'level' Set the desired log level\n"
 	},
 	{