Commit 40bf1cb0 authored by Changbin Du's avatar Changbin Du Committed by Arnaldo Carvalho de Melo

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: default avatarChangbin Du <changbin.du@huawei.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230513074000.733550-1-changbin.du@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 6d491b37
......@@ -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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment