iowatcher: Fix filtering of outliers from below
authorJan Kara <jack@suse.cz>
Sat, 1 Sep 2012 21:37:20 +0000 (23:37 +0200)
committerChris Mason <chris.mason@oracle.com>
Tue, 11 Sep 2012 00:53:05 +0000 (20:53 -0400)
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 <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
iowatcher/blkparse.c

index 2be2f056a8997df574501fb99bf868b4bd99699b..3aa44a6f5aae46639627dbb394d4db6725fcf304 100644 (file)
@@ -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]++;