This patchset adds a high-level API for setting up and polling perf buffers associated with BPF_MAP_TYPE_PERF_EVENT_ARRAY map. Details of APIs are described in corresponding commit. Andrii Nakryiko (2): libbpf: add perf buffer reading API selftests/bpf: test perf buffer API tools/lib/bpf/libbpf.c | 282 ++++++++++++++++++ tools/lib/bpf/libbpf.h | 12 + tools/lib/bpf/libbpf.map | 5 +- .../selftests/bpf/prog_tests/perf_buffer.c | 86 ++++++ .../selftests/bpf/progs/test_perf_buffer.c | 31 ++ 5 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/perf_buffer.c create mode 100644 tools/testing/selftests/bpf/progs/test_perf_buffer.c -- 2.17.1