linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Two questions on perf dwarf callchains
@ 2014-01-17 23:42 Mauro Andreolini
  0 siblings, 0 replies; 18+ messages in thread
From: Mauro Andreolini @ 2014-01-17 23:42 UTC (permalink / raw)
  To: linux-perf-users@vger.kernel.org

[Sorry for the repost, I can't see my reply in the gmane interface]

Il giorno ven, 17/01/2014 alle 12.11 -0800, Andi Kleen ha scritto:
> Mauro Andreolini <mauro.andreolini@gmail.com> writes:
> > file to get perf report to print the function names.
> > Is this expected behaviour? How do I get perf to automatically
extract
> > symbols from compressed files?
> 
> Someone would need to write the code to do that I guess.
OK.

> >
> > To which function would 0x7facc1df12a0 match? It does not even seem
to
> > be in the mapped address space of "ls". I am clueless.
> 
> The unwinder got confused. A common cause is incomplete or partially
> broken dwarf unwind information. May be a compiler problem.
Thanks for your time. Right now I am using gcc 4.8.2 20131219
(prerelease) and libunwind 1.1. I noticed the following
compile flags: "-O2 -g -fvar-tracking-assignments". I thought that
maybe optimizations like function inlining and the like would not play
together with debugging info, so I changed them to "-Og -g3
-fvar-tracking-assignments" and recompiled anything, albeit with no
luck. I must be missing something big here. How can I be sure to give
correct dwarf unwind information?

Mauro

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Two questions on perf dwarf callchains
@ 2014-01-17 10:21 Mauro Andreolini
  2014-01-17 20:11 ` Andi Kleen
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Mauro Andreolini @ 2014-01-17 10:21 UTC (permalink / raw)
  To: linux-perf-users; +Cc: Mauro Andreolini

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

I hit two problems.
Problem n.1: perf report warns me about missing kernel symbols.

No kallsyms or vmlinux with build-id 4c6ab941f31dde04c2a481430218994849927c8d was found
[ext4] with build id 4c6ab941f31dde04c2a481430218994849927c8d not found, continuing without symbols
No kallsyms or vmlinux with build-id 21f163b0a8a8b924efdd173b8f83ad723d378958 was found
[drm] with build id 21f163b0a8a8b924efdd173b8f83ad723d378958 not found, continuing without symbols
No kallsyms or vmlinux with build-id d0bd7dd69886c2dccde18dee760b6d39cc0b5a55 was found[qxl] with build id d0bd7dd69886c2dccde18dee760b6d39cc0b5a55 not found, continuing without symbols
No kallsyms or vmlinux with build-id 8d13e6f0c4d4f8b4628c8c4bd6c660b0a00576df was found[ttm] with build id 8d13e6f0c4d4f8b4628c8c4bd6c660b0a00576df not found, continuing without symbols
...
#
# Samples: 4K of event 'cpu-clock'
# Event count (approx.): 1201250000
#
# Overhead  Command      Shared Object
Symbol
# ........  .......  .................  .................................
...
     7.12%       ls  [qxl]              [k] 0x0000000000009b20 <--- HERE
                 |
                 |--4.09%-- 0xffffffffa048c2c2
                 |          |
                 |          |--42.86%-- 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

For example, the 0x0000000000009b20 address should refer to some
function in the qxl module for which no symbol was generated. As far as
I could understand, perf does not seem to be able to extract symbol
information from compressed modules. I had to decompress the qxl.ko.gz
file to get perf report to print the function names.
Is this expected behaviour? How do I get perf to automatically extract
symbols from compressed files?

Problem n.2: sometimes 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.

Thanks for your time.
Bye
Mauro

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

end of thread, other threads:[~2014-02-04 16:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-17 23:42 Two questions on perf dwarf callchains Mauro Andreolini
  -- strict thread matches above, loose matches on Subject: below --
2014-01-17 10:21 Mauro Andreolini
2014-01-17 20:11 ` Andi Kleen
2014-01-17 23:37   ` Mauro Andreolini
2014-01-18  4:42     ` Andi Kleen
2014-01-22 14:40       ` Mauro Andreolini
2014-01-22 17:55         ` Andi Kleen
2014-01-22 18:02           ` Mauro Andreolini
2014-01-29 11:18 ` Jiri Olsa
2014-01-29 15:09   ` Mauro Andreolini
2014-01-30 11:47     ` Jiri Olsa
2014-01-30 14:43       ` Mauro Andreolini
2014-01-30 15:40         ` Jiri Olsa
2014-02-03 14:30           ` Mauro Andreolini
2014-02-04 15:28             ` Mauro Andreolini
2014-02-04 15:35               ` Jiri Olsa
2014-02-04 16:01                 ` Mauro Andreolini
2014-01-29 13:02 ` Mauro Andreolini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).