summaryrefslogtreecommitdiff
path: root/verify_blkparse.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-02-02 12:06:34 +0100
committerJens Axboe <axboe@suse.de>2006-02-02 12:06:34 +0100
commitced8a9bfde18818f157efd02d0bd8af9ac86d487 (patch)
treebe8a6f68ca35582f2f151652b3ba4a04d4084cc5 /verify_blkparse.c
parent36652af405cfc21cfb22aca8e32cd9c3bf42cb67 (diff)
downloadblktrace-ced8a9bfde18818f157efd02d0bd8af9ac86d487.tar.gz
blktrace-ced8a9bfde18818f157efd02d0bd8af9ac86d487.tar.bz2
[PATCH] verify_blkparse: update for per-CPU sequences
Diffstat (limited to 'verify_blkparse.c')
-rw-r--r--verify_blkparse.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/verify_blkparse.c b/verify_blkparse.c
index 50a1c81..36287fc 100644
--- a/verify_blkparse.c
+++ b/verify_blkparse.c
@@ -3,14 +3,20 @@
#include <fcntl.h>
#include <unistd.h>
+#define MAX_CPUS (512)
+
int main(int argc, char *argv[])
{
double this_time, last_time;
char line[256], *p;
- int major, minor, cpu, seq, nr, alias, last_seq;
+ int major, minor, cpu, seq, nr, alias;
unsigned long long total_entries;
+ unsigned long last_seq[MAX_CPUS];
FILE *f;
+ for (nr = 0; nr < MAX_CPUS; nr++)
+ last_seq[nr] = -1;
+
if (argc < 2) {
fprintf(stderr, "%s: file\n", argv[0]);
return 1;
@@ -22,7 +28,6 @@ int main(int argc, char *argv[])
return 1;
}
- last_seq = -1;
last_time = 0;
alias = nr = 0;
total_entries = 0;
@@ -36,12 +41,17 @@ int main(int argc, char *argv[])
} else
last_time = this_time;
- if (last_seq == seq) {
+ if (cpu >= MAX_CPUS) {
+ fprintf(stderr, "cpu%d too large\n", cpu);
+ break;
+ }
+
+ if (last_seq[cpu] == seq) {
fprintf(stdout, "alias on sequence %u\n", seq);
alias++;
}
- last_seq = seq;
+ last_seq[cpu] = seq;
total_entries++;
}