Skip to contentSkip to conversation

Add back in combined seek output file

PATCH In review Alan D. Brunelle 2 participants 4 messages Apr 10, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add back in combined seek output file

From: Alan D. Brunelle <[email protected]>

Add in combined seek output

---

 btt/seek.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
btt/seek.c +6 -2
index e23f6bb..fb62714 100644
@@ -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++;
#1 lore raw

btt/seek.c void seeki_add(void *handle, struct io *iop) · line 160

Quoted 13 lines · Alan D. Brunelle
btt/seek.c +4 -1
@@ -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);
 

thx for adding this. it might be better if in combined file, print out current io is read or write.

Ming

#2 lore raw
In reply to Alan D. Brunelle
Quoted 20 lines · Ming Zhang
Quoted 4 lines · Alan D. Brunelle
btt/seek.c +0 -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;

btt/seek.c void seeki_add(void *handle, struct io *iop) · line 161

Quoted 10 lines
btt/seek.c +4 -1
+       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);
 
 

thx for adding this. it might be better if in combined file, print out current io is read or write.

Quoted 3 lines

Ming

I could do this - very easily - but then the question is the format:

- ASCII ("read" "write")
- Binary (0 = write, 1 = read (or vice versa))

It doesn't matter much to me...

Alan

#3 lore raw
In reply to Alan D. Brunelle
Quoted 24 lines · Alan D. Brunelle
Quoted 20 lines · Ming Zhang
Quoted 4 lines · Alan D. Brunelle
btt/seek.c +0 -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;

btt/seek.c void seeki_add(void *handle, struct io *iop) · line 161

Quoted 10 lines
btt/seek.c +4 -1
+       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);
 
 

thx for adding this. it might be better if in combined file, print out current io is read or write.

Quoted 3 lines

Ming

Quoted 6 lines

I could do this - very easily - but then the question is the format:

- ASCII ("read" "write")
- Binary (0 = write, 1 = read (or vice versa))

It doesn't matter much to me...

r/w. easier for grep.

Quoted 6 lines

Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-btrace" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html