public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
* Internal error while annotating function
@ 2025-02-24 16:05 Breno Leitao
  2025-02-25  0:11 ` Namhyung Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Breno Leitao @ 2025-02-24 16:05 UTC (permalink / raw)
  To: linux-perf-users

Hello,

I am trying to run annotate a perf function on aarch64, and it returns
an error. How do I get the logs for what is happening?

Here is what I see, in either `perf top` or `perf report`:

1) Open the TUI
2) Get on top of a specific hot function. Not all of them reproduce the
   error. For instance, one of these functions is `finish_task_switch`
3) Press "Annotate finish_task_switch"
4) Got the following error:

	┌─Error:──────────────────────────────┐
	│Couldn't annotate finish_task_switch:│
	│Internal error: Invalid -1 error code│
	│                                     │
	│                                     │
	│Press any key...                     │
	└─────────────────────────────────────┘

At the bottom I also see:

	Error running objdump  --start-address=0xffff800080907fa0 --stop-address=0xffff800080908220  -d --no-show-raw-insn -S      -C "$1"

If I try to run this manually, I see the following. Is this the real
cause?

	# objdump  --start-address=0xffff800080907fa0 --stop-address=0xffff800080908220  -d --no-show-raw-insn -S -C /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da

	objdump: /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: unknown type [0x13] section `.relr.dyn'
	objdump: /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: unknown type [0x13] section `.relr.dyn'
	/boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da:     file format elf64-little
	objdump: can't disassemble for architecture UNKNOWN!

The file seems to be a valid aarch64 binary:

	$ file /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
	/boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: symbolic link to /lib/modules/6.13.2-0_fbk0_rc8_0_g925d379822da/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
	$ file /lib/modules/6.13.2-0_fbk0_rc8_0_g925d379822da/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
	/lib/modules/6.13.2-0_fbk0_rc8_0_g925d379822da/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=be549c9fd62405a10f6b36236610cd6a57a6d3e3, with debug_info, not stripped

Any clue how to investigate this further?

Thanks
--breno

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

* Re: Internal error while annotating function
  2025-02-24 16:05 Internal error while annotating function Breno Leitao
@ 2025-02-25  0:11 ` Namhyung Kim
  2025-02-25 15:27   ` Breno Leitao
  0 siblings, 1 reply; 3+ messages in thread
From: Namhyung Kim @ 2025-02-25  0:11 UTC (permalink / raw)
  To: Breno Leitao; +Cc: linux-perf-users

Hello,

On Mon, Feb 24, 2025 at 08:05:57AM -0800, Breno Leitao wrote:
> Hello,
> 
> I am trying to run annotate a perf function on aarch64, and it returns
> an error. How do I get the logs for what is happening?
> 
> Here is what I see, in either `perf top` or `perf report`:
> 
> 1) Open the TUI
> 2) Get on top of a specific hot function. Not all of them reproduce the
>    error. For instance, one of these functions is `finish_task_switch`
> 3) Press "Annotate finish_task_switch"
> 4) Got the following error:
> 
> 	┌─Error:──────────────────────────────┐
> 	│Couldn't annotate finish_task_switch:│
> 	│Internal error: Invalid -1 error code│
> 	│                                     │
> 	│                                     │
> 	│Press any key...                     │
> 	└─────────────────────────────────────┘
> 
> At the bottom I also see:
> 
> 	Error running objdump  --start-address=0xffff800080907fa0 --stop-address=0xffff800080908220  -d --no-show-raw-insn -S      -C "$1"
> 
> If I try to run this manually, I see the following. Is this the real
> cause?
> 
> 	# objdump  --start-address=0xffff800080907fa0 --stop-address=0xffff800080908220  -d --no-show-raw-insn -S -C /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
> 
> 	objdump: /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: unknown type [0x13] section `.relr.dyn'
> 	objdump: /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: unknown type [0x13] section `.relr.dyn'
> 	/boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da:     file format elf64-little
> 	objdump: can't disassemble for architecture UNKNOWN!
> 
> The file seems to be a valid aarch64 binary:
> 
> 	$ file /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
> 	/boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: symbolic link to /lib/modules/6.13.2-0_fbk0_rc8_0_g925d379822da/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
> 	$ file /lib/modules/6.13.2-0_fbk0_rc8_0_g925d379822da/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
> 	/lib/modules/6.13.2-0_fbk0_rc8_0_g925d379822da/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=be549c9fd62405a10f6b36236610cd6a57a6d3e3, with debug_info, not stripped
> 
> Any clue how to investigate this further?

What's the version of binutils?  Is it old?  I don't know what's the
problem but checking the latest version might help.

Thanks,
Namhyung


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

* Re: Internal error while annotating function
  2025-02-25  0:11 ` Namhyung Kim
