perf test bpf: Use epoll_wait() instead of epoll_pwait()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Jul 2016 02:22:30 +0000 (23:22 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Jul 2016 18:20:33 +0000 (15:20 -0300)
The prototype for epoll_wait() is available in older distros, so use it
instead of epoll_pwait() (removing the last NULL arg, the sigmask,
makes it the same thing anyway) to avoid breaking the build.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-pwiwizloxt0jujy8em80qut3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/bpf-script-example.c
tools/perf/tests/bpf.c

index 0ec9c2c031649377a2523deda904ea1a7c9284c0..e53bc91fa2604f8653bdfed80ff1d43e85849ffb 100644 (file)
@@ -31,8 +31,8 @@ struct bpf_map_def SEC("maps") flip_table = {
        .max_entries = 1,
 };
 
-SEC("func=sys_epoll_pwait")
-int bpf_func__sys_epoll_pwait(void *ctx)
+SEC("func=sys_epoll_wait")
+int bpf_func__sys_epoll_wait(void *ctx)
 {
        int ind =0;
        int *flag = bpf_map_lookup_elem(&flip_table, &ind);
index da0d876139752dc79c7d7617eb4dfda75dc1dc86..fc54064b91860edf0b1d173f1c05eee2bac4762c 100644 (file)
 
 #ifdef HAVE_LIBBPF_SUPPORT
 
-static int epoll_pwait_loop(void)
+static int epoll_wait_loop(void)
 {
        int i;
 
        /* Should fail NR_ITERS times */
        for (i = 0; i < NR_ITERS; i++)
-               epoll_pwait(-(i + 1), NULL, 0, 0, NULL);
+               epoll_wait(-(i + 1), NULL, 0, 0);
        return 0;
 }
 
@@ -61,7 +61,7 @@ static struct {
                "[basic_bpf_test]",
                "fix 'perf test LLVM' first",
                "load bpf object failed",
-               &epoll_pwait_loop,
+               &epoll_wait_loop,
                (NR_ITERS + 1) / 2,
        },
 #ifdef HAVE_BPF_PROLOGUE