From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: paulus@samba.org, jolsa@kernel.org, tglx@linutronix.de,
a.p.zijlstra@chello.nl, adrian.hunter@intel.com,
eranian@google.com, cjashfor@linux.vnet.ibm.com, hpa@zytor.com,
linux-kernel@vger.kernel.org, mingo@kernel.org,
dsahern@gmail.com, acme@redhat.com, fweisbec@gmail.com,
namhyung@kernel.org
Subject: [tip:perf/core] perf tools: Try to lookup kernel module map before creating one
Date: Tue, 24 Mar 2015 09:30:02 -0700 [thread overview]
Message-ID: <tip-kx76xfqpnrpho5hdaapbqm09@git.kernel.org> (raw)
Commit-ID: bc84f464862489e687c98dea1a8ff20dc4413f93
Gitweb: http://git.kernel.org/tip/bc84f464862489e687c98dea1a8ff20dc4413f93
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Tue, 17 Feb 2015 17:31:18 +0100
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 23 Mar 2015 12:46:51 -0300
perf tools: Try to lookup kernel module map before creating one
Currently we assume machine__new_module is called only once for each
module so we create its map&dso unconditionally.
However it's possible that it's called multiple times for same module.
Like for perf record:
1) via machine__create_module during machine init
2) via kernel MMAP event processing
Trying to lookup kernel module map before creating one.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-kx76xfqpnrpho5hdaapbqm09@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/machine.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 1de5438..e335330 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -498,6 +498,11 @@ struct map *machine__new_module(struct machine *machine, u64 start,
if (kmod_path__parse_name(&m, filename))
return NULL;
+ map = map_groups__find_by_name(&machine->kmaps, MAP__FUNCTION,
+ m.name);
+ if (map)
+ goto out;
+
dso = machine__module_dso(machine, &m, filename);
if (dso == NULL)
goto out;
reply other threads:[~2015-03-24 16:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=tip-kx76xfqpnrpho5hdaapbqm09@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
/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®