From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Ian Rogers <irogers@google.com>, Yonghong Song <yhs@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>, bpf <bpf@vger.kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Petar Penkov <ppenkov@google.com>
Subject: Re: [PATCH] btf_encoder: Make BTF_KIND_TAG conditional
Date: Thu, 21 Oct 2021 09:59:20 -0300 [thread overview]
Message-ID: <YXFkKKcAHqJ1mQCC@kernel.org> (raw)
In-Reply-To: <CAEf4BzaZpfnmTZj4k+APhTheODb6_NbNvUdsPYH84ophCaU3cw@mail.gmail.com>
Em Wed, Oct 20, 2021 at 02:27:37PM -0700, Andrii Nakryiko escreveu:
> On Wed, Oct 20, 2021 at 2:23 PM Ian Rogers <irogers@google.com> wrote:
> > On Wed, Oct 20, 2021 at 2:12 PM Andrii Nakryiko <andrii.nakryiko@gmail.com> wrote:
> > > On Thu, Oct 14, 2021 at 2:20 PM Ian Rogers <irogers@google.com> wrote:
> > > > @@ -648,6 +650,7 @@ static int32_t btf_encoder__add_datasec(struct btf_encoder *encoder, const char
> > > > static int32_t btf_encoder__add_tag(struct btf_encoder *encoder, const char *value, uint32_t type,
> > > > int component_idx)
> > > > {
> > > > +#ifdef BTF_KIND_TAG /* Proxy for libbtf 6.0 */
> > > How will this work when libbpf is loaded dynamically? I believe pahole
> > > has this mode as well.
> > Well it won't have a compilation error because BTF_KIND_TAG isn't
> Great, you traded compile-time error for runtime linking error, I hope
> that trade off makes sense to Arnaldo.
This situation is tricky to handle, yeah :-\
> > undefined :-) Tbh, I'm not sure but it seems that you'd be limited to
> > features in the version of libbpf you compiled against.
> I've been consistently advocating for statically linking against
> libbpf exactly to control what APIs and features are supported. But
> people stubbornly want dynamic linking. I hope added complexity and
> feature detection makes sense in practice for pahole.
It is a pain, but fedora also have this policy.
> > > Also, note that libbpf now provides LIBBPF_MAJOR_VERSION and
> > > LIBBPF_MINOR_VERSION macros, starting from 0.5, so no need for
> > > guessing the version
> >
> > This was moved to a header file in:
> > https://lore.kernel.org/bpf/CAADnVQJ2qd095mvj3z9u9BXQYCe2OTDn4=Gsu9nv1tjFHc2yqQ@mail.gmail.com/T/
> >
> > But that header doesn't appear any more:
> > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/tree/tools/lib/bpf
> >
> > Is that a bug?
>
> You should be checking here:
>
> https://github.com/libbpf/libbpf/blob/master/src/libbpf_version.h
Ian, would be so kind as to follow up on this so that we get this
situation improved?
- Arnaldo
prev parent reply other threads:[~2021-10-21 12:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-14 21:20 [PATCH] btf_encoder: Make BTF_KIND_TAG conditional Ian Rogers
2021-10-15 12:51 ` Arnaldo Carvalho de Melo
2021-10-20 21:11 ` Andrii Nakryiko
2021-10-20 21:22 ` Ian Rogers
2021-10-20 21:27 ` Andrii Nakryiko
2021-10-20 21:49 ` Ian Rogers
2021-10-20 22:30 ` Andrii Nakryiko
2021-10-20 23:46 ` Ian Rogers
2021-10-21 1:55 ` Andrii Nakryiko
2021-10-21 12:59 ` Arnaldo Carvalho de Melo [this message]
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=YXFkKKcAHqJ1mQCC@kernel.org \
--to=acme@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=irogers@google.com \
--cc=ppenkov@google.com \
--cc=yhs@fb.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 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).