aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/bench/futex-lock-pi.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/bench/futex-lock-pi.c')
-rw-r--r--tools/perf/bench/futex-lock-pi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c
index 89fd8f325f38..bb25d8beb3b8 100644
--- a/tools/perf/bench/futex-lock-pi.c
+++ b/tools/perf/bench/futex-lock-pi.c
@@ -211,7 +211,8 @@ 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 / bench__runtime.tv_sec;
+ unsigned long t = bench__runtime.tv_sec > 0 ?
+ worker[i].ops / bench__runtime.tv_sec : 0;
update_stats(&throughput_stats, t);
if (!silent)