[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1471584546-11080-5-git-send-email-ravi.bangoria@linux.vnet.ibm.com>
Date: Fri, 19 Aug 2016 10:59:03 +0530
From: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
To: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
acme@...nel.org
Cc: peterz@...radead.org, mingo@...hat.com,
alexander.shishkin@...ux.intel.com, treeze.taeung@...il.com,
naveen.n.rao@...ux.vnet.ibm.com, markus@...ppelsdorf.de,
chris.ryder@....com, pawel.moll@....com, mhiramat@...nel.org,
rmk+kernel@....linux.org.uk, jolsa@...nel.org, mpe@...erman.id.au,
hemant@...ux.vnet.ibm.com, namhyung@...nel.org,
Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
Subject: [PATCH v5 4/7] perf annotate: Do not ignore call instruction with indirect target
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@...erman.id.au>
[Suggested about 'bctrl' instruction]
Signed-off-by: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
---
Changes in v5:
- New patch, introduced to annotate all indirect call instructions.
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 0b64841..6368ba9 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -81,16 +81,12 @@ static int call__parse(struct ins_operands *ops, const char *norm_arch)
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.5.5
Powered by blists - more mailing lists