1. 02 Jun, 2009 1 commit
  2. 01 Jun, 2009 5 commits
    • Mike Galbraith's avatar
      perf_counter tools: Guard against record damaging existing files · 229c4eed
      Mike Galbraith authored
      Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      229c4eed
    • Ingo Molnar's avatar
      perf_counter: Tidy up style details · 22a4f650
      Ingo Molnar authored
       - whitespace fixlets
       - make local variable definitions more consistent
      
      [ Impact: cleanup ]
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: John Kacur <jkacur@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      22a4f650
    • Paul Mackerras's avatar
      perf_counter: Allow software counters to count while task is not running · 880ca15a
      Paul Mackerras authored
      This changes perf_swcounter_match() so that per-task software
      counters can count events that occur while their associated
      task is not running.  This will allow us to use the generic
      software counter code for counting task migrations, which can
      occur while the task is not scheduled in.
      
      To do this, we have to distinguish between the situations where
      the counter is inactive because its task has been scheduled
      out, and those where the counter is inactive because it is part
      of a group that was not able to go on the PMU.  In the former
      case we want the counter to count, but not in the latter case.
      If the context is active, we have the latter case.  If the
      context is inactive then we need to know whether the counter
      was counting when the context was last active, which we can
      determine by comparing its ->tstamp_stopped timestamp with the
      context's timestamp.
      
      This also folds three checks in perf_swcounter_match, checking
      perf_event_raw(), perf_event_type() and perf_event_id()
      individually, into a single 64-bit comparison on
      counter->hw_event.config, as an optimization.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      LKML-Reference: <18979.34810.259718.955621@cargo.ozlabs.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      880ca15a
    • Paul Mackerras's avatar
      perf_counter: Provide functions for locking and pinning the context for a task · 25346b93
      Paul Mackerras authored
      This abstracts out the code for locking the context associated
      with a task.  Because the context might get transferred from
      one task to another concurrently, we have to check after
      locking the context that it is still the right context for the
      task and retry if not.  This was open-coded in
      find_get_context() and perf_counter_init_task().
      
      This adds a further function for pinning the context for a
      task, i.e. marking it so it can't be transferred to another
      task.  This adds a 'pin_count' field to struct
      perf_counter_context to indicate that a context is pinned,
      instead of the previous method of setting the parent_gen count
      to all 1s.  Pinning the context with a pin_count is easier to
      undo and doesn't require saving the parent_gen value.  This
      also adds a perf_unpin_context() to undo the effect of
      perf_pin_task_context() and changes perf_counter_init_task to
      use it.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      LKML-Reference: <18979.34748.755674.596386@cargo.ozlabs.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      25346b93
    • Ingo Molnar's avatar
      Merge branch 'linus' into perfcounters/core · 23db9f43
      Ingo Molnar authored
      Merge reason: merge almost-rc8 into perfcounters/core, which was -rc6
                    based - to pick up the latest upstream fixes.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      23db9f43
  3. 31 May, 2009 1 commit
    • Ingo Molnar's avatar
      perf_counter tools: Fix unknown command help text · 27b9613b
      Ingo Molnar authored
      Arjan reported this error when entering an unknown command to perf:
      
        $ perf start
        fatal: Uh oh. Your system reports no Git commands at all.
      
      The Git code expects there to be perf-* commands - but since Perf
      is a 'pure' utility with no dash commands anymore, this old assumption
      of Git does not hold anymore. Remove that error check.
      Reported-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: John Kacur <jkacur@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      27b9613b
  4. 30 May, 2009 4 commits
    • Ingo Molnar's avatar
      perf_counter tools: Generate per command manpages (and pdf/html, etc.) · c1c2365a
      Ingo Molnar authored
      Import Git's nice .txt => {man/html/pdf} generation machinery.
      
      Fix various errors in the Documentation/perf*.txt description as well.
      
      Also fix a bug in builtin-help: we'd map 'perf help top' to 'perftop'
      if only the 'perf' binary is in the default PATH - confusing the manpage
      logic. I dont fully understand why Git did it this way - but i suppose
      it's a migration artifact from their migration from standalone git-xyz
      commands to 'git xyz' commands. The perf tools were always using the
      modern form so it's not an issue there.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c1c2365a
    • Ingo Molnar's avatar
      perf_counter tools: Fix 'make install' · 7fbd5544
      Ingo Molnar authored
      'make install' didnt install perf itself - which needs a special
      rule to be copied to bindir.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      7fbd5544
    • Ingo Molnar's avatar
      perf_counter tools: Print 'CPU utilization factor' in builtin-stat · d7c29318
      Ingo Molnar authored
      Before:
      
       Performance counter stats for '/home/mingo/hackbench':
      
          5728.862689  task clock ticks     (msecs)
                34426  context switches     #        0.006 M/sec
                 3835  CPU migrations       #        0.001 M/sec
                18158  pagefaults           #        0.003 M/sec
          16218109156  CPU cycles           #     2830.947 M/sec
          13519616840  instructions         #     2359.913 M/sec
             55941661  cache references     #        9.765 M/sec
             23554938  cache misses         #        4.112 M/sec
      
       Wall-clock time elapsed:   528.886980 msecs
      
      After:
      
       Performance counter stats for '/home/mingo/hackbench':
      
          5845.443541  task clock ticks     #      11.886 CPU utilization factor
                38289  context switches     #       0.007 M/sec
                 4208  CPU migrations       #       0.001 M/sec
                17755  pagefaults           #       0.003 M/sec
          16664668576  CPU cycles           #    2850.882 M/sec
          13468113991  instructions         #    2304.036 M/sec
             57445468  cache references     #       9.827 M/sec
             26896502  cache misses         #       4.601 M/sec
      
       Wall-clock time elapsed:   491.802357 msecs
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d7c29318
    • Arnaldo Carvalho de Melo's avatar
      perf_counter tools: Add locking to perf top · c44613a4
      Arnaldo Carvalho de Melo authored
      perf_counter tools: Add locking to perf top
      
      We need to protect the active_symbols list as two threads change it:
      the main thread adding entries to the head and the display thread
      decaying entries from any place in the list.
      
      Also related: take a snapshot of syme->count[0] before using it to
      calculate the weight and to show the same number used in this calc when
      displaying the symbol usage.
      Reported-by: default avatarMike Galbraith <efault@gmx.de>
      Tested-by: default avatarMike Galbraith <efault@gmx.de>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20090529200307.GR4747@ghostprotocols.net>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c44613a4
  5. 29 May, 2009 29 commits