diff options
| author | Breno Leitao <[email protected]> | 2025-07-14 09:56:49 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-07-17 00:25:49 +0000 |
| commit | fd2aadcefbacb4425f54c252ec9cfb8218548eb9 (patch) | |
| tree | 8358bc514d6c72e5aad4e7c6a2372c9f9270a38a /tools/testing/selftests/net/lib/py/utils.py | |
| parent | selftests: drv-net: add helper/wrapper for bpftrace (diff) | |
| download | kernel-fd2aadcefbacb4425f54c252ec9cfb8218548eb9.tar.gz kernel-fd2aadcefbacb4425f54c252ec9cfb8218548eb9.zip | |
selftests: drv-net: Strip '@' prefix from bpftrace map keys
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 <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/net/lib/py/utils.py')
| -rw-r--r-- | tools/testing/selftests/net/lib/py/utils.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/lib/py/utils.py b/tools/testing/selftests/net/lib/py/utils.py index 5950a643a533..f395c90fb0f1 100644 --- a/tools/testing/selftests/net/lib/py/utils.py +++ b/tools/testing/selftests/net/lib/py/utils.py @@ -217,6 +217,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 |
