summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/btf_helpers.c
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2021-02-26 23:22:53 +0300
committerAlexei Starovoitov <ast@kernel.org>2021-03-05 04:58:16 +0300
commit7e72aad3a15c06e40e3ccd2352e5010e978f1acf (patch)
tree4eaee9bf7b2d7ed005ea697da74d15ce0ed5efe7 /tools/testing/selftests/bpf/btf_helpers.c
parentb1828f0b04828aa8cccadf00a702f459caefeed9 (diff)
downloadlinux-7e72aad3a15c06e40e3ccd2352e5010e978f1acf.tar.xz
selftest/bpf: Add BTF_KIND_FLOAT tests
Test the good variants as well as the potential malformed ones. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210226202256.116518-8-iii@linux.ibm.com
Diffstat (limited to 'tools/testing/selftests/bpf/btf_helpers.c')
-rw-r--r--tools/testing/selftests/bpf/btf_helpers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/btf_helpers.c b/tools/testing/selftests/bpf/btf_helpers.c
index 48f90490f922..b692e6ead9b5 100644
--- a/tools/testing/selftests/bpf/btf_helpers.c
+++ b/tools/testing/selftests/bpf/btf_helpers.c
@@ -23,6 +23,7 @@ static const char * const btf_kind_str_mapping[] = {
[BTF_KIND_FUNC_PROTO] = "FUNC_PROTO",
[BTF_KIND_VAR] = "VAR",
[BTF_KIND_DATASEC] = "DATASEC",
+ [BTF_KIND_FLOAT] = "FLOAT",
};
static const char *btf_kind_str(__u16 kind)
@@ -173,6 +174,9 @@ int fprintf_btf_type_raw(FILE *out, const struct btf *btf, __u32 id)
}
break;
}
+ case BTF_KIND_FLOAT:
+ fprintf(out, " size=%u", t->size);
+ break;
default:
break;
}