Re: [PATCH v5 2/4] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-07-31 Thread Alexei Starovoitov
On 7/31/15 4:59 AM, Kaixu Xia wrote: + /* +* prevent some crazy events so we can make our life easier +*/ + if (event->attr.type != PERF_TYPE_RAW && + event->attr.type != PERF_TYPE_HARDWARE) { + perf_event_release_kernel(event); +

[PATCH v5 2/4] bpf: Add new bpf map type to store the pointer to struct perf_event

2015-07-31 Thread Kaixu Xia
Introduce a new bpf map type 'BPF_MAP_TYPE_PERF_EVENT_ARRAY'. This map only stores the pointer to struct perf_event. The user space event FDs from perf_event_open() syscall are converted to the pointer to struct perf_event and stored in map. Signed-off-by: Kaixu Xia --- include/linux/bpf.h