[dpdk-dev] [PATCH v8 4/4] usertools/dpdk-telemetry: provide info on available sockets
Walsh, Conor
conor.walsh at intel.com
Wed Oct 13 15:15:39 CEST 2021
> From: dev <dev-bounces at dpdk.org> On Behalf Of Bruce Richardson
> Sent: Tuesday 12 October 2021 17:39
> To: dev at dpdk.org
> Cc: Power, Ciara <ciara.power at intel.com>; David Marchand
> <david.marchand at redhat.com>; Burakov, Anatoly
> <anatoly.burakov at intel.com>; Kevin Traynor <ktraynor at redhat.com>;
> Richardson, Bruce <bruce.richardson at intel.com>
> Subject: [dpdk-dev] [PATCH v8 4/4] usertools/dpdk-telemetry: provide info
> on available sockets
>
> When a user runs the dpdk-telemetry script and fails to connect because
> the socket path does not exist, run a scan for possible sockets that
> could be connected to and inform the user of the command needed to
> connect to those.
>
> For example:
>
> $ ./dpdk-telemetry.py -i4
> Connecting to /run/user/1000/dpdk/rte/dpdk_telemetry.v2:4
> Error connecting to /run/user/1000/dpdk/rte/dpdk_telemetry.v2:4
>
> Other DPDK telemetry sockets found:
> - dpdk_telemetry.v2 # Connect with './dpdk-telemetry.py'
> - dpdk_telemetry.v2:2 # Connect with './dpdk-telemetry.py -i 2'
> - dpdk_telemetry.v2:1 # Connect with './dpdk-telemetry.py -i 1'
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> Acked-by: Ciara Power <ciara.power at intel.com>
> ---
<snip>
> +def print_socket_options(prefix, paths):
> + """ Given a set of socket paths, give the commands needed to connect
> """
> + cmd = sys.argv[0]
> + if prefix != DEFAULT_PREFIX:
> + cmd += " -f " + prefix
> + for s in paths:
When I tested this the sockets were in the wrong order e.g. 2, 1, 0.
If the above paths variable was wrapped with sorted() it would ensure the list
was always in the correct order.
With or without this change:
Reviewed-by: Conor Walsh <conor.walsh at intel.com>
> + sock_name = os.path.basename(s)
> + if sock_name.endswith(TELEMETRY_VERSION):
> + print("- {} # Connect with '{}'".format(os.path.basename(s),
> + cmd))
> + else:
> + print("- {} # Connect with '{} -i {}'".format(os.path.basename(s),
> + cmd,
> + s.split(':')[-1]))
<snip>
More information about the dev
mailing list