• Jiri Olsa's avatar
    perf stat record: Add pipe support for record command · 664c98d4
    Jiri Olsa authored
    Allowing storing stat record data into pipe, so report tools
    (report/script) could read data directly from record.
    
    Committer note:
    
    Before this patch:
    
      $ perf stat record -o - usleep 1 | perf report -i -
      incompatible file format (rerun with -v to learn more)
      $ perf stat record -o - usleep 1 | perf script -i -
      incompatible file format (rerun with -v to learn more)
      $ ls -la perf.data
      ls: cannot access perf.data: No such file or directory
      $
    
    After:
    
      $ perf stat record -o - usleep 1 | perf report -i -
      # To display the perf.data header info, please use
      # --header/--header-only options.
      #
      Error:
      The - file has no samples!
      $ perf stat record -o - usleep 1 | perf script -i -
      Display of symbols requested but neither sample IP nor sample address
      is selected. Hence, no addresses to convert to symbols.
      0 [0x80]: failed to process type: 64
      $ ls -la perf.data
      ls: cannot access perf.data: No such file or directory
      $
    Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Tested-by: default avatarKan Liang <kan.liang@intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/1446734469-11352-7-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    664c98d4
builtin-stat.c 41.7 KB