]> git.baikalelectronics.ru Git - kernel.git/commit
perf: add the necessary core perf APIs when accessing events counters in eBPF programs
authorKaixu Xia <xiakaixu@huawei.com>
Thu, 6 Aug 2015 07:02:32 +0000 (07:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Aug 2015 05:50:05 +0000 (22:50 -0700)
commit316bd914e3576c114eac64385e2de802bcf63fc9
treebaf9499372ba05151d168ecf4aff23591ab981ba
parentbef7a2d3264f42aa086c981475a68902c9bca5c6
perf: add the necessary core perf APIs when accessing events counters in eBPF programs

This patch add three core perf APIs:
 - perf_event_attrs(): export the struct perf_event_attr from struct
   perf_event;
 - perf_event_get(): get the struct perf_event from the given fd;
 - perf_event_read_local(): read the events counters active on the
   current CPU;
These APIs are needed when accessing events counters in eBPF programs.

The API perf_event_read_local() comes from Peter and I add the
corresponding SOB.

Signed-off-by: Kaixu Xia <xiakaixu@huawei.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/perf_event.h
kernel/events/core.c