mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 16:41:58 +00:00
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 <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.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
6d491b37e7
commit
40bf1cb07e
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user