arm64: ihk_mc_perfctr_start/stop: fix prototype that was changed in x86

The functions now take a bitmask in argument since commit d7416c6f79
("perf_event: Specify counter by bit_mask on start/stop")...
Thanksfully the change also induced a type modification so it was easy
to notice.

(On the other hand I'm building with --disable-perf so why the hell is
that file compiled?!)

Change-Id: Ie16367cc94e81068b70e1b80142a6394de896c4f
This commit is contained in:
Dominique Martinet
2018-08-16 16:48:48 +09:00
committed by Dominique Martinet
parent 21af0351d1
commit c4b4b7222e

View File

@@ -93,21 +93,50 @@ int ihk_mc_perfctr_init(int counter, uint64_t config, int mode)
return ret; return ret;
} }
int ihk_mc_perfctr_start(int counter) int ihk_mc_perfctr_start(unsigned long counter_mask)
{ {
int ret; int ret = 0;
ret = cpu_pmu.enable_counter(counter); int counter;
return ret; unsigned long counter_bit;
for (counter = 0, counter_bit = 1;
counter_bit < counter_mask;
counter++, counter_bit <<= 1) {
if (!(counter_mask & counter_bit))
continue;
ret = cpu_pmu.enable_counter(counter_mask);
if (ret < 0)
break;
}
return ret < 0 ? ret : 0;
} }
int ihk_mc_perfctr_stop(int counter) int ihk_mc_perfctr_stop(unsigned long counter_mask)
{ {
cpu_pmu.disable_counter(counter); int ret = 0;
int counter;
unsigned long counter_bit;
// ihk_mc_perfctr_startが呼ばれるときには、 for (counter = 0, counter_bit = 1;
// init系関数が呼ばれるのでdisableにする。 counter_bit < counter_mask;
cpu_pmu.disable_intens(counter); counter++, counter_bit <<= 1) {
return 0; if (!(counter_mask & counter_bit))
continue;
ret = cpu_pmu.disable_counter(counter);
if (ret < 0)
break;
// ihk_mc_perfctr_startが呼ばれるときには、
// init系関数が呼ばれるのでdisableにする。
ret = cpu_pmu.disable_intens(counter);
if (ret < 0)
break;
}
return ret < 0 ? ret : 0;
} }
int ihk_mc_perfctr_reset(int counter) int ihk_mc_perfctr_reset(int counter)