lkml.org 
[lkml]   [2022]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] libbpf: Support raw btf placed in the default path
Date
Now only elf btf can be placed in the default path, raw btf should
also can be there.

Signed-off-by: chentao.ct <chentao.kernel@linux.alibaba.com>
---
tools/lib/bpf/btf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index bb1e06e..b22b5b3 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -4661,7 +4661,7 @@ struct btf *btf__load_vmlinux_btf(void)
} locations[] = {
/* try canonical vmlinux BTF through sysfs first */
{ "/sys/kernel/btf/vmlinux", true /* raw BTF */ },
- /* fall back to trying to find vmlinux ELF on disk otherwise */
+ /* fall back to trying to find vmlinux RAW/ELF on disk otherwise */
{ "/boot/vmlinux-%1$s" },
{ "/lib/modules/%1$s/vmlinux-%1$s" },
{ "/lib/modules/%1$s/build/vmlinux" },
@@ -4686,7 +4686,7 @@ struct btf *btf__load_vmlinux_btf(void)
if (locations[i].raw_btf)
btf = btf__parse_raw(path);
else
- btf = btf__parse_elf(path, NULL);
+ btf = btf__parse(path, NULL);
err = libbpf_get_error(btf);
pr_debug("loading kernel BTF '%s': %d\n", path, err);
if (err)
--
2.2.1
\
 
 \ /
  Last update: 2022-08-24 16:07    [W:0.253 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site