From ca5cc357c4db711e316c182158736813a6836b81 Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Tue, 20 Jun 2017 12:12:56 -0400 Subject: [PATCH] gettime: drop tv_valid->last_cycles and tv_valid->last_tv_valid The two variables were set on every call to fio_gettime that uses the CPU clock. However, these values were never read anywhere. So we should drop them to reduce the amount of work done in the fast path. --- gettime.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gettime.c b/gettime.c index 093b6a49..6a50ec54 100644 --- a/gettime.c +++ b/gettime.c @@ -31,8 +31,6 @@ static unsigned int cycles_wrap; int tsc_reliable = 0; struct tv_valid { - uint64_t last_cycles; - int last_tv_valid; int warned; }; #ifdef ARCH_HAVE_CPU_CLOCK @@ -198,9 +196,6 @@ static void __fio_gettime(struct timespec *tp) nsecs = multiples * nsecs_for_max_cycles; nsecs += ((t & max_cycles_mask) * clock_mult) >> clock_shift; #endif - tv->last_cycles = t; - tv->last_tv_valid = 1; - tp->tv_sec = nsecs / 1000000000ULL; tp->tv_nsec = nsecs % 1000000000ULL; break; -- 2.25.1