linux/arch/x86
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
configs
crypto
ia32 Merge branch 'core/percpu' into perfcounters/core 2009-01-18 18:15:49 +01:00
include/asm Merge branch 'core/percpu' into perfcounters/core 2009-01-23 10:20:15 +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: change KVM to use IOMMU API 2009-01-03 14:11:07 +01:00
lguest Merge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-02 11:44:09 -08:00
lib
mach-default
mach-generic x86: rename all fields of mpc_table mpc_X to X 2009-01-05 14:08:34 +01:00
mach-rdc321x
mach-voyager percpu: add optimized generic percpu accessors 2009-01-16 14:20:31 +01:00
math-emu
mm Merge commit 'v2.6.29-rc2' into perfcounters/core 2009-01-21 16:37:27 +01:00
oprofile perfcounters: fix "perf counters kills oprofile" bug, v2 2009-02-05 15:24:14 +01:00
pci x86 PAT: consolidate old memtype new memtype check into a function 2009-01-13 19:13:00 +01:00
power
scripts
vdso
video
xen x86, xen: fix hardirq.h merge fallout 2009-01-23 11:09:15 +01:00
Kconfig Merge branch 'core/percpu' into perfcounters/core 2009-01-23 10:20:15 +01:00
Kconfig.cpu x86: make x86_32 use tlb_64.c, build fix, clean up X86_L1_CACHE_BYTES 2009-01-21 11:17:11 +01:00
Kconfig.debug
Makefile
Makefile_32.cpu