<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/bpf/progs/test_attach_probe.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-08-23T22:40:11Z</updated>
<entry>
<title>selftests/bpf: Add tests for bpf_copy_from_user_str kfunc.</title>
<updated>2024-08-23T22:40:11Z</updated>
<author>
<name>Jordan Rome</name>
</author>
<published>2024-08-23T19:51:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ddc3d98807dca05ad10f4c76d13019c428302719'/>
<id>urn:sha1:ddc3d98807dca05ad10f4c76d13019c428302719</id>
<content type='text'>
This adds tests for both the happy path and
the error path.

Signed-off-by: Jordan Rome &lt;linux@jordanrome.com&gt;
Link: https://lore.kernel.org/r/20240823195101.3621028-2-linux@jordanrome.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Add test for legacy/perf kprobe/uprobe attach mode</title>
<updated>2023-03-06T17:38:08Z</updated>
<author>
<name>Menglong Dong</name>
</author>
<published>2023-03-06T06:48:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c7aec81b31e43a0aa94ee55d9bb33d70b1046f76'/>
<id>urn:sha1:c7aec81b31e43a0aa94ee55d9bb33d70b1046f76</id>
<content type='text'>
Add the testing for kprobe/uprobe attaching in default, legacy, perf and
link mode. And the testing passed:

./test_progs -t attach_probe
$5/1     attach_probe/manual-default:OK
$5/2     attach_probe/manual-legacy:OK
$5/3     attach_probe/manual-perf:OK
$5/4     attach_probe/manual-link:OK
$5/5     attach_probe/auto:OK
$5/6     attach_probe/kprobe-sleepable:OK
$5/7     attach_probe/uprobe-lib:OK
$5/8     attach_probe/uprobe-sleepable:OK
$5/9     attach_probe/uprobe-ref_ctr:OK
$5       attach_probe:OK
Summary: 1/9 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Menglong Dong &lt;imagedong@tencent.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Reviewed-by: Biao Jiang &lt;benbjiang@tencent.com&gt;
Link: https://lore.kernel.org/bpf/20230306064833.7932-4-imagedong@tencent.com
</content>
</entry>
<entry>
<title>selftests/bpf: Split test_attach_probe into multi subtests</title>
<updated>2023-03-06T17:38:08Z</updated>
<author>
<name>Menglong Dong</name>
</author>
<published>2023-03-06T06:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7391ec6391e2b129aeaee5462487c404f61157aa'/>
<id>urn:sha1:7391ec6391e2b129aeaee5462487c404f61157aa</id>
<content type='text'>
In order to adapt to the older kernel, now we split the "attach_probe"
testing into multi subtests:

  manual // manual attach tests for kprobe/uprobe
  auto // auto-attach tests for kprobe and uprobe
  kprobe-sleepable // kprobe sleepable test
  uprobe-lib // uprobe tests for library function by name
  uprobe-sleepable // uprobe sleepable test
  uprobe-ref_ctr // uprobe ref_ctr test

As sleepable kprobe needs to set BPF_F_SLEEPABLE flag before loading,
we need to move it to a stand alone skel file, in case of it is not
supported by kernel and make the whole loading fail.

Therefore, we can only enable part of the subtests for older kernel.

Signed-off-by: Menglong Dong &lt;imagedong@tencent.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Reviewed-by: Biao Jiang &lt;benbjiang@tencent.com&gt;
Link: https://lore.kernel.org/bpf/20230306064833.7932-3-imagedong@tencent.com
</content>
</entry>
<entry>
<title>selftests/bpf: Attach to fopen()/fclose() in attach_probe</title>
<updated>2023-02-10T23:21:27Z</updated>
<author>
<name>Ilya Leoshkevich</name>
</author>
<published>2023-02-10T00:12:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=202702e890a41412a7de970b84a970ba1d5001c9'/>
<id>urn:sha1:202702e890a41412a7de970b84a970ba1d5001c9</id>
<content type='text'>
malloc() and free() may be completely replaced by sanitizers, use
fopen() and fclose() instead.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20230210001210.395194-7-iii@linux.ibm.com
</content>
</entry>
<entry>
<title>selftests/bpf: use BPF_KSYSCALL and SEC("ksyscall") in selftests</title>
<updated>2022-07-19T16:33:18Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2022-07-14T07:07:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d814ed62d3d24eb5c5f904b897e0414c1ccb5740'/>
<id>urn:sha1:d814ed62d3d24eb5c5f904b897e0414c1ccb5740</id>
<content type='text'>
Convert few selftest that used plain SEC("kprobe") with arch-specific
syscall wrapper prefix to ksyscall/kretsyscall and corresponding
BPF_KSYSCALL macro. test_probe_user.c is especially benefiting from this
simplification.

