Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1487601

[PATCH 17/22] perf annotate: Do not ignore call instruction with indirect target

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 17/22] perf annotate: Do not ignore call instruction with indirect target
Date 2016-09-20 22:10 +0200
Message-ID <sjzwD-7F4-75@gated-at.bofh.it> (permalink)
References <sjzwB-7F4-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>

Do not ignore call instruction with indirect target when its already
identified as a call. This is an extension of commit e8ea1561952b ("perf
annotate: Use raw form for register indirect call instructions") to
generalize annotation for all instructions with indirect calls.

This is needed for certain powerpc call instructions that use address in
a register (such as bctrl, btarl, ...).

Apart from that, when kcore is used to disassemble function, all call
instructions were ignored. This patch will fix it as a side effect by
not ignoring them. For example,

Before (with kcore):
       mov    %r13,%rdi
       callq  0xffffffff811a7e70
     ^ jmpq   64
       mov    %gs:0x7ef41a6e(%rip),%al

After (with kcore):
       mov    %r13,%rdi
     > callq  0xffffffff811a7e70
     ^ jmpq   64
       mov    %gs:0x7ef41a6e(%rip),%al

Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
[Suggested about 'bctrl' instruction]
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Chris Riyder <chris.ryder@arm.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Taeung Song <treeze.taeung@gmail.com>
Link: http://lkml.kernel.org/r/1471611578-11255-5-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/annotate.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 7a80c7362a03..60e915f392a6 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -82,16 +82,12 @@ static int call__parse(struct ins_operands *ops)
 	return ops->target.name == NULL ? -1 : 0;
 
 indirect_call:
-	tok = strchr(endptr, '(');
-	if (tok != NULL) {
+	tok = strchr(endptr, '*');
+	if (tok == NULL) {
 		ops->target.addr = 0;
 		return 0;
 	}
 
-	tok = strchr(endptr, '*');
-	if (tok == NULL)
-		return -1;
-
 	ops->target.addr = strtoull(tok + 1, NULL, 16);
 	return 0;
 }
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/22] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  [PATCH 10/22] perf ui/stdio: Always reset output width for hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  [PATCH 17/22] perf annotate: Do not ignore call instruction with indirect target Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  [PATCH 08/22] perf hists: Introduce hists__link_hierarchy() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  [PATCH 20/22] perf ui/tui: Reset output width for hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  [PATCH 22/22] perf symbols: Do not open device files Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  [PATCH 12/22] perf report: Enable group view with hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  [PATCH 05/22] perf tools: Do hugetlb handling in more systems Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  [PATCH 07/22] perf hists: Introduce hists__match_hierarchy() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  [PATCH 18/22] perf annotate: Pass the symbol's map/dso to the instruction parsers Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-09-20 22:10 +0200
  Re: [GIT PULL 00/22] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-09-20 23:40 +0200

csiph-web