From: tip-bot for Mike Galbraith <efault@gmx.de>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mathieu.desnoyers@polymtl.ca,
acme@redhat.com, hpa@zytor.com, mingo@redhat.com,
a.p.zijlstra@chello.nl, efault@gmx.de, fweisbec@gmail.com,
tglx@linutronix.de, mhiramat@redhat.com, mingo@elte.hu,
avi@redhat.com
Subject: [tip:perf/urgent] perf tools: Fix module symbol loading bug
Date: Wed, 23 Sep 2009 11:49:18 GMT [thread overview]
Message-ID: <tip-508c4d0874acf8584787bbab7e4a3798e2834c1a@git.kernel.org> (raw)
In-Reply-To: <1253697658.11461.36.camel@marge.simson.net>
Commit-ID: 508c4d0874acf8584787bbab7e4a3798e2834c1a
Gitweb: http://git.kernel.org/tip/508c4d0874acf8584787bbab7e4a3798e2834c1a
Author: Mike Galbraith <efault@gmx.de>
AuthorDate: Wed, 23 Sep 2009 11:20:58 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 23 Sep 2009 13:45:48 +0200
perf tools: Fix module symbol loading bug
Avi Kivity reported 'perf annotate' failures with modules, the
requested function was not annotated.
If there are no modules currently loaded, or the last module
scanned is not loaded, dso__load_modules() steps on the value from
dso__load_vmlinux(), so we happily load the kallsyms symbols on top
of what we've already loaded.
Fix that such that the total count of symbols loaded is returned.
Should module symbol load fail after parsing of vmlinux, is's a
hard failure, so do not silently fall-back to kallsyms.
Reported-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: rostedt@goodmis.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
LKML-Reference: <1253697658.11461.36.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/util/symbol.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index fd3d9c8..559fb06 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -833,7 +833,7 @@ int dso__load_modules(struct dso *self, symbol_filter_t filter, int v)
struct mod_dso *mods = mod_dso__new_dso("modules");
struct module *pos;
struct rb_node *next;
- int err;
+ int err, count = 0;
err = mod_dso__load_modules(mods);
@@ -852,14 +852,16 @@ int dso__load_modules(struct dso *self, symbol_filter_t filter, int v)
break;
next = rb_next(&pos->rb_node);
+ count += err;
}
if (err < 0) {
mod_dso__delete_modules(mods);
mod_dso__delete_self(mods);
+ return err;
}
- return err;
+ return count;
}
static inline void dso__fill_symbol_holes(struct dso *self)
@@ -913,8 +915,15 @@ int dso__load_kernel(struct dso *self, const char *vmlinux,
if (vmlinux) {
err = dso__load_vmlinux(self, vmlinux, filter, v);
- if (err > 0 && use_modules)
- err = dso__load_modules(self, filter, v);
+ if (err > 0 && use_modules) {
+ int syms = dso__load_modules(self, filter, v);
+
+ if (syms < 0) {
+ fprintf(stderr, "dso__load_modules failed!\n");
+ return syms;
+ }
+ err += syms;
+ }
}
if (err <= 0)
next prev parent reply other threads:[~2009-09-23 11:50 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-16 20:16 mailing list for trace users Steven Rostedt
2009-09-21 19:17 ` Frederic Weisbecker
2009-09-22 0:46 ` Li Zefan
2009-09-22 9:31 ` Ingo Molnar
2009-09-21 19:50 ` John Kacur
2009-09-22 9:13 ` Avi Kivity
2009-09-22 10:59 ` Peter Zijlstra
2009-09-22 11:51 ` Mike Galbraith
2009-09-22 11:18 ` Mike Galbraith
2009-09-22 11:28 ` Mike Galbraith
2009-09-22 11:34 ` Avi Kivity
2009-09-22 11:47 ` Mike Galbraith
2009-09-22 11:51 ` Avi Kivity
2009-09-22 11:54 ` Mike Galbraith
2009-09-22 13:53 ` Mike Galbraith
2009-09-22 14:03 ` Avi Kivity
2009-09-22 19:09 ` Mike Galbraith
2009-09-22 19:14 ` Avi Kivity
2009-09-23 8:26 ` Mike Galbraith
2009-09-22 20:17 ` [perf] Finding uninstalled modules Was " Arnaldo Carvalho de Melo
2009-09-23 8:31 ` Avi Kivity
2009-09-23 8:37 ` Arnaldo Carvalho de Melo
2009-09-23 9:15 ` Ingo Molnar
2009-09-23 9:20 ` [patch] " Mike Galbraith
2009-09-23 9:55 ` Avi Kivity
2009-09-23 10:02 ` Mike Galbraith
2009-09-23 11:31 ` Mike Galbraith
2009-09-23 12:00 ` Mike Galbraith
2009-09-23 12:58 ` Avi Kivity
2009-09-23 13:06 ` Mike Galbraith
2009-09-23 13:10 ` Avi Kivity
2009-09-23 13:50 ` Mike Galbraith
2009-09-23 14:00 ` Avi Kivity
2009-09-23 14:09 ` Mike Galbraith
2009-09-23 14:39 ` Avi Kivity
2009-09-23 14:52 ` Mike Galbraith
2009-09-23 14:56 ` Avi Kivity
2009-09-23 15:05 ` Mike Galbraith
2009-09-23 15:09 ` Avi Kivity
2009-09-23 15:26 ` Mike Galbraith
2009-09-24 8:07 ` Mike Galbraith
2009-09-24 11:01 ` [tip:perf/urgent] perf tools: Handle relative paths while loading module symbols tip-bot for Mike Galbraith
2009-09-23 11:49 ` tip-bot for Mike Galbraith [this message]
2009-09-22 22:32 ` mailing list for trace users David Miller
2009-09-23 11:47 ` Ingo Molnar
2009-09-23 16:45 ` Masami Hiramatsu
2009-09-23 17:00 ` Ingo Molnar
2009-09-23 18:07 ` Masami Hiramatsu
2009-09-23 20:07 ` Ingo Molnar
2009-09-23 18:14 ` David Miller
2009-09-23 19:30 ` Ingo Molnar
2009-09-23 19:40 ` John Kacur
2009-09-23 19:42 ` John Kacur
2009-09-23 19:59 ` Ingo Molnar
2009-09-23 21:24 ` Steven Rostedt
2009-09-23 21:41 ` Ingo Molnar
2009-09-23 21:56 ` Ingo Molnar
2009-09-23 19:49 ` Ingo Molnar
2009-09-23 20:08 ` John Kacur
2009-09-23 21:54 ` David Miller
2009-09-23 22:02 ` Ingo Molnar
2009-09-23 22:47 ` David Miller
2009-09-24 11:51 ` Ingo Molnar
2009-09-23 11:48 ` Ingo Molnar
2009-09-23 18:12 ` David Miller
2009-09-23 19:41 ` Ingo Molnar
2009-09-23 21:55 ` David Miller
2009-09-23 22:10 ` Ingo Molnar
2009-09-23 22:41 ` David Miller
2009-09-24 11:16 ` Ingo Molnar
2009-09-24 16:40 ` David Miller
2009-09-24 18:58 ` David Miller
2009-09-24 19:22 ` 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=tip-508c4d0874acf8584787bbab7e4a3798e2834c1a@git.kernel.org \
--to=efault@gmx.de \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=avi@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mhiramat@redhat.com \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--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
Powered by JetHome