All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	bpf <bpf@vger.kernel.org>, Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH bpf-next] bpf: Generate BTF_KIND_FLOAT when linking vmlinux
Date: Tue, 30 Mar 2021 23:28:36 -0700	[thread overview]
Message-ID: <CAEf4BzaF6WMz8pM2X03p_oQo95J1e-7Owi+8Y=GAOkXrx8H-aA@mail.gmail.com> (raw)
In-Reply-To: <20210331014356.256212-1-iii@linux.ibm.com>

On Tue, Mar 30, 2021 at 6:44 PM Ilya Leoshkevich <iii@linux.ibm.com> wrote:
>
> 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.
>

Does anyone really cherry-pick and backport pahole patches, though? So
far we've been using strictly version checks for pahole (1.13, then
1.16, then 1.19 for modules), that keeps everything simpler and more
reliable, IMO. I'd stick with 1.21 check and just check with Arnaldo
when he's planning to release a new version.

> 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}

we know that -J is always specified, so I'd leave it intact, and just
have "extra pahole options", potentially empty.

>
>         # 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
>

  reply	other threads:[~2021-03-31  6:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-03-31 13:14   ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEf4BzaF6WMz8pM2X03p_oQo95J1e-7Owi+8Y=GAOkXrx8H-aA@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=acme@redhat.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.