From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@linux.intel.com>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>
Subject: [PATCHSET v2 0/5] perf inject: Fix broken data with mixed input/output
Date: Tue, 13 Jul 2021 17:34:37 -0700 [thread overview]
Message-ID: <20210714003442.1111502-1-namhyung@kernel.org> (raw)
Hello,
The perf inject processes the input data and produces an output with
injected data according to the given options. During the work, it
assumes the input and output files have the same format - either a
regular file or a pipe. This works for the obvious cases, but
sometimes makes a trouble when input and output have different
formats (like for debugging).
* changes in v2
- factor out perf_event__synthesize_for_pipe
- add a shell test for pipe operations
For example, this patchset fixed the following cases
1. input: pipe, output: file
# perf record -a -o - sleep 1 | perf inject -b -o perf-pipe.data
# perf report -i perf-pipe.data
2. input: file, output: pipe
# perf record -a -B sleep 1
# perf inject -b -i perf.data | perf report -i -
Thanks,
Namhyung
Namhyung Kim (5):
perf tools: Remove repipe argument from perf_session__new()
perf tools: Pass a fd to perf_file_header__read_pipe()
perf inject: Fix output from a pipe to a file
perf inject: Fix output from a file to a pipe
perf tools: Add pipe_test.sh to verify pipe operations
tools/perf/bench/synthesize.c | 4 +-
tools/perf/builtin-annotate.c | 2 +-
tools/perf/builtin-buildid-cache.c | 2 +-
tools/perf/builtin-buildid-list.c | 2 +-
tools/perf/builtin-c2c.c | 2 +-
tools/perf/builtin-diff.c | 4 +-
tools/perf/builtin-evlist.c | 2 +-
tools/perf/builtin-inject.c | 38 ++++++++++++++--
tools/perf/builtin-kmem.c | 2 +-
tools/perf/builtin-kvm.c | 4 +-
tools/perf/builtin-lock.c | 2 +-
tools/perf/builtin-mem.c | 3 +-
tools/perf/builtin-record.c | 40 +++--------------
tools/perf/builtin-report.c | 2 +-
tools/perf/builtin-sched.c | 4 +-
tools/perf/builtin-script.c | 4 +-
tools/perf/builtin-stat.c | 4 +-
tools/perf/builtin-timechart.c | 3 +-
tools/perf/builtin-top.c | 2 +-
tools/perf/builtin-trace.c | 2 +-
tools/perf/tests/shell/pipe_test.sh | 69 +++++++++++++++++++++++++++++
tools/perf/tests/topology.c | 4 +-
tools/perf/util/data-convert-bt.c | 2 +-
tools/perf/util/data-convert-json.c | 2 +-
tools/perf/util/header.c | 12 ++---
tools/perf/util/header.h | 2 +-
tools/perf/util/session.c | 11 ++---
tools/perf/util/session.h | 12 ++++-
tools/perf/util/synthetic-events.c | 53 +++++++++++++++++++++-
tools/perf/util/synthetic-events.h | 6 +++
30 files changed, 217 insertions(+), 84 deletions(-)
create mode 100755 tools/perf/tests/shell/pipe_test.sh
--
2.32.0.93.g670b81a890-goog
next reply other threads:[~2021-07-14 0:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-14 0:34 Namhyung Kim [this message]
2021-07-14 0:34 ` [PATCH 1/5] perf tools: Remove repipe argument from perf_session__new() Namhyung Kim
2021-07-14 0:34 ` [PATCH 2/5] perf tools: Pass a fd to perf_file_header__read_pipe() Namhyung Kim
2021-07-14 0:34 ` [PATCH 3/5] perf inject: Fix output from a pipe to a file Namhyung Kim
2021-07-14 0:34 ` [PATCH 4/5] perf inject: Fix output from a file to a pipe Namhyung Kim
2021-07-14 0:34 ` [PATCH 5/5] perf tools: Add pipe_test.sh to verify pipe operations Namhyung Kim
2021-07-18 21:38 ` Jiri Olsa
2021-07-19 19:28 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210714003442.1111502-1-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®