diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-10-21 02:09:28 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-10-21 08:13:32 +0200 |
commit | 3dca21156b5f809510e8c3efe7f1046e27242e3d (patch) | |
tree | ee60aebfc20747a4df2532951263c3f64858f802 /virt | |
parent | bpf, verifier: avoid retpoline for map push/pop/peek operation (diff) | |
download | linux-3dca21156b5f809510e8c3efe7f1046e27242e3d.tar.xz linux-3dca21156b5f809510e8c3efe7f1046e27242e3d.zip |
bpf, libbpf: simplify and cleanup perf ring buffer walk
Simplify bpf_perf_event_read_simple() a bit and fix up some minor
things along the way: the return code in the header is not of type
int but enum bpf_perf_event_ret instead. Once callback indicated
to break the loop walking event data, it also needs to be consumed
in data_tail since it has been processed already.
Moreover, bpf_perf_event_print_t callback should avoid void * as
we actually get a pointer to struct perf_event_header and thus
applications can make use of container_of() to have type checks.
The walk also doesn't have to use modulo op since the ring size is
required to be power of two.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions