From: Don Zickus <dzickus@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
eranian@google.com, jmario@redhat.com,
Don Zickus <dzickus@redhat.com>
Subject: [PATCH] perf: Fallback to MAP__FUNCTION if daddr maps are NULL
Date: Wed, 20 Aug 2014 23:25:11 -0400 [thread overview]
Message-ID: <1408591511-57884-1-git-send-email-dzickus@redhat.com> (raw)
As we run "perf c2c" on more applications, we noticed we're missing significant
samples from a common customer's application. Looking at the
/proc/<pid>/maps file for the app, we see "rwxs" and "rwxp" permissions on many
of the shared memory & heap regions, and on all the thread stacks.
Because those regions have the "x" bit set, perf marks them with a MAP_FUNCTION
type. Hence ip_resolve_data() never finds load or store events coming from
them.
We fixed this by re-calling thread__find_addr_location with MAP__FUNCTION in
the case where map is NULL as a last ditch effort to map the sample before
giving up and dropping it.
Reported-by: Joe Mario <jmario@redhat.com>
Tested-by: Joe Mario <jmario@redhat.com>
Signed-off-by: Don Zickus <dzickus@redhat.com>
---
tools/perf/util/machine.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 0e5fea9..e62bd87 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1241,6 +1241,16 @@ static void ip__resolve_data(struct machine *machine, struct thread *thread,
thread__find_addr_location(thread, machine, m, MAP__VARIABLE, addr,
&al);
+ if (al.map == NULL) {
+ /*
+ * some shared data regions have execute bit set which puts
+ * their mapping in the MAP__FUNCTION type array.
+ * Check there as a fallback option before dropping the sample.
+ */
+ thread__find_addr_location(thread, machine, m, MAP__FUNCTION, addr,
+ &al);
+ }
+
ams->addr = addr;
ams->al_addr = al.addr;
ams->sym = al.sym;
--
1.7.1
next reply other threads:[~2014-08-21 3:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-21 3:25 Don Zickus [this message]
2014-08-21 7:04 ` Jiri Olsa
2014-08-21 15:48 ` Arnaldo Carvalho de Melo
2014-08-24 14:59 ` [tip:perf/core] perf machine: " tip-bot for Don Zickus
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=1408591511-57884-1-git-send-email-dzickus@redhat.com \
--to=dzickus@redhat.com \
--cc=acme@kernel.org \
--cc=eranian@google.com \
--cc=jmario@redhat.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.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 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®