All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] kbuild: handle old pahole more gracefully when generating BTF
@ 2019-04-15 21:58 andrii.nakryiko
  2019-04-15 23:37 ` Song Liu
  2019-04-16  8:26 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: andrii.nakryiko @ 2019-04-15 21:58 UTC (permalink / raw)
  To: andrii.nakryiko, netdev, bpf, kernel-team, davem
  Cc: Andrii Nakryiko, Masahiro Yamada, Arnaldo Carvalho de Melo,
	Daniel Borkmann, Alexei Starovoitov, Yonghong Song,
	Martin KaFai Lau

From: Andrii Nakryiko <andriin@fb.com>

When CONFIG_DEBUG_INFO_BTF is enabled but available version of pahole is too
old to support BTF generation, build script is supposed to emit warning and
proceed with the build. Due to using exit instead of return from BASH function,
existing handling code prematurely exits exit code 0, not completing some of
the build steps. This patch fixes issue by correctly returning just from
gen_btf() function only.

Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux")
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
 scripts/link-vmlinux.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index dd2b31ccca6a..6a148d0d51bf 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -99,7 +99,7 @@ gen_btf()
 	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"
-		exit 0
+		return 0
 	fi
 
 	info "BTF" ${1}
-- 
2.17.1


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

* Re: [PATCH bpf-next] kbuild: handle old pahole more gracefully when generating BTF
  2019-04-15 21:58 [PATCH bpf-next] kbuild: handle old pahole more gracefully when generating BTF andrii.nakryiko
@ 2019-04-15 23:37 ` Song Liu
  2019-04-16  8:26 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2019-04-15 23:37 UTC (permalink / raw)
  To: andrii.nakryiko
  Cc: Networking, bpf, Kernel Team, David S. Miller, Andrii Nakryiko,
	Masahiro Yamada, Arnaldo Carvalho de Melo, Daniel Borkmann,
	Alexei Starovoitov, Yonghong Song, Martin Lau



> On Apr 15, 2019, at 2:58 PM, andrii.nakryiko@gmail.com wrote:
> 
> From: Andrii Nakryiko <andriin@fb.com>
> 
> When CONFIG_DEBUG_INFO_BTF is enabled but available version of pahole is too
> old to support BTF generation, build script is supposed to emit warning and
> proceed with the build. Due to using exit instead of return from BASH function,
> existing handling code prematurely exits exit code 0, not completing some of
> the build steps. This patch fixes issue by correctly returning just from
> gen_btf() function only.
> 
> Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux")
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Yonghong Song <yhs@fb.com>
> Cc: Martin KaFai Lau <kafai@fb.com>
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Acked-by: Song Liu <songliubraving@fb.com>


> ---
> scripts/link-vmlinux.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> index dd2b31ccca6a..6a148d0d51bf 100755
> --- a/scripts/link-vmlinux.sh
> +++ b/scripts/link-vmlinux.sh
> @@ -99,7 +99,7 @@ gen_btf()
> 	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"
> -		exit 0
> +		return 0
> 	fi
> 
> 	info "BTF" ${1}
> -- 
> 2.17.1
> 


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

* Re: [PATCH bpf-next] kbuild: handle old pahole more gracefully when generating BTF
  2019-04-15 21:58 [PATCH bpf-next] kbuild: handle old pahole more gracefully when generating BTF andrii.nakryiko
  2019-04-15 23:37 ` Song Liu
@ 2019-04-16  8:26 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2019-04-16  8:26 UTC (permalink / raw)
  To: andrii.nakryiko, netdev, bpf, kernel-team, davem
  Cc: Andrii Nakryiko, Masahiro Yamada, Arnaldo Carvalho de Melo,
	Alexei Starovoitov, Yonghong Song, Martin KaFai Lau

On 04/15/2019 11:58 PM, andrii.nakryiko@gmail.com wrote:
> From: Andrii Nakryiko <andriin@fb.com>
> 
> When CONFIG_DEBUG_INFO_BTF is enabled but available version of pahole is too
> old to support BTF generation, build script is supposed to emit warning and
> proceed with the build. Due to using exit instead of return from BASH function,
> existing handling code prematurely exits exit code 0, not completing some of
> the build steps. This patch fixes issue by correctly returning just from
> gen_btf() function only.
> 
> Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux")
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Yonghong Song <yhs@fb.com>
> Cc: Martin KaFai Lau <kafai@fb.com>
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Applied, thanks!

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

end of thread, other threads:[~2019-04-16  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15 21:58 [PATCH bpf-next] kbuild: handle old pahole more gracefully when generating BTF andrii.nakryiko
2019-04-15 23:37 ` Song Liu
2019-04-16  8:26 ` Daniel Borkmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.