From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Yonghong Song <yhs@fb.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH bpf-next 8/9] selftests/bpf: add a test with a bpf program with btf_tag attributes
Date: Wed, 8 Sep 2021 22:39:09 -0700 [thread overview]
Message-ID: <CAEf4BzayrFRw8cJD-SV7Xf=NyeCVnDdUwySD1=6eT7zBdWyYbg@mail.gmail.com> (raw)
In-Reply-To: <20210907230132.1960689-1-yhs@fb.com>
On Tue, Sep 7, 2021 at 4:01 PM Yonghong Song <yhs@fb.com> wrote:
>
> Add a bpf program with btf_tag attributes. The program is
> loaded successfully with the kernel. With the command
> bpftool btf dump file ./tag.o
> the following dump shows that tags are properly encoded:
> [8] STRUCT 'key_t' size=12 vlen=3
> 'a' type_id=2 bits_offset=0
> 'b' type_id=2 bits_offset=32
> 'c' type_id=2 bits_offset=64
> [9] TAG 'tag1' type_id=8, comp_id=-1
> [10] TAG 'tag2' type_id=8, comp_id=-1
> [11] TAG 'tag1' type_id=8, comp_id=1
> [12] TAG 'tag2' type_id=8, comp_id=1
> ...
> [21] FUNC_PROTO '(anon)' ret_type_id=2 vlen=1
> 'x' type_id=2
> [22] FUNC 'foo' type_id=21 linkage=static
> [23] TAG 'tag1' type_id=22, comp_id=0
> [24] TAG 'tag2' type_id=22, comp_id=0
> [25] TAG 'tag1' type_id=22, comp_id=-1
> [26] TAG 'tag2' type_id=22, comp_id=-1
> ...
> [29] VAR 'total' type_id=27, linkage=global
> [30] TAG 'tag1' type_id=29, comp_id=-1
> [31] TAG 'tag2' type_id=29, comp_id=-1
>
> If an old clang compiler, which does not support btf_tag attribute,
> is used, these btf_tag attributes will be silently ignored.
>
> Signed-off-by: Yonghong Song <yhs@fb.com>
> ---
LGTM.
Acked-by: Andrii Nakryiko <andrii@kernel.org>
> .../selftests/bpf/prog_tests/btf_tag.c | 14 +++++++
> tools/testing/selftests/bpf/progs/tag.c | 39 +++++++++++++++++++
> 2 files changed, 53 insertions(+)
> create mode 100644 tools/testing/selftests/bpf/prog_tests/btf_tag.c
> create mode 100644 tools/testing/selftests/bpf/progs/tag.c
>
[...]
next prev parent reply other threads:[~2021-09-09 5:39 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 23:00 [PATCH bpf-next 0/9] bpf: add support for new btf kind BTF_KIND_TAG Yonghong Song
2021-09-07 23:00 ` [PATCH bpf-next 1/9] bpf: " Yonghong Song
2021-09-09 5:09 ` Andrii Nakryiko
2021-09-10 15:55 ` Yonghong Song
2021-09-07 23:01 ` [PATCH bpf-next 2/9] libbpf: rename btf_{hash,equal}_int to btf_{hash,equal}_int_tag Yonghong Song
2021-09-09 5:10 ` Andrii Nakryiko
2021-09-07 23:01 ` [PATCH bpf-next 3/9] libbpf: add support for BTF_KIND_TAG Yonghong Song
2021-09-09 5:26 ` Andrii Nakryiko
2021-09-10 16:04 ` Yonghong Song
2021-09-07 23:01 ` [PATCH bpf-next 4/9] bpftool: " Yonghong Song
2021-09-09 5:28 ` Andrii Nakryiko
2021-09-09 5:33 ` Andrii Nakryiko
2021-09-10 16:38 ` Yonghong Song
2021-09-10 18:05 ` Andrii Nakryiko
2021-09-10 16:04 ` Yonghong Song
2021-09-07 23:01 ` [PATCH bpf-next 5/9] selftests/bpf: test libbpf API function btf__add_tag() Yonghong Song
2021-09-09 5:35 ` Andrii Nakryiko
2021-09-10 16:39 ` Yonghong Song
2021-09-07 23:01 ` [PATCH bpf-next 6/9] selftests/bpf: add BTF_KIND_TAG unit tests Yonghong Song
2021-09-07 23:01 ` [PATCH bpf-next 7/9] selftests/bpf: test BTF_KIND_TAG for deduplication Yonghong Song
2021-09-07 23:01 ` [PATCH bpf-next 8/9] selftests/bpf: add a test with a bpf program with btf_tag attributes Yonghong Song
2021-09-09 5:39 ` Andrii Nakryiko [this message]
2021-09-07 23:01 ` [PATCH bpf-next 9/9] docs/bpf: add documentation for BTF_KIND_TAG Yonghong Song
2021-09-09 5:42 ` Andrii Nakryiko
2021-09-10 16:40 ` Yonghong Song
2021-09-10 18:05 ` Andrii Nakryiko
2021-09-09 22:45 ` [PATCH bpf-next 0/9] bpf: add support for new btf kind BTF_KIND_TAG Jose E. Marchesi
2021-09-09 23:30 ` Yonghong Song
2021-09-10 2:19 ` Jose E. Marchesi
2021-09-10 7:04 ` Yonghong Song
2021-09-10 8:31 ` Jose E. Marchesi
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='CAEf4BzayrFRw8cJD-SV7Xf=NyeCVnDdUwySD1=6eT7zBdWyYbg@mail.gmail.com' \
--to=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.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).