From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Yonghong Song <yhs@fb.com>, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
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: Fri, 15 Oct 2021 09:51:58 -0300 [thread overview]
Message-ID: <YWl5bq4m60EGo0JY@kernel.org> (raw)
In-Reply-To: <20211014212049.1010192-1-irogers@google.com>
Em Thu, Oct 14, 2021 at 02:20:49PM -0700, Ian Rogers escreveu:
> BTF_KIND_TAG is present in libbtf 6.0 but not libbtf in 5.15rc4. Make
> the code requiring it conditionally compiled in.
Thanks, applied.
I just removed the part updating lib/bpf, as I have updated it recently:
⬢[acme@toolbox pahole]$ git show cc6c7d473d51832490aa7b743a0ed7f7f9e05592
commit cc6c7d473d51832490aa7b743a0ed7f7f9e05592
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Thu Oct 14 16:27:07 2021 -0300
Update libbpf to get API to combine BTF
I.e. the one in:
13ebb60ab66799ab libbpf: Add API that copies all BTF types from one BTF object to another
This will be used to paralellize the BTF encoding phase.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/lib/bpf b/lib/bpf
index 980777cc16db75d5..92c1e61a605410b1 160000
--- a/lib/bpf
+++ b/lib/bpf
@@ -1 +1 @@
-Subproject commit 980777cc16db75d5628a537c892aefc2640bb242
+Subproject commit 92c1e61a605410b16d6330fdd4a7a4e03add86d4
⬢[acme@toolbox pahole]$ git log --oneline -3
cad8b8b840d621cd (HEAD -> master) btf_encoder: Make BTF_KIND_TAG conditional
a9c99e98815f06bd dwarves: Introduce conf_load->thread_exit() callback
cc6c7d473d518324 Update libbpf to get API to combine BTF
⬢[acme@toolbox pahole]$
- Arnaldo
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> btf_encoder.c | 7 +++++++
> lib/bpf | 2 +-
> 2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/btf_encoder.c b/btf_encoder.c
> index c341f95..400d64b 100644
> --- a/btf_encoder.c
> +++ b/btf_encoder.c
> @@ -141,7 +141,9 @@ static const char * const btf_kind_str[NR_BTF_KINDS] = {
> [BTF_KIND_VAR] = "VAR",
> [BTF_KIND_DATASEC] = "DATASEC",
> [BTF_KIND_FLOAT] = "FLOAT",
> +#ifdef BTF_KIND_TAG /* BTF_KIND_TAG was added in 6.0 */
> [BTF_KIND_TAG] = "TAG",
> +#endif
> };
>
> static const char *btf__printable_name(const struct btf *btf, uint32_t offset)
> @@ -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 */
> struct btf *btf = encoder->btf;
> const struct btf_type *t;
> int32_t id;
> @@ -663,6 +666,10 @@ static int32_t btf_encoder__add_tag(struct btf_encoder *encoder, const char *val
> }
>
> return id;
> +#else
> + fprintf(stderr, "error: unable to encode BTF_KIND_TAG due to old libbtf\n");
> + return -ENOTSUP;
> +#endif
> }
>
> /*
> diff --git a/lib/bpf b/lib/bpf
> index 980777c..986962f 160000
> --- a/lib/bpf
> +++ b/lib/bpf
> @@ -1 +1 @@
> -Subproject commit 980777cc16db75d5628a537c892aefc2640bb242
> +Subproject commit 986962fade5dfa89c2890f3854eb040d2a64ab38
> --
> 2.33.0.1079.g6e70778dc9-goog
next prev parent reply other threads:[~2021-10-15 12:52 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 [this message]
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
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=YWl5bq4m60EGo0JY@kernel.org \
--to=acme@kernel.org \
--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).