From: Andi Kleen Date: Sat, 3 Aug 2013 00:41:12 +0000 (-0700) Subject: perf stat: Flush output after each line in interval mode X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2bbf03f16a634f675c49c473b2b6528571990aea;p=linux-beck.git perf stat: Flush output after each line in interval mode When interval mode is outputting to a pipe, each measurement should be flushed individually, so that the reader sees it timely. 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 Reviewed-by: Jiri Olsa Cc: Jiri Olsa Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1375490473-1503-5-git-send-email-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 2e637e4c951d..f686d5ff594e 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)