perfctr_stop: add flags to no 'disable_intens'
The original fujitsu code added a whole new ihk_mc_perfctr_stop_first function, duplicating a lot of code - add a flag to existing function instead. Change-Id: Ic9ce0236d68f967ff72cf88e5d9f1bda5c98aa1b Fujitsu: POSTK_DEBUG_ARCH_DEP_107
This commit is contained in:
committed by
Dominique Martinet
parent
d0d99adfb3
commit
34a995d290
@ -148,30 +148,32 @@ int ihk_mc_perfctr_start(unsigned long counter_mask)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ihk_mc_perfctr_stop(unsigned long counter_mask)
|
||||
int ihk_mc_perfctr_stop(unsigned long counter_mask, int flags)
|
||||
{
|
||||
int ret = 0;
|
||||
int counter;
|
||||
unsigned long counter_bit;
|
||||
int i = 0;
|
||||
|
||||
for (counter = 0, counter_bit = 1;
|
||||
counter_bit < counter_mask;
|
||||
counter++, counter_bit <<= 1) {
|
||||
if (!(counter_mask & counter_bit))
|
||||
for (i = 0; i < sizeof(counter_mask) * BITS_PER_BYTE; i++) {
|
||||
if (!(counter_mask & (1UL << i)))
|
||||
continue;
|
||||
|
||||
ret = cpu_pmu.disable_counter(counter);
|
||||
if (ret < 0)
|
||||
break;
|
||||
int ret = 0;
|
||||
|
||||
// ihk_mc_perfctr_startが呼ばれるときには、
|
||||
// init系関数が呼ばれるのでdisableにする。
|
||||
ret = cpu_pmu.disable_intens(counter);
|
||||
if (ret < 0)
|
||||
break;
|
||||
ret = cpu_pmu.disable_counter(i);
|
||||
if (ret < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (flags & IHK_MC_PERFCTR_DISABLE_INTERRUPT) {
|
||||
// when ihk_mc_perfctr_start is called,
|
||||
// ihk_mc_perfctr_init is also called so disable
|
||||
// interrupt
|
||||
ret = cpu_pmu.disable_intens(i);
|
||||
if (ret < 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret < 0 ? ret : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ihk_mc_perfctr_reset(int counter)
|
||||
|
||||
Reference in New Issue
Block a user