From 41fdf407713a487702d8112b6d4696744e693b73 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Sat, 1 Sep 2012 23:37:20 +0200 Subject: [PATCH] iowatcher: Fix filtering of outliers from below There are lots of trace actions which do not carry a sector with them (e.g. plug, unplug, ...). Thus sector is 0 for them and that results in trimming of outliers from below never working. Fix the problem by accounting only Queue events in the outlier statistics. Signed-off-by: Jan Kara Signed-off-by: Chris Mason --- iowatcher/blkparse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iowatcher/blkparse.c b/iowatcher/blkparse.c index 2be2f05..3aa44a6 100644 --- a/iowatcher/blkparse.c +++ b/iowatcher/blkparse.c @@ -463,7 +463,8 @@ int filter_outliers(struct trace *trace, u64 max_offset, memset(max_per_bucket, 0, sizeof(u64) * 11); first_record(trace); while (1) { - if (!(trace->io->action & BLK_TC_ACT(BLK_TC_NOTIFY))) { + if (!(trace->io->action & BLK_TC_ACT(BLK_TC_NOTIFY)) && + (trace->io->action & BLK_TA_MASK) == __BLK_TA_QUEUE) { u64 top = (trace->io->sector << 9) + trace->io->bytes; slot = (int)(top / bytes_per_bucket); hits[slot]++; -- 2.25.1