summaryrefslogtreecommitdiff
path: root/btt/trace_complete.c
diff options
context:
space:
mode:
authorAlan D. Brunelle <Alan.Brunelle@hp.com>2007-12-10 13:41:37 -0500
committerAlan D. Brunelle <Alan.Brunelle@hp.com>2007-12-10 13:41:37 -0500
commitae6d30f4475181d685d1f33faf056755803f189b (patch)
tree461cfc69aacbe6536798af8291f55c3872442b1c /btt/trace_complete.c
parenta84a97fdf8ce07ccda8dcc4f32f0df2291f2f54f (diff)
downloadblktrace-ae6d30f4475181d685d1f33faf056755803f189b.tar.gz
blktrace-ae6d30f4475181d685d1f33faf056755803f189b.tar.bz2
Separated out g/i/m trace handling.
Also separated out DM-device calculations.
Diffstat (limited to 'btt/trace_complete.c')
-rw-r--r--btt/trace_complete.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/btt/trace_complete.c b/btt/trace_complete.c
index c51d43d..b4dcadd 100644
--- a/btt/trace_complete.c
+++ b/btt/trace_complete.c
@@ -36,9 +36,14 @@ static void display_io_track(FILE *ofp, struct io *iop)
{
fprintf(ofp, "%3d,%-3d: ", MAJOR(iop->t.device), MINOR(iop->t.device));
__out(ofp, iop->t.time, IOP_Q, iop->t.sector, t_sec(&iop->t), 0);
- __out(ofp, iop->i_time, IOP_I, iop->t.sector, t_sec(&iop->t), 1);
- __out(ofp, iop->gm_time, iop->is_getrq ? IOP_G : IOP_M,
- iop->t.sector, t_sec(&iop->t), 1);
+
+ if (iop->g_time != (__u64)-1)
+ __out(ofp, iop->g_time, IOP_G, iop->t.sector, t_sec(&iop->t),1);
+ if (iop->i_time != (__u64)-1)
+ __out(ofp, iop->i_time, IOP_I, iop->t.sector, t_sec(&iop->t),1);
+ if (iop->m_time != (__u64)-1)
+ __out(ofp, iop->i_time, IOP_M, iop->t.sector, t_sec(&iop->t),1);
+
__out(ofp, iop->d_time, IOP_D, iop->d_sec, iop->d_nsec, 1);
__out(ofp, iop->c_time, IOP_C, iop->c_sec, iop->c_nsec, 1);
fprintf(ofp, "\n");
@@ -59,16 +64,19 @@ static void handle_complete(struct io *c_iop)
list_for_each_safe(p, q, &head) {
struct io *q_iop = list_entry(p, struct io, f_head);
__u64 q2c = tdelta(q_iop->t.time, c_iop->t.time);
- __u64 d2c = tdelta(q_iop->d_time, c_iop->t.time);
c_iop->bytes_left -= q_iop->t.bytes;
update_q2c(q_iop, q2c);
latency_q2c(q_iop->dip, q_iop->t.time, q2c);
- update_d2c(q_iop, d2c);
- latency_d2c(q_iop->dip, c_iop->t.time, d2c);
- iostat_complete(q_iop, c_iop);
+ if (q_iop->d_time != (__u64)-1) {
+ __u64 d2c = tdelta(q_iop->d_time, c_iop->t.time);
+
+ update_d2c(q_iop, d2c);
+ latency_d2c(q_iop->dip, c_iop->t.time, d2c);
+ iostat_complete(q_iop, c_iop);
+ }
if (per_io_ofp) {
q_iop->c_time = c_iop->t.time;