aha/arch/powerpc
Paul Mackerras 0475f9ea8e perf_counters: allow users to count user, kernel and/or hypervisor events
Impact: new perf_counter feature

This extends the perf_counter_hw_event struct with bits that specify
that events in user, kernel and/or hypervisor mode should not be
counted (i.e. should be excluded), and adds code to program the PMU
mode selection bits accordingly on x86 and powerpc.

For software counters, we don't currently have the infrastructure to
distinguish which mode an event occurs in, so we currently fail the
counter initialization if the setting of the hw_event.exclude_* bits
would require us to distinguish.  Context switches and CPU migrations
are currently considered to occur in kernel mode.

On x86, this changes the previous policy that only root can count
kernel events.  Now non-root users can count kernel events or exclude
them.  Non-root users still can't use NMI events, though.  On x86 we
don't appear to have any way to control whether hypervisor events are
counted or not, so hw_event.exclude_hv is ignored.

On powerpc, the selection of whether to count events in user, kernel
and/or hypervisor mode is PMU-wide, not per-counter, so this adds a
check that the hw_event.exclude_* settings are the same as other events
on the PMU.  Counters being added to a group have to have the same
settings as the other hardware counters in the group.  Counters and
groups can only be enabled in hw_perf_group_sched_in or power_perf_enable
if they have the same settings as any other counters already on the
PMU.  If we are not running on a hypervisor, the exclude_hv setting
is ignored (by forcing it to 0) since we can't ever get any
hypervisor events.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-02-11 15:06:59 +11:00
..
boot powerpc/83xx: Make serial ports work on MPC8315E-RDB w/ FSL U-Boots 2009-01-13 17:46:29 -06:00
configs powerpc: Enable PS3 options and QPACE in ppc64_defconfig 2009-01-13 14:48:03 +11:00
include/asm Merge commit 'v2.6.29-rc2' into perfcounters/core 2009-01-21 16:37:27 +01:00
kernel perf_counters: allow users to count user, kernel and/or hypervisor events 2009-02-11 15:06:59 +11:00
kvm KVM: Consolidate userspace memory capability reporting into common code 2008-12-31 16:55:46 +02:00
lib Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-12-28 16:54:33 -08:00
math-emu powerpc: Add SPE/EFP math emulation for E500v1/v2 processors. 2008-12-03 08:19:16 -06:00
mm powerpc: is_hugepage_only_range() must account for both 4kB and 64kB slices 2009-01-16 16:15:16 +11:00
oprofile powerpc: Change u64/s64 to a long long integer type 2009-01-13 14:47:59 +11:00
platforms Merge commit 'v2.6.29-rc2' into perfcounters/core 2009-01-21 16:37:27 +01:00
sysdev Merge commit 'v2.6.29-rc2' into perfcounters/core 2009-01-21 16:37:27 +01:00
xmon powerpc: Prepare xmon_save_regs for use with kdump 2008-12-23 15:13:28 +11:00
Kconfig [CVE-2009-0029] powerpc: Enable syscall wrappers for 64-bit 2009-01-14 14:15:17 +01:00
Kconfig.debug powerpc: Allow the max stack trace depth to be configured 2008-12-03 20:46:35 +11:00
Makefile powerpc: Remove unncessary SPE related compiler flag 2008-12-03 08:19:10 -06:00