1. 30 1月, 2015 2 次提交
  2. 21 1月, 2015 9 次提交
  3. 17 1月, 2015 10 次提交
  4. 09 1月, 2015 1 次提交
  5. 08 1月, 2015 3 次提交
    • N
      perf hists browser: Fix segfault when showing callchain · c09e31cc
      Namhyung Kim 提交于
      When perf report on TUI shows callchain it checks first node has
      siblings to determine whether it needs to print percentage value.
      
      But it missed a case that first node is NULL.  So sometimes it segfaults
      like below:
      
        $ perf top -g
        perf: Segmentation fault
        -------- backtrace --------
        perf[0x4fcefb]
        /usr/lib/libc.so.6(+0x33b20)[0x7f2a35839b20]
        perf(rb_next+0x8)[0x47d3d8]
        perf[0x4f6058]
        perf[0x4f833b]
        perf[0x4f8610]
        perf[0x4f209e]
        perf(ui_browser__run+0x3a)[0x4f2e6a]
        perf[0x4f94ee]
        perf(perf_evlist__tui_browse_hists+0x94)[0x4fbbf4]
        perf[0x444d10]
        /usr/lib/libpthread.so.0(+0x7314)[0x7f2a37070314]
        /usr/lib/libc.so.6(clone+0x6d)[0x7f2a358ee5bd]
      
        $ addr2line -e `which perf` 0x4f6058
        /home/namhyung/project/linux/tools/perf/ui/browsers/hists.c:553
      
      I don't know why the backtrace didn't print some symbols..
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Fixes: 4087d11c ("perf hists browser: Print overhead percent value for first-level callchain")
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1419401076-21700-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c09e31cc
    • N
      perf callchain: Free callchains when hist entries are deleted · d114960c
      Namhyung Kim 提交于
      Markus reported that "perf top -g" can leak ~300MB per second on his
      machine.  This is partly because it missed to free callchains when hist
      entries are deleted.  Fix it.
      Reported-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20141230053813.GD6081@sejongSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d114960c
    • N
      perf hists: Fix children sort key behavior · 5ca82710
      Namhyung Kim 提交于
      When perf report --children resorts output fields, it tries to put
      caller above the callee.  But this was only meaningful for a same thread
      and doing this requires callchain enabled.  So fix its check before
      comparing the callchain depth.
      
      This also changes the hist accumulation tests: In test 3, xmalloc in
      bash thread should be above than other perf threads due to alphabetical
      order of comm string.  Also it's under page_fault in bash thread since
      alphabetical order of dso name.  The sys_perf_event_open in perf thread
      is put on the last line since it's self overhead is 0.
      
      In test 4, the sys_perf_event_open is put above other perf entries that
      have same children overhead since its callchain depth is smaller.
      Signed-off-by: NNamhyung 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: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1419309381-2593-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5ca82710
  6. 07 1月, 2015 2 次提交
  7. 03 1月, 2015 2 次提交
    • N
      perf diff: Fix to sort by baseline field by default · e7024fc3
      Namhyung Kim 提交于
      The currently perf diff didn't add the baseline and delta (or other
      compute) fields to the sort list so output will be sorted by other
      fields like alphabetical order of DSO or symbol as below example.
      
      Fix it by adding hpp formats for the fields and provides default compare
      functions.
      
      Before:
      
        $ perf diff
        # Event 'cycles'
        #
        # Baseline    Delta  Shared Object       Symbol
        # ........  .......  ..................  ...............................
        #
                             [bridge]            [k] ip_sabotage_in
                             [btrfs]             [k] __etree_search.constprop.47
             0.01%           [btrfs]             [k] btrfs_file_mmap
             0.01%   -0.01%  [btrfs]             [k] btrfs_getattr
                             [e1000e]            [k] e1000_watchdog
             0.00%           [kernel.vmlinux]    [k] PageHuge
             0.00%           [kernel.vmlinux]    [k] __acct_update_integrals
             0.00%           [kernel.vmlinux]    [k] __activate_page
                             [kernel.vmlinux]    [k] __alloc_fd
             0.02%   +0.02%  [kernel.vmlinux]    [k] __alloc_pages_nodemask
             ...
      
      After:
      
        # Baseline    Delta  Shared Object       Symbol
        # ........  .......  ..................  ................................
        #
            24.73%   -4.62%  perf                [.] append_chain_children
             7.96%   -1.29%  perf                [.] dso__find_symbol
             6.97%   -2.07%  libc-2.20.so        [.] vfprintf
             4.61%   +0.88%  libc-2.20.so        [.] __fprintf_chk
             4.41%   +2.43%  perf                [.] sort__comm_cmp
             4.10%   -0.16%  perf                [.] comm__str
             4.03%   -0.93%  perf                [.] machine__findnew_thread_time
             3.82%   +3.09%  perf                [.] __hists__add_entry
             2.95%   -0.18%  perf                [.] sort__dso_cmp
             ...
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1419656793-32756-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e7024fc3
    • T
      perf list: Fix --raw-dump option · b3505208
      Taesoo Kim 提交于
      Currently, 'perf list --raw-dump' requires extra arguments
      (e.g., hw) to invoke, which breaks bash/zsh completion
      (perf-completion.sh).
      
        $ perf list --raw-dump
          Error: unknown option `raw-dump'
      
           usage: perf list [hw|sw|cache|tracepoint|pmu|event_glob]
      
      After,
      
        $ perf list --raw-dump
        cpu-cycles instructions cache-references cache-misses ...
      Signed-off-by: NTaesoo Kim <tsgatesv@gmail.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Taesoo kim <taesoo@gatech.edu>
      Link: http://lkml.kernel.org/r/1419997015-11071-1-git-send-email-tsgatesv@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b3505208
  8. 02 1月, 2015 2 次提交
    • N
      perf probe: Fix crash in dwarf_getcfi_elf · 4093325f
      Namhyung Kim 提交于
      David reported that perf can segfault when adding an uprobe event like
      this:
      
        $ perf probe -x /lib64/libc-2.14.90.so -a 'malloc  size=%di'
      
        (gdb) bt
        #0  parse_eh_frame_hdr (hdr=0x0, hdr_size=2596, hdr_vaddr=71788,
            ehdr=0x7fffffffd390, eh_frame_vaddr=
            0x7fffffffd378, table_entries=0x8808d8, table_encoding=0x8808e0 "") at
            dwarf_getcfi_elf.c:79
        #1  0x000000385f81615a in getcfi_scn_eh_frame (hdr_vaddr=71788,
            hdr_scn=0x8839b0, shdr=0x7fffffffd2f0, scn=<optimized out>,
            ehdr=0x7fffffffd390, elf=0x882b30) at dwarf_getcfi_elf.c:231
        #2  getcfi_shdr (ehdr=0x7fffffffd390, elf=0x882b30) at dwarf_getcfi_elf.c:283
        #3  dwarf_getcfi_elf (elf=0x882b30) at dwarf_getcfi_elf.c:309
        #4  0x00000000004d5bac in debuginfo__find_probes (pf=0x7fffffffd4f0,
            dbg=Unhandled dwarf expression opcode 0xfa) at util/probe-finder.c:993
        #5  0x00000000004d634a in debuginfo__find_trace_events (dbg=0x880840,
            pev=<optimized out>, tevs=0x880f88, max_tevs=<optimized out>) at
            util/probe-finder.c:1200
        #6  0x00000000004aed6b in try_to_find_probe_trace_events (target=0x881b20
            "/lib64/libpthread-2.14.90.so",
            max_tevs=128, tevs=0x880f88, pev=0x859b30) at util/probe-event.c:482
        #7  convert_to_probe_trace_events (target=0x881b20
            "/lib64/libpthread-2.14.90.so", max_tevs=128, tevs=0x880f88,
            pev=0x859b30) at util/probe-event.c:2356
        #8  add_perf_probe_events (pevs=<optimized out>, npevs=1, max_tevs=128,
            target=0x881b20 "/lib64/libpthread-2.14.90.so", force_add=false) at
            util/probe-event.c:2391
        #9  0x000000000044014f in __cmd_probe (argc=<optimized out>,
            argv=0x7fffffffe2f0, prefix=Unhandled dwarf expression opcode 0xfa) at
            at builtin-probe.c:488
        #10 0x0000000000440313 in cmd_probe (argc=5, argv=0x7fffffffe2f0,
            prefix=<optimized out>) at builtin-probe.c:506
        #11 0x000000000041d133 in run_builtin (p=0x805680, argc=5,
            argv=0x7fffffffe2f0) at perf.c:341
        #12 0x000000000041c8b2 in handle_internal_command (argv=<optimized out>,
            argc=<optimized out>) at perf.c:400
        #13 run_argv (argv=<optimized out>, argcp=<optimized out>) at perf.c:444
        #14 main (argc=5, argv=0x7fffffffe2f0) at perf.c:559
      
      And I found a related commit (5704c8c4fa71 "getcfi_scn_eh_frame: Don't
      crash and burn when .eh_frame bits aren't there.") in elfutils that can
      lead to a unexpected crash like this.  To safely use the function, it
      needs to check the .eh_frame section is a PROGBITS type.
      Reported-by: NDavid Ahern <dsahern@gmail.com>
      Tested-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Mark Wielaard <mjw@redhat.com>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Link: http://lkml.kernel.org/r/20141230090533.GH6081@sejongSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4093325f
    • M
      perf probe: Fix to fall back to find probe point in symbols · 906451b9
      Masami Hiramatsu 提交于
      Fix to fall back to find a probe point in symbols if perf fails to find
      it in debuginfo.
      
      This can happen when the target function is an alias of another
      function. Such alias doesn't have an entry in debuginfo but in symbols.
      
      David Ahern reported this problem in https://lkml.org/lkml/2014/12/29/355
      
      I ensured the problem and deeper investigation discovers it.
       -----
       eu-readelf --debug-dump=info /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so | grep \"malloc\" -A6
                   name                 (strp) "malloc"
                   decl_file            (data1) 25
                   decl_line            (data2) 466
                   prototyped           (flag_present)
                   type                 (ref4) [  81b5]
                   declaration          (flag_present)
       [  8f58]      formal_parameter
       --
                   name                 (strp) "malloc"
                   decl_file            (data1) 23
                   decl_line            (data2) 466
                   prototyped           (flag_present)
                   type                 (ref4) [  9f4a]
                   declaration          (flag_present)
                   sibling              (ref4) [  bb29]
       ...
       -----
      All these entires have no instances (all of them are declarations)
      This is why the perf probe failed to find it in debuginfo.
      
      However, there are some malloc instances in symbols.
       -----
       eu-readelf --symbols /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so | grep malloc$
        1181: 0000000000080700   5332 FUNC    LOCAL  DEFAULT       12 _int_malloc
        4537: 00000000000831d0    339 FUNC    LOCAL  DEFAULT       12 __GI___libc_malloc
        5545: 00000000000831d0    339 FUNC    LOCAL  DEFAULT       12 __malloc
        6063: 00000000000831d0    339 FUNC    GLOBAL DEFAULT       12 malloc
        7302: 00000000000831d0    339 FUNC    GLOBAL DEFAULT       12 __libc_malloc
       -----
      As you an see, malloc and __libc_malloc have same address, and actually
      __libc_malloc has an entry in debuginfo. So you can set up a probe on
      __libc_malloc.
      
      To fix this problem shortly, perf probe simply falls back to find probe
      point(malloc) in symbols if it is not found in debuginfo.
      Reported-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: yrl.pp-manager.tt@hitachi.com
      Link: http://lkml.kernel.org/r/20141231062747.2087.80961.stgit@localhost.localdomainSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      906451b9
  9. 23 12月, 2014 4 次提交
  10. 20 12月, 2014 3 次提交
  11. 19 12月, 2014 2 次提交