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

* Re: [PATCH] perf annotate: Don't truncate Intel style addresses
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-08-15 13:39 UTC (permalink / raw)
  To: Alex Converse
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim,
	Adrian Hunter, Jiri Olsa, linux-kernel, Andi Kleen

Em Thu, Aug 14, 2014 at 02:03:00PM -0700, Alex Converse escreveu:
> 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>

Thanks, applied.

- Arnaldo

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

* [tip:perf/core] perf annotate: Don' t truncate Intel style addresses
  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-bot for Alex Converse
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Alex Converse @ 2014-08-18  8:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, mingo, hpa, mingo, a.p.zijlstra,
	namhyung, jolsa, aconverse, adrian.hunter, ak, tglx

Commit-ID:  1e2bb043f171084e5f34816a4268304512d35a46
Gitweb:     http://git.kernel.org/tip/1e2bb043f171084e5f34816a4268304512d35a46
Author:     Alex Converse <aconverse@google.com>
AuthorDate: Thu, 14 Aug 2014 14:03:00 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 15 Aug 2014 10:39:26 -0300

perf annotate: Don't truncate Intel style addresses

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>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1408050180-14088-1-git-send-email-aconverse@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 7745fec..3643752 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;
 

^ 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