Lines Matching refs:cpuc

391 static void maybe_change_configuration(struct cpu_hw_events *cpuc)  in maybe_change_configuration()  argument
395 if (cpuc->n_added == 0) in maybe_change_configuration()
399 for (j = 0; j < cpuc->n_events; j++) { in maybe_change_configuration()
400 struct perf_event *pe = cpuc->event[j]; in maybe_change_configuration()
402 if (cpuc->current_idx[j] != PMC_NO_INDEX && in maybe_change_configuration()
403 cpuc->current_idx[j] != pe->hw.idx) { in maybe_change_configuration()
404 alpha_perf_event_update(pe, &pe->hw, cpuc->current_idx[j], 0); in maybe_change_configuration()
405 cpuc->current_idx[j] = PMC_NO_INDEX; in maybe_change_configuration()
410 cpuc->idx_mask = 0; in maybe_change_configuration()
411 for (j = 0; j < cpuc->n_events; j++) { in maybe_change_configuration()
412 struct perf_event *pe = cpuc->event[j]; in maybe_change_configuration()
416 if (cpuc->current_idx[j] == PMC_NO_INDEX) { in maybe_change_configuration()
418 cpuc->current_idx[j] = idx; in maybe_change_configuration()
422 cpuc->idx_mask |= (1<<cpuc->current_idx[j]); in maybe_change_configuration()
424 cpuc->config = cpuc->event[0]->hw.config_base; in maybe_change_configuration()
435 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_add() local
456 n0 = cpuc->n_events; in alpha_pmu_add()
458 cpuc->event[n0] = event; in alpha_pmu_add()
459 cpuc->evtype[n0] = event->hw.event_base; in alpha_pmu_add()
460 cpuc->current_idx[n0] = PMC_NO_INDEX; in alpha_pmu_add()
462 if (!alpha_check_constraints(cpuc->event, cpuc->evtype, n0+1)) { in alpha_pmu_add()
463 cpuc->n_events++; in alpha_pmu_add()
464 cpuc->n_added++; in alpha_pmu_add()
487 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_del() local
495 for (j = 0; j < cpuc->n_events; j++) { in alpha_pmu_del()
496 if (event == cpuc->event[j]) { in alpha_pmu_del()
497 int idx = cpuc->current_idx[j]; in alpha_pmu_del()
502 while (++j < cpuc->n_events) { in alpha_pmu_del()
503 cpuc->event[j - 1] = cpuc->event[j]; in alpha_pmu_del()
504 cpuc->evtype[j - 1] = cpuc->evtype[j]; in alpha_pmu_del()
505 cpuc->current_idx[j - 1] = in alpha_pmu_del()
506 cpuc->current_idx[j]; in alpha_pmu_del()
513 cpuc->idx_mask &= ~(1UL<<idx); in alpha_pmu_del()
514 cpuc->n_events--; in alpha_pmu_del()
535 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_stop() local
538 cpuc->idx_mask &= ~(1UL<<hwc->idx); in alpha_pmu_stop()
547 if (cpuc->enabled) in alpha_pmu_stop()
555 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_start() local
567 cpuc->idx_mask |= 1UL<<hwc->idx; in alpha_pmu_start()
568 if (cpuc->enabled) in alpha_pmu_start()
718 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_enable() local
720 if (cpuc->enabled) in alpha_pmu_enable()
723 cpuc->enabled = 1; in alpha_pmu_enable()
726 if (cpuc->n_events > 0) { in alpha_pmu_enable()
728 maybe_change_configuration(cpuc); in alpha_pmu_enable()
732 wrperfmon(PERFMON_CMD_DESIRED_EVENTS, cpuc->config); in alpha_pmu_enable()
733 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_pmu_enable()
744 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_disable() local
746 if (!cpuc->enabled) in alpha_pmu_disable()
749 cpuc->enabled = 0; in alpha_pmu_disable()
750 cpuc->n_added = 0; in alpha_pmu_disable()
752 wrperfmon(PERFMON_CMD_DISABLE, cpuc->idx_mask); in alpha_pmu_disable()
803 struct cpu_hw_events *cpuc; in alpha_perf_event_irq_handler() local
810 cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_perf_event_irq_handler()
817 wrperfmon(PERFMON_CMD_DISABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
824 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
830 for (j = 0; j < cpuc->n_events; j++) { in alpha_perf_event_irq_handler()
831 if (cpuc->current_idx[j] == idx) in alpha_perf_event_irq_handler()
835 if (unlikely(j == cpuc->n_events)) { in alpha_perf_event_irq_handler()
837 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
841 event = cpuc->event[j]; in alpha_perf_event_irq_handler()
847 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
863 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()