<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/selftests/bpf/progs/bpf_iter_task_stack.c, branch v7.1.7</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1.7</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1.7'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-10-30T00:43:29+00:00</updated>
<entry>
<title>selftests/bpf: drop unnecessary bpf_iter.h type duplication</title>
<updated>2024-10-30T00:43:29+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andrii@kernel.org</email>
</author>
<published>2024-10-29T20:39:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e626a13f6fbb4697f8734333432dca577628d09a'/>
<id>urn:sha1:e626a13f6fbb4697f8734333432dca577628d09a</id>
<content type='text'>
Drop bpf_iter.h header which uses vmlinux.h but re-defines a bunch of
iterator structures and some of BPF constants for use in BPF iterator
selftests.

None of that is necessary when fresh vmlinux.h header is generated for
vmlinux image that matches latest selftests. So drop ugly hacks and have
a nice plain vmlinux.h usage everywhere.

We could do the same with all the kfunc __ksym redefinitions, but that
has dependency on very fresh pahole, so I'm not addressing that here.

Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/r/20241029203919.1948941-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Add assert for user stacks in test_task_stack</title>
<updated>2023-11-14T02:39:38+00:00</updated>
<author>
<name>Jordan Rome</name>
<email>linux@jordanrome.com</email>
</author>
<published>2023-11-12T02:30:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=727a92d62fd6a382b4c5972008e45667e707b0e4'/>
<id>urn:sha1:727a92d62fd6a382b4c5972008e45667e707b0e4</id>
<content type='text'>
This is a follow up to:
commit b8e3a87a627b ("bpf: Add crosstask check to __bpf_get_stack").

This test ensures that the task iterator only gets a single
user stack (for the current task).

Signed-off-by: Jordan Rome &lt;linux@jordanrome.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Acked-by: Stanislav Fomichev &lt;sdf@google.com&gt;
Link: https://lore.kernel.org/bpf/20231112023010.144675-1-linux@jordanrome.com
</content>
</entry>
<entry>
<title>libbpf: Move BPF_SEQ_PRINTF and BPF_SNPRINTF to bpf_helpers.h</title>
<updated>2021-05-26T17:45:41+00:00</updated>
<author>
<name>Florent Revest</name>
<email>revest@chromium.org</email>
</author>
<published>2021-05-26T16:46:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d6a6a55518c16040a369360255b355b7a2a261de'/>
<id>urn:sha1:d6a6a55518c16040a369360255b355b7a2a261de</id>
<content type='text'>
These macros are convenient wrappers around the bpf_seq_printf and
bpf_snprintf helpers. They are currently provided by bpf_tracing.h which
targets low level tracing primitives. bpf_helpers.h is a better fit.

The __bpf_narg and __bpf_apply are needed in both files and provided
twice. __bpf_empty isn't used anywhere and is removed from bpf_tracing.h

Reported-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Signed-off-by: Florent Revest &lt;revest@chromium.org&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210526164643.2881368-1-revest@chromium.org
</content>
</entry>
<entry>
<title>bpf/selftests: Add bpf_get_task_stack retval bounds test_prog</title>
<updated>2021-04-20T01:23:33+00:00</updated>
<author>
<name>Dave Marchevsky</name>
<email>davemarchevsky@fb.com</email>
</author>
<published>2021-04-16T20:47:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c77cec5c207b68a3cbc2af2f81070ec428f41145'/>
<id>urn:sha1:c77cec5c207b68a3cbc2af2f81070ec428f41145</id>
<content type='text'>
Add a libbpf test prog which feeds bpf_get_task_stack's return value
into seq_write after confirming it's positive. No attempt to bound the
value from above is made.

Load will fail if verifier does not refine retval range based on buf sz
input to bpf_get_task_stack.

Signed-off-by: Dave Marchevsky &lt;davemarchevsky@fb.com&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/20210416204704.2816874-4-davemarchevsky@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Fix compilation error of bpf_iter_task_stack.c</title>
<updated>2020-07-03T21:25:40+00:00</updated>
<author>
<name>Song Liu</name>
<email>songliubraving@fb.com</email>
</author>
<published>2020-07-03T18:17:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9ff79af3331277c69ac61cc75b2392eb3284e305'/>
<id>urn:sha1:9ff79af3331277c69ac61cc75b2392eb3284e305</id>
<content type='text'>
BPF selftests show a compilation error as follows:

  libbpf: invalid relo for 'entries' in special section 0xfff2; forgot to
  initialize global var?..

Fix it by initializing 'entries' to zeros.

Fixes: c7568114bc56 ("selftests/bpf: Add bpf_iter test with bpf_get_task_stack()")
Reported-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Signed-off-by: Song Liu &lt;songliubraving@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Link: https://lore.kernel.org/bpf/20200703181719.3747072-1-songliubraving@fb.com
</content>
</entry>
<entry>
<title>selftests/bpf: Add bpf_iter test with bpf_get_task_stack()</title>
<updated>2020-07-01T15:23:59+00:00</updated>
<author>
<name>Song Liu</name>
<email>songliubraving@fb.com</email>
</author>
<published>2020-06-30T06:28:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c7568114bc56cf3ec0bd9eb117bbe7cad3d30e11'/>
<id>urn:sha1:c7568114bc56cf3ec0bd9eb117bbe7cad3d30e11</id>
<content type='text'>
The new test is similar to other bpf_iter tests. It dumps all
/proc/&lt;pid&gt;/stack to a seq_file. Here is some example output:

pid:     2873 num_entries:        3
[&lt;0&gt;] worker_thread+0xc6/0x380
[&lt;0&gt;] kthread+0x135/0x150
[&lt;0&gt;] ret_from_fork+0x22/0x30

pid:     2874 num_entries:        9
[&lt;0&gt;] __bpf_get_stack+0x15e/0x250
[&lt;0&gt;] bpf_prog_22a400774977bb30_dump_task_stack+0x4a/0xb3c
[&lt;0&gt;] bpf_iter_run_prog+0x81/0x170
[&lt;0&gt;] __task_seq_show+0x58/0x80
[&lt;0&gt;] bpf_seq_read+0x1c3/0x3b0
[&lt;0&gt;] vfs_read+0x9e/0x170
[&lt;0&gt;] ksys_read+0xa7/0xe0
[&lt;0&gt;] do_syscall_64+0x4c/0xa0
[&lt;0&gt;] entry_SYSCALL_64_after_hwframe+0x44/0xa9

Note: bpf_iter test as-is doesn't print the contents of the seq_file. To
see the example above, it is necessary to add printf() to do_dummy_read.

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