diff options
author | Alex Converse <aconverse@google.com> | 2014-08-14 17:03:00 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-08-15 09:39:26 -0400 |
commit | 1e2bb043f171084e5f34816a4268304512d35a46 (patch) | |
tree | 9bcc7ec899ce73de0dd7f8a38988b334652d1744 /tools/perf/util/annotate.c | |
parent | 92561cb7883194714475c7a7775a11a9c40f75cb (diff) |
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>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r-- | tools/perf/util/annotate.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 7745fec01a6b..36437527dbb3 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) | |||
232 | return -1; | 232 | return -1; |
233 | 233 | ||
234 | target = ++s; | 234 | target = ++s; |
235 | comment = strchr(s, '#'); | ||
235 | 236 | ||
236 | while (s[0] != '\0' && !isspace(s[0])) | 237 | if (comment != NULL) |
237 | ++s; | 238 | s = comment - 1; |
239 | else | ||
240 | s = strchr(s, '\0') - 1; | ||
241 | |||
242 | while (s > target && isspace(s[0])) | ||
243 | --s; | ||
244 | s++; | ||
238 | prev = *s; | 245 | prev = *s; |
239 | *s = '\0'; | 246 | *s = '\0'; |
240 | 247 | ||
@@ -244,7 +251,6 @@ static int mov__parse(struct ins_operands *ops) | |||
244 | if (ops->target.raw == NULL) | 251 | if (ops->target.raw == NULL) |
245 | goto out_free_source; | 252 | goto out_free_source; |
246 | 253 | ||
247 | comment = strchr(s, '#'); | ||
248 | if (comment == NULL) | 254 | if (comment == NULL) |
249 | return 0; | 255 | return 0; |
250 | 256 | ||