summaryrefslogtreecommitdiffstats
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2009-10-18 03:09:29 +0200
committerPaul Mackerras <paulus@samba.org>2009-10-28 06:13:03 +0100
commitf7d7986060b2890fc26db6ab5203efbd33aa2497 (patch)
tree0ed63257afd3fd02d83ab481af35855603ac4790 /kernel/perf_event.c
parentpowerpc: perf_event: Enable SDAR in continous sample mode (diff)
downloadlinux-f7d7986060b2890fc26db6ab5203efbd33aa2497.tar.xz
linux-f7d7986060b2890fc26db6ab5203efbd33aa2497.zip
perf_event: Add alignment-faults and emulation-faults software events
Add two more software events that are common to many cpus. Alignment faults: When a load or store is not aligned properly. Emulation faults: When an instruction is emulated in software. Both cause a very significant slowdown (100x or worse), so identifying and fixing them is very important. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 9d0b5c665883..0683b33cbb28 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4186,6 +4186,8 @@ static const struct pmu *sw_perf_event_init(struct perf_event *event)
case PERF_COUNT_SW_PAGE_FAULTS_MAJ:
case PERF_COUNT_SW_CONTEXT_SWITCHES:
case PERF_COUNT_SW_CPU_MIGRATIONS:
+ case PERF_COUNT_SW_ALIGNMENT_FAULTS:
+ case PERF_COUNT_SW_EMULATION_FAULTS:
if (!event->parent) {
atomic_inc(&perf_swevent_enabled[event_id]);
event->destroy = sw_perf_event_destroy;