Home | History | Annotate | Download | only in btt

Lines Matching refs:dip

25 #define INC_STAT(dip, fld)						\
27 (dip)->stats. fld ++; \
28 (dip)->all_stats. fld ++; \
31 #define DEC_STAT(dip, fld) \
33 (dip)->stats. fld --; \
34 (dip)->all_stats. fld --; \
37 #define ADD_STAT(dip, fld, val) \
40 (dip)->stats. fld += __v; \
41 (dip)->all_stats. fld += __v; \
44 #define SUB_STAT(dip, fld, val) \
47 (dip)->stats. fld -= __v; \
48 (dip)->all_stats. fld -= __v; \
63 static void update_tot_qusz(struct d_info *dip, double now)
65 dip->stats.tot_qusz += ((now - dip->stats.last_qu_change) *
66 dip->stats.cur_qusz);
67 dip->all_stats.tot_qusz += ((now - dip->all_stats.last_qu_change) *
68 dip->all_stats.cur_qusz);
70 dip->stats.last_qu_change = dip->all_stats.last_qu_change = now;
73 static void update_idle_time(struct d_info *dip, double now, int force)
75 if (dip->stats.cur_dev == 0 || force) {
76 dip->stats.idle_time += (now - dip->stats.last_dev_change);
77 dip->all_stats.idle_time +=
78 (now - dip->all_stats.last_dev_change);
80 dip->stats.last_dev_change = dip->all_stats.last_dev_change = now;
83 void __dump_stats(__u64 stamp, int all, struct d_info *dip, struct stats_t *asp)
92 sp = &dip->all_stats;
95 sp = &dip->stats;
100 update_idle_time(dip, now, 1);
101 update_tot_qusz(dip, now);
118 fprintf(iostat_ofp, "%-11s ", make_dev_hdr(hdr, 11, dip, 1));
194 struct d_info *dip;
205 dip = list_entry(p, struct d_info, all_head);
206 __dump_stats(stamp, all, dip, &as);
214 dip = __dip_find((__u32)((mjr << MINORBITS) | mnr));
215 __dump_stats(stamp, all, dip, &as);
244 update_tot_qusz(iop->dip, TO_SEC(iop->t.time));
245 INC_STAT(iop->dip, cur_qusz);
250 INC_STAT(iop->dip, rqm[IOP_RW(iop)]);
256 struct d_info *dip = iop->dip;
259 INC_STAT(dip, ios[rw]);
260 ADD_STAT(dip, sec[rw], iop->t.bytes >> 9);
262 update_idle_time(dip, now, 0);
263 INC_STAT(dip, cur_dev);
269 struct d_info *dip = q_iop->dip;
272 ADD_STAT(c_iop->dip, wait, tdelta(q_iop->i_time,c_iop->t.time));
274 ADD_STAT(c_iop->dip, wait, tdelta(q_iop->m_time,c_iop->t.time));
276 update_tot_qusz(dip, now);
277 DEC_STAT(dip, cur_qusz);
279 update_idle_time(dip, now, 0);
280 DEC_STAT(dip, cur_dev);
282 ADD_STAT(dip, svctm, tdelta(q_iop->t.time, c_iop->t.time));