Skip to content

Commit

Permalink
tools/resolve_btfids: Switch to new btf__type_cnt API
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
  • Loading branch information
chenhengqi authored and anakryiko committed Oct 22, 2021
1 parent 2502e74 commit 2d8f09f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/bpf/resolve_btfids/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2d8f09f

Please sign in to comment.