]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Adjust for error codes from libbpf probes
authorMilan Landaverde <milan@mdaverde.com>
Wed, 4 May 2022 16:13:31 +0000 (12:13 -0400)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 10 May 2022 00:16:05 +0000 (17:16 -0700)
commit9a3654ef863c5d1e0ef5a3760714e1a501c46d93
treee29ffb5420c2aa031e7f199aab2c103d8ca8fc36
parentdd5935ea3c7d3b39880f86aee93cbe4eab8d9824
bpftool: Adjust for error codes from libbpf probes

Originally [1], libbpf's (now deprecated) probe functions returned a bool
to acknowledge support but the new APIs return an int with a possible
negative error code to reflect probe failure. This change decides for
bpftool to declare maps and helpers are not available on probe failures.

[1]: https://lore.kernel.org/bpf/20220202225916.3313522-3-andrii@kernel.org/

Signed-off-by: Milan Landaverde <milan@mdaverde.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220504161356.3497972-2-milan@mdaverde.com
tools/bpf/bpftool/feature.c