From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>, Paul Mackerras <paulus@samba.org>,
Namhyung Kim <namhyung.kim@lge.com>,
Namhyung Kim <namhyung@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Stephane Eranian <eranian@google.com>,
Cody P Schafer <cody@linux.vnet.ibm.com>
Subject: [PATCH 3/4] perf tools: Check return value of filename__read_debuglink()
Date: Thu, 20 Feb 2014 10:32:55 +0900 [thread overview]
Message-ID: <1392859976-32760-3-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1392859976-32760-1-git-send-email-namhyung@kernel.org>
From: Stephane Eranian <eranian@google.com>
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.
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
Stephane, can I add your s-o-b here?
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 4045d086d9d9..64453d63b971 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 3e9f336740fa..8ac4a4fe2abd 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:
--
1.7.11.7
next prev parent reply other threads:[~2014-02-20 1:33 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 ` Namhyung Kim [this message]
2014-02-27 13:30 ` [tip:perf/core] perf symbols: Check return value of filename__read_debuglink() tip-bot for Stephane Eranian
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=1392859976-32760-3-git-send-email-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=cody@linux.vnet.ibm.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=paulus@samba.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
all inboxes | Powered by JetHome®