linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: acme@kernel.org (Arnaldo Carvalho de Melo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/21] perf symbols: debuglink should take symfs option into account
Date: Wed, 11 Feb 2015 18:09:01 -0300	[thread overview]
Message-ID: <1423688955-8094-8-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1423688955-8094-1-git-send-email-acme@kernel.org>

From: Victor Kamensky <victor.kamensky@linaro.org>

Currently code that tries to read corresponding debug symbol file from
.gnu_debuglink section (DSO_BINARY_TYPE__DEBUGLINK) does not take in
account symfs option, so filename__read_debuglink function cannot open
ELF file, if symfs option is used.

Fix is to add proper handling of symfs as it is done in other places:
use __symbol__join_symfs function to get real file name of target ELF
file.

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Tested-by: David Ahern <dsahern@gmail.com>
Acked-by: David Ahern <dsahern@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Avi Kivity <avi@cloudius-systems.com>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Waiman Long <Waiman.Long@hp.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel at lists.infradead.org
Link: http://lkml.kernel.org/r/1422340442-4673-3-git-send-email-victor.kamensky at linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/dso.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index a8b3f18db1a5..814554d1b857 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -45,13 +45,13 @@ int dso__read_binary_type_filename(const struct dso *dso,
 	case DSO_BINARY_TYPE__DEBUGLINK: {
 		char *debuglink;
 
-		strncpy(filename, dso->long_name, size);
-		debuglink = filename + dso->long_name_len;
+		len = __symbol__join_symfs(filename, size, dso->long_name);
+		debuglink = filename + len;
 		while (debuglink != filename && *debuglink != '/')
 			debuglink--;
 		if (*debuglink == '/')
 			debuglink++;
-		ret = filename__read_debuglink(dso->long_name, debuglink,
+		ret = filename__read_debuglink(filename, debuglink,
 					       size - (debuglink - filename));
 		}
 		break;
-- 
1.9.3

  parent reply	other threads:[~2015-02-11 21:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11 21:08 [GIT PULL 00/21] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-02-11 21:09 ` [PATCH 06/21] perf symbols: Ignore mapping symbols on aarch64 Arnaldo Carvalho de Melo
2015-02-11 21:09 ` Arnaldo Carvalho de Melo [this message]
2015-03-05  4:30 ` [GIT PULL 00/21] perf/core improvements and fixes Victor Kamensky
2015-03-05  6:37   ` Ingo Molnar
2015-03-05  6:49     ` Victor Kamensky

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=1423688955-8094-8-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=linux-arm-kernel@lists.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).