BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: change log level of BTF loading error message
@ 2024-09-18 19:33 Ihor Solodrai
  2024-09-18 21:03 ` Eduard Zingerman
  2024-09-25 10:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 6+ messages in thread
From: Ihor Solodrai @ 2024-09-18 19:33 UTC (permalink / raw)
  To: bpf, andrii; +Cc: ast, daniel, eddyz87, mykolal

Reduce log level of BTF loading error to INFO if BTF is not required.

Suggested-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
---
 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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-25 10:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18 19:33 [PATCH bpf-next] libbpf: change log level of BTF loading error message Ihor Solodrai
2024-09-18 21:03 ` Eduard Zingerman
2024-09-18 21:45   ` Ihor Solodrai
2024-09-19  4:25   ` Andrii Nakryiko
2024-09-19  4:32     ` Eduard Zingerman
2024-09-25 10:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox