aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangbin Du <[email protected]>2023-05-13 15:40:00 +0800
committerArnaldo Carvalho de Melo <[email protected]>2023-05-15 18:27:33 -0300
commit40bf1cb07ee72480dd831d7a13e42728dfad35e2 (patch)
tree9c9cbefea81e0f6ddd82de292157ac6f6350300c
parent6d491b37e70daeb963e3b589b746d99b8b4b1357 (diff)
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]>
-rw-r--r--tools/perf/builtin-ftrace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
index 810e3376c7d6..ad2a9ae041f6 100644
--- a/tools/perf/builtin-ftrace.c
+++ b/tools/perf/builtin-ftrace.c
@@ -650,6 +650,8 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace)
break;
if (fwrite(buf, n, 1, stdout) != 1)
break;
+ /* flush output since stdout is in full buffering mode due to pager */
+ fflush(stdout);
}
}