From: kan.liang@intel.com
To: acme@kernel.org
Cc: linux-kernel@vger.kernel.org, dima@secretsauce.net,
jolsa@redhat.com, namhyung@kernel.org, andi@firstfloor.org,
Kan Liang <kan.liang@intel.com>
Subject: [PATCH] perf diff: bug fix, donot overwrite build id in dso__load
Date: Tue, 13 Sep 2016 09:29:37 -0700 [thread overview]
Message-ID: <1473784177-10131-1-git-send-email-kan.liang@intel.com> (raw)
From: Kan Liang <kan.liang@intel.com>
This patch fixes a perf diff regression issue which was introduced by:
commit 5baecbcd9c9a ("perf symbols: we can now read separate debug-info
files based on a build ID")
The binary name could be same when perf diff different binaries. Build
id is used to distinguish between them. The unique build id will be set
when processing the header.
However, the previous patch relies on binary name to find build id.
Furthermore, it overwrites the build id regardless of whether the build
id is set or not. That will bring issue when perf diff different
binaries.
This patch prevent the overwrite by checking has_build_id.
Signed-off-by: Kan Liang <kan.liang@intel.com>
---
tools/perf/util/symbol.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 19c9c55..2392c03 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1444,7 +1444,8 @@ int dso__load(struct dso *dso, struct map *map)
* Read the build id if possible. This is required for
* DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work
*/
- if (is_regular_file(dso->long_name) &&
+ if (!dso->has_build_id &&
+ is_regular_file(dso->long_name) &&
filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0)
dso__set_build_id(dso, build_id);
--
2.5.5
reply other threads:[~2016-09-13 16:29 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=1473784177-10131-1-git-send-email-kan.liang@intel.com \
--to=kan.liang@intel.com \
--cc=acme@kernel.org \
--cc=andi@firstfloor.org \
--cc=dima@secretsauce.net \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.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®