perf: add arch-dependent get_num_counters function

Change-Id: I2230af87e0c764d97115e833dccb1842946c1b94
Fujitsu: POSTK_DEBUG_ARCH_DEP_109
This commit is contained in:
Dominique Martinet
2019-01-29 11:33:41 +09:00
parent 2b254f02f8
commit 03cadbcba2
4 changed files with 13 additions and 1 deletions

View File

@@ -3768,9 +3768,10 @@ perf_counter_alloc(struct thread *thread)
{
int ret = -EINVAL;
int i = 0;
const int counters = ihk_mc_perf_get_num_counters();
// find avail generic counter
for (i = 0; i < NUM_PERF_COUNTERS; i++) {
for (i = 0; i < counters; i++) {
if(!(thread->pmc_alloc_map & (1 << i))) {
ret = i;
break;