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


Groups > linux.kernel > #1466013

[PATCH v5 6/7] perf annotate: Support jump instruction with target as second operand

From Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH v5 6/7] perf annotate: Support jump instruction with target as second operand
Date 2016-08-19 07:40 +0200
Message-ID <s7KH8-1uc-9@gated-at.bofh.it> (permalink)
References <s7Kxs-1qQ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Current perf is not able to parse jump instruction when second operand
contains target address. Arch like powerpc has such instructions. For
example, 'beq  cr7,10173e60'.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
Changes in v5:
  - New patch

 tools/perf/util/annotate.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 4a4a583..678fb81 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -117,8 +117,12 @@ static int jump__parse(struct ins_operands *ops,
 		       const char *norm_arch __maybe_unused)
 {
 	const char *s = strchr(ops->raw, '+');
+	const char *c = strchr(ops->raw, ',');
 
-	ops->target.addr = strtoull(ops->raw, NULL, 16);
+	if (c++ != NULL)
+		ops->target.addr = strtoull(c, NULL, 16);
+	else
+		ops->target.addr = strtoull(ops->raw, NULL, 16);
 
 	if (s++ != NULL)
 		ops->target.offset = strtoull(s, NULL, 16);
-- 
2.5.5

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


Thread

[PATCH v5 0/7] perf: Cross arch annotate + few miscellaneous fixes Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-19 07:30 +0200
  [PATCH v5 1/7] perf: Define macro for normalized arch names Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-19 07:30 +0200
  [PATCH v5 7/7] perf annotate: Fix jump target outside of function address range Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-19 07:40 +0200
  [PATCH v5 6/7] perf annotate: Support jump instruction with target as second operand Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-19 07:40 +0200
  [PATCH v5 3/7] perf annotate: Add support for powerpc Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-19 07:40 +0200
  [PATCH v5 2/7] perf annotate: Add cross arch annotate support Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-19 07:40 +0200
    Re: [PATCH v5 2/7] perf annotate: Add cross arch annotate support Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-08-19 10:00 +0200
      Re: [PATCH v5 2/7] perf annotate: Add cross arch annotate support Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-08-19 12:50 +0200
        Re: [PATCH v5 2/7] perf annotate: Add cross arch annotate support Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-19 13:40 +0200
      Re: [PATCH v5 2/7] perf annotate: Add cross arch annotate support Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-19 12:50 +0200

csiph-web