summaryrefslogtreecommitdiff
path: root/verify_blkparse.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-09-28 17:57:03 +0200
committerJens Axboe <axboe@suse.de>2005-09-28 17:57:03 +0200
commitcf4b68a59f5b5a7758d9e58b54edd9e59554d23e (patch)
tree4af7ec68749ae2d3bf15d9a2ea17e6d726123f2f /verify_blkparse.c
parent54aa4b1c9f410181a01996a7288056a58b456d1f (diff)
downloadblktrace-cf4b68a59f5b5a7758d9e58b54edd9e59554d23e.tar.gz
blktrace-cf4b68a59f5b5a7758d9e58b54edd9e59554d23e.tar.bz2
[PATCH] verify_blkparse: print events not ordered
And fix exit code.
Diffstat (limited to 'verify_blkparse.c')
-rw-r--r--verify_blkparse.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/verify_blkparse.c b/verify_blkparse.c
index 2f02ce2..bfbf63c 100644
--- a/verify_blkparse.c
+++ b/verify_blkparse.c
@@ -7,7 +7,7 @@ int main(int argc, char *argv[])
{
double this_time, last_time;
char line[256], *p;
- int major, minor, cpu, seq;
+ int major, minor, cpu, seq, nr;
FILE *f;
if (argc < 2) {
@@ -22,16 +22,20 @@ int main(int argc, char *argv[])
}
last_time = 0;
+ nr = 0;
while ((p = fgets(line, sizeof(line), f)) != NULL) {
if (!sscanf(p, "%3d,%3d %2d %8d %lf", &major, &minor, &cpu, &seq, &this_time))
break;
- if (this_time < last_time)
- printf("%s", p);
- else
+ if (this_time < last_time) {
+ fprintf(stdout, "%s", p);
+ nr++;
+ } else
last_time = this_time;
}
+ fprintf(stdout, "%d unordered events\n", nr);
fclose(f);
- return 0;
+
+ return nr != 0;
}