diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-10-05 14:07:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-10-05 14:07:08 -0400 |
commit | 874d48f2af91efc38c720e7c6450547f6ea8c843 (patch) | |
tree | f945d083595f20cada9273ecdc58357b899587dd /tools | |
parent | 77ede3a014a32746002f7889211f0cecf4803163 (diff) | |
parent | c1fbc0cf81f1c464f5fda322c1104d4bb1da6711 (diff) |
Merge tag 'perf-urgent-for-mingo-4.14-20171005' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fix from Arnaldo Carvalho de Melo:
- Two functions from different binaries can have the same start address. Thus,
comparing only the start address in match_chain() leads to inconsistent
callchains. Fix this by adding a check for DSOs as well (Ravi Bangoria)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/callchain.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index be09d77cade0..a971caf3759d 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c | |||
@@ -685,6 +685,8 @@ static enum match_result match_chain(struct callchain_cursor_node *node, | |||
685 | { | 685 | { |
686 | struct symbol *sym = node->sym; | 686 | struct symbol *sym = node->sym; |
687 | u64 left, right; | 687 | u64 left, right; |
688 | struct dso *left_dso = NULL; | ||
689 | struct dso *right_dso = NULL; | ||
688 | 690 | ||
689 | if (callchain_param.key == CCKEY_SRCLINE) { | 691 | if (callchain_param.key == CCKEY_SRCLINE) { |
690 | enum match_result match = match_chain_srcline(node, cnode); | 692 | enum match_result match = match_chain_srcline(node, cnode); |
@@ -696,12 +698,14 @@ static enum match_result match_chain(struct callchain_cursor_node *node, | |||
696 | if (cnode->ms.sym && sym && callchain_param.key == CCKEY_FUNCTION) { | 698 | if (cnode->ms.sym && sym && callchain_param.key == CCKEY_FUNCTION) { |
697 | left = cnode->ms.sym->start; | 699 | left = cnode->ms.sym->start; |
698 | right = sym->start; | 700 | right = sym->start; |
701 | left_dso = cnode->ms.map->dso; | ||
702 | right_dso = node->map->dso; | ||
699 | } else { | 703 | } else { |
700 | left = cnode->ip; | 704 | left = cnode->ip; |
701 | right = node->ip; | 705 | right = node->ip; |
702 | } | 706 | } |
703 | 707 | ||
704 | if (left == right) { | 708 | if (left == right && left_dso == right_dso) { |
705 | if (node->branch) { | 709 | if (node->branch) { |
706 | cnode->branch_count++; | 710 | cnode->branch_count++; |
707 | 711 | ||