@ 2025-02-25 15:27   ` Breno Leitao
  0 siblings, 0 replies; 3+ messages in thread
From: Breno Leitao @ 2025-02-25 15:27 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: linux-perf-users

On Mon, Feb 24, 2025 at 04:11:22PM -0800, Namhyung Kim wrote:
> Hello,
> 
> On Mon, Feb 24, 2025 at 08:05:57AM -0800, Breno Leitao wrote:
> > Hello,
> > 
> > I am trying to run annotate a perf function on aarch64, and it returns
> > an error. How do I get the logs for what is happening?
> > 
> > Here is what I see, in either `perf top` or `perf report`:
> > 
> > 1) Open the TUI
> > 2) Get on top of a specific hot function. Not all of them reproduce the
> >    error. For instance, one of these functions is `finish_task_switch`
> > 3) Press "Annotate finish_task_switch"
> > 4) Got the following error:
> > 
> > 	┌─Error:──────────────────────────────┐
> > 	│Couldn't annotate finish_task_switch:│
> > 	│Internal error: Invalid -1 error code│
> > 	│                                     │
> > 	│                                     │
> > 	│Press any key...                     │
> > 	└─────────────────────────────────────┘
> > 
> > At the bottom I also see:
> > 
> > 	Error running objdump  --start-address=0xffff800080907fa0 --stop-address=0xffff800080908220  -d --no-show-raw-insn -S      -C "$1"
> > 
> > If I try to run this manually, I see the following. Is this the real
> > cause?
> > 
> > 	# objdump  --start-address=0xffff800080907fa0 --stop-address=0xffff800080908220  -d --no-show-raw-insn -S -C /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
> > 
> > 	objdump: /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: unknown type [0x13] section `.relr.dyn'
> > 	objdump: /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: unknown type [0x13] section `.relr.dyn'
> > 	/boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da:     file format elf64-little
> > 	objdump: can't disassemble for architecture UNKNOWN!
> > 
> > The file seems to be a valid aarch64 binary:
> > 
> > 	$ file /boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
> > 	/boot/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: symbolic link to /lib/modules/6.13.2-0_fbk0_rc8_0_g925d379822da/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
> > 	$ file /lib/modules/6.13.2-0_fbk0_rc8_0_g925d379822da/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da
> > 	/lib/modules/6.13.2-0_fbk0_rc8_0_g925d379822da/vmlinux-6.13.2-0_fbk0_rc8_0_g925d379822da: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=be549c9fd62405a10f6b36236610cd6a57a6d3e3, with debug_info, not stripped
> > 
> > Any clue how to investigate this further?
> 
> What's the version of binutils?  Is it old?  I don't know what's the
> problem but checking the latest version might help.

I've been using the objdump from CentOS 10:

	# objdump --version
	GNU objdump (GNU Binutils) 2.37

I tried to use a different objdump (as in llvm objdump) and it worked
fine. So, it seems to be an objdump issue:

	perf top --objdump $(which llvm-objdump)

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

end of thread, other threads:[~2025-02-25 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 16:05 Internal error while annotating function Breno Leitao
2025-02-25  0:11 ` Namhyung Kim
2025-02-25 15:27   ` Breno Leitao

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