10 Mar, 2010

29 commits

  • I overlooked the perf_disable()/perf_enable() calls in
    intel_pmu_handle_irq(), (pointed out by Markus) so we should not
    explicitly disable_all/enable_all pebs counters in the drain functions,
    these are already disabled and enabling them early is confusing.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Calling ioctl(PERF_EVENT_IOC_DISABLE) on a thottled counter would result
    in a double disable, cure this by using x86_pmu_{start,stop} for
    throttle/unthrottle and teach x86_pmu_stop() to check ->active_mask.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • It turns out the LBR is massively unreliable on certain CPUs, so code the
    fixup a little more defensive to avoid crashing the kernel.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Some CPUs have errata where the LBR is not cleared on Power-On. So always
    clear the LBRs before use.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • This CPU has just too many handycaps to be really useful.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Fix up the ds allocation error path, where we could free @buffer before
    we used it.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Since there's now two users for this, place it in a common header.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Masami Hiramatsu
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Expose the full PEBS record using PERF_SAMPLE_RAW

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Saner PERF_CAPABILITIES support, which also exposes pebs_trap. Use that
    latter to make PEBS's use of LBR conditional since a fault-like pebs
    should already report the correct IP.

    ( As of this writing there is no known hardware that implements
    !pebs_trap )

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Use the PERF_RECORD_MISC_EXACT information to measure the success rate of
    the PEBS fix-up.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Use the LBR to fix up the PEBS IP+1 issue.

    As said, PEBS reports the next instruction, here we use the LBR to find
    the last branch and from that construct the actual IP. If the IP matches
    the LBR-TO, we use LBR-FROM, otherwise we use the LBR-TO address as the
    beginning of the last basic block and decode forward.

    Once we find a match to the current IP, we use the previous location.

    This patch introduces a new ABI element: PERF_RECORD_MISC_EXACT, which
    conveys that the reported IP (PERF_SAMPLE_IP) is the exact instruction
    that caused the event (barring CPU errata).

    The fixup can fail due to various reasons:

    1) LBR contains invalid data (quite possible)
    2) part of the basic block got paged out
    3) the reported IP isn't part of the basic block (see 1)

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: Masami Hiramatsu
    Cc: "Zhang, Yanmin"
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Implement simple suport Intel Last-Branch-Record, it supports all
    hardware that implements FREEZE_LBRS_ON_PMI, but does not (yet) implement
    the LBR config register.

    The Intel LBR is a FIFO of From,To addresses describing the last few
    branches the hardware took.

    This patch does not add perf interface to the LBR, but merely provides an
    interface for internal use.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Minimal userspace interface to the new 'precise' events flag.

    Can be used like "perf top -e r00c0p" which will use PEBS to sample
    retired instructions.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • This patch implements support for Intel Precise Event Based Sampling,
    which is an alternative counter mode in which the counter triggers a
    hardware assist to collect information on events. The hardware assist
    takes a trap like snapshot of a subset of the machine registers.

    This data is written to the Intel Debug-Store, which can be programmed
    with a data threshold at which to raise a PMI.

    With the PEBS hardware assist being trap like, the reported IP is always
    one instruction after the actual instruction that triggered the event.

    This implements a simple PEBS model that always takes a single PEBS event
    at a time. This is done so that the interaction with the rest of the
    system is as expected (freq adjust, period randomization, lbr,
    callchains, etc.).

    It adds an ABI element: perf_event_attr::precise, which indicates that we
    wish to use this (constrained, but precise) mode.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Try to avoid useless rotation and PMU disables.

    [ Could be improved by keeping a nr_runnable count to better account
    for the < PERF_STAT_INACTIVE counters ]

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • hw_perf_enable() would enable already enabled events.

    This causes problems with code that assumes that ->enable/->disable calls
    are balanced (like the LBR code does).

    What happens is that events that were already running and left in place
    would get enabled again.

    Avoid this by only enabling new events that match their previous
    assignment.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • hw_perf_enable() would disable events that were not yet enabled.

    This causes problems with code that assumes that ->enable/->disable calls
    are balanced (like the LBR code does).

    What happens is that we disable newly added counters that match their
    previous assignment, even though they are not yet programmed on the
    hardware.

    Avoid this by only doing the first pass over the existing events.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Make sure n_added is properly accounted so that we can rely on the value
    to reflect the number of added counters. This is needed if its going to
    be used for more than a boolean check.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Calling ioctl(PERF_EVENT_IOC_DISABLE) on a thottled counter would result
    in a double disable, cure this by using x86_pmu_{start,stop} for
    throttle/unthrottle and teach x86_pmu_stop() to check ->active_mask.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • pmu::start should undo pmu::stop, make it so.

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • There is no concurrency on these variables, so don't use LOCK'ed ops.

    As to the intel_pmu_handle_irq() status bit clean, nobody uses that so
    remove it all together.

    Signed-off-by: Peter Zijlstra
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Pass the full perf_event into the x86_pmu functions so that those may
    make use of more than the hw_perf_event, and while doing this, remove the
    superfluous second argument.

    Signed-off-by: Peter Zijlstra
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • The second and third argument to x86_perf_event_update() are superfluous
    since they are simple expressions of the first argument. Hence remove
    them.

    Signed-off-by: Peter Zijlstra
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • The second and third argument to x86_perf_event_set_period() are
    superfluous since they are simple expressions of the first argument.
    Hence remove them.

    Signed-off-by: Peter Zijlstra
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Explicitly use intel_pmu_{disable,enable}_all() in intel_pmu_handle_irq()
    to avoid the NMI race conditions in perf_{disable,enable}

    Signed-off-by: Peter Zijlstra
    Cc: Arnaldo Carvalho de Melo
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Currently we always call hw_perf_disable(), even if its already disabled,
    this seems superflous, esp. since it cannot be made NMI safe (see further
    patches).

    Signed-off-by: Peter Zijlstra
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Remove the hw_perf_event_*() hotplug hooks in favour of per PMU hotplug
    notifiers. This has the advantage of reducing the static weak interface
    as well as exposing all hotplug actions to the PMU.

    Use this to fix x86 hotplug usage where we did things in ONLINE which
    should have been done in UP_PREPARE or STARTING.

    Signed-off-by: Peter Zijlstra
    Cc: Paul Mundt
    Cc: paulus@samba.org
    Cc: eranian@google.com
    Cc: robert.richter@amd.com
    Cc: fweisbec@gmail.com
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • This makes it easier to extend perf_sample_data and fixes a bug on arm
    and sparc, which failed to set ->raw to NULL, which can cause crashes
    when combined with PERF_SAMPLE_RAW.

    It also optimizes PowerPC and tracepoint, because the struct
    initialization is forced to zero out the whole structure.

    Signed-off-by: Peter Zijlstra
    Acked-by: Jean Pihet
    Reviewed-by: Frederic Weisbecker
    Acked-by: David S. Miller
    Cc: Jamie Iles
    Cc: Paul Mackerras
    Cc: Stephane Eranian
    Cc: stable@kernel.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Conflicts:
    tools/perf/util/probe-event.c

    Merge reason: Pick up -rc1 and resolve the conflict as well.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

