diff options
author | Alan D. Brunelle <Alan.Brunelle@hp.com> | 2007-02-26 20:44:24 +0100 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-02-26 20:44:24 +0100 |
commit | fa0ab85de6801b1ebfddf9b697ac0293c14c3e00 (patch) | |
tree | b26ca7fa52175ac856912bc2318e04da04aa715d /btt/inlines.h | |
parent | a6c42403c52df673378c30586f673b5fa86b4122 (diff) | |
download | blktrace-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.h | 16 |
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)]++; +} |