<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/bpf/Makefile, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-05-14T08:52:45Z</updated>
<entry>
<title>selftests/bpf: Re-generate vmlinux.h and BPF skeletons if bpftool changed</title>
<updated>2021-05-14T08:52:45Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2021-03-18T19:40:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3be43633d30fb0b2d51e196806769709cb4adc70'/>
<id>urn:sha1:3be43633d30fb0b2d51e196806769709cb4adc70</id>
<content type='text'>
[ Upstream commit cab62c37be057379a2a17b1b2eacd9dcba1e14dc ]

Trigger vmlinux.h and BPF skeletons re-generation if detected that bpftool was
re-compiled. Otherwise full `make clean` is required to get updated skeletons,
if bpftool is modified.

Fixes: acbd06206bbb ("selftests/bpf: Add vmlinux.h selftest exercising tracing of syscalls")
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/20210318194036.3521577-11-andrii@kernel.org
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Integrate the socket_cookie test to test_progs</title>
<updated>2021-02-12T01:44:41Z</updated>
<author>
<name>Florent Revest</name>
</author>
<published>2021-02-10T11:14:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61f8c9c8f3c8fb60722f0f3168d1a546dbf8a3d4'/>
<id>urn:sha1:61f8c9c8f3c8fb60722f0f3168d1a546dbf8a3d4</id>
<content type='text'>
Currently, the selftest for the BPF socket_cookie helpers is built and
run independently from test_progs. It's easy to forget and hard to
maintain.

This patch moves the socket cookies test into prog_tests/ and vastly
simplifies its logic by:
- rewriting the loading code with BPF skeletons
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs

Signed-off-by: Florent Revest &lt;revest@chromium.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: KP Singh &lt;kpsingh@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210210111406.785541-3-revest@chromium.org
</content>
</entry>
<entry>
<title>tools: Factor Clang, LLC and LLVM utils definitions</title>
<updated>2021-01-29T00:25:34Z</updated>
<author>
<name>Sedat Dilek</name>
</author>
<published>2021-01-28T01:50:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=211a741cd3e124bffdc13ee82e7e65f204e53f60'/>
<id>urn:sha1:211a741cd3e124bffdc13ee82e7e65f204e53f60</id>
<content type='text'>
When dealing with BPF/BTF/pahole and DWARF v5 I wanted to build bpftool.

While looking into the source code I found duplicate assignments in misc tools
for the LLVM eco system, e.g. clang and llvm-objcopy.

Move the Clang, LLC and/or LLVM utils definitions to tools/scripts/Makefile.include
file and add missing includes where needed. Honestly, I was inspired by the commit
c8a950d0d3b9 ("tools: Factor HOSTCC, HOSTLD, HOSTAR definitions").

I tested with bpftool and perf on Debian/testing AMD64 and LLVM/Clang v11.1.0-rc1.

Build instructions:

[ make and make-options ]
MAKE="make V=1"
MAKE_OPTS="HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld CC=clang LD=ld.lld LLVM=1 LLVM_IAS=1"
MAKE_OPTS="$MAKE_OPTS PAHOLE=/opt/pahole/bin/pahole"

[ clean-up ]
$MAKE $MAKE_OPTS -C tools/ clean

[ bpftool ]
$MAKE $MAKE_OPTS -C tools/bpf/bpftool/

[ perf ]
PYTHON=python3 $MAKE $MAKE_OPTS -C tools/perf/

I was careful with respecting the user's wish to override custom compiler, linker,
GNU/binutils and/or LLVM utils settings.

Signed-off-by: Sedat Dilek &lt;sedat.dilek@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt; # tools/build and tools/perf
Link: https://lore.kernel.org/bpf/20210128015117.20515-1-sedat.dilek@gmail.com
</content>
</entry>
<entry>
<title>bpf, selftests: Fold test_current_pid_tgid_new_ns into test_progs.</title>
<updated>2021-01-20T22:10:35Z</updated>
<author>
<name>Carlos Neira</name>
</author>
<published>2021-01-14T14:10:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09c02d553c49fa6965fe39e28355b62f6ad02792'/>
<id>urn:sha1:09c02d553c49fa6965fe39e28355b62f6ad02792</id>
<content type='text'>
Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs.
This change folds test cases into test_progs.

Changes from v11:

 - Fixed test failure is not detected.
 - Removed EXIT(3) call as it will stop test_progs execution.

