1. 09 12月, 2012 3 次提交
  2. 09 11月, 2012 3 次提交
    • A
      perf diff: Use hists__link when not pairing just with baseline · bfaef4b4
      Arnaldo Carvalho de Melo 提交于
      Previously there were blind spots because we were not looking at symbols
      that didn't ocurred in the latest run:
      
        # perf record usleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.018 MB perf.data (~801 samples) ]
        # perf record usleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.018 MB perf.data (~801 samples) ]
      
      Before:
      
        # perf diff
        # Event 'cycles'
        #
        # Baseline    Delta      Shared Object                         Symbol
        # ........  .......  .................  .............................
        #
                    +10.38%  [kernel.kallsyms]  [k] get_empty_filp
                     +9.51%  [kernel.kallsyms]  [k] update_sd_lb_stats
                     +9.41%  libpopt.so.0.0.0   [.] _init
                     +9.29%  [kernel.kallsyms]  [k] vma_interval_tree_insert
             9.05%   +0.12%  [kernel.kallsyms]  [k] do_sys_open
                     +9.14%  [kernel.kallsyms]  [k] kfree
                     +8.98%  [kernel.kallsyms]  [k] free_pages_and_swap_cache
                     +8.78%  [kernel.kallsyms]  [k] unmap_page_range
             9.36%   -0.90%  [kernel.kallsyms]  [k] zap_pte_range
             7.60%   +0.09%  [kernel.kallsyms]  [k] find_next_bit
                     +4.37%  [kernel.kallsyms]  [k] place_entity
                     +3.38%  [kernel.kallsyms]  [k] __do_page_fault
                     +0.80%  [kernel.kallsyms]  [k] native_apic_mem_write
             0.21%   +0.43%  [kernel.kallsyms]  [k] native_write_msr_safe
        #
      
      So 9.05 + 9.36 + 7.60 + 0.21 != 100%
      
      Now using the recently introduced hists__link we can see the whole
      picture:
      
        # perf diff
        # Event 'cycles'
        #
        # Baseline    Delta      Shared Object                         Symbol
        # ........  .......  .................  .............................
        #
             8.44%   -8.44%  [kernel.kallsyms]  [k] _raw_spin_lock
             9.05%   -9.05%  [kernel.kallsyms]  [k] sha_transform
            10.55%  -10.55%  [kernel.kallsyms]  [k] __d_lookup_rcu
                    +10.38%  [kernel.kallsyms]  [k] get_empty_filp
            17.70%  -17.70%  [kernel.kallsyms]  [k] kmem_cache_free
                     +9.51%  [kernel.kallsyms]  [k] update_sd_lb_stats
                     +9.41%  libpopt.so.0.0.0   [.] _init
                     +9.29%  [kernel.kallsyms]  [k] vma_interval_tree_insert
             9.05%   +0.12%  [kernel.kallsyms]  [k] do_sys_open
                     +9.14%  [kernel.kallsyms]  [k] kfree
                     +8.98%  [kernel.kallsyms]  [k] free_pages_and_swap_cache
                     +8.78%  [kernel.kallsyms]  [k] unmap_page_range
             9.36%   -0.90%  [kernel.kallsyms]  [k] zap_pte_range
             7.60%   +0.09%  [kernel.kallsyms]  [k] find_next_bit
                     +4.37%  [kernel.kallsyms]  [k] place_entity
                     +3.38%  [kernel.kallsyms]  [k] __do_page_fault
             4.01%   -4.01%  [kernel.kallsyms]  [k] handle_pte_fault
             9.27%   -9.27%  [kernel.kallsyms]  [k] find_get_page
             0.78%   -0.78%  [kernel.kallsyms]  [k] rcu_irq_enter
             0.57%   -0.57%  [kernel.kallsyms]  [k] finish_task_switch
             4.25%   -4.25%  [kernel.kallsyms]  [k] run_timer_softirq
                     +0.80%  [kernel.kallsyms]  [k] native_apic_mem_write
             0.21%   +0.43%  [kernel.kallsyms]  [k] native_write_msr_safe
             9.16%   -9.16%  ld-2.12.so         [.] close
        #
      
      Now:
      
      8.44 + 9.05 + 10.55 + 17.70 + 9.05 + 9.36 +
      7.60 + 4.01 + 9.27 + 0.78 + 0.57 + 4.25 + 0.21 + 9.16 == 100%
      
      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-jeq55qdgby1745bs8r9sscdh@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bfaef4b4
    • A
      perf diff: Move hists__match to the hists lib · 95529be4
      Arnaldo Carvalho de Melo 提交于
      Its not 'diff' specific and will be useful for other use cases, like
      bucketizing multiple events in a single session.
      
      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-o35urjgxfxxm70aw1wa81s4w@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      95529be4
    • A
      perf diff: Start moving to support matching more than two hists · b821c732
      Arnaldo Carvalho de Melo 提交于
      We want to match more than two hists, so that we can match more than two
      perf.data files and moreover, match hist_entries (buckets) in multiple
      events in a group.
      
      So the "baseline"/"leader" will instead of a ->pair pointer, use a
      list_head, that will link to the pairs and hists__match use it.
      
      Following that perf_evlist__link will link the hists in its evsel
      groups.
      
      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-2kbmzepoi544ygj9godseqpv@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b821c732
  3. 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
  4. 06 10月, 2012 7 次提交
  5. 05 10月, 2012 3 次提交
  6. 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
  7. 09 9月, 2012 1 次提交
  8. 08 9月, 2012 1 次提交
    • J
      perf diff: Make diff command work with evsel hists · 863e451f
      Jiri Olsa 提交于
      Putting 'perf diff' command back on track with the 'latest'
      evsel hists changes. Each evsel has its own 'hists' object
      gathering stats for the particular event.
      
      While currently counts are accumulated for the whole session
      regardless of the events diversification within compared
      sessions.
      
      The 'perf diff' command now outputs all matching events within
      compared sessions (with event name specified). The per event
      diff output stays the same.
      
        $ ./perf diff
        # Event 'cycles'
        #
        # Baseline  Delta          Shared Object                          Symbol
        # ........ ..........  .................  ..............................
        #
             0.00%    +15.14%  [kernel.kallsyms]  [k] __wake_up
             0.00%    +13.38%  [kernel.kallsyms]  [k] ext4fs_dirhash
      
      ... SNIP
      
             0.00%     +0.42%  [kernel.kallsyms]  [k] local_clock
             0.17%     -0.05%  [kernel.kallsyms]  [k] native_write_msr_safe
      
        # Event 'faults'
        #
        # Baseline  Delta          Shared Object                          Symbol
        # ........ ..........  .................  ..............................
        #
             0.00%    +79.12%  ld-2.15.so         [.] _dl_relocate_object
             0.00%    +11.62%  ld-2.15.so         [.] openaux
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Andi Kleen <andi@firstfloor.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@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1346946426-13496-2-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      863e451f
  9. 23 3月, 2012 1 次提交
  10. 28 11月, 2011 3 次提交
  11. 07 10月, 2011 1 次提交
  12. 24 3月, 2011 1 次提交
    • A
      perf session: Pass evsel in event_ops->sample() · 9e69c210
      Arnaldo Carvalho de Melo 提交于
      Resolving the sample->id to an evsel since the most advanced tools,
      report and annotate, and the others will too when they evolve to
      properly support multi-event perf.data files.
      
      Good also because it does an extra validation, checking that the ID is
      valid when present. When that is not the case, the overhead is just a
      branch + function call (perf_evlist__id2evsel).
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9e69c210
  13. 30 1月, 2011 2 次提交
  14. 22 12月, 2010 3 次提交
    • 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
    • I
      perf record,report,annotate,diff: Process events in order · eac23d1c
      Ian Munsie 提交于
      This patch changes perf report to ask for the ID info on all events be
      default if recording from multiple CPUs.
      
      Perf report, annotate and diff will now process the events in order if
      the kernel is able to provide timestamps on all events. This ensures
      that events such as COMM and MMAP which are necessary to correctly
      interpret samples are processed prior to those samples so that they are
      attributed correctly.
      
      Before:
       # perf record ./cachetest
       # perf report
      
       # Events: 6K cycles
       #
       # Overhead  Command      Shared Object                           Symbol
       # ........  .......  .................  ...............................
       #
           74.11%    :3259  [unknown]          [k] 0x4a6c
            1.50%  cachetest  ld-2.11.2.so       [.] 0x1777c
            1.46%    :3259  [kernel.kallsyms]  [k] .perf_event_mmap_ctx
            1.25%    :3259  [kernel.kallsyms]  [k] restore
            0.74%    :3259  [kernel.kallsyms]  [k] ._raw_spin_lock
            0.71%    :3259  [kernel.kallsyms]  [k] .filemap_fault
            0.66%    :3259  [kernel.kallsyms]  [k] .memset
            0.54%  cachetest  [kernel.kallsyms]  [k] .sha_transform
            0.54%    :3259  [kernel.kallsyms]  [k] .copy_4K_page
            0.54%    :3259  [kernel.kallsyms]  [k] .find_get_page
            0.52%    :3259  [kernel.kallsyms]  [k] .trace_hardirqs_off
            0.50%    :3259  [kernel.kallsyms]  [k] .__do_fault
      <SNIP>
      
      After:
       # perf report
      
       # Events: 6K cycles
       #
       # Overhead  Command      Shared Object                           Symbol
       # ........  .......  .................  ...............................
       #
           44.28%  cachetest  cachetest          [.] sumArrayNaive
           22.53%  cachetest  cachetest          [.] sumArrayOptimal
            6.59%  cachetest  ld-2.11.2.so       [.] 0x1777c
            2.13%  cachetest  [unknown]          [k] 0x340
            1.46%  cachetest  [kernel.kallsyms]  [k] .perf_event_mmap_ctx
            1.25%  cachetest  [kernel.kallsyms]  [k] restore
            0.74%  cachetest  [kernel.kallsyms]  [k] ._raw_spin_lock
            0.71%  cachetest  [kernel.kallsyms]  [k] .filemap_fault
            0.66%  cachetest  [kernel.kallsyms]  [k] .memset
            0.54%  cachetest  [kernel.kallsyms]  [k] .copy_4K_page
            0.54%  cachetest  [kernel.kallsyms]  [k] .find_get_page
            0.54%  cachetest  [kernel.kallsyms]  [k] .sha_transform
            0.52%  cachetest  [kernel.kallsyms]  [k] .trace_hardirqs_off
            0.50%  cachetest  [kernel.kallsyms]  [k] .__do_fault
      <SNIP>
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1291872833-839-1-git-send-email-imunsie@au1.ibm.com>
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eac23d1c
    • I
      perf session: Fallback to unordered processing if no sample_id_all · 21ef97f0
      Ian Munsie 提交于
      If we are running the new perf on an old kernel without support for
      sample_id_all, we should fall back to the old unordered processing of
      events. If we didn't than we would *always* process events without
      timestamps out of order, whether or not we hit a reordering race. In
      other words, instead of there being a chance of not attributing samples
      correctly, we would guarantee that samples would not be attributed.
      
      While processing all events without timestamps before events with
      timestamps may seem like an intuitive solution, it falls down as
      PERF_RECORD_EXIT events would also be processed before any samples.
      Even with a workaround for that case, samples before/after an exec would
      not be attributed correctly.
      
      This patch allows commands to indicate whether they need to fall back to
      unordered processing, so that commands that do not care about timestamps
      on every event will not be affected. If we do fallback, this will print
      out a warning if report -D was invoked.
      
      This patch adds the test in perf_session__new so that we only need to
      test once per session. Commands that do not use an event_ops (such as
      record and top) can simply pass NULL in it's place.
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <1291951882-sup-6069@au1.ibm.com>
      Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      21ef97f0
  15. 05 12月, 2010 1 次提交
    • A
      perf session: Parse sample earlier · 640c03ce
      Arnaldo Carvalho de Melo 提交于
      At perf_session__process_event, so that we reduce the number of lines in eache
      tool sample processing routine that now receives a sample_data pointer already
      parsed.
      
      This will also be useful in the next patch, where we'll allow sample the
      identity fields in MMAP, FORK, EXIT, etc, when it will be possible to see (cpu,
      timestamp) just after before every event.
      
      Also validate callchains in perf_session__process_event, i.e. as early as
      possible, and keep a counter of the number of events discarded due to invalid
      callchains, warning the user about it if it happens.
      
      There is an assumption that was kept that all events have the same sample_type,
      that will be dealt with in the future, when this preexisting limitation will be
      removed.
      Tested-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NIan Munsie <imunsie@au1.ibm.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ian Munsie <imunsie@au1.ibm.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Stephane Eranian <eranian@google.com>
      LKML-Reference: <1291318772-30880-4-git-send-email-acme@infradead.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      640c03ce
  16. 02 12月, 2010 1 次提交
  17. 27 7月, 2010 1 次提交
  18. 05 6月, 2010 1 次提交
    • A
      perf tools: Make event__preprocess_sample parse the sample · 41a37e20
      Arnaldo Carvalho de Melo 提交于
      Simplifying the tools that were using both in sequence and allowing
      upcoming simplifications, such as Arun's patch to sort by cpus.
      
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      41a37e20
  19. 15 5月, 2010 2 次提交
    • A
      perf report: Report number of events, not samples · c82ee828
      Arnaldo Carvalho de Melo 提交于
      Number of samples is meaningless after we switched to auto-freq, so
      report the number of events, i.e. not the sum of the different periods,
      but the number PERF_RECORD_SAMPLE emitted by the kernel.
      
      While doing this I noticed that naming "count" to the sum of all the
      event periods can be confusing, so rename it to .period, just like in
      struct sample.data, so that we become more consistent.
      
      This helps with the next step, that was to record in struct hist_entry
      the number of sample events for each instance, we need that because we
      use it to generate the number of events when applying filters to the
      tree of hist entries like it is being done in the TUI report browser.
      Suggested-by: NIngo Molnar <mingo@elte.hu>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c82ee828
    • A
      perf hist: Clarify events_stats fields usage · cee75ac7
      Arnaldo Carvalho de Melo 提交于
      The events_stats.total field is too generic, rename it to .total_period,
      and also add a comment explaining that it is the sum of all the .period
      fields in samples, that is needed because we use auto-freq to avoid
      sampling artifacts.
      
      Ditto for events_stats.lost, that is the sum of all lost_event.lost
      fields, i.e. the number of events the kernel dropped.
      
      Looking at the users, builtin-sched.c can make use of these fields and
      stop doing it again.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cee75ac7
  20. 11 5月, 2010 1 次提交
    • A
      perf hist: Introduce hists class and move lots of methods to it · 1c02c4d2
      Arnaldo Carvalho de Melo 提交于
      In cbbc79a5 we introduced support for multiple events by introducing a
      new "event_stat_id" struct and then made several perf_session methods
      receive a point to it instead of a pointer to perf_session, and kept the
      event_stats and hists rb_tree in perf_session.
      
      While working on the new newt based browser, I realised that it would be
      better to introduce a new class, "hists" (short for "histograms"),
      renaming the "event_stat_id" struct and the perf_session methods that
      were really "hists" methods, as they manipulate only struct hists
      members, not touching anything in the other perf_session members.
      
      Other optimizations, such as calculating the maximum lenght of a symbol
      name present in an hists instance will be possible as we add them,
      avoiding a re-traversal just for finding that information.
      
      The rationale for the name "hists" to replace "event_stat_id" is that we
      may have multiple sets of hists for the same event_stat id, as, for
      instance, the 'perf diff' tool has, so event stat id is not what
      characterizes what this struct and the functions that manipulate it do.
      
      Cc: Eric B Munson <ebmunson@us.ibm.com>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1c02c4d2
  21. 10 5月, 2010 1 次提交
    • A
      perf hist: Simplify the insertion of new hist_entry instances · 28e2a106
      Arnaldo Carvalho de Melo 提交于
      And with that fix at least one bug:
      
      The first hit for an entry, the one that calls malloc to create a new
      instance in __perf_session__add_hist_entry, wasn't adding the count to
      the per cpumode (PERF_RECORD_MISC_USER, etc) total variable.
      
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      28e2a106
  22. 03 5月, 2010 1 次提交
    • T
      perf: add perf-inject builtin · 454c407e
      Tom Zanussi 提交于
      Currently, perf 'live mode' writes build-ids at the end of the
      session, which isn't actually useful for processing live mode events.
      
      What would be better would be to have the build-ids sent before any of
      the samples that reference them, which can be done by processing the
      event stream and retrieving the build-ids on the first hit.  Doing
      that in perf-record itself, however, is off-limits.
      
      This patch introduces perf-inject, which does the same job while
      leaving perf-record untouched.  Normal mode perf still records the
      build-ids at the end of the session as it should, but for live mode,
      perf-inject can be injected in between the record and report steps
      e.g.:
      
      perf record -o - ./hackbench 10 | perf inject -v -b | perf report -v -i -
      
      perf-inject reads a perf-record event stream and repipes it to stdout.
      At any point the processing code can inject other events into the
      event stream - in this case build-ids (-b option) are read and
      injected as needed into the event stream.
      
      Build-ids are just the first user of perf-inject - potentially
      anything that needs userspace processing to augment the trace stream
      with additional information could make use of this facility.
      
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frédéric Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1272696080-16435-3-git-send-email-tzanussi@gmail.com>
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      454c407e