<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/bpf/btf_helpers.c, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-06-07T17:20:43Z</updated>
<entry>
<title>selftests/bpf: Test new enum kflag and enum64 API functions</title>
<updated>2022-06-07T17:20:43Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2022-06-07T06:27:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2b7301457ffe7be085744fa49f1244a71c1c6f1d'/>
<id>urn:sha1:2b7301457ffe7be085744fa49f1244a71c1c6f1d</id>
<content type='text'>
Add tests to use the new enum kflag and enum64 API functions
in selftest btf_write.

Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Link: https://lore.kernel.org/r/20220607062703.3724287-1-yhs@fb.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Test libbpf API function btf__add_type_tag()</title>
<updated>2021-11-12T01:41:11Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2021-11-12T01:26:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0dc85872203bf7b15c56c7eb228b8f3fabb17ac2'/>
<id>urn:sha1:0dc85872203bf7b15c56c7eb228b8f3fabb17ac2</id>
<content type='text'>
Add unit tests for btf__add_type_tag().

Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20211112012625.1505748-1-yhs@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Update btf_dump__new() uses to v1.0+ variant</title>
<updated>2021-11-12T00:54:06Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2021-11-11T05:36:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=60ba87bb6bafaaa6e8ef9a73834cf701194d1923'/>
<id>urn:sha1:60ba87bb6bafaaa6e8ef9a73834cf701194d1923</id>
<content type='text'>
Update to-be-deprecated forms of btf_dump__new().

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20211111053624.190580-8-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Fix memory leaks in btf_type_c_dump() helper</title>
<updated>2021-11-07T17:14:15Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2021-11-07T16:55:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8ba285874913da21ca39a46376e9cc5ce0f45f94'/>
<id>urn:sha1:8ba285874913da21ca39a46376e9cc5ce0f45f94</id>
<content type='text'>
Free up memory and resources used by temporary allocated memstream and
btf_dump instance.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Reviewed-by: Hengqi Chen &lt;hengqi.chen@gmail.com&gt;
Link: https://lore.kernel.org/bpf/20211107165521.9240-4-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Switch to new btf__type_cnt/btf__raw_data APIs</title>
<updated>2021-10-22T23:09:14Z</updated>
<author>
<name>Hengqi Chen</name>
<email>hengqi.chen@gmail.com</email>
</author>
<published>2021-10-22T13:06:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=487ef148cf17730442444c07a4c56f16578ec73e'/>
<id>urn:sha1:487ef148cf17730442444c07a4c56f16578ec73e</id>
<content type='text'>
Replace the calls to btf__get_nr_types/btf__get_raw_data in
selftests with new APIs btf__type_cnt/btf__raw_data. The old
APIs will be deprecated in libbpf v0.7+.

Signed-off-by: Hengqi Chen &lt;hengqi.chen@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20211022130623.1548429-6-hengqi.chen@gmail.com
</content>
</entry>
<entry>
<title>bpf: Rename BTF_KIND_TAG to BTF_KIND_DECL_TAG</title>
<updated>2021-10-19T01:35:36Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2021-10-12T16:48:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=223f903e9c832699f4e5f422281a60756c1c6cfe'/>
<id>urn:sha1:223f903e9c832699f4e5f422281a60756c1c6cfe</id>
<content type='text'>
Patch set [1] introduced BTF_KIND_TAG to allow tagging
declarations for struct/union, struct/union field, var, func
and func arguments and these tags will be encoded into
dwarf. They are also encoded to btf by llvm for the bpf target.

After BTF_KIND_TAG is introduced, we intended to use it
for kernel __user attributes. But kernel __user is actually
a type attribute. Upstream and internal discussion showed
it is not a good idea to mix declaration attribute and
type attribute. So we proposed to introduce btf_type_tag
as a type attribute and existing btf_tag renamed to
btf_decl_tag ([2]).

This patch renamed BTF_KIND_TAG to BTF_KIND_DECL_TAG and some
other declarations with *_tag to *_decl_tag to make it clear
the tag is for declaration. In the future, BTF_KIND_TYPE_TAG
might be introduced per [3].

 [1] https://lore.kernel.org/bpf/20210914223004.244411-1-yhs@fb.com/
 [2] https://reviews.llvm.org/D111588
 [3] https://reviews.llvm.org/D111199

Fixes: b5ea834dde6b ("bpf: Support for new btf kind BTF_KIND_TAG")
Fixes: 5b84bd10363e ("libbpf: Add support for BTF_KIND_TAG")
Fixes: 5c07f2fec003 ("bpftool: Add support for BTF_KIND_TAG")
Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20211012164838.3345699-1-yhs@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Test libbpf API function btf__add_tag()</title>
<updated>2021-09-15T01:45:52Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2021-09-14T22:30:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=71d29c2d47d112404fe23e31cf33f7cccde75a8c'/>
<id>urn:sha1:71d29c2d47d112404fe23e31cf33f7cccde75a8c</id>
<content type='text'>
Add btf_write tests with btf__add_tag() function.

Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210914223036.247560-1-yhs@fb.com
</content>
</entry>
<entry>
<title>selftest/bpf: Add BTF_KIND_FLOAT tests</title>
<updated>2021-03-05T01:58:16Z</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2021-02-26T20:22:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7e72aad3a15c06e40e3ccd2352e5010e978f1acf'/>
<id>urn:sha1:7e72aad3a15c06e40e3ccd2352e5010e978f1acf</id>
<content type='text'>
Test the good variants as well as the potential malformed ones.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210226202256.116518-8-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add split BTF dedup selftests</title>
<updated>2020-11-06T02:37:31Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2020-11-05T04:34:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=232338fa2fb47726ab7c459419115a6ab6bfb3e3'/>
<id>urn:sha1:232338fa2fb47726ab7c459419115a6ab6bfb3e3</id>
<content type='text'>
Add selftests validating BTF deduplication for split BTF case. Add a helper
macro that allows to validate entire BTF with raw BTF dump, not just
type-by-type. This saves tons of code and complexity.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Link: https://lore.kernel.org/bpf/20201105043402.2530976-11-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Add checking of raw type dump in BTF writer APIs selftests</title>
<updated>2020-11-06T02:37:30Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-11-05T04:33:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1306c980cf892bc17e7296d3e9ab8e9082f893a1'/>
<id>urn:sha1:1306c980cf892bc17e7296d3e9ab8e9082f893a1</id>
<content type='text'>
Add re-usable btf_helpers.{c,h} to provide BTF-related testing routines. Start
with adding a raw BTF dumping helpers.

Raw BTF dump is the most succinct and at the same time a very human-friendly
way to validate exact contents of BTF types. Cross-validate raw BTF dump and
writable BTF in a single selftest. Raw type dump checks also serve as a good
self-documentation.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Link: https://lore.kernel.org/bpf/20201105043402.2530976-7-andrii@kernel.org
</content>
</entry>
</feed>
