summaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile/op_model_p4.c
diff options
context:
space:
mode:
authorRobert Richter2009-05-25 17:59:06 +0200
committerRobert Richter2009-06-11 19:42:15 +0200
commit42399adb239d4f1413899cc618ecf640779e79df (patch)
tree8c7ed4b60b00be9faca1acd175dfe84beacddef5 /arch/x86/oprofile/op_model_p4.c
parentx86/oprofile: replace macros to calculate control register (diff)
downloadkernel-qcow2-linux-42399adb239d4f1413899cc618ecf640779e79df.tar.gz
kernel-qcow2-linux-42399adb239d4f1413899cc618ecf640779e79df.tar.xz
kernel-qcow2-linux-42399adb239d4f1413899cc618ecf640779e79df.zip
x86/oprofile: replace CTR_OVERFLOWED macros
The patch replaces all CTR_OVERFLOWED macros. 64 bit MSR functions and 64 bit counter values are used now. Thus, it will be easier to later extend the models to use more than 32 bit width counters. Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile/op_model_p4.c')
-rw-r--r--arch/x86/oprofile/op_model_p4.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c
index 05ba0287b1f7..ac4ca28b9ed5 100644
--- a/arch/x86/oprofile/op_model_p4.c
+++ b/arch/x86/oprofile/op_model_p4.c
@@ -32,6 +32,8 @@
#define NUM_CCCRS_HT2 9
#define NUM_CONTROLS_HT2 (NUM_ESCRS_HT2 + NUM_CCCRS_HT2)
+#define OP_CTR_OVERFLOW (1ULL<<31)
+
static unsigned int num_counters = NUM_COUNTERS_NON_HT;
static unsigned int num_controls = NUM_CONTROLS_NON_HT;
@@ -362,8 +364,6 @@ static struct p4_event_binding p4_events[NUM_EVENTS] = {
#define CCCR_OVF_P(cccr) ((cccr) & (1U<<31))
#define CCCR_CLEAR_OVF(cccr) ((cccr) &= (~(1U<<31)))
-#define CTR_OVERFLOW_P(ctr) (!((ctr) & 0x80000000))
-
/* this assigns a "stagger" to the current CPU, which is used throughout
the code in this module as an extra array offset, to select the "even"
@@ -622,7 +622,7 @@ static int p4_check_ctrs(struct pt_regs * const regs,
rdmsr(p4_counters[real].cccr_address, low, high);
rdmsr(p4_counters[real].counter_address, ctr, high);
- if (CCCR_OVF_P(low) || CTR_OVERFLOW_P(ctr)) {
+ if (CCCR_OVF_P(low) || !(ctr & OP_CTR_OVERFLOW)) {
oprofile_add_sample(regs, i);
wrmsr(p4_counters[real].counter_address,
-(u32)reset_value[i], -1);