Skip to contentSkip to conversation

Add periodic fflush to xentop batch mode.

PATCH New Yusuke KANEKI 1 participant 1 message Mar 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add periodic fflush to xentop batch mode.

Add periodic fflush to xentop(batch mode).

If you want to make monitor tool using the following command, you can not get output every some seconds.

xentop -b -d 1 > xentop.log
(above tool use tail command to get periodic data from xentop.log)

This patch is useful when you get
xentop output(batch mode) periodicaly using pipe.

Best Regards,
Yusuke Kaneki

----

*** old/xentop.c 2008-03-14 21:00:28.000000000 +0900
--- new/xentop.c 2008-03-14 21:00:36.000000000 +0900
***************
*** 1121,1126 ****
--- 1121,1127 ----

                do {
                        gettimeofday(&curtime, NULL);
                        top();
+                       fflush(stdout);
                        oldtime = curtime;
                        if ((!loop) && !(--iterations))
                                break;