lkml.org 
[lkml]   [2011]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 06/10] perf report: Setup browser if stdout is a pipe
    Date
    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



    \
     
     \ /
      Last update: 2011-12-06 11:37    [W:0.022 / U:29.828 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site