diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-08-18 16:25:59 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-09-25 15:46:55 -0400 |
commit | f66a889dbc96dd342c87232d74f0956076707746 (patch) | |
tree | e56930da92ec4753c15c2d572d4c87db935d2d41 /tools/perf/tests | |
parent | 0a04c9e0b2181aff8348b5e80d9d96ec8df1ffb3 (diff) |
perf evlist: Introduce poll method for common code idiom
Since we have access two evlist members in all these poll calls, provide
a helper.
This will also help to make the patch introducing the pollfd class more
clear, as the evlist specific uses will be hiden away
perf_evlist__poll().
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-jr9d4aop4lvy9453qahbcgp0@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r-- | tools/perf/tests/open-syscall-tp-fields.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/perf-record.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/task-exit.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/tests/open-syscall-tp-fields.c b/tools/perf/tests/open-syscall-tp-fields.c index 922bdb627950..127dcae0b760 100644 --- a/tools/perf/tests/open-syscall-tp-fields.c +++ b/tools/perf/tests/open-syscall-tp-fields.c | |||
@@ -105,7 +105,7 @@ int test__syscall_open_tp_fields(void) | |||
105 | } | 105 | } |
106 | 106 | ||
107 | if (nr_events == before) | 107 | if (nr_events == before) |
108 | poll(evlist->pollfd, evlist->nr_fds, 10); | 108 | perf_evlist__poll(evlist, 10); |
109 | 109 | ||
110 | if (++nr_polls > 5) { | 110 | if (++nr_polls > 5) { |
111 | pr_debug("%s: no events!\n", __func__); | 111 | pr_debug("%s: no events!\n", __func__); |
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c index 2ce753c1db63..7a228a2a070b 100644 --- a/tools/perf/tests/perf-record.c +++ b/tools/perf/tests/perf-record.c | |||
@@ -268,7 +268,7 @@ int test__PERF_RECORD(void) | |||
268 | * perf_event_attr.wakeup_events, just PERF_EVENT_SAMPLE does. | 268 | * perf_event_attr.wakeup_events, just PERF_EVENT_SAMPLE does. |
269 | */ | 269 | */ |
270 | if (total_events == before && false) | 270 | if (total_events == before && false) |
271 | poll(evlist->pollfd, evlist->nr_fds, -1); | 271 | perf_evlist__poll(evlist, -1); |
272 | 272 | ||
273 | sleep(1); | 273 | sleep(1); |
274 | if (++wakeups > 5) { | 274 | if (++wakeups > 5) { |
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index 87522f01c7ad..3a8fedef83bc 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c | |||
@@ -105,7 +105,7 @@ retry: | |||
105 | } | 105 | } |
106 | 106 | ||
107 | if (!exited || !nr_exit) { | 107 | if (!exited || !nr_exit) { |
108 | poll(evlist->pollfd, evlist->nr_fds, -1); | 108 | perf_evlist__poll(evlist, -1); |
109 | goto retry; | 109 | goto retry; |
110 | } | 110 | } |
111 | 111 | ||