Skip to content

Commit

Permalink
perf test bpf: Use epoll_wait() instead of epoll_pwait()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnaldo Carvalho de Melo committed Jul 12, 2016
1 parent 12f0203 commit 4ffde49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tools/perf/tests/bpf-script-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions tools/perf/tests/bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

#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;
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4ffde49

Please sign in to comment.