BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: Improve debug message when the base BTF cannot be found
@ 2024-11-21 22:03 Ben Olson
  2024-11-21 23:55 ` Andrii Nakryiko
  2024-11-22  1:01 ` [PATCH v2 " Olson, Matthew
  0 siblings, 2 replies; 8+ messages in thread
From: Ben Olson @ 2024-11-21 22:03 UTC (permalink / raw)
  To: Andrii Nakryiko, Eduard Zingerman, bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	bpf, linux-kernel

When running `bpftool` on a kernel module installed in `/lib/modules...`,
this error is encountered if the user does not specify `--base-btf` to
point to a valid base BTF (e.g. usually in `/sys/kernel/btf/vmlinux`).
However, looking at the debug output to determine the cause of the error
simply says `Invalid BTF string section`, which does not point to the
actual source of the error. This just improves that debug message to tell
users what happened.

Signed-off-by: Ben Olson <matthew.olson@intel.com>
---
 tools/lib/bpf/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 12468ae0d573..1a17de9d99e6 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -283,7 +283,7 @@ static int btf_parse_str_sec(struct btf *btf)
 		return -EINVAL;
 	}
 	if (!btf->base_btf && start[0]) {
-		pr_debug("Invalid BTF string section\n");
+		pr_debug("Cannot find base BTF\n");
 		return -EINVAL;
 	}
 	return 0;
-- 
2.47.0

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

end of thread, other threads:[~2024-11-26 20:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-21 22:03 [PATCH bpf-next] libbpf: Improve debug message when the base BTF cannot be found Ben Olson
2024-11-21 23:55 ` Andrii Nakryiko
2024-11-22  0:59   ` Olson, Matthew
2024-11-22  1:01 ` [PATCH v2 " Olson, Matthew
2024-11-22  5:35   ` John Fastabend
2024-11-26 19:21   ` Andrii Nakryiko
2024-11-26 19:39     ` Olson, Matthew
2024-11-26 20:14       ` Olson, Matthew

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