summaryrefslogtreecommitdiff
path: root/btt/trace_complete.c
diff options
context:
space:
mode:
authorAlan D. Brunelle <alan.brunelle@hp.com>2008-11-11 13:46:13 -0500
committerAlan D. Brunelle <alan.brunelle@hp.com>2008-11-11 13:46:13 -0500
commita22df989ded0fb438dcad77a08c59a1a16b6b849 (patch)
tree763690b7e6ba7d84fcc680db2ad73ec3f07e76e5 /btt/trace_complete.c
parent9638f3909854d936f4a55a48f787364abdbda71f (diff)
downloadblktrace-a22df989ded0fb438dcad77a08c59a1a16b6b849.tar.gz
blktrace-a22df989ded0fb438dcad77a08c59a1a16b6b849.tar.bz2
Added -P to create a data file w/ Q, D and C per line
Easy parsing for graph creation
Diffstat (limited to 'btt/trace_complete.c')
-rw-r--r--btt/trace_complete.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/btt/trace_complete.c b/btt/trace_complete.c
index 35a6b17..6f616bc 100644
--- a/btt/trace_complete.c
+++ b/btt/trace_complete.c
@@ -53,6 +53,8 @@ static void handle_complete(struct io *c_iop)
{
LIST_HEAD(head);
struct list_head *p, *q;
+ __u64 d_time = (__u64)-1;
+ FILE *pit_fp = c_iop->dip->pit_fp;
update_blks(c_iop);
update_cregion(&all_regions, c_iop->t.time);
@@ -77,6 +79,8 @@ static void handle_complete(struct io *c_iop)
update_d2c(q_iop, d2c);
latency_d2c(q_iop->dip, c_iop->t.time, d2c);
iostat_complete(q_iop, c_iop);
+
+ d_time = q_iop->d_time;
}
if (per_io_ofp) {
@@ -86,6 +90,12 @@ static void handle_complete(struct io *c_iop)
display_io_track(per_io_ofp, q_iop);
}
+ if (q_iop->dip->pit_fp) {
+ fprintf(pit_fp, "%d.%09lu ",
+ (int)SECONDS(q_iop->t.time),
+ (unsigned long)NANO_SECONDS(q_iop->t.time));
+ }
+
list_del(&q_iop->f_head);
io_release(q_iop);
}
@@ -93,6 +103,14 @@ static void handle_complete(struct io *c_iop)
if (per_io_ofp)
fprintf(per_io_ofp,
"-----------------------------------------\n");
+
+ if (c_iop->dip->pit_fp) {
+ fprintf(pit_fp, "| %d.%09lu | %d.%09lu\n",
+ (int)SECONDS(d_time),
+ (unsigned long)NANO_SECONDS(d_time),
+ (int)SECONDS(c_iop->t.time),
+ (unsigned long)NANO_SECONDS(c_iop->t.time));
+ }
}
void trace_complete(struct io *c_iop)