diff options
author | Namhyung Kim <namhyung@kernel.org> | 2021-07-19 15:31:52 -0700 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-08-02 10:14:34 -0300 |
commit | c3a057dc3aa9979ce6dc350e05eb2e4c021432cd (patch) | |
tree | 529d39004afcda9a59b78f2a77564835f4fe9fd6 /tools/perf/util/term.h | |
parent | fea20d66f90cdbdc7dccf1fa001d40e084984e55 (diff) |
perf inject: Fix output from a file to a pipe
When the input is a regular file but the output is a pipe, it should
write a pipe header. But just repiping would write a portion of the
existing header which is different in 'size' value. So we need to
prevent it and write a new pipe header along with other information
like event attributes and features.
This can handle something like this:
# perf record -a -B sleep 1
# perf inject -b -i perf.data | perf report -i -
Factor out perf_event__synthesize_for_pipe() to be shared between perf
record and inject.
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-5-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/term.h')
0 files changed, 0 insertions, 0 deletions