aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavidlohr Bueso <davidlohr@hp.com>2014-06-16 14:14:23 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-06-19 15:13:16 -0400
commitd9de84afd1f3a464135abe2b26e66aa86be5af8d (patch)
tree6893d5c8b1f7998242f0b73d9b6ec47a4af01327 /tools
parentb6f0629a94f7ed6089560be7f0561be19f934fc4 (diff)
perf bench futex: Use global --repeat option
This option is available through perf-bench, use it instead and free the local option. Signed-off-by: Davidlohr Bueso <davidlohr@hp.com> Cc: Aswin Chandramouleeswaran <aswin@hp.com> Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> Cc: Jiri Olsa <jolsa@kernel.org> Link: http://lkml.kernel.org/r/1402942467-10671-6-git-send-email-davidlohr@hp.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/bench/futex-requeue.c10
-rw-r--r--tools/perf/bench/futex-wake.c12
2 files changed, 3 insertions, 19 deletions
diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c
index a16255876f1d..732403bfd31a 100644
--- a/tools/perf/bench/futex-requeue.c
+++ b/tools/perf/bench/futex-requeue.c
@@ -29,13 +29,6 @@ static u_int32_t futex1 = 0, futex2 = 0;
29 */ 29 */
30static unsigned int nrequeue = 1; 30static unsigned int nrequeue = 1;
31 31
32/*
33 * There can be significant variance from run to run,
34 * the more repeats, the more exact the overall avg and
35 * the better idea of the futex latency.
36 */
37static unsigned int repeat = 10;
38
39static pthread_t *worker; 32static pthread_t *worker;
40static bool done = 0, silent = 0; 33static bool done = 0, silent = 0;
41static pthread_mutex_t thread_lock; 34static pthread_mutex_t thread_lock;
@@ -46,7 +39,6 @@ static unsigned int ncpus, threads_starting, nthreads = 0;
46static const struct option options[] = { 39static const struct option options[] = {
47 OPT_UINTEGER('t', "threads", &nthreads, "Specify amount of threads"), 40 OPT_UINTEGER('t', "threads", &nthreads, "Specify amount of threads"),
48 OPT_UINTEGER('q', "nrequeue", &nrequeue, "Specify amount of threads to requeue at once"), 41 OPT_UINTEGER('q', "nrequeue", &nrequeue, "Specify amount of threads to requeue at once"),
49 OPT_UINTEGER('r', "repeat", &repeat, "Specify amount of times to repeat the run"),
50 OPT_BOOLEAN( 's', "silent", &silent, "Silent mode: do not display data/details"), 42 OPT_BOOLEAN( 's', "silent", &silent, "Silent mode: do not display data/details"),
51 OPT_END() 43 OPT_END()
52}; 44};
@@ -146,7 +138,7 @@ int bench_futex_requeue(int argc, const char **argv,
146 pthread_cond_init(&thread_parent, NULL); 138 pthread_cond_init(&thread_parent, NULL);
147 pthread_cond_init(&thread_worker, NULL); 139 pthread_cond_init(&thread_worker, NULL);
148 140
149 for (j = 0; j < repeat && !done; j++) { 141 for (j = 0; j < bench_repeat && !done; j++) {
150 unsigned int nrequeued = 0; 142 unsigned int nrequeued = 0;
151 struct timeval start, end, runtime; 143 struct timeval start, end, runtime;
152 144
diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c
index d096169b161e..50022cbce87e 100644
--- a/tools/perf/bench/futex-wake.c
+++ b/tools/perf/bench/futex-wake.c
@@ -30,15 +30,8 @@ static u_int32_t futex1 = 0;
30 */ 30 */
31static unsigned int nwakes = 1; 31static unsigned int nwakes = 1;
32 32
33/*
34 * There can be significant variance from run to run,
35 * the more repeats, the more exact the overall avg and
36 * the better idea of the futex latency.
37 */
38static unsigned int repeat = 10;
39
40pthread_t *worker; 33pthread_t *worker;
41static bool done = 0, silent = 0; 34static bool done = false, silent = false;
42static pthread_mutex_t thread_lock; 35static pthread_mutex_t thread_lock;
43static pthread_cond_t thread_parent, thread_worker; 36static pthread_cond_t thread_parent, thread_worker;
44static struct stats waketime_stats, wakeup_stats; 37static struct stats waketime_stats, wakeup_stats;
@@ -47,7 +40,6 @@ static unsigned int ncpus, threads_starting, nthreads = 0;
47static const struct option options[] = { 40static const struct option options[] = {
48 OPT_UINTEGER('t', "threads", &nthreads, "Specify amount of threads"), 41 OPT_UINTEGER('t', "threads", &nthreads, "Specify amount of threads"),
49 OPT_UINTEGER('w', "nwakes", &nwakes, "Specify amount of threads to wake at once"), 42 OPT_UINTEGER('w', "nwakes", &nwakes, "Specify amount of threads to wake at once"),
50 OPT_UINTEGER('r', "repeat", &repeat, "Specify amount of times to repeat the run"),
51 OPT_BOOLEAN( 's', "silent", &silent, "Silent mode: do not display data/details"), 43 OPT_BOOLEAN( 's', "silent", &silent, "Silent mode: do not display data/details"),
52 OPT_END() 44 OPT_END()
53}; 45};
@@ -149,7 +141,7 @@ int bench_futex_wake(int argc, const char **argv,
149 pthread_cond_init(&thread_parent, NULL); 141 pthread_cond_init(&thread_parent, NULL);
150 pthread_cond_init(&thread_worker, NULL); 142 pthread_cond_init(&thread_worker, NULL);
151 143
152 for (j = 0; j < repeat && !done; j++) { 144 for (j = 0; j < bench_repeat && !done; j++) {
153 unsigned int nwoken = 0; 145 unsigned int nwoken = 0;
154 struct timeval start, end, runtime; 146 struct timeval start, end, runtime;
155 147