Skip to content

perf, bpf: add support for bpf in sw/hw perf_events

Alexei Starovoitov lkml netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 2 repliesIn review
  2. v26 patches 6 repliesSuperseded
  3. v16 patches 9 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6bpf: support 8-byte metafield accesskernel/bpf/verifier.c+6 -30 replies
2/6bpf: introduce BPF_PROG_TYPE_PERF_EVENT program typeinclude/linux/perf_event.h include/uapi/linux/Kbuild include/uapi/linux/bpf.h +2 more+86 -00 replies
3/6bpf: perf_event progs should only use preallocated mapskernel/bpf/verifier.c+21 -10 replies
4/6perf, bpf: add perf events core support for BPF_PROG_TYPE_PERF_EVENT programsinclude/linux/bpf.h include/linux/perf_event.h kernel/events/core.c+96 -10 replies
5/6samples/bpf: add perf_event+bpf examplesamples/bpf/Makefile samples/bpf/bpf_helpers.h samples/bpf/bpf_load.c +2 more+290 -10 replies
6/6samples/bpf: add sampleip examplesamples/bpf/Makefile samples/bpf/sampleip_kern.c samples/bpf/sampleip_user.c+238 -00 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDaniel BorkmannPeter Zijlstra (Intel)
SeriesA-b
1/6A-b
2/6A-b
3/6A-b
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 net-next 0/6] perf, bpf: add support for bpf in sw/hw perf_events

Hi Peter, Dave,

this patch set is a follow up to the discussion:
https://lkml.kernel.org/r/20160804142853.GO6862%20()%20twins%20!%20programming%20!%20kicks-ass%20!%20net
It turned out to be simpler than what we discussed.

Patches 1-3 is bpf-side prep for the main patch 4
that adds bpf program as an overflow_handler to sw and hw perf_events.

Patches 5 and 6 are examples from myself and Brendan.

Peter,
to implement your suggestion to add ifdef CONFIG_BPF_SYSCALL inside struct perf_event, I had to shuffle ifdefs in events/core.c Please double check whether that is what you wanted to see.

v2->v3: fixed few more minor issues
v1->v2: fixed issues spotted by Peter and Daniel.

Thanks!

Alexei Starovoitov (5):
bpf: support 8-byte metafield access
bpf: introduce BPF_PROG_TYPE_PERF_EVENT program type
bpf: perf_event progs should only use preallocated maps perf, bpf: add perf events core support for BPF_PROG_TYPE_PERF_EVENT
programs
samples/bpf: add perf_event+bpf example

Brendan Gregg (1):
samples/bpf: add sampleip example

 include/linux/bpf.h                 |   4 +
 include/linux/perf_event.h          |   9 ++
 include/uapi/linux/Kbuild           |   1 +
 include/uapi/linux/bpf.h            |   1 +
 include/uapi/linux/bpf_perf_event.h |  18 +++
 kernel/bpf/verifier.c               |  31 +++++-
 kernel/events/core.c                |  89 ++++++++++++++-
 kernel/trace/bpf_trace.c            |  61 +++++++++++
 samples/bpf/Makefile                |   8 ++
 samples/bpf/bpf_helpers.h           |   2 +
 samples/bpf/bpf_load.c              |   7 +-
 samples/bpf/sampleip_kern.c         |  38 +++++++
 samples/bpf/sampleip_user.c         | 196 +++++++++++++++++++++++++++++++++
 samples/bpf/trace_event_kern.c      |  65 +++++++++++
 samples/bpf/trace_event_user.c      | 213 ++++++++++++++++++++++++++++++++++++
 15 files changed, 737 insertions(+), 6 deletions(-)
 create mode 100644 include/uapi/linux/bpf_perf_event.h
 create mode 100644 samples/bpf/sampleip_kern.c
 create mode 100644 samples/bpf/sampleip_user.c
 create mode 100644 samples/bpf/trace_event_kern.c
 create mode 100644 samples/bpf/trace_event_user.c
Signature · 1 line
2.8.0