usertools: fix telemetry script user socket path

Message ID 20200610133033.18317-1-ciara.power@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series usertools: fix telemetry script user socket path |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Power, Ciara June 10, 2020, 1:30 p.m. UTC
  The path to the socket when running the script as a regular user needed
to be updated to match the logic in EAL.

Fixes: 6a2967c112a3 ("usertools: add new telemetry script")
Cc: bruce.richardson@intel.com

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 usertools/dpdk-telemetry.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Bruce Richardson June 10, 2020, 1:38 p.m. UTC | #1
On Wed, Jun 10, 2020 at 02:30:33PM +0100, Ciara Power wrote:
> The path to the socket when running the script as a regular user needed
> to be updated to match the logic in EAL.
> 
> Fixes: 6a2967c112a3 ("usertools: add new telemetry script")
> Cc: bruce.richardson@intel.com
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
  
Thomas Monjalon June 24, 2020, 11:10 p.m. UTC | #2
10/06/2020 15:38, Bruce Richardson:
> On Wed, Jun 10, 2020 at 02:30:33PM +0100, Ciara Power wrote:
> > The path to the socket when running the script as a regular user needed
> > to be updated to match the logic in EAL.
> > 
> > Fixes: 6a2967c112a3 ("usertools: add new telemetry script")

+Cc: stable@dpdk.org
(even if there is little chance someone wants to maintain DPDK 20.05)

> > Cc: bruce.richardson@intel.com
> > 
> > Signed-off-by: Ciara Power <ciara.power@intel.com>
> > ---
> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks
  

Patch

diff --git a/usertools/dpdk-telemetry.py b/usertools/dpdk-telemetry.py
index afbf01b19..8e4039d57 100755
--- a/usertools/dpdk-telemetry.py
+++ b/usertools/dpdk-telemetry.py
@@ -78,6 +78,6 @@  def readline_complete(text, state):
 for f in glob.glob('/var/run/dpdk/*/dpdk_telemetry.%s' % TELEMETRY_VERSION):
     handle_socket(f)
 # Path to sockets for processes run as a regular user
-for f in glob.glob('/run/user/%d/dpdk/*/dpdk_telemetry.%s' %
-                   (os.getuid(), TELEMETRY_VERSION)):
+for f in glob.glob('%s/dpdk/*/dpdk_telemetry.%s' %
+                   (os.environ.get('XDG_RUNTIME_DIR', '/tmp'), TELEMETRY_VERSION)):
     handle_socket(f)