summaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-05-25 15:31:07 -0700
committerPaul E. McKenney <paulmck@kernel.org>2020-06-29 12:00:44 -0700
commit83b88c86da0e5f97faeac5a9bb19fe32f8c0394b (patch)
tree33dfaac65cd4e24ca3f9a112f990df4a5bf325fb /kernel/rcu
parent75dd8efef56ed5959c398974c785026f84aa0d1a (diff)
downloadlinux-83b88c86da0e5f97faeac5a9bb19fe32f8c0394b.tar.bz2
refperf: Allow decimal nanoseconds
The CONFIG_PREEMPT=n rcu_read_lock()/rcu_read_unlock() pair's overhead, even including loop overhead, is far less than one nanosecond. Since logscale plots are not all that happy with zero values, provide picoseconds as decimals. Cc: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/refperf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rcu/refperf.c b/kernel/rcu/refperf.c
index 57c7b7a40bd2..e991d4820f51 100644
--- a/kernel/rcu/refperf.c
+++ b/kernel/rcu/refperf.c
@@ -375,7 +375,7 @@ static int main_func(void *arg)
if (torture_must_stop())
goto end;
- reader_tasks[exp].result_avg = process_durations(exp) / ((exp + 1) * loops);
+ reader_tasks[exp].result_avg = 1000 * process_durations(exp) / ((exp + 1) * loops);
}
// Print the average of all experiments
@@ -386,7 +386,7 @@ static int main_func(void *arg)
strcat(buf, "Threads\tTime(ns)\n");
for (exp = 0; exp < nreaders; exp++) {
- sprintf(buf1, "%d\t%llu\n", exp + 1, reader_tasks[exp].result_avg);
+ sprintf(buf1, "%d\t%llu.%03d\n", exp + 1, reader_tasks[exp].result_avg / 1000, (int)(reader_tasks[exp].result_avg % 1000));
strcat(buf, buf1);
}