summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHengqi Chen <hengqi.chen@gmail.com>2021-10-22 15:06:21 +0200
committerAndrii Nakryiko <andrii@kernel.org>2021-10-23 01:09:14 +0200
commit2d8f09fafc6351d77f724c208c8168d2512d5478 (patch)
tree671b19e4643ad0c7c138a3a1d58fde62986975cf
parentperf bpf: Switch to new btf__raw_data API (diff)
downloadlinux-2d8f09fafc6351d77f724c208c8168d2512d5478.tar.xz
linux-2d8f09fafc6351d77f724c208c8168d2512d5478.zip
tools/resolve_btfids: Switch to new btf__type_cnt API
Replace the call to btf__get_nr_types with new API btf__type_cnt. The old API will be deprecated in libbpf v0.7+. No functionality change. Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20211022130623.1548429-4-hengqi.chen@gmail.com
-rw-r--r--tools/bpf/resolve_btfids/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
index 716e6ad1864b..a59cb0ee609c 100644
--- a/tools/bpf/resolve_btfids/main.c
+++ b/tools/bpf/resolve_btfids/main.c
@@ -502,12 +502,12 @@ static int symbols_resolve(struct object *obj)
}
err = -1;
- nr_types = btf__get_nr_types(btf);
+ nr_types = btf__type_cnt(btf);
/*
* Iterate all the BTF types and search for collected symbol IDs.
*/
- for (type_id = 1; type_id <= nr_types; type_id++) {
+ for (type_id = 1; type_id < nr_types; type_id++) {
const struct btf_type *type;
struct rb_root *root;
struct btf_id *id;