From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
"Geneviève Bastien" <gbastien@versatic.net>,
"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
"Francis Deslauriers" <francis.deslauriers@efficios.com>,
"Julien Desfossez" <jdesfossez@efficios.com>,
"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>
Subject: [PATCH 14/15] perf data: Add mmap[2] events to CTF conversion
Date: Fri, 28 Jul 2017 17:00:20 -0300 [thread overview]
Message-ID: <20170728200021.11389-15-acme@kernel.org> (raw)
In-Reply-To: <20170728200021.11389-1-acme@kernel.org>
From: Geneviève Bastien <gbastien@versatic.net>
This adds the mmap and mmap2 events to the CTF trace obtained from perf
data.
These events will allow CTF trace visualization tools like Trace Compass
to automatically resolve the symbols of the callchain to the
corresponding function or origin library.
To include those events, one needs to convert with the --all option.
Here follows an output of babeltrace:
$ sudo perf data convert --all --to-ctf myctftrace
$ babeltrace ./myctftrace
[19:00:00.000000000] (+0.000000000) perf_mmap2: { cpu_id = 0 },
{ pid = 638, tid = 638, start = 0x7F54AE39E000, filename =
"/usr/lib/ld-2.25.so" }
[19:00:00.000000000] (+0.000000000) perf_mmap2: { cpu_id = 0 }, { pid =
638, tid = 638, start = 0x7F54AE565000, filename =
"/usr/lib/libudev.so.1.6.6" }
[19:00:00.000000000] (+0.000000000) perf_mmap2: { cpu_id = 0 }, { pid =
638, tid = 638, start = 0x7FFC093EA000, filename = "[vdso]" }
Signed-off-by: Geneviève Bastien <gbastien@versatic.net>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
Cc: Julien Desfossez <jdesfossez@efficios.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20170727181205.24843-2-gbastien@versatic.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/data-convert-bt.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index eeb2590a3ddf..2346cecb8ea2 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -76,6 +76,8 @@ struct ctf_writer {
struct bt_ctf_event_class *comm_class;
struct bt_ctf_event_class *exit_class;
struct bt_ctf_event_class *fork_class;
+ struct bt_ctf_event_class *mmap_class;
+ struct bt_ctf_event_class *mmap2_class;
};
struct convert {
@@ -915,6 +917,18 @@ __FUNC_PROCESS_NON_SAMPLE(exit,
__NON_SAMPLE_SET_FIELD(fork, u32, ptid);
__NON_SAMPLE_SET_FIELD(fork, u64, time);
)
+__FUNC_PROCESS_NON_SAMPLE(mmap,
+ __NON_SAMPLE_SET_FIELD(mmap, u32, pid);
+ __NON_SAMPLE_SET_FIELD(mmap, u32, tid);
+ __NON_SAMPLE_SET_FIELD(mmap, u64_hex, start);
+ __NON_SAMPLE_SET_FIELD(mmap, string, filename);
+)
+__FUNC_PROCESS_NON_SAMPLE(mmap2,
+ __NON_SAMPLE_SET_FIELD(mmap2, u32, pid);
+ __NON_SAMPLE_SET_FIELD(mmap2, u32, tid);
+ __NON_SAMPLE_SET_FIELD(mmap2, u64_hex, start);
+ __NON_SAMPLE_SET_FIELD(mmap2, string, filename);
+)
#undef __NON_SAMPLE_SET_FIELD
#undef __FUNC_PROCESS_NON_SAMPLE
@@ -1254,6 +1268,19 @@ __FUNC_ADD_NON_SAMPLE_EVENT_CLASS(exit,
__NON_SAMPLE_ADD_FIELD(u64, time);
)
+__FUNC_ADD_NON_SAMPLE_EVENT_CLASS(mmap,
+ __NON_SAMPLE_ADD_FIELD(u32, pid);
+ __NON_SAMPLE_ADD_FIELD(u32, tid);
+ __NON_SAMPLE_ADD_FIELD(u64_hex, start);
+ __NON_SAMPLE_ADD_FIELD(string, filename);
+)
+
+__FUNC_ADD_NON_SAMPLE_EVENT_CLASS(mmap2,
+ __NON_SAMPLE_ADD_FIELD(u32, pid);
+ __NON_SAMPLE_ADD_FIELD(u32, tid);
+ __NON_SAMPLE_ADD_FIELD(u64_hex, start);
+ __NON_SAMPLE_ADD_FIELD(string, filename);
+)
#undef __NON_SAMPLE_ADD_FIELD
#undef __FUNC_ADD_NON_SAMPLE_EVENT_CLASS
@@ -1271,6 +1298,12 @@ static int setup_non_sample_events(struct ctf_writer *cw,
ret = add_fork_event(cw);
if (ret)
return ret;
+ ret = add_mmap_event(cw);
+ if (ret)
+ return ret;
+ ret = add_mmap2_event(cw);
+ if (ret)
+ return ret;
return 0;
}
@@ -1572,6 +1605,8 @@ int bt_convert__perf2ctf(const char *input, const char *path,
c.tool.comm = process_comm_event;
c.tool.exit = process_exit_event;
c.tool.fork = process_fork_event;
+ c.tool.mmap = process_mmap_event;
+ c.tool.mmap2 = process_mmap2_event;
}
err = perf_config(convert__config, &c);
--
2.9.4
next prev parent reply other threads:[~2017-07-28 20:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 20:00 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 01/15] perf tools: Add perf_evsel__read_size function Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 02/15] perf evsel: Add read_counter() Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 03/15] perf stat: Use group read for event groups Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 04/15] perf annotate: Do not overwrite perf_sample->weight Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 05/15] perf sort: Use default sort if evlist is empty Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 06/15] perf annotate stdio: Set enough columns for --show-total-period Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 07/15] perf annotate: Fix storing per line sym_hist_entry Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 08/15] perf annotate TUI: Use sym_hist_entry in disasm_line_samples Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 09/15] perf annotate TUI: Fix --show-total-period Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 10/15] perf annotate TUI: Clarify calculation of column header widths Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 11/15] perf annotate TUI: Fix column header when toggling period/percent Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 12/15] perf annotate TUI: Set appropriate column width for period/percent Arnaldo Carvalho de Melo
2017-07-28 20:00 ` [PATCH 13/15] perf data: Add callchain to CTF conversion Arnaldo Carvalho de Melo
2017-07-28 20:00 ` Arnaldo Carvalho de Melo [this message]
2017-07-28 20:00 ` [PATCH 15/15] perf data: Add doc when no conversion support compiled Arnaldo Carvalho de Melo
2017-07-30 9:31 ` [GIT PULL 00/15] perf/core improvements and fixes Ingo Molnar
2017-07-30 9:37 ` [PATCH] perf build: Clarify header version warning message Ingo Molnar
2017-07-30 9:51 ` perf build: Clarify open-coded " Ingo Molnar
2017-07-30 9:52 ` tools/include: Sync kernel ABI headers with tooling headers Ingo Molnar
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=20170728200021.11389-15-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=francis.deslauriers@efficios.com \
--cc=gbastien@versatic.net \
--cc=jdesfossez@efficios.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--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;
as well as URLs for NNTP newsgroup(s).