]> xenbits.xensource.com Git - xentesttools/bootstrap.git/commitdiff
read_intr: Make it flush to output so when pipping it works correctly.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 25 Jan 2012 03:13:31 +0000 (22:13 -0500)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 25 Jan 2012 03:13:31 +0000 (22:13 -0500)
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
root_image/tools/read_intr/read_intr.c

index e698f4a99c57216697a3f011c5a08cca723299c2..1772fdff5a272ec36293a2dc02a7a18e5f2e1be7 100644 (file)
@@ -217,13 +217,14 @@ void get_delta(struct snapshot *b, struct snapshot *n, unsigned long tick)
                        if (delta > p_new->max[i])
                                p_new->max[i] = delta;
                        if (delta > DELTA) {
-                               printf("%-5s %2d: %-5d %-5d %-5d %-20s %ldsec\n",
+                               fprintf(stdout, "%-5s %2d: %-5d %-5d %-5d %-20s %ldsec\n",
                                        p_old->name, i, delta / MAX_SLEEP,
                                        p_new->avg[i] / MAX_SLEEP, p_new->max[i] / MAX_SLEEP,
                                        p_old->drivers, tick);
                        }
                        
                }
+               fflush(stdout);
 skip:
                p_old = q_old;
                p_new = q_new;
@@ -242,8 +243,8 @@ int main(int argc, char *argv[])
                return;
 
        cnt = MAX_CNT;
-       printf("-----------------------------------------------------------\n");
-       printf("irq  cpu: delta avg/s max/s driver               time\n");
+       fprintf(stdout,"-----------------------------------------------------------\n");
+       fprintf(stdout,"irq  cpu: delta avg/s max/s driver               time\n");
        before = get_snapshot(cpu_count);
        tick = 0;
        while (cnt--) {