public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf annotate: Don't truncate Intel style addresses
@ 2014-08-14 21:03 Alex Converse
  2014-08-15 13:39 ` Arnaldo Carvalho de Melo
  2014-08-18  8:21 ` [tip:perf/core] perf annotate: Don' t " tip-bot for Alex Converse
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Converse @ 2014-08-14 21:03 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim,
	Adrian Hunter, Jiri Olsa, linux-kernel, Andi Kleen, Alex Converse

Instructions like "mov r9,QWORD PTR [rdx+0x8]" were being truncated to
"mov r9,QWORD" by code that assuemd operands cannot have spaces.

Signed-off-by: Alex Converse <aconverse@google.com>
---
 tools/perf/util/annotate.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 809b4c5..cc6f72c 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -232,9 +232,16 @@ static int mov__parse(struct ins_operands *ops)
 		return -1;
 
 	target = ++s;
+	comment = strchr(s, '#');
 
-	while (s[0] != '\0' && !isspace(s[0]))
-		++s;
+	if (comment != NULL)
+		s = comment - 1;
+	else
+		s = strchr(s, '\0') - 1;
+
+	while (s > target && isspace(s[0]))
+		--s;
+	s++;
 	prev = *s;
 	*s = '\0';
 
@@ -244,7 +251,6 @@ static int mov__parse(struct ins_operands *ops)
 	if (ops->target.raw == NULL)
 		goto out_free_source;
 
-	comment = strchr(s, '#');
 	if (comment == NULL)
 		return 0;
 
-- 
2.1.0.rc2.206.gedb03e5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-18  8:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 21:03 [PATCH] perf annotate: Don't truncate Intel style addresses Alex Converse
2014-08-15 13:39 ` Arnaldo Carvalho de Melo
2014-08-18  8:21 ` [tip:perf/core] perf annotate: Don' t " tip-bot for Alex Converse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox