From: "Alan D. Brunelle" <Alan.Brunelle@hp.com>
To: linux-btrace@vger.kernel.org
Subject: [PATCH] Handled no difference in seek times
Date: Wed, 21 May 2008 20:01:32 +0000 [thread overview]
Message-ID: <48347F9C.1080509@hp.com> (raw)
For some reason recent kernels (2.6.25.4, for example) have 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...
[[Jens: I've pushed this, so you don't need to apply this, but I'm
wondering have others seen this? I'm seeing 0.01 - which I think means
we're gated by HZ (set to 100 on this .config, I'm trying w/ HZ\x1000 to
check this theory). A /lot/ happens in 1/100th of a second on modern
computers! :-) ]]
Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
---
btt/doc/btt.tex | 4 +++-
btt/seek.c | 7 ++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/btt/doc/btt.tex b/btt/doc/btt.tex
index 9938f67..87e7082 100644
--- a/btt/doc/btt.tex
+++ b/btt/doc/btt.tex
@@ -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
diff --git a/btt/seek.c b/btt/seek.c
index fec57c4..69400c8 100644
--- a/btt/seek.c
+++ b/btt/seek.c
@@ -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);
--
1.5.4.3
next reply other threads:[~2008-05-21 20:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-21 20:01 Alan D. Brunelle [this message]
2008-05-22 2:14 ` [PATCH] Handled no difference in seek times M. Edward (Ed) Borasky
2008-05-22 14:47 ` Alan D. Brunelle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48347F9C.1080509@hp.com \
--to=alan.brunelle@hp.com \
--cc=linux-btrace@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).