From: tip-bot for Stephane Eranian <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
eranian@google.com, hpa@zytor.com, mingo@kernel.org,
cody@linux.vnet.ibm.com, a.p.zijlstra@chello.nl,
namhyung.kim@lge.com, namhyung@kernel.org, tglx@linutronix.de
Subject: [tip:perf/core] perf symbols: Check return value of filename__read_debuglink()
Date: Thu, 27 Feb 2014 05:30:01 -0800 [thread overview]
Message-ID: <tip-0d3dc5e8b85a144aaeb5dc26f7f2113e4c4e7e81@git.kernel.org> (raw)
In-Reply-To: <1392859976-32760-3-git-send-email-namhyung@kernel.org>
Commit-ID: 0d3dc5e8b85a144aaeb5dc26f7f2113e4c4e7e81
Gitweb: http://git.kernel.org/tip/0d3dc5e8b85a144aaeb5dc26f7f2113e4c4e7e81
Author: Stephane Eranian <eranian@google.com>
AuthorDate: Thu, 20 Feb 2014 10:32:55 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 24 Feb 2014 16:24:38 -0300
perf symbols: Check return value of filename__read_debuglink()
When dso__read_binary_type_filename() called, it doesn't check the
return value of filename__read_debuglink() so that it'll try to open the
debuglink file even if it doesn't exist.
Also fix return value of the filename__read_debuglink() as it always
return -1 regardless of the result.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1392859976-32760-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/dso.c | 4 ++--
tools/perf/util/symbol-elf.c | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 4045d08..64453d6 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -45,8 +45,8 @@ int dso__read_binary_type_filename(const struct dso *dso,
debuglink--;
if (*debuglink == '/')
debuglink++;
- filename__read_debuglink(dso->long_name, debuglink,
- size - (debuglink - filename));
+ ret = filename__read_debuglink(dso->long_name, debuglink,
+ size - (debuglink - filename));
}
break;
case DSO_BINARY_TYPE__BUILD_ID_CACHE:
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 3e9f336..8ac4a4f 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -506,6 +506,8 @@ int filename__read_debuglink(const char *filename, char *debuglink,
/* the start of this section is a zero-terminated string */
strncpy(debuglink, data->d_buf, size);
+ err = 0;
+
out_elf_end:
elf_end(elf);
out_close:
next prev parent reply other threads:[~2014-02-27 13:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-20 1:32 [PATCH 1/4] perf tools: Check availability of annotate when processing samples Namhyung Kim
2014-02-20 1:32 ` [PATCH 2/4] perf tools: Destroy unused symsrcs Namhyung Kim
2014-02-27 13:29 ` [tip:perf/urgent] perf symbols: " tip-bot for Namhyung Kim
2014-02-20 1:32 ` [PATCH 3/4] perf tools: Check return value of filename__read_debuglink() Namhyung Kim
2014-02-27 13:30 ` tip-bot for Stephane Eranian [this message]
2014-02-20 1:32 ` [PATCH 4/4] perf tools: Check compatible symtab type before loading dso Namhyung Kim
2014-02-27 13:30 ` [tip:perf/core] perf symbols: " tip-bot for Namhyung Kim
2014-02-24 12:46 ` [PATCH 1/4] perf tools: Check availability of annotate when processing samples Arnaldo Carvalho de Melo
2014-02-27 13:29 ` [tip:perf/urgent] perf annotate: " tip-bot for Namhyung Kim
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-0d3dc5e8b85a144aaeb5dc26f7f2113e4c4e7e81@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=cody@linux.vnet.ibm.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--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®