Handled no difference in seek times
authorAlan D. Brunelle <alan.brunelle@hp.com>
Wed, 21 May 2008 19:55:57 +0000 (15:55 -0400)
committerAlan D. Brunelle <alan.brunelle@hp.com>
Wed, 21 May 2008 19:55:57 +0000 (15:55 -0400)
For some reason recent kernels (2.6.25.4, for example) we've lost a lot
of resolution in our blktrace times. This can result in lots of things
happening "simultaneously." This change at least tries to handle the
case where all the seeks happen at once.

Probably have other issues that need to be looked into...

btt/doc/btt.tex
btt/seek.c

index 9938f6702fb3d198a656cfcbf8d6cfa3cd47a73e..87e7082fe8fcf31cdd34ac18622d8b22e5f99c0c 100644 (file)
@@ -769,7 +769,9 @@ Device:       rrqm/s   wrqm/s     r/s     w/s    rsec/s    wsec/s
 
   When there is only a single data point within a 1-second window,
   \texttt{btt} will just output the time value for the point, and the
-  value 1.0 in the second column.
+  value 1.0 in the second column. If there is no perceived difference
+  in the times present for the current sample, then the second columns
+  value is the number of seeks present at that time.
 
   Otherwise, if $\alpha$ and $\Omega$ are the first and last times
   seen within a 1-second window, and $\nu$ are the number of seeks seen
index fec57c43a07027171c893bf5cd83a63d60487e1c..69400c86e62d648441e47e3eb18932c50a1506cb 100644 (file)
@@ -18,6 +18,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */
+#include <float.h>
 #include "globals.h"
 
 static struct file_info *seek_files = NULL;
@@ -102,13 +103,13 @@ static void sps_emit(struct seeki *sip)
 {
        double tstamp, s_p_s;
        struct sps_bkt *sps = &sip->sps;
+       double delta = sps->t_last - sps->t_start;
 
-       if (sps->nseeks == 1) {
-               s_p_s = 1.0;
+       if ((sps->nseeks == 1) || (delta < DBL_EPSILON)) {
+               s_p_s = (double)(sps->nseeks);
                tstamp = sps->t_start;
        }
        else {
-               double delta = sps->t_last - sps->t_start;
 
                s_p_s = (double)(sps->nseeks) / delta;
                tstamp = sps->t_start + (delta / 2);