]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Print the enum's name instead of value
authorMartin KaFai Lau <kafai@fb.com>
Wed, 18 Mar 2020 17:16:37 +0000 (10:16 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 20 Mar 2020 14:51:35 +0000 (15:51 +0100)
commitd93461da2e42ba54ed4996049e46e34edfbd2d9c
treed5ec98e971734053d9b103ea38bdecf6b99f5bba
parent667b7ff2b3684a305d30916f291fed4e20b8020d
bpftool: Print the enum's name instead of value

This patch prints the enum's name if there is one found in
the array of btf_enum.

The commit d8cf207ff992 ("bpf: fix BTF verification of enums")
has details about an enum could have any power-of-2 size (up to 8 bytes).
This patch also takes this chance to accommodate these non 4 byte
enums.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20200318171637.128862-1-kafai@fb.com
tools/bpf/bpftool/btf_dumper.c