x86/oprofile: replace CTRL_SET_*ACTIVE macros
The patch replaces all CTRL_SET_*ACTIVE macros. 64 bit MSR functions and 64 bit counter values are used now. The code uses bit masks from <asm/intel_arch_perfmon.h>. Signed-off-by: Robert Richter <robert.richter@amd.com>
This commit is contained in:
@@ -262,13 +262,13 @@ static int op_amd_check_ctrs(struct pt_regs * const regs,
|
||||
|
||||
static void op_amd_start(struct op_msrs const * const msrs)
|
||||
{
|
||||
unsigned int low, high;
|
||||
u64 val;
|
||||
int i;
|
||||
for (i = 0 ; i < NUM_COUNTERS ; ++i) {
|
||||
if (reset_value[i]) {
|
||||
rdmsr(msrs->controls[i].addr, low, high);
|
||||
CTRL_SET_ACTIVE(low);
|
||||
wrmsr(msrs->controls[i].addr, low, high);
|
||||
rdmsrl(msrs->controls[i].addr, val);
|
||||
val |= ARCH_PERFMON_EVENTSEL0_ENABLE;
|
||||
wrmsrl(msrs->controls[i].addr, val);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ static void op_amd_start(struct op_msrs const * const msrs)
|
||||
|
||||
static void op_amd_stop(struct op_msrs const * const msrs)
|
||||
{
|
||||
unsigned int low, high;
|
||||
u64 val;
|
||||
int i;
|
||||
|
||||
/*
|
||||
@@ -287,9 +287,9 @@ static void op_amd_stop(struct op_msrs const * const msrs)
|
||||
for (i = 0 ; i < NUM_COUNTERS ; ++i) {
|
||||
if (!reset_value[i])
|
||||
continue;
|
||||
rdmsr(msrs->controls[i].addr, low, high);
|
||||
CTRL_SET_INACTIVE(low);
|
||||
wrmsr(msrs->controls[i].addr, low, high);
|
||||
rdmsrl(msrs->controls[i].addr, val);
|
||||
val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE;
|
||||
wrmsrl(msrs->controls[i].addr, val);
|
||||
}
|
||||
|
||||
op_amd_stop_ibs();
|
||||
|
Reference in New Issue
Block a user