gettime: include min/max cycle counts for CPU clock

Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/gettime.c b/gettime.c
index 5ceb809..72968c5 100644
--- a/gettime.c
+++ b/gettime.c
@@ -254,7 +254,7 @@
 static int calibrate_cpu_clock(void)
 {
 	double delta, mean, S;
-	uint64_t avg, cycles[NR_TIME_ITERS];
+	uint64_t minc, maxc, avg, cycles[NR_TIME_ITERS];
 	int i, samples;
 
 	cycles[0] = get_cycles_per_usec();
@@ -277,10 +277,14 @@
 
 	S = sqrt(S / (NR_TIME_ITERS - 1.0));
 
-	samples = avg = 0;
+	minc = -1ULL;
+	maxc = samples = avg = 0;
 	for (i = 0; i < NR_TIME_ITERS; i++) {
 		double this = cycles[i];
 
+		minc = min(cycles[i], minc);
+		maxc = max(cycles[i], maxc);
+
 		if ((fmax(this, mean) - fmin(this, mean)) > S)
 			continue;
 		samples++;
@@ -296,8 +300,12 @@
 
 	avg /= samples;
 	avg = (avg + 5) / 10;
+	minc /= 10;
+	maxc /= 10;
 	dprint(FD_TIME, "avg: %llu\n", (unsigned long long) avg);
-	dprint(FD_TIME, "mean=%f, S=%f\n", mean, S);
+	dprint(FD_TIME, "min=%llu, max=%llu, mean=%f, S=%f\n",
+			(unsigned long long) minc,
+			(unsigned long long) maxc, mean, S);
 
 	cycles_per_usec = avg;
 	inv_cycles_per_usec = 16777216UL / cycles_per_usec;