1. 24 Nov, 2014 1 commit
    • Namhyung Kim's avatar
      perf hists browser: Print overhead percent value for first-level callchain · 4087d11c
      Namhyung Kim authored
      Currently perf report on TUI doesn't print percent for first-level
      callchain entry.
      
      I guess it (wrongly) assumes that there's only a single callchain in the
      first level.
      
      This patch fixes it by handling the first level callchains same as
      others - if it's not 100% it should print the percent value.
      
      Also it'll affect other callchains in the other way around - if it's
      100% (single callchain) it should not print the percentage.
      
      Before:
        -   30.95%     6.84%  abc2     abc2              [.] a
           - a
              - 70.00% c
                 - 100.00% apic_timer_interrupt
                      smp_apic_timer_interrupt
                      local_apic_timer_interrupt
                      hrtimer_interrupt
                      ...
              + 30.00% b
           + __libc_start_main
      
      After:
        -   30.95%     6.84%  abc2     abc2              [.] a
           - 77.90% a
              - 70.00% c
                 - apic_timer_interrupt
                   smp_apic_timer_interrupt
                   local_apic_timer_interrupt
                   hrtimer_interrupt
                   ...
              + 30.00% b
           + 22.10% __libc_start_main
      Reported-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: 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.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1416816807-6495-1-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4087d11c
  2. 20 Nov, 2014 1 commit
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 4e6e311e
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible fixes:
      
       - Fallback to kallsyms when using the minimal 'ELF' loader (Arnaldo Carvalho de Melo)
      
       - Fix annotation with kcore (Adrian Hunter)
      
       - Fix up srcline histogram key formatting (Arnaldo Carvalho de Melo)
      
       - Add missing handler for PERF_RECORD_MMAP2 events in 'perf diff' (Kan Liang)
      
      User visible changes/new features:
      
       - Only print base source file for srcline histogram sort key (Andi Kleen)
      
       - Support source line numbers in annotate using a hotkey (Andi Kleen)
      
      Infrastructure changes and fixes:
      
       - Do not poll events that use the system_wide flag (Adrian Hunter)
      
       - Add perf-read-vdso32 and perf-read-vdsox32 to .gitignore (Adrian Hunter)
      
       - Only override the default :tid comm entry (Adrian Hunter)
      
       - Factor out adding new call chain entries (Andi Kleen)
      
       - Use al.addr to set up call chain (Andi Kleen)
      
       - Use a common function to resolve symbol or name (Andi Kleen)
      
       - Fix ftrace:function event recording (Jiri Olsa)
      
       - Move disable_buildid_cache() to util/build-id.c (Namhyung Kim)
      
       - Clean up libelf feature support code (Namhyung Kim)
      
       - Fix typo in python 'perf test' (WANG Chao)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      4e6e311e
  3. 19 Nov, 2014 16 commits
  4. 16 Nov, 2014 14 commits
  5. 12 Nov, 2014 1 commit
  6. 07 Nov, 2014 1 commit
  7. 06 Nov, 2014 4 commits
  8. 05 Nov, 2014 2 commits
    • Namhyung Kim's avatar
      perf tools: Make vmlinux short name more like kallsyms short name · 96d78059
      Namhyung Kim authored
      The previous patch changed kernel dso name from '[kernel.kallsyms]' to
      vmlinux.  However it might add confusion to old users accustomed to the
      old name.  So change the short name to '[kernel.vmlinux]' to reduce such
      confusion.
      
      Before:
        # Overhead  Command         Shared Object            Symbol
        # ........  ..............  .......................  ...............................
        #
             9.83%  swapper         vmlinux                  [k] intel_idle
             4.10%  awk             libc-2.20.so             [.] __strcmp_sse2
             1.86%  sed             libc-2.20.so             [.] __strcmp_sse2
             1.78%  netctl-auto     libc-2.20.so             [.] __strcmp_sse2
             1.23%  netctl-auto     libc-2.20.so             [.] __mbrtowc
             1.21%  firefox         libxul.so                [.] 0x00000000024b62bd
             1.20%  swapper         vmlinux                  [k] cpuidle_enter_state
             1.03%  sleep           vmlinux                  [k] copy_user_generic_unrolled
      
      After:
        # Overhead  Command         Shared Object            Symbol
        # ........  ..............  .......................  ...............................
        #
             9.83%  swapper         [kernel.vmlinux]         [k] intel_idle
             4.10%  awk             libc-2.20.so             [.] __strcmp_sse2
             1.86%  sed             libc-2.20.so             [.] __strcmp_sse2
             1.78%  netctl-auto     libc-2.20.so             [.] __strcmp_sse2
             1.23%  netctl-auto     libc-2.20.so             [.] __mbrtowc
             1.21%  firefox         libxul.so                [.] 0x00000000024b62bd
             1.20%  swapper         [kernel.vmlinux]         [k] cpuidle_enter_state
             1.03%  sleep           [kernel.vmlinux]         [k] copy_user_generic_unrolled
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1415063674-17206-9-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      96d78059
    • Namhyung Kim's avatar
      perf tools: Fix build-id matching on vmlinux · b837a8bd
      Namhyung Kim authored
      There's a problem on finding correct kernel symbols when perf report
      runs on a different kernel.  Although a part of the problem was solved
      by the prior commit 0a7e6d1b ("perf tools: Check recorded kernel
      version when finding vmlinux"), there's a remaining problem still.
      
      When perf records samples, it synthesizes the kernel map using
      machine__mmap_name() and ref_reloc_sym like "[kernel.kallsyms]_text".
      You can easily see it using 'perf report -D' command.
      
      After finishing record, it goes through the recorded events to find
      maps/dsos actually used.  And then record build-id info of them.
      
      During this process, it needs to load symbols in a dso and it'd call
      dso__load_vmlinux_path() since the default value of the symbol_conf.
      try_vmlinux_path is true.  However it changes dso->long_name to a real
      path of the vmlinux file (e.g. /lib/modules/3.16.4/build/vmlinux) if one
      is running on a custom kernel.
      
      It resulted in that perf report reads the build-id of the vmlinux, but
      cannot use it since it only knows about the [kernel.kallsyms] map.  It
      then falls back to possible vmlinux paths by using the recorded kernel
      version (in case of a recent version) or a running kernel silently.
      
      Even with the recent tools, this still has a possibility of breaking
      the result.  As the build directory is a symbolic link, if one built a
      new kernel in the same directory with different source/config, the old
      link to vmlinux will point the new file.  So it's absolutely needed to
      use build-id when finding a kernel image.
      
      In this patch, it's now changed to try to search a kernel dso in the
      existing dso list which was constructed during build-id table parsing
      so it'll always have a build-id.  If not found, search "[kernel.kallsyms]".
      
      Before:
      
        $ perf report
        # Children      Self  Command  Shared Object      Symbol
        # ........  ........  .......  .................  ...............................
        #
            72.15%     0.00%  swapper  [kernel.kallsyms]  [k] set_curr_task_rt
            72.15%     0.00%  swapper  [kernel.kallsyms]  [k] native_calibrate_tsc
            72.15%     0.00%  swapper  [kernel.kallsyms]  [k] tsc_refine_calibration_work
            71.87%    71.87%  swapper  [kernel.kallsyms]  [k] module_finalize
         ...
      
      After (for the same perf.data):
      
            72.15%     0.00%  swapper  vmlinux  [k] cpu_startup_entry
            72.15%     0.00%  swapper  vmlinux  [k] arch_cpu_idle
            72.15%     0.00%  swapper  vmlinux  [k] default_idle
            71.87%    71.87%  swapper  vmlinux  [k] native_safe_halt
         ...
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: http://lkml.kernel.org/r/20140924073356.GB1962@gmail.com
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1415063674-17206-8-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b837a8bd