aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/trace-event-scripting.c
diff options
context:
space:
mode:
authorYonghong Song <[email protected]>2018-08-09 08:55:19 -0700
committerDaniel Borkmann <[email protected]>2018-08-10 20:54:07 +0200
commitdc1508a579e682a1e5f1ed0753390e0aa7c23a97 (patch)
tree1ba086385540f878a93b30d2e1f0b1b478a076ca /tools/perf/util/trace-event-scripting.c
parent60afdf066a35317efd5d1d7ae7c7f4ef2b32601f (diff)
bpf: fix bpffs non-array map seq_show issue
In function map_seq_next() of kernel/bpf/inode.c, the first key will be the "0" regardless of the map type. This works for array. But for hash type, if it happens key "0" is in the map, the bpffs map show will miss some items if the key "0" is not the first element of the first bucket. This patch fixed the issue by guaranteeing to get the first element, if the seq_show is just started, by passing NULL pointer key to map_get_next_key() callback. This way, no missing elements will occur for bpffs hash table show even if key "0" is in the map. Fixes: a26ca7c982cb5 ("bpf: btf: Add pretty print support to the basic arraymap") Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: Yonghong Song <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions