gettime: drop tv_valid->last_cycles and tv_valid->last_tv_valid
authorVincent Fu <vincent.fu@sandisk.com>
Tue, 20 Jun 2017 16:12:56 +0000 (12:12 -0400)
committerVincent Fu <vincent.fu@sandisk.com>
Wed, 21 Jun 2017 15:55:15 +0000 (11:55 -0400)
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

index 093b6a499df0e1549ae65b158ae578814e974778..6a50ec548d0091d0f489fb45c6310254539ed7f2 100644 (file)
--- 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;