Skip to content

Commit 40bf1cb

Browse files
Changbin Duacmel
authored andcommitted
perf ftrace: Flush output after each writing
The pager will result stdout in full buffering mode instead of line buffering. We need to make the trace visible timely. Signed-off-by: Changbin Du <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 6d491b3 commit 40bf1cb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/perf/builtin-ftrace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace)
650650
break;
651651
if (fwrite(buf, n, 1, stdout) != 1)
652652
break;
653+
/* flush output since stdout is in full buffering mode due to pager */
654+
fflush(stdout);
653655
}
654656
}
655657

0 commit comments

Comments
 (0)