16e9270eaSCiara Power.. SPDX-License-Identifier: BSD-3-Clause 224cd1b52SCiara Power Copyright(c) 2020 Intel Corporation. 34080e46cSReshma Pattan 46e9270eaSCiara Power 524cd1b52SCiara PowerDPDK Telemetry User Guide 624cd1b52SCiara Power========================= 76e9270eaSCiara Power 824cd1b52SCiara PowerThe Telemetry library provides users with the ability to query DPDK for 924cd1b52SCiara Powertelemetry information, currently including information such as ethdev stats, 1024cd1b52SCiara Powerethdev port list, and eal parameters. 116e9270eaSCiara Power 126e9270eaSCiara Power 1324cd1b52SCiara PowerTelemetry Interface 1424cd1b52SCiara Power------------------- 156e9270eaSCiara Power 1624cd1b52SCiara PowerThe :doc:`../prog_guide/telemetry_lib` opens a socket with path 1724cd1b52SCiara Power*<runtime_directory>/dpdk_telemetry.<version>*. The version represents the 1824cd1b52SCiara Powertelemetry version, the latest is v2. For example, a client would connect to a 1924cd1b52SCiara Powersocket with path */var/run/dpdk/\*/dpdk_telemetry.v2* (when the primary process 2024cd1b52SCiara Poweris run by a root user). 216e9270eaSCiara Power 226e9270eaSCiara Power 2324cd1b52SCiara PowerTelemetry Initialization 2424cd1b52SCiara Power------------------------ 256e9270eaSCiara Power 2624cd1b52SCiara PowerThe library is enabled by default, however an EAL flag to enable the library 2724cd1b52SCiara Powerexists, to provide backward compatibility for the previous telemetry library 2898ffdfbcSCiara Powerinterface:: 296e9270eaSCiara Power 3024cd1b52SCiara Power --telemetry 316e9270eaSCiara Power 3298ffdfbcSCiara PowerA flag exists to disable Telemetry also:: 336e9270eaSCiara Power 3424cd1b52SCiara Power --no-telemetry 356e9270eaSCiara Power 366e9270eaSCiara Power 3724cd1b52SCiara PowerRunning Telemetry 3824cd1b52SCiara Power----------------- 396e9270eaSCiara Power 4024cd1b52SCiara PowerThe following steps show how to run an application with telemetry support, 4124cd1b52SCiara Powerand query information using the telemetry client python script. 426e9270eaSCiara Power 4398ffdfbcSCiara Power#. Launch testpmd as the primary application with telemetry:: 446e9270eaSCiara Power 4524cd1b52SCiara Power ./app/dpdk-testpmd 466e9270eaSCiara Power 4798ffdfbcSCiara Power#. Launch the telemetry client script:: 4824cd1b52SCiara Power 49b1df4163SRobin Jarry ./usertools/dpdk-telemetry.py 5024cd1b52SCiara Power 5198ffdfbcSCiara Power#. When connected, the script displays the following, waiting for user input:: 5224cd1b52SCiara Power 5324cd1b52SCiara Power Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2 5498ffdfbcSCiara Power {"version": "DPDK 20.05.0-rc2", "pid": 60285, "max_output_len": 16384} 5524cd1b52SCiara Power --> 5624cd1b52SCiara Power 5724cd1b52SCiara Power#. The user can now input commands to send across the socket, and receive the 5898ffdfbcSCiara Power response. Some available commands are shown below. 5924cd1b52SCiara Power 6098ffdfbcSCiara Power * List all commands:: 6124cd1b52SCiara Power 6224cd1b52SCiara Power --> / 6324cd1b52SCiara Power {"/": ["/", "/eal/app_params", "/eal/params", "/ethdev/list", 6424cd1b52SCiara Power "/ethdev/link_status", "/ethdev/xstats", "/help", "/info"]} 6598ffdfbcSCiara Power 6698ffdfbcSCiara Power * Get the list of ethdev ports:: 6798ffdfbcSCiara Power 6824cd1b52SCiara Power --> /ethdev/list 6924cd1b52SCiara Power {"/ethdev/list": [0, 1]} 7098ffdfbcSCiara Power 7198ffdfbcSCiara Power .. Note:: 7298ffdfbcSCiara Power 7398ffdfbcSCiara Power For commands that expect a parameter, use "," to separate the command 7498ffdfbcSCiara Power and parameter. See examples below. 7598ffdfbcSCiara Power 7698ffdfbcSCiara Power * Get extended statistics for an ethdev port:: 7798ffdfbcSCiara Power 7898ffdfbcSCiara Power --> /ethdev/xstats,0 7998ffdfbcSCiara Power {"/ethdev/xstats": {"rx_good_packets": 0, "tx_good_packets": 0, 8098ffdfbcSCiara Power "rx_good_bytes": 0, "tx_good_bytes": 0, "rx_missed_errors": 0, 8198ffdfbcSCiara Power ... 8298ffdfbcSCiara Power "tx_priority7_xon_to_xoff_packets": 0}} 8398ffdfbcSCiara Power 8498ffdfbcSCiara Power * Get the help text for a command. This will indicate what parameters are 8598ffdfbcSCiara Power required. Pass the command as a parameter:: 8698ffdfbcSCiara Power 8798ffdfbcSCiara Power --> /help,/ethdev/xstats 8898ffdfbcSCiara Power {"/help": {"/ethdev/xstats": "Returns the extended stats for a port. 8998ffdfbcSCiara Power Parameters: int port_id"}} 90*11435aaeSBruce Richardson 91*11435aaeSBruce Richardson 92*11435aaeSBruce RichardsonConnecting to Different DPDK Processes 93*11435aaeSBruce Richardson-------------------------------------- 94*11435aaeSBruce Richardson 95*11435aaeSBruce RichardsonWhen multiple DPDK process instances are running on a system, the user will 96*11435aaeSBruce Richardsonnaturally wish to be able to select the instance to which the connection is 97*11435aaeSBruce Richardsonbeing made. The method to select the instance depends on how the individual 98*11435aaeSBruce Richardsoninstances are run: 99*11435aaeSBruce Richardson 100*11435aaeSBruce Richardson* For DPDK processes run using a non-default file-prefix, 101*11435aaeSBruce Richardson i.e. using the `--file-prefix` EAL option flag, 102*11435aaeSBruce Richardson the file-prefix for the process should be passed via the `-f` or `--file-prefix` script flag. 103*11435aaeSBruce Richardson 104*11435aaeSBruce Richardson For example, to connect to testpmd run as:: 105*11435aaeSBruce Richardson 106*11435aaeSBruce Richardson $ ./build/app/dpdk-testpmd -l 2,3 --file-prefix="tpmd" 107*11435aaeSBruce Richardson 108*11435aaeSBruce Richardson One would use the telemetry script command:: 109*11435aaeSBruce Richardson 110*11435aaeSBruce Richardson $ ./usertools/dpdk-telemetry -f "tpmd" 111*11435aaeSBruce Richardson 112*11435aaeSBruce Richardson* For the case where multiple processes are run using the `--in-memory` EAL flag, 113*11435aaeSBruce Richardson but no `--file-prefix` flag, or the same `--file-prefix` flag, 114*11435aaeSBruce Richardson those processes will all share the same runtime directory. 115*11435aaeSBruce Richardson In this case, 116*11435aaeSBruce Richardson each process after the first will add an increasing count suffix to the telemetry socket name, 117*11435aaeSBruce Richardson with each one taking the first available free socket name. 118*11435aaeSBruce Richardson This suffix count can be passed to the telemetry script using the `-i` or `--instance` flag. 119*11435aaeSBruce Richardson 120*11435aaeSBruce Richardson For example, if the following two applications are run in separate terminals:: 121*11435aaeSBruce Richardson 122*11435aaeSBruce Richardson $ ./build/app/dpdk-testpmd -l 2,3 --in-memory # will use socket "dpdk_telemetry.v2" 123*11435aaeSBruce Richardson 124*11435aaeSBruce Richardson $ ./build/app/test/dpdk-test -l 4,5 --in-memory # will use "dpdk_telemetry.v2:1" 125*11435aaeSBruce Richardson 126*11435aaeSBruce Richardson The following telemetry script commands would allow one to connect to each binary:: 127*11435aaeSBruce Richardson 128*11435aaeSBruce Richardson $ ./usertools/dpdk-telemetry.py # will connect to testpmd 129*11435aaeSBruce Richardson 130*11435aaeSBruce Richardson $ ./usertools/dpdk-telemetry.py -i 1 # will connect to test binary 131