Skip to contentSkip to conversation

bpf: btf: Always output invariant hit in pahole DWARF to BTF transform

PATCH Applied Chris Down 3 participants 3 messages Jan 22, 2020

Subsystems (4)
lore
Share & tools
lore

Chris Down

author
#0 lore raw

PATCH v2 1/1 bpf: btf: Always output invariant hit in pahole DWARF to BTF transform

When trying to compile with CONFIG_DEBUG_INFO_BTF enabled, I got this error:

% make -s
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make[3]: *** [vmlinux] Error 1

Compiling again without -s shows the true error (that pahole is missing), but since this is fatal, we should show the error unconditionally on stderr as well, not silence it using the info function. With this patch:

% make -s
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make[3]: *** [vmlinux] Error 1

---
 scripts/link-vmlinux.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/link-vmlinux.sh +2 -2
index c287ad9b3a67..bbe9be2bf5ff 100755
@@ -108,13 +108,13 @@ gen_btf()
 	local bin_arch
 
 	if ! [ -x "$(command -v ${PAHOLE})" ]; then
-		info "BTF" "${1}: pahole (${PAHOLE}) is not available"
+		echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available"
 		return 1
 	fi
 
 	pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/')
 	if [ "${pahole_ver}" -lt "113" ]; then
-		info "BTF" "${1}: pahole version $(${PAHOLE} --version) is too old, need at least v1.13"
+		echo >&2 "BTF: ${1}: pahole version $(${PAHOLE} --version) is too old, need at least v1.13"
 		return 1
 	fi
 
Signature · 1 line
2.25.0
Acked-by on v2 1/1
#1 lore raw
Quoted 28 lines · Chris Down

When trying to compile with CONFIG_DEBUG_INFO_BTF enabled, I got this error:

% make -s
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make[3]: *** [vmlinux] Error 1

Compiling again without -s shows the true error (that pahole is missing), but since this is fatal, we should show the error unconditionally on stderr as well, not silence it using the info function. With this patch:

% make -s
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make[3]: *** [vmlinux] Error 1

Quoted 4 lines
---
 scripts/link-vmlinux.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Looks great, thanks!

Quoted 23 lines
scripts/link-vmlinux.sh +2 -3
index c287ad9b3a67..bbe9be2bf5ff 100755
@@ -108,13 +108,13 @@ gen_btf()
        local bin_arch
 
        if ! [ -x "$(command -v ${PAHOLE})" ]; then
-               info "BTF" "${1}: pahole (${PAHOLE}) is not available"
+               echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available"
                return 1
        fi
 
        pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/')
        if [ "${pahole_ver}" -lt "113" ]; then
-               info "BTF" "${1}: pahole version $(${PAHOLE} --version) is too old, need at least v1.13"
+               echo >&2 "BTF: ${1}: pahole version $(${PAHOLE} --version) is too old, need at least v1.13"
                return 1
        fi
 
--

2.25.0

maintainer Applied
#2 lore raw
In reply to Chris Down
Quoted 19 lines · Chris Down

When trying to compile with CONFIG_DEBUG_INFO_BTF enabled, I got this error:

% make -s
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make[3]: *** [vmlinux] Error 1

Compiling again without -s shows the true error (that pahole is missing), but since this is fatal, we should show the error unconditionally on stderr as well, not silence it using the info function. With this patch:

% make -s
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make[3]: *** [vmlinux] Error 1

Quoted 8 lines

Applied, thanks!