diff options
| author | Hengqi Chen <[email protected]> | 2021-10-22 13:06:23 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2021-10-22 23:09:14 +0000 |
| commit | 487ef148cf17730442444c07a4c56f16578ec73e (patch) | |
| tree | b2c6ec554b4b21bb648bf273b9acbd215fc9f813 /tools/testing/selftests/bpf/prog_tests/btf_split.c | |
| parent | bpftool: Switch to new btf__type_cnt API (diff) | |
| download | kernel-487ef148cf17730442444c07a4c56f16578ec73e.tar.gz kernel-487ef148cf17730442444c07a4c56f16578ec73e.zip | |
selftests/bpf: Switch to new btf__type_cnt/btf__raw_data APIs
Replace the calls to btf__get_nr_types/btf__get_raw_data in
selftests with new APIs btf__type_cnt/btf__raw_data. The old
APIs will be deprecated in libbpf v0.7+.
Signed-off-by: Hengqi Chen <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/btf_split.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/btf_split.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/btf_split.c b/tools/testing/selftests/bpf/prog_tests/btf_split.c index ca7c2a91610a..b1ffe61f2aa9 100644 --- a/tools/testing/selftests/bpf/prog_tests/btf_split.c +++ b/tools/testing/selftests/bpf/prog_tests/btf_split.c @@ -72,7 +72,7 @@ void test_btf_split() { d = btf_dump__new(btf2, NULL, &opts, btf_dump_printf); if (!ASSERT_OK_PTR(d, "btf_dump__new")) goto cleanup; - for (i = 1; i <= btf__get_nr_types(btf2); i++) { + for (i = 1; i < btf__type_cnt(btf2); i++) { err = btf_dump__dump_type(d, i); ASSERT_OK(err, "dump_type_ok"); } |
