summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan D. Brunelle <alan.brunelle@hp.com>2009-04-02 12:09:08 -0400
committerAlan D. Brunelle <alan.brunelle@hp.com>2009-04-02 12:09:08 -0400
commit15d67efcf8859d0f64d2ba38249bc50f87c30b57 (patch)
treec1cb2cde56b903b750d0f3a9527d39ca744748cc
parentd8ba9b683e1a341ab72c40836c05a360875c2e5e (diff)
downloadblktrace-15d67efcf8859d0f64d2ba38249bc50f87c30b57.tar.gz
blktrace-15d67efcf8859d0f64d2ba38249bc50f87c30b57.tar.bz2
Working on fixing % time q plugged
-rw-r--r--btt/devs.c3
-rw-r--r--btt/globals.h2
-rw-r--r--btt/trace_plug.c3
3 files changed, 5 insertions, 3 deletions
diff --git a/btt/devs.c b/btt/devs.c
index fc50555..ff55aa7 100644
--- a/btt/devs.c
+++ b/btt/devs.c
@@ -252,11 +252,12 @@ void dip_unplug(__u32 dev, double cur_time, __u64 nios_up)
}
}
-void dip_unplug_tm(__u32 dev, __u64 nios_up)
+void dip_unplug_tm(__u32 dev, double cur_time, __u64 nios_up)
{
struct d_info *dip = __dip_find(dev);
if (dip && dip->is_plugged) {
+ dip->plugged_time += (cur_time - dip->last_plug);
dip->n_timer_unplugs++;
dip->nios_upt += nios_up;
dip->nplugs_t++;
diff --git a/btt/globals.h b/btt/globals.h
index 43c38f4..c6c8c99 100644
--- a/btt/globals.h
+++ b/btt/globals.h
@@ -215,7 +215,7 @@ struct io *dip_find_sec(struct d_info *dip, enum iop_type type, __u64 sec);
void dip_foreach_out(void (*func)(struct d_info *, void *), void *arg);
void dip_plug(__u32 dev, double cur_time);
void dip_unplug(__u32 dev, double cur_time, __u64 nio_ups);
-void dip_unplug_tm(__u32 dev, __u64 nio_ups);
+void dip_unplug_tm(__u32 dev, double cur_time, __u64 nio_ups);
void dip_exit(void);
void dip_cleanup(void);
diff --git a/btt/trace_plug.c b/btt/trace_plug.c
index 97e2f66..b1925ae 100644
--- a/btt/trace_plug.c
+++ b/btt/trace_plug.c
@@ -35,7 +35,8 @@ void trace_unplug_io(struct io *u_iop)
void trace_unplug_timer(struct io *ut_iop)
{
- dip_unplug_tm(ut_iop->t.device, get_nio_up(ut_iop));
+ dip_unplug_tm(ut_iop->t.device, BIT_TIME(ut_iop->t.time),
+ get_nio_up(ut_iop));
io_release(ut_iop);
}