netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 bpf-next 0/4] libbpf: add perf buffer abstraction and API
@ 2019-06-30  6:51 Andrii Nakryiko
  2019-06-30  6:51 ` [PATCH v4 bpf-next 1/4] libbpf: add perf buffer API Andrii Nakryiko
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Andrii Nakryiko @ 2019-06-30  6:51 UTC (permalink / raw)
  To: andrii.nakryiko, ast, daniel, kernel-team, bpf, netdev, jakub.kicinski
  Cc: Andrii Nakryiko

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.

Patch #1 adds a set of APIs to set up and work with perf buffer.
Patch #2 enhances libbpf to support auto-setting PERF_EVENT_ARRAY map size.
Patch #3 adds test.
Patch #4 converts bpftool map event_pipe to new API.

v3->v4:
- fixed bpftool event_pipe cmd error handling (Jakub);

v2->v3:
- added perf_buffer__new_raw for more low-level control;
- converted bpftool map event_pipe to new API (Daniel);
- fixed bug with error handling in create_maps (Song);

v1->v2:
- add auto-sizing of PERF_EVENT_ARRAY maps;

Andrii Nakryiko (4):
  libbpf: add perf buffer API
  libbpf: auto-set PERF_EVENT_ARRAY size to number of CPUs
  selftests/bpf: test perf buffer API
  tools/bpftool: switch map event_pipe to libbpf's perf_buffer

 tools/bpf/bpftool/map_perf_ring.c             | 201 +++------
 tools/lib/bpf/libbpf.c                        | 397 +++++++++++++++++-
 tools/lib/bpf/libbpf.h                        |  49 +++
 tools/lib/bpf/libbpf.map                      |   4 +
 .../selftests/bpf/prog_tests/perf_buffer.c    |  94 +++++
 .../selftests/bpf/progs/test_perf_buffer.c    |  29 ++
 6 files changed, 630 insertions(+), 144 deletions(-)
 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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-07-03 16:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-30  6:51 [PATCH v4 bpf-next 0/4] libbpf: add perf buffer abstraction and API Andrii Nakryiko
2019-06-30  6:51 ` [PATCH v4 bpf-next 1/4] libbpf: add perf buffer API Andrii Nakryiko
2019-06-30  6:51 ` [PATCH v4 bpf-next 2/4] libbpf: auto-set PERF_EVENT_ARRAY size to number of CPUs Andrii Nakryiko
2019-06-30  6:51 ` [PATCH v4 bpf-next 3/4] selftests/bpf: test perf buffer API Andrii Nakryiko
2019-06-30  6:51 ` [PATCH v4 bpf-next 4/4] tools/bpftool: switch map event_pipe to libbpf's perf_buffer Andrii Nakryiko
2019-07-01 22:04   ` Jakub Kicinski
2019-07-03  9:36 ` [PATCH v4 bpf-next 0/4] libbpf: add perf buffer abstraction and API Daniel Borkmann
2019-07-03 16:27   ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).