1. 21 Sep, 2009 5 commits
    • Ingo Molnar's avatar
      perf: Do the big rename: Performance Counters -> Performance Events · cdd6c482
      Ingo Molnar authored
      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: default avatarStephane Eranian <eranian@google.com>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Acked-by: default avatarPaul Mackerras <paulus@samba.org>
      Reviewed-by: default avatarArjan 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: default avatarIngo Molnar <mingo@elte.hu>
      cdd6c482
    • Ingo Molnar's avatar
      perf_counter: Rename 'event' to event_id/hw_event · dfc65094
      Ingo Molnar authored
      In preparation to the renames, to avoid a namespace clash.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      dfc65094
    • Ingo Molnar's avatar
      perf_counter: Rename list_entry -> group_entry, counter_list -> group_list · 65abc865
      Ingo Molnar authored
      This is in preparation of the big rename, but also makes sense
      in a standalone way: 'list_entry' is a bad name as we already
      have a list_entry() in list.h.
      
      Also, the 'counter list' is too vague, it doesnt tell us the
      purpose of that list.
      
      Clarify these names to show that it's all about the group
      hiearchy.
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      65abc865
    • Ingo Molnar's avatar
      Merge branch 'linus' into perfcounters/rename · ae82bfd6
      Ingo Molnar authored
      Merge reason: pull in all the latest code before doing the rename.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ae82bfd6
    • Paul Mackerras's avatar
      perf_counter, powerpc, sparc: Fix compilation after perf_counter_overflow() change · cd74c86b
      Paul Mackerras authored
      Commit 5622f295 ("x86, perf_counter, bts: Optimize BTS overflow
      handling") removed the regs field from struct perf_sample_data and
      added a regs parameter to perf_counter_overflow().  This breaks the
      build on powerpc (and Sparc) as reported by Sachin Sant:
      
        arch/powerpc/kernel/perf_counter.c: In function 'record_and_restart':
        arch/powerpc/kernel/perf_counter.c:1165: error: unknown field 'regs' specified in initializer
      
      This adjusts arch/powerpc/kernel/perf_counter.c to correspond with the
      new struct perf_sample_data and perf_counter_overflow().
      
      [ v2: also fix Sparc, Markus Metzger <markus.t.metzger@intel.com> ]
      Reported-by: default avatarSachin Sant <sachinp@in.ibm.com>
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Cc: Markus Metzger <markus.t.metzger@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: benh@kernel.crashing.org
      Cc: linuxppc-dev@ozlabs.org
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <19127.8400.376239.586120@drongo.ozlabs.ibm.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      cd74c86b
  2. 20 Sep, 2009 26 commits
  3. 19 Sep, 2009 9 commits
    • Wolfram Sang's avatar
      [PATCH] i2c-imx: make bus available early · 5d3f3331
      Wolfram Sang authored
      As I2C is used by PMICs also, make the busses available early via
      subsys_initcall().
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
      5d3f3331
    • Mikael Pettersson's avatar
      i2c-mv64xxx: correct mv64xxx_i2c_intr() return type · b0999cc5
      Mikael Pettersson authored
      The mv64xxx_i2c_intr() irq handler in drivers/i2c/busses/i2c-mv64xxx.c
      is declared as returning 'int', resulting in this compile-time warning:
      
      drivers/i2c/busses/i2c-mv64xxx.c: In function 'mv64xxx_i2c_probe':
      drivers/i2c/busses/i2c-mv64xxx.c:540: warning: passing argument 2 of 'request_irq' from incompatible pointer type
      
      Fix: correct the return type to 'irqreturn_t'.
      Signed-off-by: default avatarMikael Pettersson <mikpe@it.uu.se>
      Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
      b0999cc5
    • Alan Stern's avatar
      USB serial: update the console driver · 7bd032dc
      Alan Stern authored
      This patch (as1292) modifies the USB serial console driver, to make it
      compatible with the recent changes to the USB serial core.  The most
      important change is that serial->disc_mutex now has to be unlocked
      following a successful call to usb_serial_get_by_index().
      
      Other less notable changes include:
      
      	Use the requested port number instead of port 0 always.
      
      	Prevent the serial device from being autosuspended.
      
      	Use the ASYNCB_INITIALIZED flag bit to indicate when the
      	port hardware has been initialized.
      
      In spite of these changes, there's no question that the USB serial
      console code is still a big hack.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7bd032dc
    • Alan Stern's avatar
      usb-serial: straighten out serial_open · 320348c8
      Alan Stern authored
      This patch (as1291) removes a bunch of code from serial_open(), things
      that were rendered unnecessary by earlier patches.  A missing spinlock
      is added to protect port->port.count, which needs to be incremented
      even if the open fails but not if the tty has gotten a hangup.  The
      test for whether the hardware has been initialized, based on the use
      count, is replaced by a more transparent test of the
      ASYNCB_INITIALIZED bit in the port flags.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      320348c8
    • Alan Stern's avatar
      usb-serial: add missing tests and debug lines · ff8324df
      Alan Stern authored
      This patch (as1290) adds some missing tests.  serial_down() isn't
      supposed to do anything if the hardware hasn't been initialized, and
      serial_close() isn't supposed to do anything if the tty has gotten a
      hangup (because serial_hangup() takes care of shutting down the
      hardware).
      
      The patch also updates and adds a few debugging lines.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ff8324df
    • Alan Stern's avatar
      usb-serial: rename subroutines · 74556123
      Alan Stern authored
      This patch (as1289) renames serial_do_down() to serial_down() and
      serial_do_free() to serial_release().  It also adds a missing call to
      tty_shutdown() in serial_release().
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      74556123
    • Alan Stern's avatar
      usb-serial: fix termios initialization logic · 7e29bb4b
      Alan Stern authored
      This patch (as1288) fixes the initialization logic in
      serial_install().  A new tty always needs to have a termios
      initialized no matter what, not just in the case where the lower
      driver will override the termios settings.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7e29bb4b
    • Alan Stern's avatar
      usb-serial: acquire references when a new tty is installed · cc56cd01
      Alan Stern authored
      This patch (as1287) makes serial_install() be reponsible for acquiring
      references to the usb_serial structure and the driver module when a
      tty is first used.  This is more sensible than having serial_open() do
      it, because a tty can be opened many times whereas it is installed
      only once, when it is created.  (Not to mention that these actions are
      reversed when the tty is released, not when it is closed.)  Finally,
      it is at install time that the TTY core takes its own reference to the
      usb_serial module, so it is only fitting that we should act the same
      way in regard to the lower-level serial driver.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      cc56cd01
    • Alan Stern's avatar
      usb-serial: change logic of serial lookups · 8bc2c1b2
      Alan Stern authored
      This patch (as1286) changes usb_serial_get_by_index().  Now the
      routine will check whether the serial device has been disconnected; if
      it has then the return value will be NULL.  If the device hasn't been
      disconnected then the routine will return with serial->disc_mutex
      held, so that the caller can use the structure without fear of racing
      against driver unloads.
      
      This permits the scope of table_mutex in destroy_serial() to be
      reduced.  Instead of protecting the entire function, it suffices to
      protect the part that actually uses serial_table[], i.e., the call to
      return_serial().  There's no longer any danger of the refcount being
      incremented after it reaches 0 (which was the reason for having the
      large scope previously), because it can't reach 0 until the serial
      device has been disconnected.
      
      Also, the patch makes serial_install() check that serial is non-NULL
      before attempting to use it.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8bc2c1b2