1. 05 Jun, 2009 3 commits
    • Ingo Molnar's avatar
      perf record: Split out counter creation into a helper function · f250c030
      Ingo Molnar authored
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f250c030
    • Yong Wang's avatar
      perf_counter tools: Fix incorrect printf formats · ee7b31fe
      Yong Wang authored
      Otherwise the code does not compile on 32-bit boxes.
      
      builtin-report.c: In function 'map__fprintf':
      builtin-report.c:240: error: format '%lx' expects type 'long unsigned int', but argument 3 has type 'uint64_t'
      builtin-report.c:240: error: format '%lx' expects type 'long unsigned int', but argument 4 has type 'uint64_t'
      builtin-report.c:240: error: format '%lx' expects type 'long unsigned int', but argument 5 has type 'uint64_t'
      Signed-off-by: default avatarYong Wang <yong.y.wang@intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <20090605033735.GA20451@ywang-moblin2.bj.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ee7b31fe
    • Paul Mackerras's avatar
      perf_counter: Fix lockup with interrupting counters · 6dc5f2a4
      Paul Mackerras authored
      Commit 8e3747c1 ("perf_counter: Change data head from u32 to u64")
      changed the type of 'head' in struct perf_mmap_data from atomic_t
      to atomic_long_t, but missed converting one use of atomic_read on
      it to atomic_long_read.  The effect of using atomic_read rather than
      atomic_long_read on powerpc (and other big-endian architectures) is
      that we get the high half of the 64-bit quantity, resulting in the
      cmpxchg retry loop in perf_output_begin spinning forever as soon as
      data->head becomes non-zero.  On little-endian architectures such as
      x86 we would get the low half, resulting in a lockup once data->head
      becomes greater than 4G.
      
      This fixes it by using atomic_long_read rather than atomic_read.
      
      [ Impact: fix perfcounter lockup on PowerPC / big-endian systems ]
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <18984.33964.21541.743096@cargo.ozlabs.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      6dc5f2a4
  2. 04 Jun, 2009 20 commits
    • Frederic Weisbecker's avatar
      perf_counter tools: Fix warn_unused_result warnings · 76a0f40f
      Frederic Weisbecker authored
      Fix warnings for return values that we don't care about:
      
       util/quote.c:222: attention : ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
       util/quote.c:235: attention : ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
       util/quote.c: In function ‘write_name_quotedpfx’:
       util/quote.c:290: attention : ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.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: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1244146558-8635-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      76a0f40f
    • Arnaldo Carvalho de Melo's avatar
      perf report: Add -vvv to print the list of threads and its mmaps · 9ac99545
      Arnaldo Carvalho de Melo authored
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      9ac99545
    • Frederic Weisbecker's avatar
      perf_counter: Sleep before refresh using poll in perf top · 0f5486b5
      Frederic Weisbecker authored
      perf top is refreshed every delay_secs the thread runs in such
      loop:
      
      while (sleep(delay_secs)) {
      	print_sym_table();
      }
      
      At the end of print_sym_table(), poll is used without sleep delay
      to check if we have something from stdin.
      
      It means that this check is done only every delay_secs, which can
      be higher that 2 secs if the user defined a custom refresh rate.
      
      We can drop sleep() here and directly use poll to wait between
      refresh periods, so that the reaction after the user stops perf top
      after typing "Enter" is immediate and doesn't suffer from the
      delay_secs latency.
      
      Nb: poll doesn't add any overhead that can parasite perf top measures
      since it sleeps the entire timeout here.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.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: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1244141284-7507-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0f5486b5
    • Peter Zijlstra's avatar
      perf_counter tools: Use fork and remove munmap events · 62fc4453
      Peter Zijlstra authored
      Use fork events to clone comm and map data and remove everything
      munmap related
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      62fc4453
    • Peter Zijlstra's avatar
      perf_counter: Remove munmap stuff · d99e9446
      Peter Zijlstra authored
      In name of keeping it simple, only track mmap events. Userspace
      will have to remove old overlapping maps when it encounters them.
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d99e9446
    • Peter Zijlstra's avatar
      perf_counter: Add fork event · 60313ebe
      Peter Zijlstra authored
      Create a fork event so that we can easily clone the comm and
      dso maps without having to generate all those events.
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      60313ebe
    • Ingo Molnar's avatar
      perf stat: Update help text · 20c84e95
      Ingo Molnar authored
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      20c84e95
    • Ingo Molnar's avatar
      perf report: Bail out if there are unrecognized options/arguments · edc52dea
      Ingo Molnar authored
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      edc52dea
    • Ingo Molnar's avatar
      perf_counter tools: Dont output in color on !tty · 13d0ab5e
      Ingo Molnar authored
      Dont emit ASCII color characters if the terminal is not a tty,
      such as when perf report gets redirected into a file.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      13d0ab5e
    • Ingo Molnar's avatar
      perf_counter tools: Add color terminal output support · 8fc0321f
      Ingo Molnar authored
      Add Git's color printing library to util/color.[ch].
      
      Add it to perf report, with a trivial example to print high-overhead
      entries in red, low-overhead entries in green.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      8fc0321f
    • Peter Zijlstra's avatar
      perf report: Add consistent spacing rules · 71dd8945
      Peter Zijlstra authored
      Make the sort header and the print function have the same column width.
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      71dd8945
    • Ingo Molnar's avatar
      perf report: Print out the total number of events · 05ca061e
      Ingo Molnar authored
      So that the statistical quality of the profile can be estimated at a glance.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      05ca061e
    • Ingo Molnar's avatar
      perf_counter tools: Print out symbol parsing errors only if --verbose · bd74137e
      Ingo Molnar authored
      Also, add a suggestion to 'perf report', if the default sort order is
      used.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      bd74137e
    • Peter Zijlstra's avatar
      perf report: Simplify symbol output · 95ed6fd0
      Peter Zijlstra authored
      The DSO can be printed already - no need to repeat it in the
      symbol field.
      Signed-off-by: default avatarPeter 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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      95ed6fd0
    • Ingo Molnar's avatar
      perf_counter tools: Build with native optimization · af794b94
      Ingo Molnar authored
      Build the tools with -march=native by default.
      
      No measurable difference in speed though, compared to the
      default, on a Nehalem testbox.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      af794b94
    • Ingo Molnar's avatar
      perf record/report: Fix PID/COMM handling · df97992c
      Ingo Molnar authored
      Fix two bugs causing lost comm mappings:
      
       - initial PID is not 0 but getpid()
      
       - when we are unable to handle an mmap event, dont assume the event
         itself is broken - try to parse the stream. This way we wont lose
         comm events.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      df97992c
    • Yong Wang's avatar
      perf_counter: Documentation update · 3aff27ca
      Yong Wang authored
      The 'nmi' bit is no longer there.
      Signed-off-by: default avatarYong Wang <yong.y.wang@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: Arjan van de Ven <arjan@linux.intel.com>
      LKML-Reference: <20090603084225.GA6553@ywang-moblin2.bj.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      3aff27ca
    • Paul Mackerras's avatar
      perf_counter: powerpc: Use new identifier names in powerpc-specific code · 1b58c251
      Paul Mackerras authored
      Commit b23f3325 ("perf_counter: Rename various fields") fixed up
      most of the uses of the renamed fields, but missed one instance
      of "record_type" in powerpc-specific code which needs to be changed
      to "sample_type", and a "PERF_RECORD_ADDR" in the same statement that
      needs to be changed to "PERF_SAMPLE_ADDR", causing compilation
      errors on powerpc.  This fixes it.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <18983.3111.770392.800486@cargo.ozlabs.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      1b58c251
    • Ingo Molnar's avatar
      perf top: Reduce default filter threshold · 6e53cdf1
      Ingo Molnar authored
      On idle systems 'perf top' comes up empty by default, because the event
      count filter is set to 100.
      
      Reduce it to 5 instead.
      
      Also add an option to limit the number of functions displayed.
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Acked-by: default avatarPeter 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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      6e53cdf1
    • Arnaldo Carvalho de Melo's avatar
      perf report: Fix rbtree bug · a4c43bea
      Arnaldo Carvalho de Melo authored
      Ingo Molnar reported:
      
      > FYI, i just got this crash (segfault) in perf report after
      > collecting a long profile from Xorg:
      >
      > Starting program: /home/mingo/tip/Documentation/perf_counter/perf report
      > [Thread debugging using libthread_db enabled]
      > Detaching after fork from child process 20008.
      > [New Thread 0x7f92fd62a6f0 (LWP 20005)]
      >
      > Program received signal SIGSEGV, Segmentation fault.
      > 0x000000000041031a in __rb_erase_color (node=0x142c090, parent=0x0,
      > root=0x881918)
      >     at util/rbtree.c:143
      > 143			if (parent->rb_left == node)
      
      It was a problem introduced in this cset:
      
       perf report: Fix comm sorting - 8229289b
      
      This patch should fix it.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      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: Stephane Eranian <eranian@googlemail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      a4c43bea
  3. 03 Jun, 2009 17 commits
    • Ingo Molnar's avatar
      perf report: Handle all known event types · d11444df
      Ingo Molnar authored
      We have munmap, throttle/unthrottle and period events as well,
      process them - otherwise they are considered broke events and
      we mis-parse the next few events.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d11444df
    • Ingo Molnar's avatar
      perf report: Split out event processing helpers · 75051724
      Ingo Molnar authored
      - Introduce per event helper functions
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      75051724
    • Ingo Molnar's avatar
      perf report: Clean up event processing · d80d338d
      Ingo Molnar authored
      - Split out event processig into process_events() helper.
      
      - Untangle the cwd parameters - it's constant so can be a static.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d80d338d
    • Ingo Molnar's avatar
      perf_counter: Fix throttling lock-up · 128f048f
      Ingo Molnar authored
      Throttling logic is broken and we can lock up with too small
      hw sampling intervals.
      
      Make the throttling code more robust: disable counters even
      if we already disabled them.
      
      ( Also clean up whitespace damage i noticed while reading
        various pieces of code related to throttling. )
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      128f048f
    • Ingo Molnar's avatar
      perf_counter tools: Work around warnings in older GCCs · 233f0b95
      Ingo Molnar authored
      GCC 4.1.2 produces:
      
       util/parse-options.c: In function ‘get_value’:
       util/parse-options.c:36: warning: ‘arg’ may be used uninitialized in this function
      
       builtin-top.c: In function ‘display_thread’:
       builtin-top.c:178: warning: ‘printed’ may be used uninitialized in this function
      
      Annotate them away by initializing these variables to 0.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      233f0b95
    • Arnaldo Carvalho de Melo's avatar
      perf_counter tools: Fix off-by-one bug in symbol__new · 18374ab7
      Arnaldo Carvalho de Melo authored
      The end is really (start + len - 1). Noticed when synthesizing
      the PLT symbols, that are small (16 bytes), and hot on the
      start RIP.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      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>
      LKML-Reference: <20090603174921.GG7805@ghostprotocols.net>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      18374ab7
    • Ingo Molnar's avatar
      perf_counter tools: Optimize harder · 095b3a6a
      Ingo Molnar authored
      Use -O6 to build the tools.
      
      Before:
      
          12387507370  instructions         #    3121.653 M/sec
      
      After:
      
           6244894971  instructions         #    3458.437 M/sec
      
      Almost twice as fast!
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      095b3a6a
    • Ingo Molnar's avatar
      perf help: Fix bug when there's no perf-* command around · 051cdc3c
      Ingo Molnar authored
      main_cmds can be empty - fix util/help.c to handle this case
      without segfaulting.
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.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: Thomas Gleixner <tglx@linutronix.de>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      051cdc3c
    • Ingo Molnar's avatar
      perf report: Add front-entry cache for lookups · eed4dcd4
      Ingo Molnar authored
      Before:
      
       Performance counter stats for './perf report -i perf.data.big':
      
           12453988058  instructions
      
       Performance counter stats for './perf report -i perf.data.big':
      
           12379566017  instructions
      
      0.60% reduction.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      eed4dcd4
    • Ingo Molnar's avatar
      perf stat: Print out all arguments · 44db76c8
      Ingo Molnar authored
      Before:
      
       Performance counter stats for '/home/mingo/hackbench':
      
      After:
      
       Performance counter stats for '/home/mingo/hackbench 10':
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      44db76c8
    • Ingo Molnar's avatar
      perf report: Display 100% correctly · e98e96fe
      Ingo Molnar authored
      Needs to be 6.2 not 5.2, for 100.00% to be aligned properly.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e98e96fe
    • Ingo Molnar's avatar
      perf record: Refine capture printout · 021e9f47
      Ingo Molnar authored
      Print out the number of bytes captured, and the (estimated) number of
      events the output file contains.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      021e9f47
    • Ingo Molnar's avatar
      perf_counter tools: Clean up old kerneltop references · f2521b6e
      Ingo Molnar authored
      kerneltop has been replaced with perf top - so fix up a few
      remaining references to it in display text and error messages.
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f2521b6e
    • Peter Zijlstra's avatar
      perf_counter: Fix race in counter initialization · a96bbc16
      Peter Zijlstra authored
      We need the PID namespace and counter ID available when the
      counter overflows and we need to generate a sample event.
      
      [ Impact: fix kernel crash with high-frequency sampling ]
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarPeter 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>
      [ fixed a further crash and cleaned up the initialization a bit ]
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      a96bbc16
    • Peter Zijlstra's avatar
      perf report: Fix comm sorting · 8229289b
      Peter Zijlstra authored
      Since we can (and do) change comm strings during the collection
      phase, we cannot actually sort on them to build the histogram.
      Therefore add an (optional) third sorting phase to collapse the
      histrogram.
      
      Comm sorting now builds the histrogram on threads and then in
      the collapse phase collects all threads with the same comm.
      
      This collapsed histogram is then reversed and sorted on events.
      Signed-off-by: default avatarPeter 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>
      8229289b
    • Peter Zijlstra's avatar
      perf record: Use long arg for counter period · e61078a0
      Peter Zijlstra authored
      I wrote this to test the extended period emulation, we might as
      well merge it.
      Signed-off-by: default avatarPeter 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>
      e61078a0
    • Peter Zijlstra's avatar
      perf_counter: Add a comm hook for pure fork()s · 226f62fd
      Peter Zijlstra authored
      I noticed missing COMM events and found that we missed
      reporting them for pure forks.
      Signed-off-by: default avatarPeter 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>
      226f62fd