summaryrefslogtreecommitdiff
path: root/btt/inlines.h
diff options
context:
space:
mode:
authorAlan D. Brunelle <Alan.Brunelle@hp.com>2007-02-26 20:44:24 +0100
committerJens Axboe <axboe@carl.home.kernel.dk>2007-02-26 20:44:24 +0100
commitfa0ab85de6801b1ebfddf9b697ac0293c14c3e00 (patch)
treeb26ca7fa52175ac856912bc2318e04da04aa715d /btt/inlines.h
parenta6c42403c52df673378c30586f673b5fa86b4122 (diff)
downloadblktrace-fa0ab85de6801b1ebfddf9b697ac0293c14c3e00.tar.gz
blktrace-fa0ab85de6801b1ebfddf9b697ac0293c14c3e00.tar.bz2
Add Q and D histograms (based upon IO size)
Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'btt/inlines.h')
-rw-r--r--btt/inlines.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/btt/inlines.h b/btt/inlines.h
index 5eb183c..8756bea 100644
--- a/btt/inlines.h
+++ b/btt/inlines.h
@@ -432,3 +432,19 @@ static inline void bilink_for_each_down(bilink_func func, struct io *uiop,
biunlink(blp);
}
}
+
+static inline int histo_idx(__u64 nbytes)
+{
+ int idx = (nbytes >> 9) - 1;
+ return min(idx, N_HIST_BKTS-1);
+}
+
+static inline void update_q_histo(__u64 nbytes)
+{
+ q_histo[histo_idx(nbytes)]++;
+}
+
+static inline void update_d_histo(__u64 nbytes)
+{
+ d_histo[histo_idx(nbytes)]++;
+}