[tip:perf/powerpc] powerpc: perf_event: Add alignment-faults and emulation-faults software events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  196f02bf900c5eb6f85d889c4f70e7cc11fda7e8
Gitweb:     http://git.kernel.org/tip/196f02bf900c5eb6f85d889c4f70e7cc11fda7e8
Author:     Anton Blanchard <anton@xxxxxxxxx>
AuthorDate: Sun, 18 Oct 2009 01:13:00 +0000
Committer:  Paul Mackerras <paulus@xxxxxxxxx>
CommitDate: Wed, 28 Oct 2009 16:13:03 +1100

powerpc: perf_event: Add alignment-faults and emulation-faults software events

Hook up the alignment-faults and emulation-faults events for powerpc.

Signed-off-by: Anton Blanchard <anton@xxxxxxxxx>
Signed-off-by: Paul Mackerras <paulus@xxxxxxxxx>
---
 arch/powerpc/include/asm/emulated_ops.h |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/emulated_ops.h b/arch/powerpc/include/asm/emulated_ops.h
index 640c4e4..f0fb4fc 100644
--- a/arch/powerpc/include/asm/emulated_ops.h
+++ b/arch/powerpc/include/asm/emulated_ops.h
@@ -19,6 +19,7 @@
 #define _ASM_POWERPC_EMULATED_OPS_H
 
 #include <asm/atomic.h>
+#include <linux/perf_event.h>
 
 
 #ifdef CONFIG_PPC_EMULATED_STATS
@@ -70,7 +71,18 @@ extern void ppc_warn_emulated_print(const char *type);
 
 #endif /* !CONFIG_PPC_EMULATED_STATS */
 
-#define PPC_WARN_EMULATED(type, regs)	__PPC_WARN_EMULATED(type)
-#define PPC_WARN_ALIGNMENT(type, regs)	__PPC_WARN_EMULATED(type)
+#define PPC_WARN_EMULATED(type, regs)					\
+	do {								\
+		perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,		\
+			1, 0, regs, 0);					\
+		__PPC_WARN_EMULATED(type);				\
+	} while (0)
+
+#define PPC_WARN_ALIGNMENT(type, regs)					\
+	do {								\
+		perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS,		\
+			1, 0, regs, regs->dar);				\
+		__PPC_WARN_EMULATED(type);				\
+	} while (0)
 
 #endif /* _ASM_POWERPC_EMULATED_OPS_H */
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux