linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] perf: bogus correlation of kernel symbols
@ 2011-05-12 14:48 Stephane Eranian
  2011-05-12 18:06 ` David Miller
  2011-05-12 20:31 ` Linus Torvalds
  0 siblings, 2 replies; 50+ messages in thread
From: Stephane Eranian @ 2011-05-12 14:48 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: LKML

Hi,

I think there is a serious problem with kernel symbol correlation
with the latest perf in 2.6.39-rc7-tip.

Here is a simple example with a stupid program that only
does open()/close on /dev/null:

$ perf record -e cycles:k openclose
$ perf report --stdio

# Events: 2K cycles
#
# Overhead    Command     Shared Object           Symbol
# ........  .........  ................  ...............
#
    99.76%  openclose  [binfmt_misc]     [k] 0xffffffff81010fe6
     0.13%  openclose  libc-2.12.1.so    [.] __open_nocancel
     0.09%  openclose  libc-2.12.1.so    [.] __GI_close

The DSO (binfmt_misc) is bogus. That's not where time is spent.

But if I ran the same test as root:

$ sudo perf record -e cycles:k openclose
$ sudo perf report --stdio

# Events: 2K cycles
#
# Overhead    Command      Shared Object                         Symbol
# ........  .........  .................  .............................
#
    17.13%  openclose  [kernel.kallsyms]  [k] __lock_acquire
    11.77%  openclose  [kernel.kallsyms]  [k] native_sched_clock
     7.36%  openclose  [kernel.kallsyms]  [k] sched_clock_local
     5.99%  openclose  [kernel.kallsyms]  [k] lock_release
     5.38%  openclose  [kernel.kallsyms]  [k] local_clock
     4.43%  openclose  [kernel.kallsyms]  [k] lock_acquired
     4.05%  openclose  [kernel.kallsyms]  [k] lock_acquire
     3.95%  openclose  [kernel.kallsyms]  [k] lock_is_held
     3.51%  openclose  [kernel.kallsyms]  [k] sched_clock_cpu
     3.24%  openclose  [kernel.kallsyms]  [k] trace_hardirqs_off_caller

This is much more meaningful.

This is not related to the paranoid level (1 for me).

Looking at perf report -D, the same kernel address is associated to different
module based on my permission level.

first perf.data:
416749738927 0x4210 [0x28]: PERF_RECORD_SAMPLE(IP, 1): 4886/4886:
0xffffffff8107c1d8 period: 2262681
 ... thread: openclose:4886
 ...... dso: /lib/modules/2.6.39-rc7-tip/kernel/fs/binfmt_misc.ko

second perf.data:
436879910722 0xc950 [0x28]: PERF_RECORD_SAMPLE(IP, 1): 4894/4894:
0xffffffff8107c1d8 period: 2280253
 ... thread: openclose:4894
 ...... dso: vmlinux

Same address different mapping!

My path to vmlinux is all accessible to me.

If there were permission problems, I would expect perf record or perf report
to tell me and not fallback to some bogus mappings.

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

end of thread, other threads:[~2011-05-24  4:06 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1305292059.1949.0.camel@dan>
2011-05-13 13:29 ` [BUG] perf: bogus correlation of kernel symbols Dan Rosenberg
2011-05-16 15:35   ` Ingo Molnar
2011-05-16 16:14     ` Dan Rosenberg
2011-05-20  0:56     ` Dan Rosenberg
2011-05-20 12:07       ` Ingo Molnar
2011-05-20 12:54         ` Dan Rosenberg
2011-05-20 13:11           ` Ingo Molnar
2011-05-20 17:41             ` Dan Rosenberg
2011-05-20 18:14               ` Linus Torvalds
2011-05-20 18:27                 ` Kees Cook
2011-05-20 18:34                   ` Dan Rosenberg
2011-05-20 18:42                     ` Ingo Molnar
2011-05-20 18:28                 ` Ingo Molnar
2011-05-22  6:11                 ` david
2011-05-20 18:35               ` Ingo Molnar
2011-05-22 18:45             ` Dan Rosenberg
     [not found]               ` <BANLkTik1SK_kWVvGsKk0SqdByQ5-0b5nFg@mail.gmail.com>
2011-05-23  0:25                 ` Dan Rosenberg
2011-05-23  0:37                   ` H. Peter Anvin
2011-05-23 10:49                   ` Ingo Molnar
2011-05-23 19:02                     ` Ray Lee
2011-05-23 19:35                       ` Ingo Molnar
2011-05-24  1:59                     ` Valdis.Kletnieks
2011-05-24  4:06                       ` Ingo Molnar
2011-05-12 14:48 Stephane Eranian
2011-05-12 18:06 ` David Miller
2011-05-12 18:37   ` Dave Jones
2011-05-12 19:01     ` David Miller
2011-05-12 19:58       ` Pekka Enberg
2011-05-13  6:12         ` Kees Cook
2011-05-13  6:24           ` Pekka Enberg
2011-05-12 20:24       ` Alexey Dobriyan
2011-05-12 21:06   ` Ingo Molnar
2011-05-12 20:31 ` Linus Torvalds
2011-05-12 20:43   ` David Miller
2011-05-12 21:07   ` Stephane Eranian
2011-05-12 21:30     ` Stephane Eranian
2011-05-12 21:35       ` Ingo Molnar
2011-05-12 21:38         ` Stephane Eranian
2011-05-12 21:50           ` Ingo Molnar
2011-05-12 21:56             ` Stephane Eranian
2011-05-12 22:00               ` Ingo Molnar
2011-05-12 22:07             ` Dave Jones
2011-05-12 22:15               ` Stephane Eranian
2011-05-13  9:01                 ` Ingo Molnar
2011-05-13  8:57               ` Ingo Molnar
2011-05-13 16:23                 ` Andi Kleen
2011-05-17 12:17                   ` Ingo Molnar
2011-05-12 21:36     ` Ingo Molnar
2011-05-12 21:41       ` Stephane Eranian
2011-05-12 21:54         ` Ingo Molnar

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).