Tested-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/r/20220714070755.3235561-6-andrii@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: add tests for sleepable (uk)probes</title>
<updated>2022-06-17T02:27:30Z</updated>
<author>
<name>Delyan Kratunov</name>
</author>
<published>2022-06-14T23:10:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb3f4a4a462b46eb5487ad806d58e34824c49044'/>
<id>urn:sha1:cb3f4a4a462b46eb5487ad806d58e34824c49044</id>
<content type='text'>
Add tests that ensure sleepable uprobe programs work correctly.
Add tests that ensure sleepable kprobe programs cannot attach.

Also add tests that attach both sleepable and non-sleepable
uprobe programs to the same location (i.e. same bpf_prog_array).

Acked-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Delyan Kratunov &lt;delyank@fb.com&gt;
Link: https://lore.kernel.org/r/c744e5bb7a5c0703f05444dc41f2522ba3579a48.1655248076.git.delyank@fb.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Use target-less SEC() definitions in various tests</title>
<updated>2022-04-28T21:46:04Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2022-04-28T18:53:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32c03c4954a03d46f603f94acac9d2705bd5c9c6'/>
<id>urn:sha1:32c03c4954a03d46f603f94acac9d2705bd5c9c6</id>
<content type='text'>
Add new or modify existing SEC() definitions to be target-less and
validate that libbpf handles such program definitions correctly.

For kprobe/kretprobe we also add explicit test that generic
bpf_program__attach() works in cases when kprobe definition contains
proper target. It wasn't previously tested as selftests code always
explicitly specified the target regardless.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&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/20220428185349.3799599-4-andrii@kernel.org
</content>
</entry>
<entry>
<title>selftests/bpf: Add tests for u[ret]probe attach by name</title>
<updated>2022-04-04T02:56:00Z</updated>
<author>
<name>Alan Maguire</name>
</author>
<published>2022-03-30T15:26:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ba7499bc9d52f7ea93301a48c05caa370c68b213'/>
<id>urn:sha1:ba7499bc9d52f7ea93301a48c05caa370c68b213</id>
<content type='text'>
add tests that verify attaching by name for

1. local functions in a program
2. library functions in a shared object

...succeed for uprobe and uretprobes using new "func_name"
option for bpf_program__attach_uprobe_opts().  Also verify
auto-attach works where uprobe, path to binary and function
name are specified, but fails with -EOPNOTSUPP with a SEC
name that does not specify binary path/function.

Signed-off-by: Alan Maguire &lt;alan.maguire@oracle.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/1648654000-21758-5-git-send-email-alan.maguire@oracle.com
</content>
</entry>
<entry>
<title>libbpf: Merge selftests' bpf_trace_helpers.h into libbpf's bpf_tracing.h</title>
<updated>2020-03-03T00:25:14Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2020-02-29T23:11:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df8ff35311c8d10d90b4604c02b32c361dc997aa'/>
<id>urn:sha1:df8ff35311c8d10d90b4604c02b32c361dc997aa</id>
<content type='text'>
Move BPF_PROG, BPF_KPROBE, and BPF_KRETPROBE macro into libbpf's bpf_tracing.h
header to make it available for non-selftests users.

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/20200229231112.1240137-5-andriin@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Fix BPF_KRETPROBE macro and use it in attach_probe test</title>
<updated>2020-03-03T00:25:14Z</updated>
<author>
<name>Andrii Nakryiko</name>
</author>
<published>2020-02-29T23:11:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=396f544ed5e5a9c40de5663b774f643644cba059'/>
<id>urn:sha1:396f544ed5e5a9c40de5663b774f643644cba059</id>
<content type='text'>
For kretprobes, there is no point in capturing input arguments from pt_regs,
as they are going to be, most probably, clobbered by the time probed kernel
function returns. So switch BPF_KRETPROBE to accept zero or one argument
(optional return result).

Fixes: ac065870d928 ("selftests/bpf: Add BPF_PROG, BPF_KPROBE, and BPF_KRETPROBE macros")
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/20200229231112.1240137-4-andriin@fb.com
</content>
</entry>
</feed>
