bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v3] bpf: Generate BTF_KIND_FLOAT when linking vmlinux
@ 2021-04-13 19:00 Ilya Leoshkevich
  2021-04-13 21:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Leoshkevich @ 2021-04-13 19:00 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Arnaldo Carvalho de Melo
  Cc: bpf, Heiko Carstens, Vasily Gorbik, Ilya Leoshkevich, Andrii Nakryiko

pahole v1.21 supports the --btf_gen_floats flag, which makes it
generate the information about the floating-point types [1].

Adjust link-vmlinux.sh to pass this flag to pahole in case it's
supported, which is determined using a simple version check.

[1] https://lore.kernel.org/dwarves/YHRiXNX1JUF2Az0A@kernel.org/

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
---

v1:
https://lore.kernel.org/bpf/20210331014356.256212-1-iii@linux.ibm.com/
v1 -> v2: Use a version check instead of probing.

v2:
https://lore.kernel.org/bpf/20210412215629.17865-1-iii@linux.ibm.com/
v2 -> v3: Simplify extra_paholeopt handling (it's still useful to have
          "=" when declaring it to be "-u"-compliant, even though
          link-vmlinux.sh does not use this flag at the moment).

 scripts/link-vmlinux.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 3b261b0f74f0..667aacb9261c 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -213,6 +213,7 @@ vmlinux_link()
 gen_btf()
 {
 	local pahole_ver
+	local extra_paholeopt=
 
 	if ! [ -x "$(command -v ${PAHOLE})" ]; then
 		echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available"
@@ -227,8 +228,12 @@ gen_btf()
 
 	vmlinux_link ${1}
 
+	if [ "${pahole_ver}" -ge "121" ]; then
+		extra_paholeopt="${extra_paholeopt} --btf_gen_floats"
+	fi
+
 	info "BTF" ${2}
-	LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
+	LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${extra_paholeopt} ${1}
 
 	# Create ${2} which contains just .BTF section but no symbols. Add
 	# SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all
-- 
2.29.2


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

* Re: [PATCH bpf-next v3] bpf: Generate BTF_KIND_FLOAT when linking vmlinux
  2021-04-13 19:00 [PATCH bpf-next v3] bpf: Generate BTF_KIND_FLOAT when linking vmlinux Ilya Leoshkevich
@ 2021-04-13 21:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-13 21:40 UTC (permalink / raw)
  To: Ilya Leoshkevich
  Cc: ast, daniel, andrii.nakryiko, acme, bpf, hca, gor, andrii

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

On Tue, 13 Apr 2021 21:00:43 +0200 you wrote:
> pahole v1.21 supports the --btf_gen_floats flag, which makes it
> generate the information about the floating-point types [1].
> 
> Adjust link-vmlinux.sh to pass this flag to pahole in case it's
> supported, which is determined using a simple version check.
> 
> [1] https://lore.kernel.org/dwarves/YHRiXNX1JUF2Az0A@kernel.org/
> 
> [...]

Here is the summary with links:
  - [bpf-next,v3] bpf: Generate BTF_KIND_FLOAT when linking vmlinux
    https://git.kernel.org/bpf/bpf-next/c/db16c1fe92d7

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-04-13 21:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 19:00 [PATCH bpf-next v3] bpf: Generate BTF_KIND_FLOAT when linking vmlinux Ilya Leoshkevich
2021-04-13 21:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).