diff options
author | Stanislav Fomichev <sdf@google.com> | 2019-01-16 11:10:01 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-01-17 10:30:31 +0100 |
commit | 04a5d323e6b90856b479be7a2b08d4cba6b720b6 (patch) | |
tree | 98421af15d892ee8ee675f2449fd51b4d776999d /init | |
parent | 8a89fff60a7ef63a23b112bdfa76d7ba160a4a68 (diff) | |
download | linux-04a5d323e6b90856b479be7a2b08d4cba6b720b6.tar.gz linux-04a5d323e6b90856b479be7a2b08d4cba6b720b6.tar.bz2 linux-04a5d323e6b90856b479be7a2b08d4cba6b720b6.zip |
bpftool: don't print empty key/value for maps
When doing dump or lookup, don't print key if key_size == 0 or value if
value_size == 0. The initial usecase is queue and stack, where we have
only values.
This is for regular output only, json still has all the fields.
Before:
bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q
bpftool map update pinned /sys/fs/bpf/q value 0 1 2 3
bpftool map lookup pinned /sys/fs/bpf/q
key: value: 00 01 02 03
After:
bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q
bpftool map update pinned /sys/fs/bpf/q value 0 1 2 3
bpftool map lookup pinned /sys/fs/bpf/q
value: 00 01 02 03
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions