1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2020 Intel Corporation.
5 DPDK Telemetry User Guide
6 =========================
8 The Telemetry library provides users with the ability to query DPDK for
9 telemetry information, currently including information such as ethdev stats,
10 ethdev port list, and eal parameters.
16 The :doc:`../prog_guide/telemetry_lib` opens a socket with path
17 *<runtime_directory>/dpdk_telemetry.<version>*. The version represents the
18 telemetry version, the latest is v2. For example, a client would connect to a
19 socket with path */var/run/dpdk/\*/dpdk_telemetry.v2* (when the primary process
20 is run by a root user).
23 Telemetry Initialization
24 ------------------------
26 The library is enabled by default, however an EAL flag to enable the library
27 exists, to provide backward compatibility for the previous telemetry library
32 A flag exists to disable Telemetry also::
40 The following steps show how to run an application with telemetry support,
41 and query information using the telemetry client python script.
43 #. Launch testpmd as the primary application with telemetry::
47 #. Launch the telemetry client script::
49 ./usertools/dpdk-telemetry.py
51 #. When connected, the script displays the following, waiting for user input::
53 Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
54 {"version": "DPDK 20.05.0-rc2", "pid": 60285, "max_output_len": 16384}
57 #. The user can now input commands to send across the socket, and receive the
58 response. Some available commands are shown below.
63 {"/": ["/", "/eal/app_params", "/eal/params", "/ethdev/list",
64 "/ethdev/link_status", "/ethdev/xstats", "/help", "/info"]}
66 * Get the list of ethdev ports::
69 {"/ethdev/list": [0, 1]}
73 For commands that expect a parameter, use "," to separate the command
74 and parameter. See examples below.
76 * Get extended statistics for an ethdev port::
79 {"/ethdev/xstats": {"rx_good_packets": 0, "tx_good_packets": 0,
80 "rx_good_bytes": 0, "tx_good_bytes": 0, "rx_missed_errors": 0,
82 "tx_priority7_xon_to_xoff_packets": 0}}
84 * Get the help text for a command. This will indicate what parameters are
85 required. Pass the command as a parameter::
87 --> /help,/ethdev/xstats
88 {"/help": {"/ethdev/xstats": "Returns the extended stats for a port.
89 Parameters: int port_id"}}
92 Connecting to Different DPDK Processes
93 --------------------------------------
95 When multiple DPDK process instances are running on a system, the user will
96 naturally wish to be able to select the instance to which the connection is
97 being made. The method to select the instance depends on how the individual
100 * For DPDK processes run using a non-default file-prefix,
101 i.e. using the `--file-prefix` EAL option flag,
102 the file-prefix for the process should be passed via the `-f` or `--file-prefix` script flag.
104 For example, to connect to testpmd run as::
106 $ ./build/app/dpdk-testpmd -l 2,3 --file-prefix="tpmd"
108 One would use the telemetry script command::
110 $ ./usertools/dpdk-telemetry -f "tpmd"
112 To list all running telemetry-enabled file-prefixes, the ``-l`` or ``--list`` flags can be used::
114 $ ./usertools/dpdk-telemetry -l
116 * For the case where multiple processes are run using the `--in-memory` EAL flag,
117 but no `--file-prefix` flag, or the same `--file-prefix` flag,
118 those processes will all share the same runtime directory.
120 each process after the first will add an increasing count suffix to the telemetry socket name,
121 with each one taking the first available free socket name.
122 This suffix count can be passed to the telemetry script using the `-i` or `--instance` flag.
124 For example, if the following two applications are run in separate terminals::
126 $ ./build/app/dpdk-testpmd -l 2,3 --in-memory # will use socket "dpdk_telemetry.v2"
128 $ ./build/app/test/dpdk-test -l 4,5 --in-memory # will use "dpdk_telemetry.v2:1"
130 The following telemetry script commands would allow one to connect to each binary::
132 $ ./usertools/dpdk-telemetry.py # will connect to testpmd
134 $ ./usertools/dpdk-telemetry.py -i 1 # will connect to test binary