[dpdk-dev] [PATCH v5 4/5] usertools/dpdk-telemetry: connect to in-memory processes
From: Bruce Richardson <hidden>
Date: 2021-10-01 16:32:56
Subsystem:
the rest · Maintainer:
Linus Torvalds
Allow connecting to an in-memory process via "-p <pid>" flag, which can be used to identify the in-memory process to which to connect. Signed-off-by: Bruce Richardson <redacted> --- doc/guides/howto/telemetry.rst | 6 ++++++ usertools/dpdk-telemetry.py | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/doc/guides/howto/telemetry.rst b/doc/guides/howto/telemetry.rst
index 8a61302459..c3adca9504 100644
--- a/doc/guides/howto/telemetry.rst
+++ b/doc/guides/howto/telemetry.rst@@ -63,6 +63,12 @@ and query information using the telemetry client python script. ./usertools/dpdk-telemetry.py + .. note:: + + When connecting to a process run with `--in-memory` EAL flag, + one must specify the PID of the process to connect to using the `-p` flag. + This is because there may be multiple such instances. + #. When connected, the script displays the following, waiting for user input:: Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
diff --git a/usertools/dpdk-telemetry.py b/usertools/dpdk-telemetry.py
index 2974a64732..690014ba9a 100755
--- a/usertools/dpdk-telemetry.py
+++ b/usertools/dpdk-telemetry.py@@ -112,6 +112,11 @@ def get_dpdk_runtime_dir(fp): parser = argparse.ArgumentParser() parser.add_argument('-f', '--file-prefix', default='rte', help='Provide file-prefix for DPDK runtime directory') +parser.add_argument('-p', '--pid', + help='Connect to DPDK process with the given pid') args = parser.parse_args() rd = get_dpdk_runtime_dir(args.file_prefix) -handle_socket(os.path.join(rd, 'dpdk_telemetry.{}'.format(TELEMETRY_VERSION))) +sock_path = os.path.join(rd, 'dpdk_telemetry.{}'.format(TELEMETRY_VERSION)) +if args.pid: + sock_path += ".{}".format(args.pid) +handle_socket(sock_path)
--
2.30.2