Skip to content

Commit fd2aadc

Browse files
leitaokuba-moo
authored andcommitted
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]>
1 parent 3c561c5 commit fd2aadc

File tree

1 file changed

+2
-0
lines changed
  • tools/testing/selftests/net/lib/py

1 file changed

+2
-0
lines changed

tools/testing/selftests/net/lib/py/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ def bpftrace(expr, json=None, ns=None, host=None, timeout=None):
217217
if one.get('type') != 'map':
218218
continue
219219
for k, v in one["data"].items():
220+
if k.startswith('@'):
221+
k = k.lstrip('@')
220222
ret[k] = v
221223
return ret
222224
return cmd_obj

0 commit comments

Comments
 (0)