]> git.baikalelectronics.ru Git - kernel.git/commit
perf, bpf: Add BPF support to all perf_event types
authorAlexei Starovoitov <ast@fb.com>
Sat, 3 Jun 2017 04:03:52 +0000 (21:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2017 01:58:01 +0000 (21:58 -0400)
commitd261066386d346b0ee64e6e358815e284fd6866d
treee7a3eec8f6794fda623941afb426db5c1f8472b0
parent1bb0753178cfae1fe8312c8cffd2051b4dad6052
perf, bpf: Add BPF support to all perf_event types

Allow BPF_PROG_TYPE_PERF_EVENT program types to attach to all
perf_event types, including HW_CACHE, RAW, and dynamic pmu events.
Only tracepoint/kprobe events are treated differently which require
BPF_PROG_TYPE_TRACEPOINT/BPF_PROG_TYPE_KPROBE program types accordingly.

Also add support for reading all event counters using
bpf_perf_event_read() helper.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/perf_event.h
kernel/bpf/arraymap.c
kernel/events/core.c
kernel/trace/bpf_trace.c