diff options
| author | Arnaldo Carvalho de Melo <[email protected]> | 2020-03-04 13:29:19 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2020-03-04 13:29:19 +0000 |
| commit | d46eec8e975a8180e178e01ba505801c44bc9a6c (patch) | |
| tree | bff067e554fc03c576e107297085d30c8e381370 /tools/perf/bench/futex-lock-pi.c | |
| parent | perf/x86: Add Intel Tiger Lake uncore support (diff) | |
| parent | perf diff: Fix undefined string comparison spotted by clang's -Wstring-compare (diff) | |
| download | kernel-d46eec8e975a8180e178e01ba505801c44bc9a6c.tar.gz kernel-d46eec8e975a8180e178e01ba505801c44bc9a6c.zip | |
Merge remote-tracking branch 'acme/perf/urgent' into perf/core
To pick up fixes.
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/bench/futex-lock-pi.c')
| -rw-r--r-- | tools/perf/bench/futex-lock-pi.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c index d0cae8125423..30d97121dc4f 100644 --- a/tools/perf/bench/futex-lock-pi.c +++ b/tools/perf/bench/futex-lock-pi.c @@ -37,7 +37,6 @@ static bool silent = false, multi = false; static bool done = false, fshared = false; static unsigned int nthreads = 0; static int futex_flag = 0; -struct timeval start, end, runtime; static pthread_mutex_t thread_lock; static unsigned int threads_starting; static struct stats throughput_stats; @@ -64,7 +63,7 @@ static void print_summary(void) printf("%sAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n", !silent ? "\n" : "", avg, rel_stddev_stats(stddev, avg), - (int) runtime.tv_sec); + (int)bench__runtime.tv_sec); } static void toggle_done(int sig __maybe_unused, @@ -73,8 +72,8 @@ static void toggle_done(int sig __maybe_unused, { /* inform all threads that we're done for the day */ done = true; - gettimeofday(&end, NULL); - timersub(&end, &start, &runtime); + gettimeofday(&bench__end, NULL); + timersub(&bench__end, &bench__start, &bench__runtime); } static void *workerfn(void *arg) @@ -185,7 +184,7 @@ int bench_futex_lock_pi(int argc, const char **argv) threads_starting = nthreads; pthread_attr_init(&thread_attr); - gettimeofday(&start, NULL); + gettimeofday(&bench__start, NULL); create_threads(worker, thread_attr, cpu); pthread_attr_destroy(&thread_attr); @@ -211,7 +210,7 @@ int bench_futex_lock_pi(int argc, const char **argv) pthread_mutex_destroy(&thread_lock); for (i = 0; i < nthreads; i++) { - unsigned long t = worker[i].ops/runtime.tv_sec; + unsigned long t = worker[i].ops / bench__runtime.tv_sec; update_stats(&throughput_stats, t); if (!silent) |
