Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 874d48f2 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-urgent-for-mingo-4.14-20171005' of...

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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 77ede3a0 c1fbc0cf
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -685,6 +685,8 @@ static enum match_result match_chain(struct callchain_cursor_node *node,
{
	struct symbol *sym = node->sym;
	u64 left, right;
	struct dso *left_dso = NULL;
	struct dso *right_dso = NULL;

	if (callchain_param.key == CCKEY_SRCLINE) {
		enum match_result match = match_chain_srcline(node, cnode);
@@ -696,12 +698,14 @@ static enum match_result match_chain(struct callchain_cursor_node *node,
	if (cnode->ms.sym && sym && callchain_param.key == CCKEY_FUNCTION) {
		left = cnode->ms.sym->start;
		right = sym->start;
		left_dso = cnode->ms.map->dso;
		right_dso = node->map->dso;
	} else {
		left = cnode->ip;
		right = node->ip;
	}

	if (left == right) {
	if (left == right && left_dso == right_dso) {
		if (node->branch) {
			cnode->branch_count++;