BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: Generate BTF_KIND_FLOAT when linking vmlinux
@ 2021-03-31  1:43 Ilya Leoshkevich
  2021-03-31  6:28 ` Andrii Nakryiko
  0 siblings, 1 reply; 3+ messages in thread
From: Ilya Leoshkevich @ 2021-03-31  1:43 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann
  Cc: Andrii Nakryiko, Arnaldo Carvalho de Melo, bpf, Heiko Carstens,
	Vasily Gorbik, Ilya Leoshkevich

pahole v1.21 will support the --btf_gen_floats flag, which makes it
generate the information about the floating-point types.

Adjust link-vmlinux.sh to pass this flag to pahole in case it's
supported. Whether or not this flag is supported is determined by
probing, which is chosen over version check for two reasons:

1) at this moment --btf_gen_floats exists only in master, which
   identifies itself as v1.20.
2) distros may backport features, making the version check too
   conservative.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 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..f4c763d2661d 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -227,8 +227,13 @@ gen_btf()
 
 	vmlinux_link ${1}
 
+	local paholeopt=-J
+	if ${PAHOLE} --btf_gen_floats --help >/dev/null 2>&1; then
+		paholeopt="${paholeopt} --btf_gen_floats"
+	fi
+
 	info "BTF" ${2}
-	LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
+	LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} ${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] 3+ messages in thread

end of thread, other threads:[~2021-03-31 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-31  1:43 [PATCH bpf-next] bpf: Generate BTF_KIND_FLOAT when linking vmlinux Ilya Leoshkevich
2021-03-31  6:28 ` Andrii Nakryiko
2021-03-31 13:14   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox