[PATCH] blkparse: allow a few more skips
authorJens Axboe <axboe@suse.de>
Mon, 19 Sep 2005 11:59:30 +0000 (13:59 +0200)
committerJens Axboe <axboe@suse.de>
Mon, 19 Sep 2005 11:59:30 +0000 (13:59 +0200)
blkparse.c

index a6407281924fadebe615cf7e9eb058e9353b3650..9076631b6f753cc673cf8e9d282a7bbc4a5a2e34 100644 (file)
@@ -72,6 +72,7 @@ struct per_dev_info {
        unsigned long long last_reported_time;
        struct io_stats io_stats;
        unsigned long last_sequence;
+       unsigned long skips;
 
        int ncpus;
        struct per_cpu_info *cpus;
@@ -1063,8 +1064,9 @@ static void show_device_and_cpu_stats(void)
                        dump_io_stats(&total, line);
                }
 
-               fprintf(ofp, "Events (%s): %'Lu\n",
-                       get_dev_name(pdi, line, sizeof(line)), pdi->events);
+               fprintf(ofp, "\nEvents (%s): %'Lu entries, %'lu skips\n",
+                       get_dev_name(pdi, line, sizeof(line)), pdi->events,
+                       pdi->skips);
        }
 }
 
@@ -1145,12 +1147,15 @@ static void show_entries_rb(int piped)
                /*
                 * back off displaying more info if we are out of sync
                 * on SMP systems. to prevent stalling on lost events,
-                * only allow an event to skip us once
+                * only allow an event to us a few times
                 */
                if (piped && bit->sequence != (pdi->last_sequence + 1)) {
-                       if (!t->skipped) {
-                               t->skipped = 1;
+                       if (t->skipped < 5) {
+                               t->skipped++;
                                break;
+                       } else {
+                               fprintf(stderr, "skipping from %lu to %u\n", pdi->last_sequence, bit->sequence);
+                               pdi->skips++;
                        }
                }