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...
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
* 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;
{
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);