1. 22 10月, 2013 1 次提交
    • W
      perf report: Add --max-stack option to limit callchain stack scan · 91e95617
      Waiman Long 提交于
      When callgraph data was included in the perf data file, it may take a
      long time to scan all those data and merge them together especially if
      the stored callchains are long and the perf data file itself is large,
      like a Gbyte or so.
      
      The callchain stack is currently limited to PERF_MAX_STACK_DEPTH (127).
      This is a large value. Usually the callgraph data that developers are
      most interested in are the first few levels, the rests are usually not
      looked at.
      
      This patch adds a new --max-stack option to perf-report to limit the
      depth of callchain stack data to look at to reduce the time it takes for
      perf-report to finish its processing. It trades the presence of trailing
      stack information with faster speed.
      
      The following table shows the elapsed time of doing perf-report on a
      perf.data file of size 985,531,828 bytes.
      
        --max_stack   Elapsed Time    Output data size
        -----------   ------------    ----------------
        not set        88.0s          124,422,651
        64             87.5s          116,303,213
        32             87.2s          112,023,804
        16             86.6s           94,326,380
        8              59.9s           33,697,248
        4              40.7s           10,116,637
        -g none        27.1s            2,555,810
      Signed-off-by: NWaiman Long <Waiman.Long@hp.com>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Aswin Chandramouleeswaran <aswin@hp.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>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1382107129-2010-4-git-send-email-Waiman.Long@hp.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      91e95617
  2. 04 10月, 2013 2 次提交
  3. 22 7月, 2013 1 次提交
  4. 13 7月, 2013 1 次提交
    • 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
  5. 28 5月, 2013 1 次提交
  6. 01 4月, 2013 1 次提交
    • 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
  7. 27 3月, 2013 1 次提交
  8. 01 2月, 2013 1 次提交
    • N
      perf report: Add --group option · 01d14f16
      Namhyung Kim 提交于
      Add --group option to enable event grouping.  When enabled, all the
      group members information will be shown together with the leader.
      
        $ perf report --group
        ...
        # group: {ref-cycles,cycles}
        # ========
        #
        # Samples: 7K of event 'anon group { ref-cycles, cycles }'
        # Event count (approx.): 6876107743
        #
        #         Overhead  Command      Shared Object                      Symbol
        # ................  .......  .................  ..........................
        #
            99.84%  99.76%  noploop  noploop            [.] main
             0.07%   0.00%  noploop  ld-2.15.so         [.] strcmp
             0.03%   0.00%  noploop  [kernel.kallsyms]  [k] timerqueue_del
             0.03%   0.03%  noploop  [kernel.kallsyms]  [k] sched_clock_cpu
             0.02%   0.00%  noploop  [kernel.kallsyms]  [k] account_user_time
             0.01%   0.00%  noploop  [kernel.kallsyms]  [k] __alloc_pages_nodemask
             0.00%   0.00%  noploop  [kernel.kallsyms]  [k] native_write_msr_safe
             0.00%   0.11%  noploop  [kernel.kallsyms]  [k] _raw_spin_lock
             0.00%   0.06%  noploop  [kernel.kallsyms]  [k] find_get_page
             0.00%   0.02%  noploop  [kernel.kallsyms]  [k] rcu_check_callbacks
             0.00%   0.02%  noploop  [kernel.kallsyms]  [k] __current_kernel_time
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.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/1358845787-1350-18-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      01d14f16
  9. 25 1月, 2013 1 次提交
  10. 06 9月, 2012 1 次提交
  11. 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
  12. 20 3月, 2012 1 次提交
    • P
      perf report: Add a simple GTK2-based 'perf report' browser · c31a9457
      Pekka Enberg 提交于
      This patch adds a simple GTK2-based browser to 'perf report' that's
      based on the TTY-based browser in builtin-report.c.
      
      To launch "perf report" using the new GTK interface just type:
      
        $ perf report --gtk
      
      The interface is somewhat limited in features at the moment:
      
        - No callgraph support
      
        - No KVM guest profiling support
      
        - No color coding for percentages
      
        - No sorting from the UI
      
        - ..and many, many more!
      
      That said, I think this patch a reasonable start to build future features on.
      Signed-off-by: NPekka Enberg <penberg@kernel.org>
      Cc: Colin Walters <walters@verbum.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1202231952410.6689@tux.localdomain
      [ committer note: Added #pragma to make gtk no strict prototype problem go
        away as suggested by Colin Walters modulo avoiding push/pop ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c31a9457
  13. 19 3月, 2012 1 次提交
  14. 09 3月, 2012 2 次提交
    • S
      perf report: Auto-detect branch stack sampling mode · 993ac88d
      Stephane Eranian 提交于
      This patch enhances perf report to auto-detect when the
      perf.data file contains samples with branch stacks. That way it
      is not necessary to use the -b option.
      
      To force branch view mode to off, simply use --no-branch-stack.
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: asharma@fb.com
      Cc: ravitillo@lbl.gov
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1331246868-19905-4-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      993ac88d
    • R
      perf report: Add support for taken branch sampling · b50311dc
      Roberto Agostino Vitillo 提交于
      This patch adds support for taken branch sampling, i.e, the
      PERF_SAMPLE_BRANCH_STACK feature to perf report. In other
      words, to display histograms based on taken branches rather
      than executed instructions addresses.
      
      The new option is called -b and it takes no argument. To
      generate meaningful output, the perf.data must have been
      obtained using perf record -b xxx ... where xxx is a branch
      filter option.
      
      The output shows symbols, modules, sorted by 'who branches
      where' the most often. The percentages reported in the first
      column refer to the total number of branches captured and
      not the usual number of samples.
      
      Here is a quick example.
      Here branchy is simple test program which looks as follows:
      
      void f2(void)
      {}
      void f3(void)
      {}
      void f1(unsigned long n)
      {
        if (n & 1UL)
          f2();
        else
          f3();
      }
      int main(void)
      {
        unsigned long i;
      
        for (i=0; i < N; i++)
         f1(i);
        return 0;
      }
      
      Here is the output captured on Nehalem, if we are
      only interested in user level function calls.
      
      $ perf record -b any_call,u -e cycles:u branchy
      
      $ perf report -b --sort=symbol
          52.34%  [.] main                   [.] f1
          24.04%  [.] f1                     [.] f3
          23.60%  [.] f1                     [.] f2
           0.01%  [k] _IO_new_file_xsputn    [k] _IO_file_overflow
           0.01%  [k] _IO_vfprintf_internal  [k] _IO_new_file_xsputn
           0.01%  [k] _IO_vfprintf_internal  [k] strchrnul
           0.01%  [k] __printf               [k] _IO_vfprintf_internal
           0.01%  [k] main                   [k] __printf
      
      About half (52%) of the call branches captured are from main()
      -> f1(). The second half (24%+23%) is split in two equal shares
      between f1() -> f2(), f1() ->f3(). The output is as expected
      given the code.
      
      It should be noted, that using -b in perf record does not
      eliminate information in the perf.data file. Consequently, a
      typical profile can also be obtained by perf report by simply
      not using its -b option.
      
      It is possible to sort on branch related columns:
      
         - dso_from, symbol_from
         - dso_to, symbol_to
         - mispredict
      Signed-off-by: NRoberto Agostino Vitillo <ravitillo@lbl.gov>
      Signed-off-by: NStephane Eranian <eranian@google.com>
      Cc: peterz@infradead.org
      Cc: acme@redhat.com
      Cc: robert.richter@amd.com
      Cc: ming.m.lin@intel.com
      Cc: andi@firstfloor.org
      Cc: asharma@fb.com
      Cc: vweaver1@eecs.utk.edu
      Cc: khandual@linux.vnet.ibm.com
      Cc: dsahern@gmail.com
      Link: http://lkml.kernel.org/r/1328826068-11713-14-git-send-email-eranian@google.comSigned-off-by: NIngo Molnar <mingo@elte.hu>
      b50311dc
  15. 24 12月, 2011 1 次提交
    • R
      perf report: Accept fifos as input file · efad1415
      Robert Richter 提交于
      The default input file for perf report is not handled the same way as
      perf record does it for its output file. This leads to unexpected
      behavior of perf report, etc. E.g.:
      
       # perf record -a -e cpu-cycles sleep 2 | perf report | cat
       failed to open perf.data: No such file or directory  (try 'perf record' first)
      
      While perf record writes to a fifo, perf report expects perf.data to be
      read. This patch changes this to accept fifos as input file.
      
      Applies to the following commands:
      
       perf annotate
       perf buildid-list
       perf evlist
       perf kmem
       perf lock
       perf report
       perf sched
       perf script
       perf timechart
      
      Also fixes char const* -> const char* type declaration for filename
      strings.
      
      v2:
      * Prevent potential null pointer access to input_name in
        builtin-report.c. Needed due to removal of patch "perf report: Setup
        browser if stdout is a pipe"
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1323248577-11268-5-git-send-email-robert.richter@amd.comSigned-off-by: NRobert Richter <robert.richter@amd.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      efad1415
  16. 20 12月, 2011 1 次提交
  17. 28 11月, 2011 1 次提交
  18. 08 10月, 2011 2 次提交
    • A
      perf tools: Make --no-asm-raw the default · 64c6f0c7
      Arnaldo Carvalho de Melo 提交于
      And add the annotation output knobs to all the tools that have
      integrated annotation (top, report).
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      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-gnlob67mke6sji2kf4nstp7m@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      64c6f0c7
    • S
      perf tools: Make perf.data more self-descriptive (v8) · fbe96f29
      Stephane Eranian 提交于
      The goal of this patch is to include more information about the host
      environment into the perf.data so it is more self-descriptive. Overtime,
      profiles are captured on various machines and it becomes hard to track
      what was recorded, on what machine and when.
      
      This patch provides a way to solve this by extending the perf.data file
      with basic information about the host machine. To add those extensions,
      we leverage the feature bits capabilities of the perf.data format.  The
      change is backward compatible with existing perf.data files.
      
      We define the following useful new extensions:
       - HEADER_HOSTNAME: the hostname
       - HEADER_OSRELEASE: the kernel release number
       - HEADER_ARCH: the hw architecture
       - HEADER_CPUDESC: generic CPU description
       - HEADER_NRCPUS: number of online/avail cpus
       - HEADER_CMDLINE: perf command line
       - HEADER_VERSION: perf version
       - HEADER_TOPOLOGY: cpu topology
       - HEADER_EVENT_DESC: full event description (attrs)
       - HEADER_CPUID: easy-to-parse low level CPU identication
      
      The small granularity for the entries is to make it easier to extend
      without breaking backward compatiblity. Many entries are provided as
      ASCII strings.
      
      Perf report/script have been modified to print the basic information as
      easy-to-parse ASCII strings. Extended information about CPU and NUMA
      topology may be requested with the -I option.
      
      Thanks to David Ahern for reviewing and testing the many versions of
      this patch.
      
       $ perf report --stdio
       # ========
       # captured on : Mon Sep 26 15:22:14 2011
       # hostname : quad
       # os release : 3.1.0-rc4-tip
       # perf version : 3.1.0-rc4
       # arch : x86_64
       # nrcpus online : 4
       # nrcpus avail : 4
       # cpudesc : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
       # cpuid : GenuineIntel,6,15,11
       # total memory : 8105360 kB
       # cmdline : /home/eranian/perfmon/official/tip/build/tools/perf/perf record date
       # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, id = { 29, 30, 31,
       # HEADER_CPU_TOPOLOGY info available, use -I to display
       # HEADER_NUMA_TOPOLOGY info available, use -I to display
       # ========
       #
       ...
      
       $ perf report --stdio -I
       # ========
       # captured on : Mon Sep 26 15:22:14 2011
       # hostname : quad
       # os release : 3.1.0-rc4-tip
       # perf version : 3.1.0-rc4
       # arch : x86_64
       # nrcpus online : 4
       # nrcpus avail : 4
       # cpudesc : Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
       # cpuid : GenuineIntel,6,15,11
       # total memory : 8105360 kB
       # cmdline : /home/eranian/perfmon/official/tip/build/tools/perf/perf record date
       # event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, id = { 29, 30, 31,
       # sibling cores   : 0-3
       # sibling threads : 0
       # sibling threads : 1
       # sibling threads : 2
       # sibling threads : 3
       # node0 meminfo  : total = 8320608 kB, free = 7571024 kB
       # node0 cpu list : 0-3
       # ========
       #
       ...
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Tested-by: NDavid Ahern <dsahern@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Link: http://lkml.kernel.org/r/20110930134040.GA5575@quadSigned-off-by: NStephane Eranian <eranian@google.com>
      [ committer notes: Use --show-info in the tools as was in the docs, rename
        perf_header_fprintf_info to perf_file_section__fprintf_info, fixup
        conflict with f69b64f7 "perf: Support setting the disassembler style" ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fbe96f29
  19. 07 10月, 2011 1 次提交
  20. 30 9月, 2011 1 次提交
  21. 05 7月, 2011 1 次提交
    • A
      perf report/annotate/script: Add option to specify a CPU range · 5d67be97
      Anton Blanchard 提交于
      Add an option to perf report/annotate/script to specify which
      CPUs to operate on. This enables us to take a single system wide
      profile and analyse each CPU (or group of CPUs) in isolation.
      
      This was useful when profiling a multiprocess workload where the
      bottleneck was on one CPU but this was hidden in the overall
      profile. Per process and per thread breakdowns didn't help
      because multiple processes were running on each CPU and no
      single process consumed an entire CPU.
      
      The patch converts the list of CPUs returned by cpu_map__new
      into a bitmap for fast lookup. I wanted to use -C to be
      consistent with perf top/record/stat, but unfortunately perf
      report already uses -C <comms>.
      
       v2: Incorporate suggestions from David Ahern:
      	- Added -c to perf script
      	- Check that SAMPLE_CPU is set when -c is used
      	- Update documentation
      
       v3: Create perf_session__cpu_bitmap()
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Acked-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Link: http://lkml.kernel.org/r/20110704215750.11647eb9@krytenSigned-off-by: NIngo Molnar <mingo@elte.hu>
      5d67be97
  22. 30 6月, 2011 1 次提交
    • S
      perf tools: Add inverted call graph report support. · d797fdc5
      Sam Liao 提交于
      Add "caller/callee" option to support inverted butterfly report,
      in the inverted report (with caller option), the call graph start
      from the callee's ancestor. Users can use such view to catch system's
      performance bottleneck from a sysprof like view. Using this option
      with specified sort order like pid gives us high level view of call
      graph statistics.
      
      Also add "-G" alias for inverted call graph.
      Signed-off-by: NSam Liao <phyomh@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: David Ahern <dsahern@gmail.com>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      d797fdc5
  23. 22 12月, 2010 1 次提交
    • D
      perf symbols: Add symfs option for off-box analysis using specified tree · ec5761ea
      David Ahern 提交于
      The symfs argument allows analysis of perf.data file using a locally accessible
      filesystem tree with debug symbols - e.g., tree created during image builds,
      sshfs mount, loop mounted KVM disk images, USB keys, initrds, etc. Anything
      with an OS tree can be analyzed from anywhere without the need to populate a
      local data store with build-ids.
      
      Commiter notes:
      
      o Fixed up symfs="/" variants handling.
      
      o prefixed DSO__ORIG_GUEST_KMODULE case with symfs too, avoiding use of files
        outside the symfs directory.
      
      LKML-Reference: <1291926427-28846-1-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ec5761ea
  24. 09 12月, 2010 1 次提交
  25. 02 12月, 2010 1 次提交
  26. 21 8月, 2010 1 次提交
  27. 16 12月, 2009 1 次提交
    • A
      perf diff: Use perf_session__fprintf_hists just like 'perf record' · c351c281
      Arnaldo Carvalho de Melo 提交于
      That means that almost everything you can do with 'perf report'
      can be done with 'perf diff', for instance:
      
      $ perf record -f find / > /dev/null
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.062 MB perf.data (~2699
      samples) ] $ perf record -f find / > /dev/null
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.062 MB perf.data (~2687
      samples) ] perf diff | head -8
           9.02%     +1.00%     find  libc-2.10.1.so               [.] _IO_vfprintf_internal
           2.91%     -1.00%     find  [kernel]                     [k] __kmalloc
           2.85%     -1.00%     find  [kernel]                     [k] ext4_htree_store_dirent
           1.99%     -1.00%     find  [kernel]                     [k] _atomic_dec_and_lock
           2.44%                find  [kernel]                     [k] half_md4_transform
      $
      
      So if you want to zoom into libc:
      
      $ perf diff --dsos libc-2.10.1.so | head -8
          37.34%                find  [.] _IO_vfprintf_internal
          10.34%                find  [.] __GI_memmove
           8.25%     +2.00%     find  [.] _int_malloc
           5.07%     -1.00%     find  [.] __GI_mempcpy
           7.62%     +2.00%     find  [.] _int_free
      $
      
      And if there were multiple commands using libc, it is also
      possible to aggregate them all by using --sort symbol:
      
      $ perf diff --dsos libc-2.10.1.so --sort symbol | head -8
          37.34%             [.] _IO_vfprintf_internal
          10.34%             [.] __GI_memmove
           8.25%     +2.00%  [.] _int_malloc
           5.07%     -1.00%  [.] __GI_mempcpy
           7.62%     +2.00%  [.] _int_free
      $
      
      The displacement column now is off by default, to use it:
      
      perf diff -m --dsos libc-2.10.1.so --sort symbol | head -8
          37.34%                   [.] _IO_vfprintf_internal
          10.34%                   [.] __GI_memmove
           8.25%     +2.00%        [.] _int_malloc
           5.07%     -1.00%    +2  [.] __GI_mempcpy
           7.62%     +2.00%    -1  [.] _int_free
      $
      
      Using -t/--field-separator can be used for scripting:
      
      $ perf diff -t, -m --dsos libc-2.10.1.so --sort symbol | head -8
      37.34, , ,[.] _IO_vfprintf_internal
      10.34, , ,[.] __GI_memmove
      8.25,+2.00%, ,[.] _int_malloc
      5.07,-1.00%,  +2,[.] __GI_mempcpy
      7.62,+2.00%,  -1,[.] _int_free
      6.99,+1.00%,  -1,[.] _IO_new_file_xsputn
      1.89,-2.00%,  +4,[.] __readdir64
      $
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1260978567-550-1-git-send-email-acme@infradead.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c351c281
  28. 09 11月, 2009 1 次提交
  29. 31 8月, 2009 1 次提交
  30. 09 8月, 2009 1 次提交
    • B
      perf report: Fix and improve the displaying of per-thread event counters · 8d513270
      Brice Goglin 提交于
      Improve and fix the handling of per-thread counter stats
      recorded via perf record -s. Previously we only displayed
      it in debug printouts (-D) and even that output was hard
      to disambiguate.
      
      I moved everything to utils/values.[ch] so that we may reuse
      it in perf stat.
      
      We get something like this now:
      
       #  PID   TID  cache-misses  cache-references
         4658  4659        495581           3238779
         4658  4662        498246           3236823
         4658  4663        499531           3243162
      
      Then it'll be easy to add --pretty=raw to display a single line per thread/event.
      
      By the way, -S was also used for --symbol... So I used -T/--thread here.
      
      perf report: Add -T/--threads to display per-thread counter values
      
       We get something like this now:
       #  PID   TID  cache-misses  cache-references
         4658  4659        495581           3238779
         4658  4662        498246           3236823
         4658  4663        499531           3243162
      
      Per-thread arrays of counter values are managed in utils/values.[ch]
      Signed-off-by: NBrice Goglin <Brice.Goglin@inria.fr>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: paulus@samba.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8d513270
  31. 12 7月, 2009 1 次提交
    • A
      perf report: Introduce -n/--show-nr-samples · e3d7e183
      Arnaldo Carvalho de Melo 提交于
      [acme@doppio pahole]$ perf report -ns comm,dso,symbol -d /lib64/libc-2.10.1.so -C pahole | head -17
          21.94%      32101  [.] _int_malloc
          20.10%      29402  [.] __GI_strcmp
          16.77%      24533  [.] __tsearch
          12.61%      18450  [.] malloc_consolidate
           6.42%       9394  [.] _int_free
           6.28%       9191  [.] __tfind
           4.56%       6678  [.] __GI___libc_free
           4.46%       6520  [.] _IO_vfprintf_internal
           2.59%       3786  [.] __malloc
           1.17%       1716  [.] __GI_memcpy
      [acme@doppio pahole]$
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1247325517-12272-5-git-send-email-acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e3d7e183
  32. 11 7月, 2009 1 次提交
    • A
      perf report: Adjust column width to the values sampled · 52d422de
      Arnaldo Carvalho de Melo 提交于
      Auto-adjust column width of perf report output to the
      longest occuring string length.
      
      Example:
      
      [acme@doppio pahole]$  perf report --sort comm,dso,symbol | head -13
      
          12.79%   pahole  /usr/lib64/libdw-0.141.so    [.] __libdw_find_attr
           8.90%   pahole  /lib64/libc-2.10.1.so        [.] _int_malloc
           8.68%   pahole  /usr/lib64/libdw-0.141.so    [.] __libdw_form_val_len
           8.15%   pahole  /lib64/libc-2.10.1.so        [.] __GI_strcmp
           6.80%   pahole  /lib64/libc-2.10.1.so        [.] __tsearch
           5.54%   pahole  ./build/libdwarves.so.1.0.0  [.] tag__recode_dwarf_type
      [acme@doppio pahole]$
      
      [acme@doppio pahole]$  perf report --sort comm,dso,symbol -d /lib64/libc-2.10.1.so | head -10
      
          21.92%   pahole  /lib64/libc-2.10.1.so  [.] _int_malloc
          20.08%   pahole  /lib64/libc-2.10.1.so  [.] __GI_strcmp
          16.75%   pahole  /lib64/libc-2.10.1.so  [.] __tsearch
      [acme@doppio pahole]$
      
      Also add these extra options to control the new behaviour:
      
        -w, --field-width
      
      Force each column width to the provided list, for large terminal
      readability.
      
        -t, --field-separator:
      
      Use a special separator character and don't pad with spaces, replacing
      all occurances of this separator in symbol names (and other output) with
      a '.' character, that thus it's the only non valid separator.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <20090711014728.GH3452@ghostprotocols.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      52d422de
  33. 01 7月, 2009 3 次提交
    • A
      perf report: Add --symbols parameter · 7bec7a91
      Arnaldo Carvalho de Melo 提交于
      So that we can filter by symbol name.
      
      The 'pfunct' utility in the 'dwarves' package can be used to
      create a file with the functions one wants.
      
      Example:
      
      [acme@doppio pahole]$ pfunct /usr/lib/debug/usr/lib64/libdw-0.141.so.debug | grep dwarf > /tmp/dwarf.symbols
      [acme@doppio pahole]$ wc -l /tmp/dwarf.symbols
      93 /tmp/dwarf.symbols
      [acme@doppio pahole]$ head -3 /tmp/dwarf.symbols
      dwfl_addrdwarf
      dwfl_module_getdwarf
      dwfl_getdwarf
      [acme@doppio pahole]$ perf report --sort comm,dso,symbol --comms pahole --dsos /usr/lib64/libdw-0.141.so --symbols file:///tmp/dwarf.symbols
      
          33.99%            pahole  /usr/lib64/libdw-0.141.so  [.] dwarf_tag
          29.07%            pahole  /usr/lib64/libdw-0.141.so  [.] dwarf_decl_file
          27.71%            pahole  /usr/lib64/libdw-0.141.so  [.] dwarf_getsrclines
           4.54%            pahole  /usr/lib64/libdw-0.141.so  0x00000000007400
           3.93%            pahole  /usr/lib64/libdw-0.141.so  [.] dwarf_decl_line
           0.46%            pahole  /usr/lib64/libdw-0.141.so  [.] dwarf_getlocation
           0.18%            pahole  /usr/lib64/libdw-0.141.so  [.] __libdwarf_next_prime
           0.13%            pahole  /usr/lib64/libdw-0.141.so  [.] dwarf_diecu
      
      [acme@doppio pahole]$
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1246399282-20934-4-git-send-email-acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7bec7a91
    • A
      perf report: Add --comms parameter · cc8b88b1
      Arnaldo Carvalho de Melo 提交于
      So that we can filter by comm. Symbols in other comms won't be
      accounted for.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1246399282-20934-3-git-send-email-acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cc8b88b1
    • A
      perf report: Add --dsos parameter · 25903407
      Arnaldo Carvalho de Melo 提交于
      So that we can filter by dso. Symbols in other dsos won't be
      accounted for.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1246399282-20934-2-git-send-email-acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      25903407
  34. 23 6月, 2009 1 次提交
  35. 07 6月, 2009 1 次提交