Reduce log level of BTF loading error to INFO if BTF is not required. Suggested-by: Andrii Nakryiko <andrii@xxxxxxxxxx> Signed-off-by: Ihor Solodrai <ihor.solodrai@xxxxx> --- tools/lib/bpf/libbpf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 219facd0e66e..b8d72b5fbc79 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -3581,11 +3581,12 @@ static int bpf_object__sanitize_and_load_btf(struct bpf_object *obj) report: if (err) { btf_mandatory = kernel_needs_btf(obj); - pr_warn("Error loading .BTF into kernel: %d. %s\n", err, - btf_mandatory ? "BTF is mandatory, can't proceed." - : "BTF is optional, ignoring."); - if (!btf_mandatory) + if (btf_mandatory) { + pr_warn("Error loading .BTF into kernel: %d. BTF is mandatory, can't proceed.\n", err); + } else { + pr_info("Error loading .BTF into kernel: %d. BTF is optional, ignoring.\n", err); err = 0; + } } return err; } -- 2.34.1