Linux btrace development
 help / color / mirror / Atom feed
From: "Alan D. Brunelle" <alan.brunelle@hp.com>
To: linux-btrace@vger.kernel.org
Subject: [BTT PATCH] Add back in combined seek output file
Date: Tue, 10 Apr 2007 16:59:28 +0000	[thread overview]
Message-ID: <461BC38D.5040405@hp.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: seek_c --]
[-- Type: text/plain, Size: 1211 bytes --]

From: Alan D. Brunelle <Alan.Brunelle@hp.com>

Add in combined seek output

Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com>
---

 btt/seek.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/btt/seek.c b/btt/seek.c
index e23f6bb..fb62714 100644
--- a/btt/seek.c
+++ b/btt/seek.c
@@ -29,7 +29,7 @@ struct seek_bkt {
 };
 
 struct seeki {
-	FILE *rfp, *wfp;
+	FILE *rfp, *wfp, *cfp;
 	struct rb_root root;
 	long long tot_seeks;
 	double total_sectors;
@@ -125,6 +125,7 @@ void *seeki_init(__u32 device)
 
 	sip->rfp = seek_open(device, 'r');
 	sip->wfp = seek_open(device, 'w');
+	sip->cfp = seek_open(device, 'c');
 	sip->tot_seeks = 0;
 	sip->total_sectors = 0.0;
 	sip->last_start = sip->last_end = 0;
@@ -149,9 +150,12 @@ void seeki_add(void *handle, struct io *iop)
 	struct seeki *sip = handle;
 	long long dist = seek_dist(sip, iop);
 	FILE *fp = IOP_READ(iop) ? sip->rfp : sip->wfp;
+	double tstamp = BIT_TIME(iop->t.time);
 
 	if (fp)
-		fprintf(fp, "%15.9lf %13lld\n", BIT_TIME(iop->t.time), dist);
+		fprintf(fp, "%15.9lf %13lld\n", tstamp, dist);
+	if (sip->cfp)
+		fprintf(sip->cfp, "%15.9lf %13lld\n", tstamp, dist);
 
 	dist = llabs(dist);
 	sip->tot_seeks++;

             reply	other threads:[~2007-04-10 16:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-10 16:59 Alan D. Brunelle [this message]
2007-04-10 17:15 ` [BTT PATCH] Add back in combined seek output file Ming Zhang
2007-04-10 17:18 ` Alan D. Brunelle
2007-04-10 17:26 ` Ming Zhang

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=461BC38D.5040405@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