perf tools: Pass a fd to perf_file_header__read_pipe()
authorNamhyung Kim <namhyung@kernel.org>
Mon, 19 Jul 2021 22:31:50 +0000 (15:31 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 2 Aug 2021 13:09:05 +0000 (10:09 -0300)
commit0ae03893623dd1ddf17c1210265e5d7f9e2f3ed6
tree2dc1ca5bf970e511191e025c1c4da4521a803622
parent2681bd85a4b92788e265934d0d76bd56b5b08d16
perf tools: Pass a fd to perf_file_header__read_pipe()

Currently it unconditionally writes to stdout for repipe.  But perf
inject can direct its output to a regular file.  Then it needs to
write the header to the file as well.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20210719223153.1618812-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-inject.c
tools/perf/util/header.c
tools/perf/util/header.h
tools/perf/util/session.c
tools/perf/util/session.h