Re: [PATCH bpf-next 1/2] libbpf: add perf buffer reading API

2019-06-25 Thread Andrii Nakryiko
On Tue, Jun 25, 2019 at 7:19 PM Song Liu wrote: > > On Tue, Jun 25, 2019 at 4:28 PM Andrii Nakryiko wrote: > > > > BPF_MAP_TYPE_PERF_EVENT_ARRAY map is often used to send data from BPF > > program > > to user space for additional processing. libbpf already has very low-level > > API > > to read

Re: [PATCH bpf-next 1/2] libbpf: add perf buffer reading API

2019-06-25 Thread Song Liu
On Tue, Jun 25, 2019 at 4:28 PM Andrii Nakryiko wrote: > > BPF_MAP_TYPE_PERF_EVENT_ARRAY map is often used to send data from BPF program > to user space for additional processing. libbpf already has very low-level API > to read single CPU perf buffer, bpf_perf_event_read_simple(), but it's hard to

[PATCH bpf-next 1/2] libbpf: add perf buffer reading API

2019-06-25 Thread Andrii Nakryiko
BPF_MAP_TYPE_PERF_EVENT_ARRAY map is often used to send data from BPF program to user space for additional processing. libbpf already has very low-level API to read single CPU perf buffer, bpf_perf_event_read_simple(), but it's hard to use and requires a lot of code to set everything up. This patch