09 Mar, 2010

3 commits

  • Acked-by: Peter Zijlstra
    Acked-by: Paul Mackerras
    Acked-by: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (62 commits)
    msi-laptop: depends on RFKILL
    msi-laptop: Detect 3G device exists by standard ec command
    msi-laptop: Add resume method for set the SCM load again
    msi-laptop: Support some MSI 3G netbook that is need load SCM
    msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
    msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
    Driver core: create lock/unlock functions for struct device
    sysfs: fix for thinko with sysfs_bin_attr_init()
    sysfs: Kill unused sysfs_sb variable.
    sysfs: Pass super_block to sysfs_get_inode
    driver core: Use sysfs_rename_link in device_rename
    sysfs: Implement sysfs_rename_link
    sysfs: Pack sysfs_dirent more tightly.
    sysfs: Serialize updates to the vfs inode
    sysfs: windfarm: init sysfs attributes
    sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes
    sysfs: Document sysfs_attr_init and sysfs_bin_attr_init
    sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes
    sysfs: Use one lockdep class per sysfs attribute.
    sysfs: Only take active references on attributes.
    ...

    Linus Torvalds
     

08 Mar, 2010

8 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
    [WATCHDOG] i6300esb.c: change platform_driver to pci_driver
    [WATCHDOG] i6300esb: fix unlock register with
    [WATCHDOG] drivers/watchdog/wdt.c:wdt_ioctl(): make `ident' non-static
    [WATCHDOG] change reboot_notifier to platform-shutdown method.
    [WATCHDOG] watchdog_info constify
    [WATCHDOG] gef_wdt: Author corrections following split of GE Fanuc joint venture
    [WATCHDOG] iTCO_wdt: clean up probe(), modify err msg
    [WATCHDOG] ep93xx: watchdog timer driver for TS-72xx SBCs cleanup
    [WATCHDOG] support for max63xx watchdog timer chips
    [WATCHDOG] ep93xx: added platform side support for TS-72xx WDT driver
    [WATCHDOG] ep93xx: implemented watchdog timer driver for TS-72xx SBCs

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (26 commits)
    ALSA: hdmi - show debug message on changing audio infoframe
    ALSA: hdmi - merge common code for intelhdmi and nvhdmi
    ALSA: hda - Add ASRock mobo to MSI blacklist
    ALSA: hda: uninitialized variable fix
    ALSA: hda: Use LPIB for a Biostar Microtech board
    ALSA: usb/audio.h: Fix field order
    ALSA: fix jazz16 compile (udelay)
    ALSA: hda: Use LPIB for Dell Latitude 131L
    ALSA: hda - Build hda_eld into snd-hda-codec module
    ALSA: hda - Support NVIDIA MCP89 and GT21x hdmi audio
    ALSA: hda - Support max codecs to 8 for nvidia hda controller
    ALSA: riptide: clean up while loop
    ALSA: usbaudio - remove debug "SAMPLE BYTES" printk line
    ALSA: timer - pass real event in snd_timer_notify1() to instance callback
    ALSA: oxygen: change || to &&
    ALSA: opti92x: use PnP data to select Master Control port
    ASoC: fix ak4104 register array access
    ASoC: soc_pcm_open: Add missing bailout tag
    ALSA: usbaudio: Fix wrong bitrate for Creative Creative VF0470 Live Cam
    ALSA: ua101: removing debugging code
    ...

    Linus Torvalds
     
  • * 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
    [S390] smsgiucv_app: deliver z/VM CP special messages (SMSG) as uevents
    [S390] smsgiucv: declare char pointers as "const"
    [S390] dasd: automatic recognition of read-only devices
    [S390] remove unused qdio flags in zfcp and qeth
    [S390] Cleanup xtime usage
    [S390] qdio: add missing bracket
    [S390] cio: fix init_count in case of recognition after steal lock
    [S390] dasd: security and PSF update patch for EMC CKD ioctl
    [S390] hvc_iucv: allocate memory buffers for IUCV in zone DMA
    [S390] uaccess: make sure copy_from_user_overflow is builtin

    Linus Torvalds
     
  • Remove the EXPERIMENTAL flag from FS-Cache so that Ubuntu can make use of the
    facility.

    Signed-off-by: Christian Kujau
    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    Christian Kujau
     
  • Since the intel 6300esb platform uses a dedicated PCI ID for
    it's watchdog timer (00:1d.4), it's better and easier to have
    this as a pci_driver.

    Signed-off-by: Wim Van Sebroeck

    Wim Van Sebroeck
     
  • The smsgiucv_app driver registers a callback with the smsgiucv driver
    to receive z/VM CP special messages (SMSG) starting with "APP".

    When the callback is called for special messages, the driver creates
    an uevent for the received message. The uevent consists of additional
    environment data containing the message prefix ("APP"), message sender,
    and message content.

    udev rules can be used to trigger application specific actions through
    matching the content or sender of the special message.

    Signed-off-by: Hendrik Brueckner
    Signed-off-by: Martin Schwidefsky

    Hendrik Brueckner
     
  • Declare the smsgiucv prefix char pointer as "const" and use
    use const char pointers in callback functions.

    Signed-off-by: Hendrik Brueckner
    Signed-off-by: Martin Schwidefsky

    Hendrik Brueckner
     
  • In z/VM it is possible to attach a device as read-only. To prevent
    unintentional write requests and subsequent I/O errors, we can detect
    this configuration using the z/VM DIAG 210 interface and set the
    respective linux block device to read-only as well.

    Signed-off-by: Stefan Weinhuber
    Signed-off-by: Martin Schwidefsky

    Stefan Weinhuber