358{
359
363 unsigned int used = 0;
365 unsigned int cntr, avail;
366
369
370
372
374 for (j=0; j < cnt; j++) {
376 }
377 }
378
379
380
381
382
384 {
385 for (j=0; j < cnt;j++)
386 {
387
389 {
390
392 DPRINT(
"Rank %d: Counters available 0x%x\n",
i,avail);
393 if (avail == 0x0)
395
396
397 cntr = ffs(avail) - 1;
398 DPRINT(
"Rank %d: Chose counter %d\n",
i,cntr);
399
400
402
403 used |= (1 << cntr);
404 DPRINT(
"Rank %d: Used counters 0x%x\n",
i, used);
405 }
406 }
407 }
408
409
410
411 used = 0;
412 for (j=0; j < cnt;j++)
413 {
414 unsigned int cntr;
415
416
418 {
419 int k, has_ifother = 0, has_hist = 0;
421 {
422 if ((e[j].unit_masks[k] == 0) || (e[j].unit_masks[k] == 1) || (e[j].unit_masks[k] == 2)) {
423 if (has_ifother)
425 has_ifother = 1;
426 }
427 else if ((e[j].unit_masks[k] == 3) || (e[j].unit_masks[k] == 4)) {
428 if (has_hist)
430 has_hist = 1;
431 }
432 }
433
435 DPRINT(
"SCB(%d): Counters available %d\n",j,avail);
436
438 DPRINT(
"SCB(%d): Chose SCB counter %d\n",j,cntr);
439
440
442 used++;
443 DPRINT(
"SCB(%d): Used counters %d\n",j,used);
444 }
445 }
446 if (used)
447 {
451 }
452
453
456
458}
#define PFMLIB_ERR_TOOMANY
#define PFMLIB_ERR_NOASSIGN
#define DPRINT(fmt, a...)
static int stuff_sicortex_scb_control_regs(pfmlib_reg_t *pc, pfmlib_reg_t *pd, int num, pfmlib_sicortex_input_param_t *mod_in)
static void stuff_sicortex_regs(pfmlib_event_t *e, int plm, pfmlib_reg_t *pc, pfmlib_reg_t *pd, int cntr, int j, pfmlib_sicortex_input_param_t *mod_in)
pfmlib_reg_t pfp_pmds[PFMLIB_MAX_PMDS]
pfmlib_reg_t pfp_pmcs[PFMLIB_MAX_PMCS]
unsigned int pfp_pmc_count
unsigned int pfp_pmd_count