1. 24 8月, 2014 1 次提交
    • J
      perf tools: Add +field argument support for --field option · 2f3f9bcf
      Jiri Olsa 提交于
      Adding support to add field(s) to default field order via using the '+'
      prefix, like for report:
      
        $ perf report
        Samples: 10  of event 'cycles', Event count (approx.): 4463799
        Overhead  Command  Shared Object      Symbol
          32.40%  ls       [kernel.kallsyms]  [k] filemap_fault
          28.19%  ls       [kernel.kallsyms]  [k] get_page_from_freelist
          23.38%  ls       [kernel.kallsyms]  [k] enqueue_entity
          15.04%  ls       [kernel.kallsyms]  [k] mmap_region
      
        $ perf report -F +period,sample
        Samples: 10  of event 'cycles', Event count (approx.): 4463799
        Overhead        Period       Samples  Command  Shared Object      Symbol
          32.40%       1446493             1  ls       [kernel.kallsyms]  [k] filemap_fault
          28.19%       1258486             1  ls       [kernel.kallsyms]  [k] get_page_from_freelist
          23.38%       1043754             1  ls       [kernel.kallsyms]  [k] enqueue_entity
          15.04%        671160             1  ls       [kernel.kallsyms]  [k] mmap_region
      
      Works in general for commands using --field option.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jean Pihet <jean.pihet@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1408715919-25990-2-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2f3f9bcf
  2. 09 6月, 2014 2 次提交
    • D
      perf tools: Add dcacheline sort · 9b32ba71
      Don Zickus 提交于
      In perf's 'mem-mode', one can get access to a whole bunch of details specific to a
      particular sample instruction.  A bunch of those details relate to the data
      address.
      
      One interesting thing you can do with data addresses is to convert them into a unique
      cacheline they belong too.  Organizing these data cachelines into similar groups and sorting
      them can reveal cache contention.
      
      This patch creates an alogorithm based on various sample details that can help group
      entries together into data cachelines and allows 'perf report' to sort on it.
      
      The algorithm relies on having proper mmap2 support in the kernel to help determine
      if the memory map the data address belongs to is private to a pid or globally shared.
      
      The alogortithm is as follows:
      
      o group cpumodes together
      o group entries with discovered maps together
      o sort on major, minor, inode and inode generation numbers
      o if userspace anon, then sort on pid
      o sort on cachelines based on data addresses
      
      The 'dcacheline' sort option in 'perf report' only works in 'mem-mode'.
      
      Sample output:
      
       #
       # Samples: 206  of event 'cpu/mem-loads/pp'
       # Total weight : 2534
       # Sort order   : dcacheline,pid
       #
       # Overhead       Samples                                                          Data Cacheline       Command:  Pid
       # ........  ............  ......................................................................  ..................
       #
          13.22%             1  [k] 0xffff88042f08ebc0                                                       swapper:    0
           9.27%             1  [k] 0xffff88082e8cea80                                                       swapper:    0
           3.59%             2  [k] 0xffffffff819ba180                                                       swapper:    0
           0.32%             1  [k] arch_trigger_all_cpu_backtrace_handler_na.23901+0xffffffffffffffe0       swapper:    0
           0.32%             1  [k] timekeeper_seq+0xfffffffffffffff8                                        swapper:    0
      
      Note:  Added a '+1' to symlen size in hists__calc_col_len to prevent the next column
      from prematurely tabbing over and mis-aligning.  Not sure what the problem is.
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Link: http://lkml.kernel.org/r/1401208087-181977-8-git-send-email-dzickus@redhat.comSigned-off-by: NJiri Olsa <jolsa@kernel.org>
      9b32ba71
    • D
      perf tools: Add cpumode to struct hist_entry · 7365be55
      Don Zickus 提交于
      The next patch needs to sort on cpumode, so add it to hist_entry to be tracked.
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Link: http://lkml.kernel.org/r/1401208087-181977-6-git-send-email-dzickus@redhat.comSigned-off-by: NJiri Olsa <jolsa@kernel.org>
      7365be55
  3. 04 6月, 2014 1 次提交
    • J
      perf tools: Move elide bool into perf_hpp_fmt struct · f2998422
      Jiri Olsa 提交于
      After output/sort fields refactoring, it's expensive
      to check the elide bool in its current location inside
      the 'struct sort_entry'.
      
      The perf_hpp__should_skip function gets highly noticable in
      workloads with high number of output/sort fields, like for:
      
        $ perf report -i perf-test.data -F overhead,sample,period,comm,pid,dso,symbol,cpu --stdio
      
      Performance report:
         9.70%  perf  [.] perf_hpp__should_skip
      
      Moving the elide bool into the 'struct perf_hpp_fmt', which
      makes the perf_hpp__should_skip just single struct read.
      
      Got speedup of around 22% for my test perf.data workload.
      The change should not harm any other workload types.
      
      Performance counter stats for (10 runs):
        before:
         358,319,732,626      cycles                    ( +-  0.55% )
         467,129,581,515      instructions              #    1.30  insns per cycle          ( +-  0.00% )
      
           150.943975206 seconds time elapsed           ( +-  0.62% )
      
        now:
         278,785,972,990      cycles                    ( +-  0.12% )
         370,146,797,640      instructions              #    1.33  insns per cycle          ( +-  0.00% )
      
           116.416670507 seconds time elapsed           ( +-  0.31% )
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      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/20140601142622.GA9131@krava.brq.redhat.comSigned-off-by: NJiri Olsa <jolsa@kernel.org>
      f2998422
  4. 01 6月, 2014 2 次提交
  5. 21 5月, 2014 4 次提交
  6. 07 11月, 2013 1 次提交
  7. 06 11月, 2013 1 次提交
  8. 04 11月, 2013 1 次提交
  9. 04 10月, 2013 2 次提交
  10. 23 7月, 2013 1 次提交
  11. 13 7月, 2013 2 次提交
    • J
      perf hists: Marking dummy hists entries · e0af43d2
      Jiri Olsa 提交于
      It does not make sense to make some computation (ratio, wdiff), when the
      hist_entry is 'dummy' - added via hists__link.
      
      Adding dummy field to struct hist_entry which indicates that it was
      added by hists__link and avoiding some of the processing for such
      entries.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Reviewed-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/n/tip-g8bxml0n0pnqsrpyd98p0ird@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e0af43d2
    • G
      perf report/top: Add option to collapse undesired parts of call graph · b21484f1
      Greg Price 提交于
      For example, in an application with an expensive function implemented
      with deeply nested recursive calls, the default call-graph presentation
      is dominated by the different callchains within that function.  By
      ignoring these callees, we can collect the callchains leading into the
      function and compactly identify what to blame for expensive calls.
      
      For example, in this report the callers of garbage_collect() are
      scattered across the tree:
      
        $ perf report -d ruby 2>- | grep -m10 ^[^#]*[a-z]
            22.03%     ruby  [.] gc_mark
                       --- gc_mark
                          |--59.40%-- mark_keyvalue
                          |          st_foreach
                          |          gc_mark_children
                          |          |--99.75%-- rb_gc_mark
                          |          |          rb_vm_mark
                          |          |          gc_mark_children
                          |          |          gc_marks
                          |          |          |--99.00%-- garbage_collect
      
      If we ignore the callees of garbage_collect(), its callers are coalesced:
      
        $ perf report --ignore-callees garbage_collect -d ruby 2>- | grep -m10 ^[^#]*[a-z]
            72.92%     ruby  [.] garbage_collect
                       --- garbage_collect
                           vm_xmalloc
                          |--47.08%-- ruby_xmalloc
                          |          st_insert2
                          |          rb_hash_aset
                          |          |--98.45%-- features_index_add
                          |          |          rb_provide_feature
                          |          |          rb_require_safe
                          |          |          vm_call_method
      Signed-off-by: NGreg Price <price@mit.edu>
      Tested-by: NJiri Olsa <jolsa@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20130623031720.GW22203@biohazard-cafe.mit.edu
      Link: http://lkml.kernel.org/r/20130708115746.GO22203@biohazard-cafe.mit.edu
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      [ remove spaces at beginning of line, reported by Fengguang Wu ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b21484f1
  12. 28 5月, 2013 4 次提交
  13. 01 4月, 2013 2 次提交
    • S
      perf tools: Add mem access sampling core support · 98a3b32c
      Stephane Eranian 提交于
      This patch adds the sorting and histogram support
      functions to enable profiling of memory accesses.
      
      The following sorting orders are added:
       - symbol_daddr: data address symbol (or raw address)
       - dso_daddr: data address shared object
       - locked: access uses locked transaction
       - tlb : TLB access
       - mem : memory level of the access (L1, L2, L3, RAM, ...)
       - snoop: access snoop mode
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1359040242-8269-12-git-send-email-eranian@google.com
      [ committer note: changed to cope with fc5871ed, the move of methods to
        machine.[ch], and the rename of dsrc to data_src, to match the change
        made in the PERF_SAMPLE_DSRC in a previous patch. ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      98a3b32c
    • A
      perf tools: Add support for weight v7 (modified) · 05484298
      Andi Kleen 提交于
      perf record has a new option -W that enables weightened sampling.
      
      Add sorting support in top/report for the average weight per sample and the
      total weight sum. This allows to both compare relative cost per event
      and the total cost over the measurement period.
      
      Add the necessary glue to perf report, record and the library.
      
      v2: Merge with new hist refactoring.
      v3: Fix manpage. Remove value check.
      Rename global_weight to weight and weight to local_weight.
      v4: Readd sort keys to manpage
      v5: Move weight to end
      v6: Move weight to template
      v7: Rename weight key.
      
      Original patch from Andi modified by Stephane Eranian <eranian@google.com>
      to include ONLY the weight supporting code and apply to pristine 3.8.0-rc4.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1359040242-8269-6-git-send-email-eranian@google.com
      [ committer note: changed to cope with fc5871ed and the hists_link perf test entry ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      05484298
  14. 07 2月, 2013 1 次提交
  15. 25 1月, 2013 1 次提交
  16. 09 12月, 2012 2 次提交
  17. 09 11月, 2012 1 次提交
  18. 06 10月, 2012 2 次提交
    • J
      perf diff: Add weighted diff computation way to compare hist entries · 81d5f958
      Jiri Olsa 提交于
      Adding 'wdiff' as new computation way to compare hist entries.
      
      If specified the 'Weighted diff' column is displayed with value 'd'
      computed as:
      
         d = B->period * WEIGHT-A - A->period * WEIGHT-B
      
        - A/B being matching hist entry from first/second file specified
          (or perf.data/perf.data.old) respectively.
        - period being the hist entry period value
        - WEIGHT-A/WEIGHT-B being user suplied weights in the the '-c' option
          behind ':' separator like '-c wdiff:1,2'.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1349448287-18919-5-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      81d5f958
    • J
      perf diff: Add option to sort entries based on diff computation · 96c47f19
      Jiri Olsa 提交于
      Adding support to sort hist entries based on the outcome of selected
      computation. It's now possible to specify '+' as a first character of
      '-c' option value to make such sort.
      
      Example:
      
        $ perf diff -c ratio -b
        # Event 'cache-misses'
        #
        #   Baseline           Ratio      Shared Object                            Symbol
        #   ........  ..............  .................  ................................
        #
              19.64%            0.69  [kernel.kallsyms]  [k] clear_page
               0.30%            0.17  [kernel.kallsyms]  [k] mm_alloc
               0.04%            0.20  [kernel.kallsyms]  [k] kmem_cache_alloc
      
        $ perf diff -c +ratio -b
        # Event 'cache-misses'
        #
        #   Baseline           Ratio      Shared Object                            Symbol
        #   ........  ..............  .................  ................................
        #
              19.64%            0.69  [kernel.kallsyms]  [k] clear_page
               0.04%            0.20  [kernel.kallsyms]  [k] kmem_cache_alloc
               0.30%            0.17  [kernel.kallsyms]  [k] mm_alloc
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1349448287-18919-4-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      96c47f19
  19. 05 10月, 2012 3 次提交
  20. 18 9月, 2012 1 次提交
  21. 08 9月, 2012 1 次提交
  22. 20 6月, 2012 1 次提交
    • A
      perf tools: Add sort by src line/number · 409a8be6
      Arnaldo Carvalho de Melo 提交于
      Using addr2line for now, requires debuginfo, needs more work to support
      detached debuginfo, aka foo-debuginfo packages.
      
      Example:
      
      	[root@sandy ~]# perf record -a sleep 3
      	[ perf record: Woken up 1 times to write data ]
      	[ perf record: Captured and wrote 0.555 MB perf.data (~24236 samples) ]
      	[root@sandy ~]# perf report -s dso,srcline 2>&1 | grep -v ^# | head -5
      	    22.41%  [kernel.kallsyms]  /home/git/linux/drivers/idle/intel_idle.c:280
      	     4.79%  [kernel.kallsyms]  /home/git/linux/drivers/cpuidle/cpuidle.c:148
      	     4.78%  [kernel.kallsyms]  /home/git/linux/arch/x86/include/asm/atomic64_64.h:121
      	     4.49%  [kernel.kallsyms]  /home/git/linux/kernel/sched/core.c:1690
      	     4.30%  [kernel.kallsyms]  /home/git/linux/include/linux/seqlock.h:90
      	[root@sandy ~]#
      
      [root@sandy ~]# perf top -U -s dso,symbol,srcline
      Samples: 1K of event 'cycles', Event count (approx.): 589617389
       18.66%  [kernel]  [k] copy_user_generic_unrolled   /home/git/linux/arch/x86/lib/copy_user_64.S:143
        7.83%  [kernel]  [k] clear_page                   /home/git/linux/arch/x86/lib/clear_page_64.S:39
        6.59%  [kernel]  [k] clear_page                   /home/git/linux/arch/x86/lib/clear_page_64.S:38
        3.66%  [kernel]  [k] page_fault                   /home/git/linux/arch/x86/kernel/entry_64.S:1379
        3.25%  [kernel]  [k] clear_page                   /home/git/linux/arch/x86/lib/clear_page_64.S:40
        3.12%  [kernel]  [k] clear_page                   /home/git/linux/arch/x86/lib/clear_page_64.S:37
        2.74%  [kernel]  [k] clear_page                   /home/git/linux/arch/x86/lib/clear_page_64.S:36
        2.39%  [kernel]  [k] clear_page                   /home/git/linux/arch/x86/lib/clear_page_64.S:43
        2.12%  [kernel]  [k] ioread32                     /home/git/linux/lib/iomap.c:90
        1.51%  [kernel]  [k] copy_user_generic_unrolled   /home/git/linux/arch/x86/lib/copy_user_64.S:144
        1.19%  [kernel]  [k] copy_user_generic_unrolled   /home/git/linux/arch/x86/lib/copy_user_64.S:154
      Suggested-by: NAndi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-pdmqbng9twz06jzkbgtuwbp8@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      409a8be6
  23. 09 3月, 2012 3 次提交