<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/samples/bpf/trace_event_kern.c, branch header-removal</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=header-removal</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=header-removal'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2021-03-26T05:03:46+00:00</updated>
<entry>
<title>bpf: Remove unused headers</title>
<updated>2021-03-26T05:03:46+00:00</updated>
<author>
<name>Lu Wei</name>
<email>luwei32@huawei.com</email>
</author>
<published>2021-03-24T08:31:47+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=b0c407ec503b8e97bbffd65cc4bed39e008c192f'/>
<id>urn:sha1:b0c407ec503b8e97bbffd65cc4bed39e008c192f</id>
<content type='text'>
The header &lt;linux/version.h&gt; is useless in sampleip_kern.c
and trace_event_kern.c, remove it.

Signed-off-by: Lu Wei &lt;luwei32@huawei.com&gt;
Signed-off-by: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Link: https://lore.kernel.org/bpf/20210324083147.149278-1-luwei32@huawei.com
</content>
</entry>
<entry>
<title>samples, bpf: Refactor kprobe, tail call kern progs map definition</title>
<updated>2020-05-19T15:13:03+00:00</updated>
<author>
<name>Daniel T. Lee</name>
<email>danieltimlee@gmail.com</email>
</author>
<published>2020-05-16T04:06:08+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=59929cd1fec508a48ea2a04d8f2e4fdef907a2cd'/>
<id>urn:sha1:59929cd1fec508a48ea2a04d8f2e4fdef907a2cd</id>
<content type='text'>
Because the previous two commit replaced the bpf_load implementation of
the user program with libbpf, the corresponding kernel program's MAP
definition can be replaced with new BTF-defined map syntax.

This commit only updates the samples which uses libbpf API for loading
bpf program not with bpf_load.

Signed-off-by: Daniel T. Lee &lt;danieltimlee@gmail.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: Yonghong Song &lt;yhs@fb.com&gt;
Link: https://lore.kernel.org/bpf/20200516040608.1377876-6-danieltimlee@gmail.com
</content>
</entry>
<entry>
<title>samples/bpf: Use consistent include paths for libbpf</title>
<updated>2020-01-21T00:37:45+00:00</updated>
<author>
<name>Toke Høiland-Jørgensen</name>
<email>toke@redhat.com</email>
</author>
<published>2020-01-20T13:06:49+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=7cf245a37ef013b2c1c5ca7ae25061de2ba7ad01'/>
<id>urn:sha1:7cf245a37ef013b2c1c5ca7ae25061de2ba7ad01</id>
<content type='text'>
Fix all files in samples/bpf to include libbpf header files with the bpf/
prefix, to be consistent with external users of the library. Also ensure
that all includes of exported libbpf header files (those that are exported
on 'make install' of the library) use bracketed includes instead of quoted.

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,
and use tools/lib instead.

Fixes: 6910d7d3867a ("selftests/bpf: Ensure bpf_helper_defs.h are taken from selftests dir")
Signed-off-by: Toke Høiland-Jørgensen &lt;toke@redhat.com&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Jesper Dangaard Brouer &lt;brouer@redhat.com&gt;
Acked-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Link: https://lore.kernel.org/bpf/157952560911.1683545.8795966751309534150.stgit@toke.dk
</content>
</entry>
<entry>
<title>selftests/bpf: Split off tracing-only helpers into bpf_tracing.h</title>
<updated>2019-10-08T21:16:03+00:00</updated>
<author>
<name>Andrii Nakryiko</name>
<email>andriin@fb.com</email>
</author>
<published>2019-10-08T17:59:39+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=3ac4dbe3dd8943450e0366f8174fbfc286ea8f19'/>
<id>urn:sha1:3ac4dbe3dd8943450e0366f8174fbfc286ea8f19</id>
<content type='text'>
Split-off PT_REGS-related helpers into bpf_tracing.h header. Adjust
selftests and samples to include it where necessary.

Signed-off-by: Andrii Nakryiko &lt;andriin@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Acked-by: Song Liu &lt;songliubraving@fb.com&gt;
Link: https://lore.kernel.org/bpf/20191008175942.1769476-5-andriin@fb.com
</content>
</entry>
<entry>
<title>samples/bpf: add example to test reading address</title>
<updated>2018-03-08T01:22:34+00:00</updated>
<author>
<name>Teng Qin</name>
<email>qinteng@fb.com</email>
</author>
<published>2018-03-06T18:55:02+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=12fe12253c56a26e591ceefbdf0998b391022003'/>
<id>urn:sha1:12fe12253c56a26e591ceefbdf0998b391022003</id>
<content type='text'>
This commit adds additional test in the trace_event example, by
attaching the bpf program to MEM_UOPS_RETIRED.LOCK_LOADS event with
PERF_SAMPLE_ADDR requested, and print the lock address value read from
the bpf program to trace_pipe.

Signed-off-by: Teng Qin &lt;qinteng@fb.com&gt;
Signed-off-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
</content>
</entry>
<entry>
<title>bpf: add a test case for helper bpf_perf_prog_read_value</title>
<updated>2017-10-07T22:05:57+00:00</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2017-10-05T16:19:23+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=81b9cf8028a17bdbdaa0da80b735b32150d4e89e'/>
<id>urn:sha1:81b9cf8028a17bdbdaa0da80b735b32150d4e89e</id>
<content type='text'>
The bpf sample program trace_event is enhanced to use the new
helper to print out enabled/running time.

Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@fb.com&gt;
Acked-by: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>bpf/samples: Fix PT_REGS_IP on s390x and use it</title>
<updated>2016-11-28T21:26:46+00:00</updated>
<author>
<name>Michael Holzheu</name>
<email>holzheu@linux.vnet.ibm.com</email>
</author>
<published>2016-11-28T12:48:30+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2dbb4c05d048995455857a7c2927a4297fc66c3b'/>
<id>urn:sha1:2dbb4c05d048995455857a7c2927a4297fc66c3b</id>
<content type='text'>
The files "sampleip_kern.c" and "trace_event_kern.c" directly access
"ctx-&gt;regs.ip" which is not available on s390x. Fix this and use the
PT_REGS_IP() macro instead.

Also fix the macro for s390x and use "psw.addr" from "pt_regs".

Reported-by: Zvonko Kosic &lt;zvonko.kosic@de.ibm.com&gt;
Signed-off-by: Michael Holzheu &lt;holzheu@linux.vnet.ibm.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>samples/bpf: add perf_event+bpf example</title>
<updated>2016-09-02T17:46:45+00:00</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@fb.com</email>
</author>
<published>2016-09-02T01:37:25+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=1c47910ef80135ac89e4d0b471d123572cee5535'/>
<id>urn:sha1:1c47910ef80135ac89e4d0b471d123572cee5535</id>
<content type='text'>
The bpf program is called 50 times a second and does hashmap[kern&amp;user_stackid]++
It's primary purpose to check that key bpf helpers like map lookup, update,
get_stackid, trace_printk and ctx access are all working.
It checks:
- PERF_COUNT_HW_CPU_CYCLES on all cpus
- PERF_COUNT_HW_CPU_CYCLES for current process and inherited perf_events to children
- PERF_COUNT_SW_CPU_CLOCK on all cpus
- PERF_COUNT_SW_CPU_CLOCK for current process

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
