]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Fix print error when show bpf map
authorYafang Shao <laoar.shao@gmail.com>
Sun, 20 Mar 2022 06:08:14 +0000 (06:08 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 21 Mar 2022 13:58:06 +0000 (14:58 +0100)
commit3c2beecf696ad770163e5fbfdbdfd6abfc237b42
tree1818f51b4c76940cc90ea466d0ba1f957b824971
parent44346efc1ec82d8f3b0e31cab0a6be57553fc6f8
bpftool: Fix print error when show bpf map

If there is no btf_id or frozen, it will not show the pids, but the pids don't
depend on any one of them.

Below is the result after this change:

  $ ./bpftool map show
  2: lpm_trie  flags 0x1
key 8B  value 8B  max_entries 1  memlock 4096B
pids systemd(1)
  3: lpm_trie  flags 0x1
key 20B  value 8B  max_entries 1  memlock 4096B
pids systemd(1)

While before this change, the 'pids systemd(1)' can't be displayed.

Fixes: 24f7afa4a6c4 ("bpf: Add bloom filter map implementation")
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220320060815.7716-1-laoar.shao@gmail.com
tools/bpf/bpftool/map.c