<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/tools/testing/selftests/bpf/Makefile, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/tools/testing/selftests/bpf/Makefile?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/tools/testing/selftests/bpf/Makefile?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-03-13T22:30:53Z</updated>
<entry>
<title>selftests/bpf: Add vmlinux.h selftest exercising tracing of syscalls</title>
<updated>2020-03-13T22:30:53Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-03-13T17:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=acbd06206bbbe59ffd2415c0b902dd244910e42e'/>
<id>urn:sha1:acbd06206bbbe59ffd2415c0b902dd244910e42e</id>
<content type='text'>
Add vmlinux.h generation to selftest/bpf's Makefile. Use it from newly added
test_vmlinux to trace nanosleep syscall using 5 different types of programs:
  - tracepoint;
  - raw tracepoint;
  - raw tracepoint w/ direct memory reads (tp_btf);
  - kprobe;
  - fentry.

These programs are realistic variants of real-life tracing programs,
excercising vmlinux.h's usage with tracing applications.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200313172336.1879637-5-andriin@fb.com
</content>
</entry>
<entry>
<title>tools/bpf: Move linux/types.h for selftests and bpftool</title>
<updated>2020-03-13T19:56:34Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2020-03-13T11:31:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=bcd66b10b5e956b3e81f76a61abfed2501ff4038'/>
<id>urn:sha1:bcd66b10b5e956b3e81f76a61abfed2501ff4038</id>
<content type='text'>
Commit fe4eb069edb7 ("bpftool: Use linux/types.h from source tree for
profiler build") added a build dependency on tools/testing/selftests/bpf
to tools/bpf/bpftool. This is suboptimal with respect to a possible
stand-alone build of bpftool.

Fix this by moving tools/testing/selftests/bpf/include/uapi/linux/types.h
to tools/include/uapi/linux/types.h.

This requires an adjustment in the include search path order for the
tests in tools/testing/selftests/bpf so that tools/include/linux/types.h
is selected when building host binaries and
tools/include/uapi/linux/types.h is selected when building bpf binaries.

Verified by compiling bpftool and the bpf selftests on x86_64 with this
change.

Fixes: fe4eb069edb7 ("bpftool: Use linux/types.h from source tree for profiler build")
Suggested-by: Andrii Nakryiko &lt;andrii.nakryiko@gmail.com&gt;
Signed-off-by: Tobias Klauser &lt;tklauser@distanz.ch&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Reviewed-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/20200313113105.6918-1-tklauser@distanz.ch
</content>
</entry>
<entry>
<title>tools/testing/selftests/bpf: Add self-tests for new helper bpf_get_ns_current_pid_tgid.</title>
<updated>2020-03-13T00:40:47Z</updated>
<author>
<name>Carlos Neira</name>
<email>cneirabustos@gmail.com</email>
</author>
<published>2020-03-04T20:41:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=1c1052e0140af8f211c283c0a333ecff2a6edfc9'/>
<id>urn:sha1:1c1052e0140af8f211c283c0a333ecff2a6edfc9</id>
<content type='text'>
Self tests added for new helper bpf_get_ns_current_pid_tgid

Signed-off-by: Carlos Neira &lt;cneirabustos@gmail.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200304204157.58695-4-cneirabustos@gmail.com
</content>
</entry>
<entry>
<title>selftests/bpf: Support out-of-tree vmlinux builds for VMLINUX_BTF</title>
<updated>2020-03-04T20:00:05Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-03-04T18:43:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=cc6fa771024ffdb428bdf25a94309cf21e8ef1b9'/>
<id>urn:sha1:cc6fa771024ffdb428bdf25a94309cf21e8ef1b9</id>
<content type='text'>
Add detection of out-of-tree built vmlinux image for the purpose of
VMLINUX_BTF detection. According to Documentation/kbuild/kbuild.rst, O takes
precedence over KBUILD_OUTPUT.

Also ensure ~/path/to/build/dir also works by relying on wildcard's resolution
first, but then applying $(abspath) at the end to also handle
O=../../whatever cases.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20200304184336.165766-1-andriin@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add test for "bpftool feature" command</title>
<updated>2020-02-26T17:34:34Z</updated>
<author>
<name>Michal Rostecki</name>
<email>mrostecki@opensuse.org</email>
</author>
<published>2020-02-26T16:59:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=736332740e295d9b6fc524f0447448f6089911d9'/>
<id>urn:sha1:736332740e295d9b6fc524f0447448f6089911d9</id>
<content type='text'>
Add Python module with tests for "bpftool feature" command, which mainly
checks whether the "full" option is working properly.

Signed-off-by: Michal Rostecki &lt;mrostecki@opensuse.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Reviewed-by: Quentin Monnet &lt;quentin@isovalent.com&gt;
Link: https://lore.kernel.org/bpf/20200226165941.6379-6-mrostecki@opensuse.org
</content>
</entry>
<entry>
<title>selftests/bpf: Print backtrace on SIGSEGV in test_progs</title>
<updated>2020-02-25T21:43:02Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-02-25T00:08:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=9fb156bb82a33f01708fbbb8828836a4219efc3d'/>
<id>urn:sha1:9fb156bb82a33f01708fbbb8828836a4219efc3d</id>
<content type='text'>
Due to various bugs in tests clean up code (usually), if host system is
misconfigured, it happens that test_progs will just crash in the middle of
running a test with little to no indication of where and why the crash
happened. For cases where coredump is not readily available (e.g., inside
a CI), it's very helpful to have a stack trace, which lead to crash, to be
printed out. This change adds a signal handler that will capture and print out
symbolized backtrace:

  $ sudo ./test_progs -t mmap
  test_mmap:PASS:skel_open_and_load 0 nsec
  test_mmap:PASS:bss_mmap 0 nsec
  test_mmap:PASS:data_mmap 0 nsec
  Caught signal #11!
  Stack trace:
  ./test_progs(crash_handler+0x18)[0x42a888]
  /lib64/libpthread.so.0(+0xf5d0)[0x7f2aab5175d0]
  ./test_progs(test_mmap+0x3c0)[0x41f0a0]
  ./test_progs(main+0x160)[0x407d10]
  /lib64/libc.so.6(__libc_start_main+0xf5)[0x7f2aab15d3d5]
  ./test_progs[0x407ebc]
  [1]    1988412 segmentation fault (core dumped)  sudo ./test_progs -t mmap

Unfortunately, glibc's symbolization support is unable to symbolize static
functions, only global ones will be present in stack trace. But it's still a
step forward without adding extra libraries to get a better symbolization.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200225000847.3965188-1-andriin@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Change llvm flag -mcpu=probe to -mcpu=v3</title>
<updated>2020-02-19T23:15:07Z</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2020-02-19T00:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=83250f2b6940654a73a2cfab7ac112b804a5f648'/>
<id>urn:sha1:83250f2b6940654a73a2cfab7ac112b804a5f648</id>
<content type='text'>
The latest llvm supports cpu version v3, which is cpu version v1
plus some additional 64bit jmp insns and 32bit jmp insn support.

In selftests/bpf Makefile, the llvm flag -mcpu=probe did runtime
probe into the host system. Depending on compilation environments,
it is possible that runtime probe may fail, e.g., due to
memlock issue. This will cause generated code with cpu version v1.
This may cause confusion as the same compiler and the same C code
generates different byte codes in different environment.

Let us change the llvm flag -mcpu=probe to -mcpu=v3 so the
generated code will be the same regardless of the compilation
environment.

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;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200219004236.2291125-1-yhs@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Improve bpftool changes detection</title>
<updated>2020-01-24T10:09:21Z</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2020-01-24T05:41:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=03506297d205e5fa25b5ead0f6338b5a4a996a93'/>
<id>urn:sha1:03506297d205e5fa25b5ead0f6338b5a4a996a93</id>
<content type='text'>
Detect when bpftool source code changes and trigger rebuild within
selftests/bpf Makefile. Also fix few small formatting problems.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Acked-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Link: https://lore.kernel.org/bpf/20200124054148.2455060-1-andriin@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Build urandom_read with LDFLAGS and LDLIBS</title>
<updated>2020-01-22T16:45:29Z</updated>
<author>
<name>Daniel Díaz</name>
<email>daniel.diaz@linaro.org</email>
</author>
<published>2020-01-22T16:44:24Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=1222653cc0489fa9304a36f7d9593ecaeb51efe1'/>
<id>urn:sha1:1222653cc0489fa9304a36f7d9593ecaeb51efe1</id>
<content type='text'>
During cross-compilation, it was discovered that LDFLAGS and
LDLIBS were not being used while building binaries, leading
to defaults which were not necessarily correct.

OpenEmbedded reported this kind of problem:

  ERROR: QA Issue: No GNU_HASH in the ELF binary [...], didn't pass LDFLAGS?

Signed-off-by: Daniel Díaz &lt;daniel.diaz@linaro.org&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
</content>
</entry>
<entry>
<title>selftests: Refactor build to remove tools/lib/bpf from include path</title>
<updated>2020-01-21T00:37:46Z</updated>
<author>
<name>Toke Høiland-Jørgensen</name>
<email>toke@redhat.com</email>
</author>
<published>2020-01-20T13:06:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=a2c9652f751e3ab39738e2b30bc45293d53604fd'/>
<id>urn:sha1:a2c9652f751e3ab39738e2b30bc45293d53604fd</id>
<content type='text'>
To make sure no new files are introduced that doesn't include the bpf/
prefix in its #include, remove tools/lib/bpf from the include path
entirely.

Instead, we introduce a new header files directory under the scratch tools/
dir, and add a rule to run the 'install_headers' rule from libbpf to have a
full set of consistent libbpf headers in $(OUTPUT)/tools/include/bpf, and
then use $(OUTPUT)/tools/include as the include path for selftests.

For consistency we also make sure we put all the scratch build files from
other bpftool and libbpf into tools/build/, so everything stays within
selftests/.

Signed-off-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Link: https://lore.kernel.org/bpf/157952561246.1683545.2762245552022369203.stgit@toke.dk
</content>
</entry>
</feed>
