diff options
author | Andrii Nakryiko <[email protected]> | 2023-11-17 19:46:20 -0800 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2023-11-18 11:39:59 -0800 |
commit | 0c95c9fdb696f35c7864785ba84cb9a50152daff (patch) | |
tree | 909fcb7acbc43862d80a67c68c62e4b41b09b16d /tools/testing/selftests/bpf/prog_tests/align.c | |
parent | 67d43dfbb42d6575304daea67733c88fbf536a1c (diff) |
bpf: emit map name in register state if applicable and available
In complicated real-world applications, whenever debugging some
verification error through verifier log, it often would be very useful
to see map name for PTR_TO_MAP_VALUE register. Usually this needs to be
inferred from key/value sizes and maybe trying to guess C code location,
but it's not always clear.
Given verifier has the name, and it's never too long, let's just emit it
for ptr_to_map_key, ptr_to_map_value, and const_ptr_to_map registers. We
reshuffle the order a bit, so that map name, key size, and value size
appear before offset and immediate values, which seems like a more
logical order.
Current output:
R1_w=map_ptr(map=array_map,ks=4,vs=8,off=0,imm=0)
But we'll get rid of useless off=0 and imm=0 parts in the next patch.
Acked-by: Eduard Zingerman <[email protected]>
Acked-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/align.c')
0 files changed, 0 insertions, 0 deletions