Skip to contentSkip to conversation

Added new IOs per unplug table

PATCH New Alan D. Brunelle 1 participant 1 message Feb 5, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Added new IOs per unplug table

========== Plug Information ==========

       DEV |    # Plugs # Timer Us  | % Time Q Plugged
---------- | ---------- ----------  | ----------------
 (  8,  0) |       1171(       123) |   0.280946640%
 (  8, 32) |          4(         0) |   0.000325469%
---------- | ---------- ----------  | ----------------
   Overall |    # Plugs # Timer Us  | % Time Q Plugged
   Average |        587(        61) |   0.140636055%
       DEV |    IOs/Unp   IOs/Unp(to)
---------- | ----------   ----------
 (  8,  0) |        9.2          8.8
 (  8, 32) |        2.5          0.0
---------- | ----------   ----------
       DEV |    IOs/Unp   IOs/Unp(to)
   Overall |        9.2          8.8

(Jens: Pushed these changes succesfully.)

---
 btt/bt_timeline.c |    2 +-
 btt/devs.c        |   10 +++-
 btt/doc/btt.tex   |  101 ++++++++++++++++++++++++++++++----------------
 btt/globals.h     |    8 ++-
 btt/output.c      |  115 ++++++++++++++++++++++++++++++++++++++---------------
 btt/trace_plug.c  |   10 ++++-
 6 files changed, 170 insertions(+), 76 deletions(-)
btt/bt_timeline.c +1 -1
index b1f480a..981b909 100644
@@ -25,7 +25,7 @@
 #include <time.h>
 #include "globals.h"
 
-char bt_timeline_version[] = "2.01";
+char bt_timeline_version[] = "2.02";
 
 char *devices, *exes, *input_name, *output_name, *seek_name, *bno_dump_name;
 char *d2c_name, *q2c_name, *per_io_name, *unplug_hist_name;
btt/devs.c +7 -3
index 61dd427..38007d1 100644
@@ -264,7 +264,7 @@ void dip_plug(__u32 dev, double cur_time)
 	dip->last_plug = cur_time;
 }
 
-void dip_unplug(__u32 dev, double cur_time)
+void dip_unplug(__u32 dev, double cur_time, __u64 nios_up)
 {
 	struct d_info *dip = __dip_find(dev);
 
@@ -272,13 +272,17 @@ void dip_unplug(__u32 dev, double cur_time)
 		dip->nplugs++;
 		dip->plugged_time += (cur_time - dip->last_plug);
 		dip->is_plugged = 0;
+		dip->nios_up += nios_up;
 	}
 }
 
-void dip_unplug_tm(__u32 dev)
+void dip_unplug_tm(__u32 dev, __u64 nios_up)
 {
 	struct d_info *dip = __dip_find(dev);
 
-	if (dip && dip->is_plugged)
+	if (dip && dip->is_plugged) {
 		dip->n_timer_unplugs++;
+		dip->nios_upt += nios_up;
+		dip->nplugs_t++;
+	}
 }
btt/doc/btt.tex +66 -35

191 lines not on this page · raw message

btt/globals.h +5 -3
index 163986b..f6041de 100644
@@ -175,7 +175,8 @@ struct d_info {
 	__u32 device;
 
 	int pre_culling;
-	int is_plugged, nplugs, n_timer_unplugs;
+	int is_plugged, nplugs, nplugs_t, n_timer_unplugs;
+	__u64 nios_up, nios_upt;
 	double start_time, last_plug, plugged_time, end_time;
 };
 
@@ -247,8 +248,8 @@ void dip_foreach(struct io *iop, enum iop_type type,
 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);
-void dip_unplug_tm(__u32 dev);
+void dip_unplug(__u32 dev, double cur_time, __u64 nio_ups);
+void dip_unplug_tm(__u32 dev, __u64 nio_ups);
 void dip_exit(void);
 
 /* dip_rb.c */
@@ -346,6 +347,7 @@ int ready_issue(struct io *d_iop, struct io *c_iop);
 void trace_issue(struct io *d_iop);
 
 /* trace_plug.c */
+__u64 get_nio_up(struct io *u_iop);
 void trace_plug(struct io *p_iop);
 void trace_unplug_io(struct io *u_iop);
 void trace_unplug_timer(struct io *u_iop);
btt/output.c +83 -32

256 lines not on this page · raw message

btt/trace_plug.c +8 -2
index 03076d7..155e92a 100644
@@ -20,16 +20,22 @@
  */
 #include "globals.h"
 
+__u64 get_nio_up(struct io *u_iop)
+{
+	__u64 *val = u_iop->pdu;
+	return be64_to_cpu(*val);
+}
+
 void trace_unplug_io(struct io *u_iop)
 {
 	unplug_hist_add(u_iop);
-	dip_unplug(u_iop->t.device, BIT_TIME(u_iop->t.time));
+	dip_unplug(u_iop->t.device, BIT_TIME(u_iop->t.time), get_nio_up(u_iop));
 	io_release(u_iop);
 }
 
 void trace_unplug_timer(struct io *ut_iop)
 {
-	dip_unplug_tm(ut_iop->t.device);
+	dip_unplug_tm(ut_iop->t.device, get_nio_up(ut_iop));
 	io_release(ut_iop);
 }
 
Signature · 1 line
1.5.2.5