Re: [PATCH v1 41/58] perf netdev-times: Port netdev-times to use python module

sashiko-bot
2026-04-20T00:28:51Z

Sashiko AI review found 1 potential issue(s):
- [Medium] Tracepoint field mismatch causes all packets to report 0 length and '[unknown]' device, breaking script functionality.
--

commit 650861cea8b019ec7d7a76a67b9c4572675db6f4
Author: Ian Rogers <irogers@google.com>

perf netdev-times: Port netdev-times to use python module

This commit ports the netdev-times script to use the perf Python module,
encapsulating the state in a class and processing events in time order.

> diff --git a/tools/perf/python/netdev-times.py b/tools/perf/python/netdev-times.py
> new file mode 100755
> index 0000000000000..c7110a0064059
> --- /dev/null
> +++ b/tools/perf/python/netdev-times.py

[ ... ]

> + def collect_event(self, sample: perf.sample_event) -> None:

[ ... ]

> + elif name in ("evsel(net:netif_receive_skb)", "evsel(net:netif_rx)",
> + "evsel(net:net_dev_queue)"):
> + event_data['skbaddr'] = getattr(sample, "skbaddr", 0)
> + event_data['skblen'] = getattr(sample, "skblen", 0)
> + event_data['dev_name'] = getattr(sample, "dev_name", "[unknown]")

Are the field names skblen and dev_name correct for these tracepoints?

The core networking tracepoints (netif_receive_skb, netif_rx, net_dev_queue)
typically expose these fields as len and name.

If getattr falls back to the default values, does this cause all packets to
report 0 length and '[unknown]' device, breaking the device filtering logic
used later in the script?

> + elif name == "evsel(net:net_dev_xmit)":
> + event_data['skbaddr'] = getattr(sample, "skbaddr", 0)
> + event_data['skblen'] = getattr(sample, "skblen", 0)
> + event_data['rc'] = getattr(sample, "rc", 0)
> + event_data['dev_name'] = getattr(sample, "dev_name", "[unknown]")

Could this block be facing the same tracepoint field mismatch with skblen and
dev_name?

[ ... ]

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260419235911.2186050-1-irogers@google.com?part=41