]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: log struct/union attribute for forward type
authorYonghong Song <yhs@fb.com>
Tue, 18 Dec 2018 21:43:58 +0000 (13:43 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 18 Dec 2018 23:47:56 +0000 (00:47 +0100)
commitce2bd5410c1086311393c5e77d4ff0af8026db4a
tree893d0b9605592704106fbe95e9f5c1688c899efc
parentc60d41fbb6374a0cb49a94f5c82892ec20c5caba
bpf: log struct/union attribute for forward type

Current btf internal verbose logger logs fwd type as
  [2] FWD A type_id=0
where A is the type name.

Commit d9226d80e6ce ("bpf: btf: fix struct/union/fwd types
with kind_flag") introduced kind_flag which can be used
to distinguish whether a forward type is a struct or
union.

Also, "type_id=0" does not carry any meaningful
information for fwd type as btf_type.type = 0 is simply
enforced during btf verification and is not used
anywhere else.

This commit changed the log to
  [2] FWD A struct
if kind_flag = 0, or
  [2] FWD A union
if kind_flag = 1.

Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/btf.c