blktrace: fix bugs in accounting
authorJens Axboe <axboe@fb.com>
Fri, 24 Apr 2015 15:03:05 +0000 (09:03 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 24 Apr 2015 15:03:05 +0000 (09:03 -0600)
commita6eaf6c9101cd3f2895376944e6425a43613dbf6
tree49b3167da27d76b3f7b82b5c9ee27150fe5f2f73
parent36870c47801ca85d1a98c7ec47950b0aa360f865
blktrace: fix bugs in accounting

We need to clear the trim part of the accounting arrays, otherwise
we can use bogus values leading to attempting to allocate huge
amounts of memory. This causes fio to exit with:

fio: pid=21428, err=12/file:memory.c:242, func=iomem allocation,
error=Cannot allocate memory

Also improve the depth detection, by making it per data direction
instead of a global state.

Signed-off-by: Jens Axboe <axboe@fb.com>
blktrace.c