From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v4 6/7] usertools/telemetry-watcher: add eth name shortcuts
Date: Thu, 5 Feb 2026 15:02:29 +0000 [thread overview]
Message-ID: <20260205150230.123076-7-bruce.richardson@intel.com> (raw)
In-Reply-To: <20260205150230.123076-1-bruce.richardson@intel.com>
Since an expected main use of the script is to monitor ethdev packet
stats, provide a shortened form of parameters to make it easier to
monitor all ports on the system. Any stat starting with "eth." is taken
not as a direct command, but instead as a shortcut for getting the stats
for all ports on the system. For example: eth.ibytes shows the byte
counts for all ports.
Beyond that, provide a shortcut for ipackets and opackets as just rx and
tx respectively. Therefore, to monitor the output rate of an app, one
can use "dpdk-telemetry-watcher -dT eth.tx"
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/tools/telemetrywatcher.rst | 33 ++++++++++++++++++
usertools/dpdk-telemetry-watcher.py | 49 ++++++++++++++++++++++++++-
2 files changed, 81 insertions(+), 1 deletion(-)
diff --git a/doc/guides/tools/telemetrywatcher.rst b/doc/guides/tools/telemetrywatcher.rst
index b4ca1fcfc0..251d99a085 100644
--- a/doc/guides/tools/telemetrywatcher.rst
+++ b/doc/guides/tools/telemetrywatcher.rst
@@ -95,6 +95,19 @@ Example telemetry commands:
See `Examples`_ section for usage examples based on the results of these telemetry commands.
+Shortcuts
+---------
+
+The tool provides convenient shortcuts for common statistics:
+
+* ``eth.rx`` - Expands to ``/ethdev/stats,N.ipackets`` for all Ethernet devices
+* ``eth.tx`` - Expands to ``/ethdev/stats,N.opackets`` for all Ethernet devices
+* ``eth.FIELD`` - Expands to ``/ethdev/stats,N.FIELD`` for all Ethernet devices
+
+These shortcuts automatically detect all available Ethernet devices
+and create a column for each one.
+
+
Examples
--------
@@ -106,10 +119,30 @@ Monitor received and transmitted packets on device 0::
dpdk-telemetry-watcher.py /ethdev/stats,0.ipackets /ethdev/stats,0.opackets
+Monitor received packets on all Ethernet devices using shortcut::
+
+ dpdk-telemetry-watcher.py eth.rx
+
+Monitor packet deltas (rates) for device 0::
+
+ dpdk-telemetry-watcher.py -d /ethdev/stats,0.ipackets /ethdev/stats,0.opackets
+
+Monitor with a total column showing aggregate traffic::
+
+ dpdk-telemetry-watcher.py -d -T eth.rx eth.tx
+
+Monitor for a specific duration (60 iterations = 60 seconds)::
+
+ dpdk-telemetry-watcher.py -t 60 /ethdev/stats,0.ipackets
+
Monitor a DPDK application with a custom file-prefix::
dpdk-telemetry-watcher.py -f myapp /ethdev/stats,0.ipackets
+Monitor in single-line mode (no scrolling)::
+
+ dpdk-telemetry-watcher.py -1 -d eth.rx eth.tx
+
List all running DPDK applications::
dpdk-telemetry-watcher.py -l
diff --git a/usertools/dpdk-telemetry-watcher.py b/usertools/dpdk-telemetry-watcher.py
index 7ec7267a38..eda57e5ba5 100755
--- a/usertools/dpdk-telemetry-watcher.py
+++ b/usertools/dpdk-telemetry-watcher.py
@@ -139,6 +139,48 @@ def print_connected_app(process):
print(f'Connected to application: "{app_name}"')
+def expand_shortcuts(process, stat_specs):
+ """Expand special shortcuts like eth.rx and eth.tx into actual stat specifications.
+
+ Args:
+ process: The subprocess.Popen handle to the telemetry process
+ stat_specs: List of stat specifications, possibly including shortcuts
+
+ Returns:
+ List of expanded stat specifications
+ """
+ expanded = []
+ for spec in stat_specs:
+ if not spec.startswith("eth."):
+ expanded.append(spec)
+ continue
+
+ # Extract the field name after "eth."
+ field = spec[4:] # Remove "eth." prefix
+ if not field:
+ print(f"Error: Invalid shortcut '{spec}' - missing field name", file=sys.stderr)
+ return None
+
+ # Map common shortcuts to actual field names
+ field_map = {
+ "rx": "ipackets",
+ "tx": "opackets",
+ }
+ field = field_map.get(field, field)
+
+ # Get list of ethernet devices
+ port_list = query_telemetry(process, "/ethdev/list")
+ if not isinstance(port_list, list):
+ print("Error: Failed to get ethernet device list", file=sys.stderr)
+ return None
+
+ # Create stat specs for each port
+ for port in port_list:
+ expanded.append(f"/ethdev/stats,{port}.{field}")
+
+ return expanded
+
+
def validate_stats(process, stat_specs):
"""Validate stat specifications and check that fields are numeric.
@@ -202,8 +244,13 @@ def monitor_stats(process, args):
process: The subprocess.Popen handle to the telemetry process
args: Parsed command line arguments
"""
+ # Expand any shortcuts like eth-rx, eth-tx
+ expanded_stats = expand_shortcuts(process, args.stats)
+ if not expanded_stats:
+ return
+
# Validate all stat specifications and get initial values
- parsed_specs, prev_values = validate_stats(process, args.stats)
+ parsed_specs, prev_values = validate_stats(process, expanded_stats)
if not parsed_specs:
return
--
2.51.0
next prev parent reply other threads:[~2026-02-05 15:03 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-10 16:55 [RFC PATCH 0/7] Add script for real-time telemetry monitoring Bruce Richardson
2025-12-10 16:55 ` [RFC PATCH 1/7] usertools: add new script to monitor telemetry on terminal Bruce Richardson
2025-12-10 16:55 ` [RFC PATCH 2/7] usertools/telemetry-watcher: add displaying stats Bruce Richardson
2025-12-10 16:55 ` [RFC PATCH 3/7] usertools/telemetry-watcher: add delta and timeout opts Bruce Richardson
2025-12-10 16:55 ` [RFC PATCH 4/7] usertools/telemetry-watcher: add total and one-line opts Bruce Richardson
2025-12-10 16:55 ` [RFC PATCH 5/7] usertools/telemetry-watcher: add thousands separator Bruce Richardson
2025-12-10 16:55 ` [RFC PATCH 6/7] usertools/telemetry-watcher: add eth name shortcuts Bruce Richardson
2025-12-10 16:55 ` [RFC PATCH 7/7] usertools/telemetry-watcher: support reconnection Bruce Richardson
2025-12-11 1:09 ` [RFC PATCH 0/7] Add script for real-time telemetry monitoring Stephen Hemminger
2025-12-11 9:10 ` Bruce Richardson
2025-12-12 5:32 ` Stephen Hemminger
2025-12-12 17:52 ` Bruce Richardson
2025-12-12 23:23 ` Stephen Hemminger
2026-01-05 17:55 ` [PATCH v2 " Bruce Richardson
2026-01-05 17:55 ` [PATCH v2 1/7] usertools: add new script to monitor telemetry on terminal Bruce Richardson
2026-01-05 17:56 ` [PATCH v2 2/7] usertools/telemetry-watcher: add displaying stats Bruce Richardson
2026-01-05 17:56 ` [PATCH v2 3/7] usertools/telemetry-watcher: add delta and timeout opts Bruce Richardson
2026-01-05 17:56 ` [PATCH v2 4/7] usertools/telemetry-watcher: add total and one-line opts Bruce Richardson
2026-01-05 17:56 ` [PATCH v2 5/7] usertools/telemetry-watcher: add thousands separator Bruce Richardson
2026-01-05 17:56 ` [PATCH v2 6/7] usertools/telemetry-watcher: add eth name shortcuts Bruce Richardson
2026-01-05 17:56 ` [PATCH v2 7/7] usertools/telemetry-watcher: support reconnection Bruce Richardson
2026-01-14 2:00 ` [PATCH v2 0/7] Add script for real-time telemetry monitoring Stephen Hemminger
2026-01-15 19:03 ` [PATCH v3 " Bruce Richardson
2026-01-15 19:03 ` [PATCH v3 1/7] usertools: add new script to monitor telemetry on terminal Bruce Richardson
2026-01-15 19:03 ` [PATCH v3 2/7] usertools/telemetry-watcher: add displaying stats Bruce Richardson
2026-01-15 19:03 ` [PATCH v3 3/7] usertools/telemetry-watcher: add delta and timeout opts Bruce Richardson
2026-01-15 19:03 ` [PATCH v3 4/7] usertools/telemetry-watcher: add total and one-line opts Bruce Richardson
2026-01-15 19:03 ` [PATCH v3 5/7] usertools/telemetry-watcher: add thousands separator Bruce Richardson
2026-01-15 19:03 ` [PATCH v3 6/7] usertools/telemetry-watcher: add eth name shortcuts Bruce Richardson
2026-01-15 19:03 ` [PATCH v3 7/7] usertools/telemetry-watcher: support reconnection Bruce Richardson
2026-01-16 6:53 ` [PATCH v3 0/7] Add script for real-time telemetry monitoring Stephen Hemminger
2026-01-16 6:57 ` Stephen Hemminger
2026-02-05 15:02 ` [PATCH v4 " Bruce Richardson
2026-02-05 15:02 ` [PATCH v4 1/7] usertools: add new script to monitor telemetry on terminal Bruce Richardson
2026-02-05 15:02 ` [PATCH v4 2/7] usertools/telemetry-watcher: add displaying stats Bruce Richardson
2026-02-05 15:02 ` [PATCH v4 3/7] usertools/telemetry-watcher: add delta and timeout opts Bruce Richardson
2026-02-05 15:02 ` [PATCH v4 4/7] usertools/telemetry-watcher: add total and one-line opts Bruce Richardson
2026-02-05 15:02 ` [PATCH v4 5/7] usertools/telemetry-watcher: add thousands separator Bruce Richardson
2026-02-05 15:02 ` Bruce Richardson [this message]
2026-02-05 15:02 ` [PATCH v4 7/7] usertools/telemetry-watcher: support reconnection Bruce Richardson
2026-03-31 18:10 ` [PATCH v4 0/7] Add script for real-time telemetry monitoring Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260205150230.123076-7-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox