skip include of kernel bpf.h in test, forward declare instead
authorBrenden Blanco <bblanco@plumgrid.com>
Mon, 2 May 2016 04:24:29 +0000 (21:24 -0700)
committerBrenden Blanco <bblanco@plumgrid.com>
Mon, 2 May 2016 04:24:29 +0000 (21:24 -0700)
tests/python/test_histogram.py

index b76ab07..27425e0 100755 (executable)
@@ -12,7 +12,7 @@ class TestHistogram(TestCase):
     def test_simple(self):
         b = BPF(text="""
 #include <uapi/linux/ptrace.h>
-#include <linux/bpf.h>
+struct bpf_map;
 BPF_HISTOGRAM(hist1);
 BPF_HASH(stub);
 int kprobe__htab_map_delete_elem(struct pt_regs *ctx, struct bpf_map *map, u64 *k) {
@@ -35,7 +35,7 @@ int kprobe__htab_map_delete_elem(struct pt_regs *ctx, struct bpf_map *map, u64 *
     def test_struct(self):
         b = BPF(text="""
 #include <uapi/linux/ptrace.h>
-#include <linux/bpf.h>
+struct bpf_map;
 typedef struct { void *map; u64 slot; } Key;
 BPF_HISTOGRAM(hist1, Key, 1024);
 BPF_HASH(stub1);