From: Jens Axboe Date: Mon, 29 Aug 2005 11:27:35 +0000 (+0200) Subject: [PATCH] blkparse: Don't clear rb_root in sort_entries() X-Git-Tag: blktrace-0.99~233 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=df0fae6de00f7dfef7b6c840e0ab42e18be03cad;p=blktrace.git [PATCH] blkparse: Don't clear rb_root in sort_entries() It will override the entries already sorted from the previous CPUs. --- diff --git a/CHANGELOG b/CHANGELOG index 26f2bae..481908a 100644 --- 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: diff --git a/blkparse.c b/blkparse.c index 876668c..3ff3fc2 100644 --- a/blkparse.c +++ b/blkparse.c @@ -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;