2 * blktrace output analysis: generate a timeline & gather statistics
4 * Copyright (C) 2006 Alan D. Brunelle <Alan.Brunelle@hp.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 static void handle_issue(struct io *d_iop)
26 struct list_head *p, *q;
28 seeki_add(d_iop->dip->seek_handle, d_iop);
29 bno_dump_add(d_iop->dip->bno_dump_handle, d_iop);
32 if (!remapper_dev(d_iop->t.device))
33 update_d_histo(d_iop->t.bytes);
35 dip_foreach_list(d_iop, IOP_Q, &head);
36 list_for_each_safe(p, q, &head) {
37 struct io *q_iop = list_entry(p, struct io, f_head);
39 update_i2d(q_iop, tdelta(q_iop->gm_time, d_iop->t.time));
40 d_iop->bytes_left -= q_iop->t.bytes;
41 LIST_DEL(&q_iop->f_head);
43 q_iop->d_time = d_iop->t.time;
44 q_iop->d_sec = d_iop->t.sector;
45 q_iop->d_nsec = t_sec(&d_iop->t);
48 assert(d_iop->bytes_left == 0);
51 void trace_issue(struct io *d_iop)
53 if (io_setup(d_iop, IOP_D))