linux/tools
Yonghong Song ad3338d250 tools/bpf: bpftool: support prog array map and map of maps
Currently, prog array map and map of maps are not supported
in bpftool. This patch added the support.
Different from other map types, for prog array map and
map of maps, the key returned bpf_get_next_key() may not
point to a valid value. So for these two map types,
no error will be printed out when such a scenario happens.

The following is the plain and json dump if btf is not available:
  $ ./bpftool map dump id 10
    key: 08 00 00 00  value: 5c 01 00 00
    Found 1 element
  $ ./bpftool -jp map dump id 10
    [{
        "key": ["0x08","0x00","0x00","0x00"
        ],
        "value": ["0x5c","0x01","0x00","0x00"
        ]
    }]

If the BTF is available, the dump looks below:
  $ ./bpftool map dump id 2
    [{
            "key": 0,
            "value": 7
        }
    ]
  $ ./bpftool -jp map dump id 2
    [{
        "key": ["0x00","0x00","0x00","0x00"
        ],
        "value": ["0x07","0x00","0x00","0x00"
        ],
        "formatted": {
            "key": 0,
            "value": 7
        }
    }]

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2018-09-11 14:17:24 -07:00
..
accounting
arch Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-08-26 11:25:21 -07:00
bpf tools/bpf: bpftool: support prog array map and map of maps 2018-09-11 14:17:24 -07:00
build Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-08-15 15:04:25 -07:00
cgroup
firewire
gpio Linux 4.16-rc5 2018-03-18 17:48:59 +01:00
hv Tools: hv: vss: fix loop device detection 2018-07-03 13:02:33 +02:00
iio iio: Add modifier for DUV light 2018-07-23 19:18:10 +01:00
include tools/bpf: sync kernel uapi header if_link.h to tools 2018-09-06 22:34:08 -07:00
kvm/kvm_stat tools/kvm_stat: Remove unused function 2018-03-28 22:47:06 +02:00
laptop
leds
lib tools/bpf: add more netlink functionalities in lib/bpf 2018-09-06 22:34:08 -07:00
memory-model tools/memory-model: Rename litmus tests to comply to norm7 2018-07-17 09:30:36 +02:00
nfsd
objtool Kbuild updates for v4.19 2018-08-15 12:09:03 -07:00
pci tools: PCI: Add MSI-X support 2018-07-19 11:47:13 +01:00
pcmcia
perf perf python: Fix pyrf_evlist__read_on_cpu() interface 2018-08-20 08:54:59 -03:00
power treewide: convert ISO_8859-1 text comments to utf-8 2018-08-23 18:48:43 -07:00
scripts Kbuild: fix # escaping in .cmd files for future Make 2018-04-11 00:03:02 +09:00
spi
testing selftests/bpf/test_progs: do not check errno == 0 2018-09-06 22:34:08 -07:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-03-27 09:51:23 +02:00
time
usb tools: usb: ffs-test: Fix build on big endian systems 2018-07-17 10:12:51 +03:00
virtio tools/virtio: add kmalloc_array stub 2018-07-27 16:54:40 +03:00
vm tools/vm/page-types.c: add support for idle page tracking 2018-08-17 16:20:28 -07:00
wmi
Makefile