[PATCH] blkparse: Don't clear rb_root in sort_entries()
authorJens Axboe <axboe@nelson>
Mon, 29 Aug 2005 11:27:35 +0000 (13:27 +0200)
committerJens Axboe <axboe@nelson>
Mon, 29 Aug 2005 11:27:35 +0000 (13:27 +0200)
It will override the entries already sorted from the previous CPUs.

CHANGELOG
blkparse.c

index 26f2baeec6432a2c55a8d2b68dc56013b5fde191..481908af4478eb44661e0fe232194015a42f7a22 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@
        - blktrace: Don't touch the stored trace, leave magic and version
          for blkparse to see as well.
        - Always store trace data in big endian format
+       - Oops, don't clear rb_root in sort_entries()
 20050827:
        - Various cleanups and killing unused variables
 20050826:
index 876668c839d3dfc9d433745b1622b13fcd4f9c2e..3ff3fc2405d076e0236a29cb9d47012522d33f63 100644 (file)
@@ -298,8 +298,6 @@ static int sort_entries(void *traces, unsigned long offset, int cpu)
        void *start = traces;
        int nelems = 0;
 
-       memset(&rb_root, 0, sizeof(rb_root));
-
        while (traces - start <= offset - sizeof(*bit)) {
                bit = traces;
 
@@ -375,6 +373,8 @@ int main(int argc, char *argv[])
 
        dev = argv[1];
 
+       memset(&rb_root, 0, sizeof(rb_root));
+
        for (max_cpus = 0, i = 0, nfiles = 0; i < MAX_CPUS; i++) {
                struct per_file_info *pfi = &per_file_info[i];
                struct stat st;