linux/tools/perf
David Ahern adb5d2a487 perf kvm: Fix bug resolving guest kernel syms
Guest kernel symbols are not resolved despite passing the information
needed to resolve them. e.g.,

perf kvm --guest --guestmount=/tmp/guest-mount record -a -- sleep 1
perf kvm --guest --guestmount=/tmp/guest-mount report --stdio

    36.55%  [guest/11399]  [unknown]         [g] 0xffffffff81600bc8
    33.19%  [guest/10474]  [unknown]         [g] 0x00000000c0116e00
    30.26%  [guest/11094]  [unknown]         [g] 0xffffffff8100a288
    43.69%  [guest/10474]  [unknown]         [g] 0x00000000c0103d90
    37.38%  [guest/11399]  [unknown]         [g] 0xffffffff81600bc8
    12.24%  [guest/11094]  [unknown]         [g] 0xffffffff810aa91d
     6.69%  [guest/11094]  [unknown]         [u] 0x00007fa784d721c3

which is just pathetic.

After a maddening 2 days sifting through perf minutia I found it --
id_hdr_size is not initialized for guest machines. This shows up on the
report side as random garbage for the cpu and timestamp, e.g.,

29816 7310572949125804849 0x1ac0 [0x50]: PERF_RECORD_MMAP ...

That messes up the sample sorting such that synthesized guest maps are
processed last.

With this patch you get a much more helpful report:

  12.11%  [guest/11399]  [guest.kernel.kallsyms.11399]  [g] irqtime_account_process_tick
  10.58%  [guest/11399]  [guest.kernel.kallsyms.11399]  [g] run_timer_softirq
   6.95%  [guest/11094]  [guest.kernel.kallsyms.11094]  [g] printk_needs_cpu
   6.50%  [guest/11094]  [guest.kernel.kallsyms.11094]  [g] do_timer
   6.45%  [guest/11399]  [guest.kernel.kallsyms.11399]  [g] idle_balance
   4.90%  [guest/11094]  [guest.kernel.kallsyms.11094]  [g] native_read_tsc
    ...

v2:
- changed rbtree walk to use rb_first per Namhyung's suggestion

Tested-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1342826756-64663-5-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-07-25 11:30:13 -03:00
..
arch
bench perf bench: Fix confused variable namings and descriptions in mem subsystem 2012-07-02 14:35:45 -03:00
config perf ui/gtk: Add GTK info_bar widget to browser window 2012-06-19 13:06:19 -03:00
Documentation perf bench: Fix confused variable namings and descriptions in mem subsystem 2012-07-02 14:35:45 -03:00
python
scripts
ui perf annotate: Check null of sym pointer before using it 2012-06-19 14:30:26 -03:00
util perf kvm: Fix bug resolving guest kernel syms 2012-07-25 11:30:13 -03:00
.gitignore perf tools: Ignore auto-generated bison/flex files 2012-04-14 13:50:39 -03:00
builtin-annotate.c perf tools: Convert critical messages to ui__error() 2012-05-29 11:53:42 -03:00
builtin-bench.c perf bench: Documentation update 2012-06-27 13:17:48 -03:00
builtin-buildid-cache.c
builtin-buildid-list.c perf buildid-list: Work better with pipe mode 2012-05-22 13:03:54 -03:00
builtin-diff.c
builtin-evlist.c perf tools: Move all users of event_name to perf_evsel__name 2012-06-19 13:06:20 -03:00
builtin-help.c
builtin-inject.c perf inject: Fix broken perf inject -b 2012-05-22 12:59:28 -03:00
builtin-kmem.c perf tools: Stop using a global trace events description list 2012-06-27 13:08:42 -03:00
builtin-kvm.c
builtin-list.c
builtin-lock.c perf tools: Stop using a global trace events description list 2012-06-27 13:08:42 -03:00
builtin-probe.c perf probe: Detect probe target when m/x options are absent 2012-05-11 13:58:53 -03:00
builtin-record.c perf tools: Move all users of event_name to perf_evsel__name 2012-06-19 13:06:20 -03:00
builtin-report.c perf report: Delay sample_type checks in pipe mode 2012-06-27 13:19:14 -03:00
builtin-sched.c perf tools: Stop using a global trace events description list 2012-06-27 13:08:42 -03:00
builtin-script.c perf tools: Stop using a global trace events description list 2012-06-27 13:08:42 -03:00
builtin-stat.c Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core 2012-06-20 13:41:53 +02:00
builtin-test.c perf tools: Move all users of event_name to perf_evsel__name 2012-06-19 13:06:20 -03:00
builtin-timechart.c
builtin-top.c perf tools: Remove unused evsel parameter from machine__resolve_callchain 2012-06-19 13:06:21 -03:00
builtin.h
command-list.txt
CREDITS
design.txt perf tools: Update ioctl documentation for PERF_IOC_FLAG_GROUP 2012-05-31 11:38:42 -03:00
Makefile perf tools: Trivial build fix 2012-06-27 13:32:06 -03:00
MANIFEST perf tools: Fix make tarballs 2012-05-30 15:05:59 -03:00
perf-archive.sh perf archive: Correct cutting of symbolic link 2012-04-14 13:52:15 -03:00
perf.c
perf.h perf record: Fix branch_stack type in perf_record_opts 2012-05-25 18:32:44 -03:00