Skip to content

Commit 83b88c8

Browse files
committed
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) <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 75dd8ef commit 83b88c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/rcu/refperf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static int main_func(void *arg)
375375
if (torture_must_stop())
376376
goto end;
377377

378-
reader_tasks[exp].result_avg = process_durations(exp) / ((exp + 1) * loops);
378+
reader_tasks[exp].result_avg = 1000 * process_durations(exp) / ((exp + 1) * loops);
379379
}
380380

381381
// Print the average of all experiments
@@ -386,7 +386,7 @@ static int main_func(void *arg)
386386
strcat(buf, "Threads\tTime(ns)\n");
387387

388388
for (exp = 0; exp < nreaders; exp++) {
389-
sprintf(buf1, "%d\t%llu\n", exp + 1, reader_tasks[exp].result_avg);
389+
sprintf(buf1, "%d\t%llu.%03d\n", exp + 1, reader_tasks[exp].result_avg / 1000, (int)(reader_tasks[exp].result_avg % 1000));
390390
strcat(buf, buf1);
391391
}
392392

0 commit comments

Comments
 (0)