• David Ahern's avatar
    bpftool: Improve handling of ENOENT on map dumps · cb4e74c1
    David Ahern authored
    [ Upstream commit bf598a8f ]
    
    bpftool output is not user friendly when dumping a map with only a few
    populated entries:
    
        $ bpftool map
        1: devmap  name tx_devmap  flags 0x0
                key 4B  value 4B  max_entries 64  memlock 4096B
        2: array  name tx_idxmap  flags 0x0
                key 4B  value 4B  max_entries 64  memlock 4096B
    
        $ bpftool map dump id 1
        key:
        00 00 00 00
        value:
        No such file or directory
        key:
        01 00 00 00
        value:
        No such file or directory
        key:
        02 00 00 00
        value:
        No such file or directory
        key: 03 00 00 00  value: 03 00 00 00
    
    Handle ENOENT by keeping the line format sane and dumping
    "<no entry>" for the value
    
        $ bpftool map dump id 1
        key: 00 00 00 00  value: <no entry>
        key: 01 00 00 00  value: <no entry>
        key: 02 00 00 00  value: <no entry>
        key: 03 00 00 00  value: 03 00 00 00
        ...
    Signed-off-by: 's avatarDavid Ahern <dsahern@gmail.com>
    Acked-by: 's avatarJakub Kicinski <jakub.kicinski@netronome.com>
    Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    cb4e74c1
Name
Last commit
Last update
..
accounting Loading commit data...
arch Loading commit data...
bpf Loading commit data...
build Loading commit data...
cgroup Loading commit data...
crypto Loading commit data...
firewire Loading commit data...
gpio Loading commit data...
hv Loading commit data...
iio Loading commit data...
include Loading commit data...
kvm/kvm_stat Loading commit data...
laptop Loading commit data...
leds Loading commit data...
lib Loading commit data...
memory-model Loading commit data...
nfsd Loading commit data...
objtool Loading commit data...
pci Loading commit data...
pcmcia Loading commit data...
perf Loading commit data...
power Loading commit data...
scripts Loading commit data...
spi Loading commit data...
testing Loading commit data...
thermal/tmon Loading commit data...
time Loading commit data...
usb Loading commit data...
virtio Loading commit data...
vm Loading commit data...
wmi Loading commit data...
Makefile Loading commit data...