Skip to content

Commit

Permalink
powerpc: perf_event: Add alignment-faults and emulation-faults softwa…
Browse files Browse the repository at this point in the history
…re events

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

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Anton Blanchard authored and Paul Mackerras committed Oct 28, 2009
1 parent eecff81 commit 196f02b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions arch/powerpc/include/asm/emulated_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define _ASM_POWERPC_EMULATED_OPS_H

#include <asm/atomic.h>
#include <linux/perf_event.h>


#ifdef CONFIG_PPC_EMULATED_STATS
Expand Down Expand Up @@ -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 */

0 comments on commit 196f02b

Please sign in to comment.