From: Jiri Olsa <jolsa@kernel.org> Date: 2020-09-18 12:33:15
Currently all the resolve_btfids 'users' are under CONFIG_BPF
code, so if we have CONFIG_BPF disabled, resolve_btfids will
fail, because there's no data to resolve.
In case CONFIG_BPF is disabled, using resolve_btfids --no-fail
option, that makes resolve_btfids leave quietly if there's no
data to resolve.
Fixes: c9a0f3b85e09 ("bpf: Resolve BTF IDs in vmlinux image")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
scripts/link-vmlinux.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
@@ -342,8 +342,13 @@ vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}# fill in BTF IDsif[-n"${CONFIG_DEBUG_INFO_BTF}"];then-infoBTFIDSvmlinux-${RESOLVE_BTFIDS}vmlinux+infoBTFIDSvmlinux+# Let's be more permissive if CONFIG_BPF is disabled+# and do not fail if there's no data to resolve.+if[-z"${CONFIG_BPF}"];then+no_fail=--no-fail+fi+${RESOLVE_BTFIDS}$no_failvmlinuxfiif[-n"${CONFIG_BUILDTIME_TABLE_SORT}"];then
From: Jiri Olsa <jolsa@kernel.org> Date: 2020-09-18 12:27:14
Seth reported problem with cross builds, that fail
on resolve_btfids build, because we are trying to
build it on cross build arch.
Fixing this by always forcing the host arch.
Fixes: fbbb68de80a4 ("bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object")
Reported-by: Seth Forshee <redacted>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/bpf/resolve_btfids/Makefile | 2 ++
1 file changed, 2 insertions(+)
On Fri, Sep 18, 2020 at 5:30 AM Jiri Olsa [off-list ref] wrote:
Currently all the resolve_btfids 'users' are under CONFIG_BPF
code, so if we have CONFIG_BPF disabled, resolve_btfids will
fail, because there's no data to resolve.
In case CONFIG_BPF is disabled, using resolve_btfids --no-fail
option, that makes resolve_btfids leave quietly if there's no
data to resolve.
Fixes: c9a0f3b85e09 ("bpf: Resolve BTF IDs in vmlinux image")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
If no CONFIG_BTF is specified, there is no need to even run
resolve_btfids. So why not do just that -- run resolve_btfids only
if both CONFIG_BPF and CONFIG_DEBUG_INFO_BTF are specified?
@@ -342,8 +342,13 @@ vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}# fill in BTF IDsif[-n"${CONFIG_DEBUG_INFO_BTF}"];then-infoBTFIDSvmlinux-${RESOLVE_BTFIDS}vmlinux+infoBTFIDSvmlinux+# Let's be more permissive if CONFIG_BPF is disabled+# and do not fail if there's no data to resolve.+if[-z"${CONFIG_BPF}"];then+no_fail=--no-fail+fi+${RESOLVE_BTFIDS}$no_failvmlinuxfiif[-n"${CONFIG_BUILDTIME_TABLE_SORT}"];then--
From: Jiri Olsa <hidden> Date: 2020-09-22 18:48:09
On Mon, Sep 21, 2020 at 02:55:27PM -0700, Andrii Nakryiko wrote:
On Fri, Sep 18, 2020 at 5:30 AM Jiri Olsa [off-list ref] wrote:
quoted
Currently all the resolve_btfids 'users' are under CONFIG_BPF
code, so if we have CONFIG_BPF disabled, resolve_btfids will
fail, because there's no data to resolve.
In case CONFIG_BPF is disabled, using resolve_btfids --no-fail
option, that makes resolve_btfids leave quietly if there's no
data to resolve.
Fixes: c9a0f3b85e09 ("bpf: Resolve BTF IDs in vmlinux image")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
If no CONFIG_BTF is specified, there is no need to even run
resolve_btfids. So why not do just that -- run resolve_btfids only
if both CONFIG_BPF and CONFIG_DEBUG_INFO_BTF are specified?
we can have CONFIG_DEBUG_INFO_BTF without CONFIG_BPF being enabled,
so we could in theory have in future some BTF ID user outside bpf code,
but I guess we can enable that, when it actually happens
jirka
@@ -342,8 +342,13 @@ vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}# fill in BTF IDsif[-n"${CONFIG_DEBUG_INFO_BTF}"];then-infoBTFIDSvmlinux-${RESOLVE_BTFIDS}vmlinux+infoBTFIDSvmlinux+# Let's be more permissive if CONFIG_BPF is disabled+# and do not fail if there's no data to resolve.+if[-z"${CONFIG_BPF}"];then+no_fail=--no-fail+fi+${RESOLVE_BTFIDS}$no_failvmlinuxfiif[-n"${CONFIG_BUILDTIME_TABLE_SORT}"];then--
On Tue, Sep 22, 2020 at 11:48 AM Jiri Olsa [off-list ref] wrote:
On Mon, Sep 21, 2020 at 02:55:27PM -0700, Andrii Nakryiko wrote:
quoted
On Fri, Sep 18, 2020 at 5:30 AM Jiri Olsa [off-list ref] wrote:
quoted
Currently all the resolve_btfids 'users' are under CONFIG_BPF
code, so if we have CONFIG_BPF disabled, resolve_btfids will
fail, because there's no data to resolve.
In case CONFIG_BPF is disabled, using resolve_btfids --no-fail
option, that makes resolve_btfids leave quietly if there's no
data to resolve.
Fixes: c9a0f3b85e09 ("bpf: Resolve BTF IDs in vmlinux image")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
If no CONFIG_BTF is specified, there is no need to even run
resolve_btfids. So why not do just that -- run resolve_btfids only
if both CONFIG_BPF and CONFIG_DEBUG_INFO_BTF are specified?
we can have CONFIG_DEBUG_INFO_BTF without CONFIG_BPF being enabled,
so we could in theory have in future some BTF ID user outside bpf code,
but I guess we can enable that, when it actually happens
@@ -342,8 +342,13 @@ vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}# fill in BTF IDsif[-n"${CONFIG_DEBUG_INFO_BTF}"];then-infoBTFIDSvmlinux-${RESOLVE_BTFIDS}vmlinux+infoBTFIDSvmlinux+# Let's be more permissive if CONFIG_BPF is disabled+# and do not fail if there's no data to resolve.+if[-z"${CONFIG_BPF}"];then+no_fail=--no-fail+fi+${RESOLVE_BTFIDS}$no_failvmlinuxfiif[-n"${CONFIG_BUILDTIME_TABLE_SORT}"];then--