1. 21 9月, 2009 1 次提交
    • I
      perf: Do the big rename: Performance Counters -> Performance Events · cdd6c482
      Ingo Molnar 提交于
      Bye-bye Performance Counters, welcome Performance Events!
      
      In the past few months the perfcounters subsystem has grown out its
      initial role of counting hardware events, and has become (and is
      becoming) a much broader generic event enumeration, reporting, logging,
      monitoring, analysis facility.
      
      Naming its core object 'perf_counter' and naming the subsystem
      'perfcounters' has become more and more of a misnomer. With pending
      code like hw-breakpoints support the 'counter' name is less and
      less appropriate.
      
      All in one, we've decided to rename the subsystem to 'performance
      events' and to propagate this rename through all fields, variables
      and API names. (in an ABI compatible fashion)
      
      The word 'event' is also a bit shorter than 'counter' - which makes
      it slightly more convenient to write/handle as well.
      
      Thanks goes to Stephane Eranian who first observed this misnomer and
      suggested a rename.
      
      User-space tooling and ABI compatibility is not affected - this patch
      should be function-invariant. (Also, defconfigs were not touched to
      keep the size down.)
      
      This patch has been generated via the following script:
      
        FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')
      
        sed -i \
          -e 's/PERF_EVENT_/PERF_RECORD_/g' \
          -e 's/PERF_COUNTER/PERF_EVENT/g' \
          -e 's/perf_counter/perf_event/g' \
          -e 's/nb_counters/nb_events/g' \
          -e 's/swcounter/swevent/g' \
          -e 's/tpcounter_event/tp_event/g' \
          $FILES
      
        for N in $(find . -name perf_counter.[ch]); do
          M=$(echo $N | sed 's/perf_counter/perf_event/g')
          mv $N $M
        done
      
        FILES=$(find . -name perf_event.*)
      
        sed -i \
          -e 's/COUNTER_MASK/REG_MASK/g' \
          -e 's/COUNTER/EVENT/g' \
          -e 's/\<event\>/event_id/g' \
          -e 's/counter/event/g' \
          -e 's/Counter/Event/g' \
          $FILES
      
      ... to keep it as correct as possible. This script can also be
      used by anyone who has pending perfcounters patches - it converts
      a Linux kernel tree over to the new naming. We tried to time this
      change to the point in time where the amount of pending patches
      is the smallest: the end of the merge window.
      
      Namespace clashes were fixed up in a preparatory patch - and some
      stylistic fallout will be fixed up in a subsequent patch.
      
      ( NOTE: 'counters' are still the proper terminology when we deal
        with hardware registers - and these sed scripts are a bit
        over-eager in renaming them. I've undone some of that, but
        in case there's something left where 'counter' would be
        better than 'event' we can undo that on an individual basis
        instead of touching an otherwise nicely automated patch. )
      Suggested-by: NStephane Eranian <eranian@google.com>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Reviewed-by: NArjan van de Ven <arjan@linux.intel.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: <linux-arch@vger.kernel.org>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cdd6c482
  2. 28 8月, 2009 1 次提交
  3. 16 8月, 2009 1 次提交
    • I
      perf: Enable more compiler warnings · 83a0944f
      Ingo Molnar 提交于
      Related to a shadowed variable bug fix Valdis Kletnieks noticed
      that perf does not get built with -Wshadow, which could have
      helped us avoid the bug.
      
      So enable -Wshadow and also enable the following warnings on
      perf builds, in addition to the already enabled -Wall -Wextra
      -std=gnu99 warnings:
      
       -Wcast-align
       -Wformat=2
       -Wshadow
       -Winit-self
       -Wpacked
       -Wredundant-decls
       -Wstack-protector
       -Wstrict-aliasing=3
       -Wswitch-default
       -Wswitch-enum
       -Wno-system-headers
       -Wundef
       -Wvolatile-register-var
       -Wwrite-strings
       -Wbad-function-cast
       -Wmissing-declarations
       -Wmissing-prototypes
       -Wnested-externs
       -Wold-style-definition
       -Wstrict-prototypes
       -Wdeclaration-after-statement
      
      And change/fix the perf code to build cleanly under GCC 4.3.2.
      
      The list of warnings enablement is rather arbitrary: it's based
      on my (quick) reading of the GCC manpages and trying them on
      perf.
      
      I categorized the warnings based on individually enabling them
      and looking whether they trigger something in the perf build.
      If i liked those warnings (i.e. if they trigger for something
      that arguably could be improved) i enabled the warning.
      
      If the warnings seemed to come from language laywers spamming
      the build with tons of nuisance warnings i generally kept them
      off. Most of the sign conversion related warnings were in
      this category. (A second patch enabling some of the sign
      warnings might be welcome - sign bugs can be nasty.)
      
      I also kept warnings that seem to make sense from their manpage
      description and which produced no actual warnings on our code
      base. These warnings might still be turned off if they end up
      being a nuisance.
      
      I also left out a few warnings that are not supported in older
      compilers.
      
      [ Note that these changes might break the build on older
        compilers i did not test, or on non-x86 architectures that
        produce different warnings, so more testing would be welcome. ]
      
      Reported-by: Valdis.Kletnieks@vt.edu
      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>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      83a0944f
  4. 09 8月, 2009 1 次提交
  5. 23 7月, 2009 1 次提交
  6. 07 6月, 2009 1 次提交
  7. 06 6月, 2009 2 次提交
    • T
      perf_counter tools: Add 'perf list' to list available events · 86847b62
      Thomas Gleixner 提交于
      perf list: List all the available event types which can be used in
      -e (--event) options.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      86847b62
    • I
      perf_counter: Separate out attr->type from attr->config · a21ca2ca
      Ingo Molnar 提交于
      Counter type is a frequently used value and we do a lot of
      bit juggling by encoding and decoding it from attr->config.
      
      Clean this up by creating a separate attr->type field.
      
      Also clean up the various similarly complex user-space bits
      all around counter attribute management.
      
      The net improvement is significant, and it will be easier
      to add a new major type (which is what triggered this cleanup).
      
      (This changes the ABI, all tools are adapted.)
      (PowerPC build-tested.)
      
      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>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a21ca2ca
  8. 26 5月, 2009 2 次提交
    • I
      perf stat: Convert to Git option parsing · 5242519b
      Ingo Molnar 提交于
      Remove getopt usage and use Git's much more advanced and more compact
      command option library.
      
      Extend the event parser library with the extensions that were in
      perf-stat before.
      
      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: NIngo Molnar <mingo@elte.hu>
      5242519b
    • I
      perf_counter tools: Librarize event string parsing · 8ad8db37
      Ingo Molnar 提交于
      Extract the event string parser from builtin-record.c, and
      librarize it - to be reused in other commands.
      
      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: NIngo Molnar <mingo@elte.hu>
      8ad8db37