lkml.org 
[lkml]   [2020]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH tip/core/rcu 07/30] refperf: Allow decimal nanoseconds
Date
From: "Paul E. McKenney" <paulmck@kernel.org>

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>
---
kernel/rcu/refperf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/refperf.c b/kernel/rcu/refperf.c
index 57c7b7a..e991d48 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);
}

--
2.9.5
\
 
 \ /
  Last update: 2020-06-23 02:33    [W:0.140 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site