Messages in this thread Patch in this message |  | | From | Robert Richter <> | | Subject | [PATCH 06/10] perf report: Setup browser if stdout is a pipe | | Date | Tue, 6 Dec 2011 11:32:36 +0100 |
| |
The decision to setup the browser should be made if stdout is pipe, not stdin.
Signed-off-by: Robert Richter <robert.richter@amd.com> --- tools/perf/builtin-report.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 4d7c834..88ca2d4 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -504,6 +504,8 @@ static const struct option options[] = { int cmd_report(int argc, const char **argv, const char *prefix __used) { + struct stat st; + argc = parse_options(argc, argv, options, report_usage, 0); if (use_stdio) @@ -514,10 +516,11 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) if (inverted_callchain) callchain_param.order = ORDER_CALLER; - if (strcmp(input_name, "-") != 0) - setup_browser(true); - else + if (!fstat(STDOUT_FILENO, &st) && S_ISFIFO(st.st_mode)) use_browser = 0; + else + setup_browser(true); + /* * Only in the newt browser we are doing integrated annotation, * so don't allocate extra space that won't be used in the stdio -- 1.7.7
|  |