]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ebpf: include perf_event only where really needed
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 2 Oct 2015 16:42:00 +0000 (18:42 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Oct 2015 14:04:08 +0000 (07:04 -0700)
Commit ea317b267e9d ("bpf: Add new bpf map type to store the pointer
to struct perf_event") added perf_event.h to the main eBPF header, so
it gets included for all users. perf_event.h is actually only needed
from array map side, so lets sanitize this a bit.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Kaixu Xia <xiakaixu@huawei.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/bpf.h
kernel/bpf/arraymap.c

index f57d7fed9ec3f4554609a02538f44c5f950612b6..c915a6b54570cddd07aad894230a53f89cc39eae 100644 (file)
@@ -10,7 +10,6 @@
 #include <uapi/linux/bpf.h>
 #include <linux/workqueue.h>
 #include <linux/file.h>
-#include <linux/perf_event.h>
 
 struct bpf_map;
 
index 29ace107f2365c05b97f8f8aba54defeb59a6a78..2fecc4aed119fffa896a667fa2e295aeb370d874 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/filter.h>
+#include <linux/perf_event.h>
 
 /* Called from syscall */
 static struct bpf_map *array_map_alloc(union bpf_attr *attr)