From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Kan Liang <kan.liang@intel.com>,
Andi Kleen <andi@firstfloor.org>,
Dima Kogan <dima@secretsauce.net>, Jiri Olsa <jolsa@redhat.com>,
Namhyung Kim <namhyung@kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 24/29] perf diff: Do not overwrite valid build id
Date: Tue, 20 Dec 2016 14:03:53 -0300 [thread overview]
Message-ID: <20161220170358.4350-25-acme@kernel.org> (raw)
In-Reply-To: <20161220170358.4350-1-acme@kernel.org>
From: Kan Liang <kan.liang@intel.com>
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.
However, the previous patch assumes the same binary name has same build
id. So it overwrites the build id according to the binary name,
regardless of whether the build id is set or not.
Check the has_build_id in dso__load. If the build id is already set, use
it.
Before the fix:
$ perf diff 1.perf.data 2.perf.data
# Event 'cycles'
#
# Baseline Delta Shared Object Symbol
# ........ ....... ................ .............................
#
99.83% -99.80% tchain_edit [.] f2
0.12% +99.81% tchain_edit [.] f3
0.02% -0.01% [ixgbe] [k] ixgbe_read_reg
After the fix:
$ perf diff 1.perf.data 2.perf.data
# Event 'cycles'
#
# Baseline Delta Shared Object Symbol
# ........ ....... ................ .............................
#
99.83% +0.10% tchain_edit [.] f3
0.12% -0.08% tchain_edit [.] f2
Signed-off-by: Kan Liang <kan.liang@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
CC: Dima Kogan <dima@secretsauce.net>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Fixes: 5baecbcd9c9a ("perf symbols: we can now read separate debug-info files based on a build ID")
Link: http://lkml.kernel.org/r/1481642984-13593-1-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 df2482b2ba45..dc93940de351 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1459,7 +1459,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.9.3
next prev parent reply other threads:[~2016-12-20 17:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-20 17:03 [GIT PULL 00/29] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 01/29] perf tools: Move headers check into bash script Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 02/29] perf sched timehist: Split is_idle_sample() Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 03/29] perf sched timehist: Introduce struct idle_time_data Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 04/29] perf sched timehist: Save callchain when entering idle Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 05/29] perf sched timehist: Skip non-idle events when necessary Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 06/29] perf sched timehist: Add -I/--idle-hist option Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 07/29] perf sched timehist: Show callchains for idle stat Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 08/29] perf tools: Remove some needless __maybe_unused Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 09/29] perf mem: Fix --all-user/--all-kernel options Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 10/29] perf evsel: Use variable instead of repeating lengthy FD macro Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 11/29] perf thread_map: Add thread_map__remove function Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 12/29] perf evsel: Allow to ignore missing pid Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 13/29] perf record: Force ignore_missing_thread for uid option Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 14/29] perf annotate: Support jump instruction with target as second operand Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 15/29] perf annotate: Fix jump target outside of function address range Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 16/29] tools lib bpf: Sync {tools,}/include/uapi/linux/bpf.h Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 17/29] tools lib bpf: use __u32 from linux/types.h Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 18/29] tools lib bpf: Add flags to bpf_create_map() Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 19/29] samples/bpf: Make samples more libbpf-centric Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 20/29] samples/bpf: Make perf_event_read() static Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 21/29] perf trace: Check if MAP_32BIT is defined (again) Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 22/29] perf bench futex: Fix lock-pi help string Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 23/29] perf annotate: Don't throw error for zero length symbols Arnaldo Carvalho de Melo
2016-12-20 17:03 ` Arnaldo Carvalho de Melo [this message]
2016-12-20 17:03 ` [PATCH 25/29] samples/bpf: Switch over to libbpf Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 26/29] tools lib bpf: Add bpf_prog_{attach,detach} Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 27/29] samples/bpf: Be consistent with bpf_load_program bpf_insn parameter Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 28/29] samples/bpf: Remove perf_event_open() declaration Arnaldo Carvalho de Melo
2016-12-20 17:03 ` [PATCH 29/29] samples/bpf: Move open_raw_sock to separate header Arnaldo Carvalho de Melo
2016-12-20 19:15 ` [GIT PULL 00/29] perf/core improvements and fixes Ingo Molnar
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=20161220170358.4350-25-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=andi@firstfloor.org \
--cc=dima@secretsauce.net \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@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;
as well as URLs for NNTP newsgroup(s).