From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: perf-record & perf-report in root directory: can't find binaries for symbol resolution
Date: Sat, 31 Oct 2009 11:56:49 +0000 [thread overview]
Message-ID: <4AEC2601.8030803@tuffmail.co.uk> (raw)
Hi,
When I ran perf record & report in the root directory, I noticed that
perf couldn't find any binaries. Both addresses and the actual names of
the binaries were printed as raw hex values:
# Overhead Command Shared Object Symbol
# ........ ............... ............. ......
#
14.23% modprobe b777ce85 [.] 0x000000b777ce85
|
|--9.52%-- 0x804cad2
| 0x8049b32
Strace showed that perf report was trying to open ".sbin/modprobe". I
found a one-line fix, which should at least explain my problem:
---------------------------------------------
>From a2eb15237fee2276fc8e388f9e15409ed7caf9e1 Mon Sep 17 00:00:00 2001
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Date: Fri, 30 Oct 2009 14:12:30 +0000
Subject: [PATCH] perf tools: fix test for whether pathnames can be shortened
The intention is to consider the pair (filename, cwd) and shorten the
filename if it lives under cwd. E.g. ("/src/foo", "/src") -> "./foo".
Make the test more specific to exclude these unintended consequences:
("/src/foo", "/") -> ".src/foo"
("/src/foo", "/s") -> ".rc/foo"
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
tools/perf/util/map.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 804e023..bd17703 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -31,7 +31,7 @@ static int strcommon(const char *pathname, char *cwd, int cwdlen)
if (cwd) {
int n = strcommon(filename, cwd, cwdlen);
- if (n == cwdlen) {
+ if (n == cwdlen && filename[n] == '/') {
snprintf(newfilename, sizeof(newfilename),
".%s", filename + n);
filename = newfilename;
--
1.6.3.2
reply other threads:[~2009-10-31 11:56 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=4AEC2601.8030803@tuffmail.co.uk \
--to=alan-jenkins@tuffmail.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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