1. 13 7月, 2013 3 次提交
    • 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
    • J
      perf report: Fix perf_session__delete removal · d4ae0a6f
      Jiri Olsa 提交于
      There's no point of having out_delete label with perf_session__delete
      call within __cmd_report function, because it's called at the end of the
      cmd_report function.
      
      The speed up due to commenting out the perf_session__delete at the end
      does not seem relevant anymore. Measured speedup for ~1GB data file with
      222466 FORKS events is around 0.5%.
      
        $ perf report -i perf.data.delete -P perf_session__delete -s parent
      
        +  99.51%  [other]
        +   0.49%  perf_session__delete
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.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>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1372161253-22081-6-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d4ae0a6f
    • J
      perf tools: Do not elide parent symbol column · ad3d6f50
      Jiri Olsa 提交于
      I found the parent symbol column data interesting even
      if there's another sorting enabled. Switching it on.
      
      Previous behaviour:
        $ perf report -i perf.data.delete -p perf_session__delete -x
      
        +   3.60%  perf  perf               [.] __rb_change_child
        +   1.89%  perf  perf               [.] rb_erase
        +   1.89%  perf  perf               [.] rb_erase
        +   1.83%  perf  perf               [.] free@plt
      
      Current behaviour:
        $ perf report -i perf.data.delete -p perf_session__delete -x
      
        +   3.60%  perf  perf               [.] __rb_change_child        perf_session__delete
        +   1.89%  perf  perf               [.] rb_erase                 perf_session__delete_dead_threads
        +   1.89%  perf  perf               [.] rb_erase                 perf_session__delete_threads
        +   1.83%  perf  perf               [.] free@plt                 perf_session__delete
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.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/n/tip-r79fn89bhqz16ixa5zmyflrd@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ad3d6f50
  2. 09 7月, 2013 1 次提交
    • J
      perf tools: Fix -x/--exclude-other option for report command · 0276c22a
      Jiri Olsa 提交于
      Currently we have symbol_conf.exclude_other being set as true every time
      so the -x/--exclude-other has nothing to do.
      
      Also we have no way to see the data with symbol_conf.exclude_other being
      false which is useful sometimes.
      
      Fixing it by making symbol_conf.exclude_other false by default.
      
      1) Example without -x option:
      
        $ perf report -i perf.data.delete -p perf_session__delete -s parent
      
        +  99.91%  [other]
        +   0.08%  perf_session__delete
        +   0.00%  perf_session__delete_dead_threads
        +   0.00%  perf_session__delete_threads
      
      2) Example with -x option:
      
        $ ./perf report -i perf.data.delete -p perf_session__delete -s parent -x
      
        +  96.22%  perf_session__delete
        +   1.89%  perf_session__delete_dead_threads
        +   1.89%  perf_session__delete_threads
      
      In Example 1) we get the sorted out data together with the rest
      "[other]". This could help us estimate how much time we spent in the
      sorted data.
      
      In Example 2) the total is just the sorted data.
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.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/n/tip-sg8fvu0fyqohf9ur9l38lhkw@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0276c22a
  3. 28 5月, 2013 8 次提交
  4. 01 4月, 2013 3 次提交
  5. 27 3月, 2013 1 次提交
  6. 16 3月, 2013 2 次提交
  7. 07 2月, 2013 2 次提交
  8. 01 2月, 2013 5 次提交
  9. 25 1月, 2013 2 次提交
  10. 09 12月, 2012 1 次提交
  11. 06 11月, 2012 2 次提交
  12. 29 10月, 2012 1 次提交
  13. 25 10月, 2012 1 次提交
  14. 07 10月, 2012 1 次提交
    • A
      perf event: No need to create a thread when handling PERF_RECORD_EXIT · f62d3f0f
      Arnaldo Carvalho de Melo 提交于
      When we were processing a PERF_RECORD_EXIT event we first used
      machine__findnew_thread for both the thread exiting and for its parent,
      only to use just the thread struct associated with the one exiting, and
      to just delete it.
      
      If it existed, i.e. not created at this very moment in
      machine__findnew_thread, it will be moved to the machine->dead_threads
      linked list, because we may have hist_entries pointing to it, but if it
      was created just do be deleted, it will just sit there with no
      references at all.
      
      Use the new machine__find_thread() method so that if it is not there, we
      don't create it.
      
      As a bonus the parent thread will also not be created at this point.
      
      Create process_fork() and process_exit() helpers to use this and make
      the builtins use it instead of the generic process_task(), ditched by
      this patch.
      
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.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-z7n2y98ebjyrvmytaope4vdl@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f62d3f0f
  15. 05 10月, 2012 3 次提交
  16. 18 9月, 2012 2 次提交
  17. 11 9月, 2012 1 次提交
    • I
      perf tools: Use __maybe_used for unused variables · 1d037ca1
      Irina Tirdea 提交于
      perf defines both __used and __unused variables to use for marking
      unused variables. The variable __used is defined to
      __attribute__((__unused__)), which contradicts the kernel definition to
      __attribute__((__used__)) for new gcc versions. On Android, __used is
      also defined in system headers and this leads to warnings like: warning:
      '__used__' attribute ignored
      
      __unused is not defined in the kernel and is not a standard definition.
      If __unused is included everywhere instead of __used, this leads to
      conflicts with glibc headers, since glibc has a variables with this name
      in its headers.
      
      The best approach is to use __maybe_unused, the definition used in the
      kernel for __attribute__((unused)). In this way there is only one
      definition in perf sources (instead of 2 definitions that point to the
      same thing: __used and __unused) and it works on both Linux and Android.
      This patch simply replaces all instances of __used and __unused with
      __maybe_unused.
      Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: NPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
      [ committer note: fixed up conflict with a116e05d in builtin-sched.c ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d037ca1
  18. 06 9月, 2012 1 次提交