[PATCH net-next v4 2/3] selftests: drv-net: Strip '@' prefix from bpftrace map keys
From: Breno Leitao
Date: Wed Jul 02 2025 - 07:22:34 EST
The '@' prefix in bpftrace map keys is specific to bpftrace and can be
safely removed when processing results. This patch modifies the bpftrace
utility to strip the '@' from map keys before storing them in the result
dictionary, making the keys more consistent with Python conventions.
Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
---
tools/testing/selftests/net/lib/py/utils.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/net/lib/py/utils.py b/tools/testing/selftests/net/lib/py/utils.py
index 760ccf6fccccc..33c23a928ed1d 100644
--- a/tools/testing/selftests/net/lib/py/utils.py
+++ b/tools/testing/selftests/net/lib/py/utils.py
@@ -213,6 +213,8 @@ def bpftrace(expr, json=None, ns=None, host=None, timeout=None):
if one.get('type') != 'map':
continue
for k, v in one["data"].items():
+ if k.startswith('@'):
+ k = k.lstrip('@')
ret[k] = v
return ret
return cmd_obj
--
2.47.1