[lkml]   [2013]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4/5] perf, tools: flush output after each line in stat interval mode
From: Andi Kleen <>

When interval mode is outputting to a pipe, each measurement
should be flushed individually, so that the reader sees it

With a terminal each line is automatically flushed by stdio,
but that is disabled with non terminal output.

Simply fflush output after each time interval

Signed-off-by: Andi Kleen <>
tools/perf/builtin-stat.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 2e637e4..f686d5f 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -416,6 +416,8 @@ static void print_interval(void)
list_for_each_entry(counter, &evsel_list->entries, node)
print_counter_aggr(counter, prefix);
+ fflush(output);

static void handle_initial_delay(void)

 \ /
  Last update: 2013-08-03 03:01    [W:0.092 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site