aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2018-11-19 15:29:10 -0800
committerAlexei Starovoitov <ast@kernel.org>2018-11-20 10:54:38 -0800
commit78a2540e8945678b390a5f41eb82459bc6f0f36c (patch)
treecab2bda07077f3d7ab9ff8e2f682a0e896ba3380 /tools/lib
parenttools/bpf: Sync kernel btf.h header (diff)
downloadlinux-dev-78a2540e8945678b390a5f41eb82459bc6f0f36c.tar.xz
linux-dev-78a2540e8945678b390a5f41eb82459bc6f0f36c.zip
tools/bpf: Add tests for BTF_KIND_FUNC_PROTO and BTF_KIND_FUNC
This patch adds unit tests for BTF_KIND_FUNC_PROTO and BTF_KIND_FUNC to test_btf. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/bpf/btf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 449591aa9900..31225e64766f 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -165,6 +165,10 @@ static int btf_parse_type_sec(struct btf *btf, btf_print_fn_t err_log)
case BTF_KIND_ENUM:
next_type += vlen * sizeof(struct btf_enum);
break;
+ case BTF_KIND_FUNC_PROTO:
+ next_type += vlen * sizeof(struct btf_param);
+ break;
+ case BTF_KIND_FUNC:
case BTF_KIND_TYPEDEF:
case BTF_KIND_PTR:
case BTF_KIND_FWD: