All of lore.kernel.org
 help / color / mirror / Atom feed
* [BTT PATCH] Add back in combined seek output file
@ 2007-04-10 16:59 Alan D. Brunelle
  2007-04-10 17:15 ` Ming Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alan D. Brunelle @ 2007-04-10 16:59 UTC (permalink / raw)
  To: linux-btrace

[-- 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++;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [BTT PATCH] Add back in combined seek output file
  2007-04-10 16:59 [BTT PATCH] Add back in combined seek output file Alan D. Brunelle
@ 2007-04-10 17:15 ` Ming Zhang
  2007-04-10 17:18 ` Alan D. Brunelle
  2007-04-10 17:26 ` Ming Zhang
  2 siblings, 0 replies; 4+ messages in thread
From: Ming Zhang @ 2007-04-10 17:15 UTC (permalink / raw)
  To: linux-btrace

On Tue, 2007-04-10 at 13:04 -0400, Alan D. Brunelle wrote:
> @@ -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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BTT PATCH] Add back in combined seek output file
  2007-04-10 16:59 [BTT PATCH] Add back in combined seek output file Alan D. Brunelle
  2007-04-10 17:15 ` Ming Zhang
@ 2007-04-10 17:18 ` Alan D. Brunelle
  2007-04-10 17:26 ` Ming Zhang
  2 siblings, 0 replies; 4+ messages in thread
From: Alan D. Brunelle @ 2007-04-10 17:18 UTC (permalink / raw)
  To: linux-btrace

Ming Zhang wrote:
> On Tue, 2007-04-10 at 13:04 -0400, Alan D. Brunelle wrote:
>   
>> @@ -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
>
>   
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BTT PATCH] Add back in combined seek output file
  2007-04-10 16:59 [BTT PATCH] Add back in combined seek output file Alan D. Brunelle
  2007-04-10 17:15 ` Ming Zhang
  2007-04-10 17:18 ` Alan D. Brunelle
@ 2007-04-10 17:26 ` Ming Zhang
  2 siblings, 0 replies; 4+ messages in thread
From: Ming Zhang @ 2007-04-10 17:26 UTC (permalink / raw)
  To: linux-btrace

On Tue, 2007-04-10 at 13:18 -0400, Alan D. Brunelle wrote:
> Ming Zhang wrote:
> > On Tue, 2007-04-10 at 13:04 -0400, Alan D. Brunelle wrote:
> >   
> >> @@ -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
> >
> >   
> 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.

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-04-10 17:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-10 16:59 [BTT PATCH] Add back in combined seek output file Alan D. Brunelle
2007-04-10 17:15 ` Ming Zhang
2007-04-10 17:18 ` Alan D. Brunelle
2007-04-10 17:26 ` Ming Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.