mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf tools: Fix truncated annotation
@ 2011-12-23 13:08 Ingo Molnar
  2011-12-29 20:49 ` [tip:perf/core] " tip-bot for Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Molnar @ 2011-12-23 13:08 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, Peter Zijlstra


I get such truncated annotation results in 'perf top':

         :        Disassembly of section .text:                                                   ▒
         :                                                                                        ▒
         :        ffffffff810966a8 <nr_iowait_cpu>:                                               ▒
    4.94 :        ffffffff810966a8:       movslq %edi,%rdi                                        ▒
    3.70 :        ffffffff810966ab:       mov    $0x13700,%rax                                    ▒
    0.00 :        ffffffff810966b2:       add    -0x7e32cb00(,%rdi,8),%rax                        ▒
    8.64 :        ffffffff810966ba:       mov    0x7e0(%rax),%eax                                 ▒
   82.72 :        ffffffff810966c0:       cltq                                                    ▒

Note the missing 'retq' which is there in the original function:

ffffffff810966a8 <nr_iowait_cpu>:
ffffffff810966a8:       48 63 ff                movslq %edi,%rdi
ffffffff810966ab:       48 c7 c0 00 37 01 00    mov    $0x13700,%rax
ffffffff810966b2:       48 03 04 fd 00 35 cd    add    -0x7e32cb00(,%rdi,8),%rax
ffffffff810966b9:       81 
ffffffff810966ba:       8b 80 e0 07 00 00       mov    0x7e0(%rax),%eax
ffffffff810966c0:       48 98                   cltq   
ffffffff810966c2:       c3                      retq   

ffffffff810966c3 <this_cpu_load>:

I'm using a fairly recent binutils:

  GNU objdump version 2.21.51.0.6-2.fc16 20110118

AFAICS the bug is simply that sym->end points to the last byte 
of the symbol in question - while objdump's --stop-address 
expects the last byte plus 1 to disassemble the full range.

Thanks,

	Ingo

Signed-off-by: Ingo Molnar <mingo@elte.hu>

Index: linux/tools/perf/util/annotate.c
===================================================================
--- linux.orig/tools/perf/util/annotate.c
+++ linux/tools/perf/util/annotate.c
@@ -334,7 +334,7 @@ fallback:
 		 disassembler_style ? "-M " : "",
 		 disassembler_style ? disassembler_style : "",
 		 map__rip_2objdump(map, sym->start),
-		 map__rip_2objdump(map, sym->end),
+		 map__rip_2objdump(map, sym->end+1),
 		 symbol_conf.annotate_asm_raw ? "" : "--no-show-raw",
 		 symbol_conf.annotate_src ? "-S" : "",
 		 symfs_filename, filename);

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

end of thread, other threads:[~2011-12-29 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-23 13:08 [PATCH] perf tools: Fix truncated annotation Ingo Molnar
2011-12-29 20:49 ` [tip:perf/core] " tip-bot for Ingo Molnar

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

all inboxes | Powered by JetHome®