aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/bench/futex-requeue.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-06-25 01:42:24 -0400
committerIngo Molnar <mingo@kernel.org>2014-06-25 01:42:24 -0400
commit06c654ca8b824e04f59f3f99d403494a140c181f (patch)
tree75c82621d95feab7b7e01e31e85bd7a95f7f28dc /tools/perf/bench/futex-requeue.c
parent98d350cf7ae077eb8083ccc7c1bfc838344ac590 (diff)
parentecdac96899e3db3f428e4d2e978f25e3f8d35a6c (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible changes: * Add --repeat global option to 'perf bench' to be used in benchmarks such as the existing 'futex' one, that was modified to use it instead of a local option. (Davidlohr Bueso) * Fix fd -> pathname resolution in 'trace', be it using /proc or a vfs_getname probe point. (Arnaldo Carvalho de Melo) * Add suggestion of how to set perf_event_paranoid sysctl, to help non-root users trying tools like 'trace' to get a working environment. (Arnaldo Carvalho de Melo) Fixes: * Fix memory leak in the 'sched-messaging' perf bench test. (Davidlohr Bueso) * The -o and -n 'perf bench mem' options are mutually exclusive, emit error when both are specified. (Davidlohr Bueso) * Fix scrollbar refresh row index in the ui browser, problem exposed now that headers will be added and will be allowed to be switched on/off. (Jiri Olsa) Cleanups: * Remove needless reassignments in 'trace' (Arnaldo Carvalho de Melo) * Cache the is_exit syscall test in 'trace) (Arnaldo Carvalho de Melo) * No need to reimplement err() in 'perf bench sched-messaging', drop barf(). (Davidlohr Bueso). * Remove ev_name argument from perf_evsel__hists_browse, can be obtained from the other parameters. (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/bench/futex-requeue.c')
-rw-r--r--tools/perf/bench/futex-requeue.c10
1 files changed, 1 insertions, 9 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