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


Groups > linux.kernel > #1466375 > unrolled thread

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

Started byRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
First post2016-08-19 15:10 +0200
Last post2016-08-19 15:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v6 6/7] perf annotate: Support jump instruction with target as second operand Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> - 2016-08-19 15:10 +0200

#1466375 — [PATCH v6 6/7] perf annotate: Support jump instruction with target as second operand

FromRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Date2016-08-19 15:10 +0200
Subject[PATCH v6 6/7] perf annotate: Support jump instruction with target as second operand
Message-ID<s7RIC-61N-25@gated-at.bofh.it>
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 v6:
  - No changes

 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 7ecb1b8..73c4f48 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web