summaryrefslogtreecommitdiff
path: root/btt/trace_queue.c
diff options
context:
space:
mode:
authorAlan D. Brunelle <Alan.Brunelle@hp.com>2007-09-10 18:37:49 +0200
committerJens Axboe <jens.axboe@oracle.com>2007-09-10 18:37:49 +0200
commit4c48f14ea8ae2fae86811ac4dc1d72ad9bb601c2 (patch)
tree97a01448fa090ed0aacf979e640bf77e40b637bf /btt/trace_queue.c
parenta5981e2e795319502cc8dda629482928f3b7b204 (diff)
downloadblktrace-4c48f14ea8ae2fae86811ac4dc1d72ad9bb601c2.tar.gz
blktrace-4c48f14ea8ae2fae86811ac4dc1d72ad9bb601c2.tar.bz2
Major revamping (ver 2.0)
After a lot of fighting with maintaining a tree-styled design (each trace having it's own node), it was just getting too cumbersome to work in all circumstances. Taking a clue from blkparse itself, I decided to just keep track of IOs at queue time, and updating fields based upon later traces. The attached (large) patch works much faster, handles larger test cases with less failures, and is managing some pretty large jobs I'm working on (large Oracle-based DB analysis - 32-way box w/ lots of storage). I've also added a Q2Q seek distance feature - it's come in handy when comparing results of IO scheduler choice: We can see what the incoming IO seek distances are (at queue time), and then see how the scheduler itself manages things (via merges & sorting) by looking at D2D seek distances generated. As noted in the subject, I arbitrarily bumped this to version 2.00 as the innards are so different. The documentation (btt/doc/btt.tex) has been updated to reflect some minor output changes. I also fixed a bug dealing with process name notification: there was a problem that if a new PID came up with a name that was previously seen, btt wouldn't keep track of it right. [When running with Oracle, a lot of processes have the same name but different PIDs of course.] Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'btt/trace_queue.c')
-rw-r--r--btt/trace_queue.c62
1 files changed, 13 insertions, 49 deletions
diff --git a/btt/trace_queue.c b/btt/trace_queue.c
index ad5e30c..f882ad2 100644
--- a/btt/trace_queue.c
+++ b/btt/trace_queue.c
@@ -20,60 +20,24 @@
*/
#include "globals.h"
-static inline void __update_q2c(struct io *q_iop, struct io *c_iop)
+static void handle_queue(struct io *q_iop)
{
- __u64 q2c = tdelta(q_iop, c_iop);
-
- update_q2c(q_iop, q2c);
- latency_q2c(q_iop->dip, q_iop->t.time, q2c);
-}
-
-void run_queue(struct io *q_iop, __attribute__((__unused__))struct io *u_iop,
- struct io *c_iop)
-{
- struct bilink *blp;
- struct io *a_iop = bilink_first_down(q_iop, &blp);
-
- if (a_iop) {
- run_remap(a_iop, q_iop, c_iop);
- biunlink(blp);
- }
-
- __update_q2c(q_iop, c_iop);
- dump_iop(q_iop, 0);
- add_rmhd(q_iop);
-}
-
-int ready_queue(struct io *q_iop, struct io *c_iop)
-{
- struct io *a_iop;
-
- if (!list_empty(&q_iop->down_list))
- return 1;
-
- a_iop = dip_find_sec(q_iop->dip, IOP_A, BIT_START(q_iop));
- if (!a_iop)
- return 1;
-
- if (!ready_remap(a_iop, c_iop))
- return 0;
-
- ASSERT(q_iop->t.bytes == a_iop->t.bytes);
- bilink(a_iop, q_iop);
- dip_rem(a_iop);
- return 1;
+ seeki_add(q_iop->dip->q2q_handle, q_iop);
+ update_lq(&last_q, &all_avgs.q2q, q_iop->t.time);
+ update_qregion(&all_regions, q_iop->t.time);
+ dip_update_q(q_iop->dip, q_iop);
+ pip_update_q(q_iop);
+ if (!remapper_dev(q_iop->t.device))
+ update_q_histo(q_iop->t.bytes);
+
+ q_iop->i_time = q_iop->gm_time = q_iop->d_time = (__u64)-1;
+ q_iop->is_getrq = -1;
}
void trace_queue(struct io *q_iop)
{
- if (io_setup(q_iop, IOP_Q)) {
- update_lq(&last_q, &all_avgs.q2q, q_iop->t.time);
- update_qregion(&all_regions, q_iop->t.time);
- dip_update_q(q_iop->dip, q_iop);
- pip_update_q(q_iop);
- if (!remapper_dev(q_iop->t.device))
- update_q_histo(q_iop->t.bytes);
- }
+ if (io_setup(q_iop, IOP_Q))
+ handle_queue(q_iop);
else
io_release(q_iop);
}