Commit 2d8f09fa authored by Hengqi Chen's avatar Hengqi Chen Committed by Andrii Nakryiko
Browse files

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: default avatarHengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211022130623.1548429-4-hengqi.chen@gmail.com
parent 2502e74b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;