libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] libunwind, perf and DWARF callchains


From: Mauro Andreolini
Subject: [Libunwind-devel] libunwind, perf and DWARF callchains
Date: Thu, 23 Jan 2014 16:07:31 +0100

Hi all,

I have installed a textual Arch Linux guest (the hypervisor
is KVM) and I am playing with perf and dwarf callchains.
In particular, I am trying to get meaningful stacktraces
for a simple command such as "ls -lR /".

Here is what I did.
* recompile the kernel with
  CONFIG_DEBUG_INFO=y
  CONFIG_FRAME_POINTER=Y
* recompile the C library with symbols (-g)
* recompile all other dependencies of "ls" (ldd /usr/bin/ls)
  with symbols (on my system, that would be libcap, libacl,
  libattr)
* recompile the coreutils package with symbols

After that, I executed the following commands:
perf record --call-graph dwarf -g -- ls -lR /
<wait 10s; hit CTRL-C>
perf report --call-graph --stdio


Problem: perf prints bogus callchains (in particular
when the various printf() variants are involved).

                 |--1.46%-- 0xffffffffa048a275
                 |          0xffffffffa048c110
                 |          0xffffffffa04909e7
                 |          |
                 |          |--80.00%-- 0xffffffffa0490afa
                 |          |          0xffffffffa048ee8b
                 |          |          0xffffffffa048ba8f
                 |          |          bit_bmove
                 |          |          fbcon_redraw_blit.isra.22
                 |          |          fbcon_scroll
                 |          |          scrup
                 |          |          lf
                 |          |          do_con_trol
                 |          |          do_con_write.part.18
                 |          |          con_write
                 |          |          do_output_char
                 |          |          n_tty_write
                 |          |          tty_write
                 |          |          vfs_write
                 |          |          sys_write
                 |          |          system_call_fastpath
                 |          |          __GI___libc_write
                 |          |          |
                 |          |          |--50.00%-- vfprintf
                 |          |          |          0x0        <---HERE
                 |          |          |
                 |          |          |--25.00%-- main
                 |          |          |          __libc_start_main
                 |          |          |          _start
                 |          |          |          0x0        <---HERE
                 |          |          |
                 |          |           --25.00%-- 0x7facc1df12a0 HERE

To which function would 0x7facc1df12a0 match? It does not even seem to
be in the mapped address space of "ls". I am clueless.
gdb can backtrace perfectly through ls -lR /. Also, recompiling the
whole system with -fno-omit-frame-pointer makes perf record & report
work like a charm. So I guess it must be the unwinder.

Thanks for your time.
Bye
Mauro




reply via email to

[Prev in Thread] Current Thread [Next in Thread]