diff options
author | Davidlohr Bueso <davidlohr@hp.com> | 2014-06-16 14:14:23 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-06-19 15:13:16 -0400 |
commit | d9de84afd1f3a464135abe2b26e66aa86be5af8d (patch) | |
tree | 6893d5c8b1f7998242f0b73d9b6ec47a4af01327 /tools | |
parent | b6f0629a94f7ed6089560be7f0561be19f934fc4 (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.c | 10 | ||||
-rw-r--r-- | tools/perf/bench/futex-wake.c | 12 |
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 | */ |
30 | static unsigned int nrequeue = 1; | 30 | static 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 | */ | ||
37 | static unsigned int repeat = 10; | ||
38 | |||
39 | static pthread_t *worker; | 32 | static pthread_t *worker; |
40 | static bool done = 0, silent = 0; | 33 | static bool done = 0, silent = 0; |
41 | static pthread_mutex_t thread_lock; | 34 | static pthread_mutex_t thread_lock; |
@@ -46,7 +39,6 @@ static unsigned int ncpus, threads_starting, nthreads = 0; | |||
46 | static const struct option options[] = { | 39 | static 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 | */ |
31 | static unsigned int nwakes = 1; | 31 | static 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 | */ | ||
38 | static unsigned int repeat = 10; | ||
39 | |||
40 | pthread_t *worker; | 33 | pthread_t *worker; |
41 | static bool done = 0, silent = 0; | 34 | static bool done = false, silent = false; |
42 | static pthread_mutex_t thread_lock; | 35 | static pthread_mutex_t thread_lock; |
43 | static pthread_cond_t thread_parent, thread_worker; | 36 | static pthread_cond_t thread_parent, thread_worker; |
44 | static struct stats waketime_stats, wakeup_stats; | 37 | static struct stats waketime_stats, wakeup_stats; |
@@ -47,7 +40,6 @@ static unsigned int ncpus, threads_starting, nthreads = 0; | |||
47 | static const struct option options[] = { | 40 | static 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 | ||