1. 13 10月, 2015 1 次提交
  2. 06 10月, 2015 1 次提交
    • A
      perf hists browser: Implement horizontal scrolling · c6c3c02d
      Arnaldo Carvalho de Melo 提交于
      Do it using the recently introduced ui_brower scrolling mode, setting
      ui_browser.columns to the number of sort columns and then, when
      rendering each line, skipping as many initial columns as the user
      pressed the right arrow.
      
      As the user presses the left arrow, the ui_browser code will remove the
      scrolling counter and the left scrolling takes place.
      
      The right arrow key was an alias for ENTER, so people used to press it
      may get a bit annoyed at first, sorry! Ditto for ESC and the left key.
      
      Callchains can be left as is or we can, when rendering the Symbol
      column, store the at what position on the screen it is and then
      using ui_browser__gotorc() to print it from there, i.e. the callchain
      would move around with the symbol.
      
      Leaving it as is, i.e. at a fixed position, close to the left, saves
      precious screen real state for it, so I'm inclined to leave it as is
      now.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Chandler Carruth <chandlerc@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-ccqq9sabgfge5dwbqjwh71ij@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c6c3c02d
  3. 29 9月, 2015 1 次提交
  4. 15 9月, 2015 2 次提交
  5. 14 9月, 2015 2 次提交
  6. 29 8月, 2015 1 次提交
  7. 13 8月, 2015 1 次提交
    • K
      perf report: Show call graph from reference events · 9e207ddf
      Kan Liang 提交于
      Introduce --show-ref-call-graph for perf report to print reference
      callgraph for no callgraph event.
      
      Here is an example.
      
       perf report --show-ref-call-graph --stdio
      
       # To display the perf.data header info, please use
       --header/--header-only options.
       #
       #
       # Total Lost Samples: 0
       #
       # Samples: 5  of event 'cpu/cpu-cycles,call-graph=fp/'
       # Event count (approx.): 144985
       #
       # Children      Self  Command  Shared Object     Symbol
       # ........  ........  .......  ................  ........................................
       #
          72.30%     0.00%  sleep    [kernel.vmlinux]  [k] entry_SYSCALL_64_fastpath
                    |
                    ---entry_SYSCALL_64_fastpath
                       |
                       |--22.62%-- __GI___libc_nanosleep
                        --77.38%-- [...]
      
      ......
      
       # Samples: 6  of event 'cpu/instructions,call-graph=no/', show reference callgraph
       # Event count (approx.): 172780
       #
       # Children      Self  Command  Shared Object     Symbol
       # ........  ........  .......  ................  ........................................
       #
          73.16%     0.00%  sleep    [kernel.vmlinux]  [k] entry_SYSCALL_64_fastpath
                    |
                    ---entry_SYSCALL_64_fastpath
                       |
                       |--31.44%-- __GI___libc_nanosleep
                        --68.56%-- [...]
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1439289050-40510-3-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9e207ddf
  8. 12 8月, 2015 3 次提交
  9. 14 7月, 2015 1 次提交
    • A
      perf hists browser: Take the --comm, --dsos, etc filters into account · 9c0fa8dd
      Arnaldo Carvalho de Melo 提交于
      At some point:
      
        commit 2c86c7ca
        Author: Namhyung Kim <namhyung@kernel.org>
        Date:   Mon Mar 17 18:18:54 2014 -0300
      
          perf report: Merge al->filtered with hist_entry->filtered
      
      We stopped dropping samples for things filtered via the --comms, --dsos,
      --symbols, etc, i.e. things marked as filtered in the symbol resolution
      routines (thread__find_addr_map(), perf_event__preprocess_sample(),
      etc).
      
      But then, in:
      
        commit 268397cb
        Author: Namhyung Kim <namhyung@kernel.org>
        Date:   Tue Apr 22 14:49:31 2014 +0900
      
          perf top/tui: Update nr_entries properly after a filter is applied
      
      We don't take into account entries that were filtered in
      perf_event__preprocess_sample() and friends, which leads to
      inconsistency in the browser seek routines, that expects the number of
      hist_entry->filtered entries to match what it thinks is the number of
      unfiltered, browsable entries.
      
      So, for instance, when we do:
      
        perf top --symbols ___non_existent_symbol___
      
      the hist_browser__nr_entries() routine thinks there are no filters in
      place, uses the hists->nr_entries but all entries are filtered, leading
      to a segfault.
      
      Tested with:
      
         perf top --symbols malloc,free --percentage=relative
      
      Freezing, by pressing 'f', at any time and doing the math on the
      percentages ends up with 100%, ditto for:
      
         perf top --dsos libpthread-2.20.so,libxul.so --percentage=relative
      
      Both were segfaulting, all fixed now.
      
      More work needed to do away with checking if filters are in place, we
      should just use the nr_non_filtered_samples counter, no need to
      conditionally use it or hists.nr_filter, as what the browser does is
      just show unfiltered stuff. An audit of how it is being accounted is
      needed, this is the minimal fix.
      Reported-by: NMichael Petlan <mpetlan@redhat.com>
      Fixes: 268397cb ("perf top/tui: Update nr_entries properly after a filter is applied")
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-6w01d5q97qk0d64kuojme5in@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9c0fa8dd
  10. 22 6月, 2015 1 次提交
  11. 20 6月, 2015 4 次提交
  12. 18 6月, 2015 1 次提交
    • A
      perf top: Allow disabling/enabling events dynamicly · 5d484f99
      Arnaldo Carvalho de Melo 提交于
      Now it is possible to press CTRL+z at anytime and that will disable the
      events being monitored, essentially turning 'top' into 'report', with
      pressing CTRL+z again making it enable the events again, returning to
      the 'top' behaviour, i.e. dynamic + decaying of older samples.
      
      One may want, for instance, play with:
      
          -d, --delay <n>       number of seconds to delay between refreshes
      
      and:
      
          -z, --zero            zero history across updates
      
      Plus CTRL+z to see only the events since last zeroing, etc.
      Suggested-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-zq7tnh5462blt2yda0bcxh5b@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5d484f99
  13. 29 5月, 2015 1 次提交
  14. 06 5月, 2015 8 次提交
  15. 22 3月, 2015 1 次提交
  16. 18 3月, 2015 2 次提交
  17. 17 3月, 2015 2 次提交
  18. 13 3月, 2015 1 次提交
    • H
      perf hists browser: Fix UI bug after fold/unfold · 4fabf3d1
      He Kuang 提交于
      In perf hists browser, the fold/unfold stat of each hist entry is
      recorded but hb->nr_callchain_rows loses its value after zoom out and
      zoom in back. This causes a wrong row cursor range that restrict user to
      move down anymore.
      
      This bug can be reproduced as follows:
      
        $ perf record -g -e syscalls:* ls
        $ perf report
      
          Available samples
        ================================================================
          2 syscalls:sys_enter_mprotect <= [enter one of the entries]
          2 syscalls:sys_exit_mprotect
          13 syscalls:sys_enter_brk
          ...
      
      In the hists brower, unfold some of the items, now the cursor can reach
      to any rows:
      
          Children      Self  Command  Shared Object          Symbol
        ================================================================
        -  100.00%   100.00%  ls       libuClibc-0.9.33.2.so  [.] lstat64
        - lstat64
             16.67% 0x6469702e64
             8.33% 0x646970
             8.33% 0x617461
             8.33% 0x65
        -   16.67%     0.00%  ls       [unknown]              [.]0x6469702e64
           0x6469702e64 <= [cursor can reach to bottom line, everything is ok]
      
      Now, zoom back to "Available samples" and enter again:
      
          Children      Self  Command  Shared Object          Symbol
        ================================================================
        -  100.00%   100.00%  ls       libuClibc-0.9.33.2.so  [.] lstat64
        - lstat64
             16.67% 0x6469702e64
             8.33% 0x646970
             8.33% 0x617461 <= [cursor may stop here, can't move down anymore]
             8.33% 0x65
        -   16.67%     0.00%  ls       [unknown]              [.]0x6469702e64
           0x6469702e64
      
      This patch recalculates hb->nr_callchain_rows to fix the bug.
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1426144909-18951-1-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4fabf3d1
  19. 03 3月, 2015 1 次提交
    • A
      perf tools: Reference count struct thread · f3b623b8
      Arnaldo Carvalho de Melo 提交于
      We need to do that to stop accumulating entries in the dead_threads
      linked list, i.e. we were keeping references to threads in struct hists
      that continue to exist even after a thread exited and was removed from
      the machine threads rbtree.
      
      We still keep the dead_threads list, but just for debugging, allowing us
      to iterate at any given point over the threads that still are referenced
      by things like struct hist_entry.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-3ejvfyed0r7ue61dkurzjux4@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f3b623b8
  20. 08 1月, 2015 1 次提交
    • 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
  21. 09 12月, 2014 1 次提交
  22. 24 11月, 2014 2 次提交
    • N
      perf tools: Collapse first level callchain entry if it has sibling · a7444af6
      Namhyung Kim 提交于
      If first level callchain has more than single path like when -g caller
      option is given, it should show only first one in the path and hide
      others.  But it didn't do it properly and just hindered the output.
      
      Before:
        -   80.33%    11.11%  abc2     abc2              [.] main
           + 86.18% main
             13.82% __libc_start_main
                main
      
      After:
        -   80.33%    11.11%  abc2     abc2              [.] main
           + 86.18% main
           + 13.82% __libc_start_main
      Signed-off-by: NNamhyung 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-2-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a7444af6
    • N
      perf hists browser: Print overhead percent value for first-level callchain · 4087d11c
      Namhyung Kim 提交于
      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: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NNamhyung 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: NArnaldo Carvalho de Melo <acme@redhat.com>
      4087d11c
  23. 19 11月, 2014 1 次提交