aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/bench/futex-wake.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/bench/futex-wake.c')
-rw-r--r--tools/perf/bench/futex-wake.c12
1 files changed, 2 insertions, 10 deletions
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