[v6,4/5] usertools/dpdk-telemetry: connect to in-memory processes
Checks
Commit Message
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 <bruce.richardson@intel.com>
---
doc/guides/howto/telemetry.rst | 6 ++++++
usertools/dpdk-telemetry.py | 7 ++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
Comments
On 05/10/2021 14:59, Bruce Richardson wrote:
> 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 <bruce.richardson@intel.com>
> ---
Tested-by: Conor Walsh <conor.walsh@intel.com>
@@ -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
@@ -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)