All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>, Ian Rogers <irogers@google.com>,
	Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 5/5] perf script: Add some missing event dumps
Date: Fri, 10 Jun 2022 14:33:16 +0300	[thread overview]
Message-ID: <20220610113316.6682-6-adrian.hunter@intel.com> (raw)
In-Reply-To: <20220610113316.6682-1-adrian.hunter@intel.com>

When the -D option is used, the details of thread-map, cpu-map and
event-update events are not currently dumped. Add prints so that they are.

Example:

 # perf record --kcore sleep 0.1
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.021 MB perf.data (7 samples) ]
 # perf script -D | grep 'THREAD\|CPU'
 0 0x4950 [0x28]: PERF_RECORD_THREAD_MAP nr: 1 thread: 35116
 0 0x4978 [0x20]: PERF_RECORD_CPU_MAP: 0-7
 # perf script -D | grep -A4 'UPDATE'
 0 0x4920 [0x30]: PERF_RECORD_EVENT_UPDATE
 ... id:    147
 ... 0-7

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/builtin-script.c | 6 ++++++
 tools/perf/util/header.c    | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index c689054002cc..7cf21ab16f4f 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -3633,6 +3633,9 @@ int process_thread_map_event(struct perf_session *session,
 	struct perf_tool *tool = session->tool;
 	struct perf_script *script = container_of(tool, struct perf_script, tool);
 
+	if (dump_trace)
+		perf_event__fprintf_thread_map(event, stdout);
+
 	if (script->threads) {
 		pr_warning("Extra thread map event, ignoring.\n");
 		return 0;
@@ -3652,6 +3655,9 @@ int process_cpu_map_event(struct perf_session *session,
 	struct perf_tool *tool = session->tool;
 	struct perf_script *script = container_of(tool, struct perf_script, tool);
 
+	if (dump_trace)
+		perf_event__fprintf_cpu_map(event, stdout);
+
 	if (script->cpus) {
 		pr_warning("Extra cpu map event, ignoring.\n");
 		return 0;
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 53332da100e8..de5b7a023e9e 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -4349,6 +4349,9 @@ int perf_event__process_event_update(struct perf_tool *tool __maybe_unused,
 	struct evsel *evsel;
 	struct perf_cpu_map *map;
 
+	if (dump_trace)
+		perf_event__fprintf_event_update(event, stdout);
+
 	if (!pevlist || *pevlist == NULL)
 		return -EINVAL;
 
-- 
2.25.1


  parent reply	other threads:[~2022-06-10 11:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 11:33 [PATCH 0/5] perf record: Preparation for sideband injection Adrian Hunter
2022-06-10 11:33 ` [PATCH 1/5] perf record: Always get text_poke events with --kcore option Adrian Hunter
2022-06-10 11:33 ` [PATCH 2/5] perf record: Always record id index Adrian Hunter
2022-06-10 11:33 ` [PATCH 3/5] perf record: Add new option to sample identifier Adrian Hunter
2022-06-14 14:53   ` Ian Rogers
2022-06-15  5:25     ` [PATCH V2 " Adrian Hunter
2022-06-10 11:33 ` [PATCH 4/5] perf record: Add finished init event Adrian Hunter
2022-06-23 13:41   ` Arnaldo Carvalho de Melo
2022-06-23 13:46     ` Arnaldo Carvalho de Melo
2022-06-23 13:55       ` Arnaldo Carvalho de Melo
2022-06-23 18:41         ` Adrian Hunter
2022-06-10 11:33 ` Adrian Hunter [this message]
2022-06-14 14:55 ` [PATCH 0/5] perf record: Preparation for sideband injection Ian Rogers
2022-06-23  9:32 ` Adrian Hunter

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=20220610113316.6682-6-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.