Signed-off-by: Carlos Neira &lt;cneirabustos@gmail.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20210114141033.GA17348@localhost
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>bpf: Add tests for new BPF atomic operations</title>
<updated>2021-01-15T02:34:29Z</updated>
<author>
<name>Brendan Jackman</name>
</author>
<published>2021-01-14T18:17:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=98d666d05a1d9706bb3fe972157fa6155dbb180f'/>
<id>urn:sha1:98d666d05a1d9706bb3fe972157fa6155dbb180f</id>
<content type='text'>
The prog_test that's added depends on Clang/LLVM features added by
Yonghong in commit 286daafd6512 (was https://reviews.llvm.org/D72184).

Note the use of a define called ENABLE_ATOMICS_TESTS: this is used
to:

 - Avoid breaking the build for people on old versions of Clang
 - Avoid needing separate lists of test objects for no_alu32, where
   atomics are not supported even if Clang has the feature.

The atomics_test.o BPF object is built unconditionally both for
test_progs and test_progs-no_alu32. For test_progs, if Clang supports
atomics, ENABLE_ATOMICS_TESTS is defined, so it includes the proper
test code. Otherwise, progs and global vars are defined anyway, as
stubs; this means that the skeleton user code still builds.

The atomics_test.o userspace object is built once and used for both
test_progs and test_progs-no_alu32. A variable called skip_tests is
defined in the BPF object's data section, which tells the userspace
object whether to skip the atomics test.

Signed-off-by: Brendan Jackman &lt;jackmanb@google.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Link: https://lore.kernel.org/bpf/20210114181751.768687-11-jackmanb@google.com
</content>
</entry>
<entry>
<title>selftests/bpf: Install btf_dump test cases</title>
<updated>2021-01-14T03:05:40Z</updated>
<author>
<name>Jean-Philippe Brucker</name>
</author>
<published>2021-01-13T16:33:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8d1cbef2ea4415edcdb5a825972d93b63fcf63c'/>
<id>urn:sha1:b8d1cbef2ea4415edcdb5a825972d93b63fcf63c</id>
<content type='text'>
The btf_dump test cannot access the original source files for comparison
when running the selftests out of tree, causing several failures:

awk: btf_dump_test_case_syntax.c: No such file or directory
...

Add those files to $(TEST_FILES) to have "make install" pick them up.

Signed-off-by: Jean-Philippe Brucker &lt;jean-philippe@linaro.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210113163319.1516382-6-jean-philippe@linaro.org
</content>
</entry>
<entry>
<title>selftests/bpf: Fix installation of urandom_read</title>
<updated>2021-01-14T03:05:39Z</updated>
<author>
<name>Jean-Philippe Brucker</name>
</author>
<published>2021-01-13T16:33:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca1e846711a8f49382005eb5feb82973fa88a849'/>
<id>urn:sha1:ca1e846711a8f49382005eb5feb82973fa88a849</id>
<content type='text'>
For out-of-tree builds, $(TEST_CUSTOM_PROGS) require the $(OUTPUT)
prefix, otherwise the kselftest lib doesn't know how to install them:

rsync: [sender] link_stat "tools/testing/selftests/bpf/urandom_read" failed: No such file or directory (2)

Signed-off-by: Jean-Philippe Brucker &lt;jean-philippe@linaro.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210113163319.1516382-5-jean-philippe@linaro.org
</content>
</entry>
<entry>
<title>selftests/bpf: Move generated test files to $(TEST_GEN_FILES)</title>
<updated>2021-01-14T03:05:39Z</updated>
<author>
<name>Jean-Philippe Brucker</name>
</author>
<published>2021-01-13T16:33:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d6ac8cad50f0c0fed5cfeb61301bb19e8e88985c'/>
<id>urn:sha1:d6ac8cad50f0c0fed5cfeb61301bb19e8e88985c</id>
<content type='text'>
During an out-of-tree build, attempting to install the $(TEST_FILES)
into the $(OUTPUT) directory fails, because the objects were already
generated into $(OUTPUT):

rsync: [sender] link_stat "tools/testing/selftests/bpf/test_lwt_ip_encap.o" failed: No such file or directory (2)
rsync: [sender] link_stat "tools/testing/selftests/bpf/test_tc_edt.o" failed: No such file or directory (2)

Use $(TEST_GEN_FILES) instead.

Signed-off-by: Jean-Philippe Brucker &lt;jean-philippe@linaro.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210113163319.1516382-4-jean-philippe@linaro.org
</content>
</entry>
<entry>
<title>selftests/bpf: Fix out-of-tree build</title>
<updated>2021-01-14T03:05:39Z</updated>
<author>
<name>Jean-Philippe Brucker</name>
</author>
<published>2021-01-13T16:33:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5837cedef6f33e01d1c4ad90ee4e966bcc6f9c30'/>
<id>urn:sha1:5837cedef6f33e01d1c4ad90ee4e966bcc6f9c30</id>
<content type='text'>
When building out-of-tree, the .skel.h files are generated into the
$(OUTPUT) directory, rather than $(CURDIR). Add $(OUTPUT) to the include
paths.

Signed-off-by: Jean-Philippe Brucker &lt;jean-philippe@linaro.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210113163319.1516382-3-jean-philippe@linaro.org
</content>
</entry>
<entry>
<title>selftests/bpf: Enable cross-building</title>
<updated>2021-01-14T03:05:39Z</updated>
<author>
<name>Jean-Philippe Brucker</name>
</author>
<published>2021-01-13T16:33:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de11ae4f56fdc53474c08b03142860428e6c5655'/>
<id>urn:sha1:de11ae4f56fdc53474c08b03142860428e6c5655</id>
<content type='text'>
Build bpftool and resolve_btfids using the host toolchain when
cross-compiling, since they are executed during build to generate the
selftests. Add a host build directory in order to build both host and
target version of libbpf. Build host tools using $(HOSTCC) defined in
Makefile.include.

Signed-off-by: Jean-Philippe Brucker &lt;jean-philippe@linaro.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210113163319.1516382-2-jean-philippe@linaro.org
</content>
</entry>
</feed>
