Lines Matching refs:cpuc
381 static void maybe_change_configuration(struct cpu_hw_events *cpuc) in maybe_change_configuration() argument
385 if (cpuc->n_added == 0) in maybe_change_configuration()
389 for (j = 0; j < cpuc->n_events; j++) { in maybe_change_configuration()
390 struct perf_event *pe = cpuc->event[j]; in maybe_change_configuration()
392 if (cpuc->current_idx[j] != PMC_NO_INDEX && in maybe_change_configuration()
393 cpuc->current_idx[j] != pe->hw.idx) { in maybe_change_configuration()
394 alpha_perf_event_update(pe, &pe->hw, cpuc->current_idx[j], 0); in maybe_change_configuration()
395 cpuc->current_idx[j] = PMC_NO_INDEX; in maybe_change_configuration()
400 cpuc->idx_mask = 0; in maybe_change_configuration()
401 for (j = 0; j < cpuc->n_events; j++) { in maybe_change_configuration()
402 struct perf_event *pe = cpuc->event[j]; in maybe_change_configuration()
406 if (cpuc->current_idx[j] == PMC_NO_INDEX) { in maybe_change_configuration()
408 cpuc->current_idx[j] = idx; in maybe_change_configuration()
412 cpuc->idx_mask |= (1<<cpuc->current_idx[j]); in maybe_change_configuration()
414 cpuc->config = cpuc->event[0]->hw.config_base; in maybe_change_configuration()
425 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in alpha_pmu_add() local
446 n0 = cpuc->n_events; in alpha_pmu_add()
448 cpuc->event[n0] = event; in alpha_pmu_add()
449 cpuc->evtype[n0] = event->hw.event_base; in alpha_pmu_add()
450 cpuc->current_idx[n0] = PMC_NO_INDEX; in alpha_pmu_add()
452 if (!alpha_check_constraints(cpuc->event, cpuc->evtype, n0+1)) { in alpha_pmu_add()
453 cpuc->n_events++; in alpha_pmu_add()
454 cpuc->n_added++; in alpha_pmu_add()
477 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in alpha_pmu_del() local
485 for (j = 0; j < cpuc->n_events; j++) { in alpha_pmu_del()
486 if (event == cpuc->event[j]) { in alpha_pmu_del()
487 int idx = cpuc->current_idx[j]; in alpha_pmu_del()
492 while (++j < cpuc->n_events) { in alpha_pmu_del()
493 cpuc->event[j - 1] = cpuc->event[j]; in alpha_pmu_del()
494 cpuc->evtype[j - 1] = cpuc->evtype[j]; in alpha_pmu_del()
495 cpuc->current_idx[j - 1] = in alpha_pmu_del()
496 cpuc->current_idx[j]; in alpha_pmu_del()
503 cpuc->idx_mask &= ~(1UL<<idx); in alpha_pmu_del()
504 cpuc->n_events--; in alpha_pmu_del()
525 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in alpha_pmu_stop() local
528 cpuc->idx_mask &= ~(1UL<<hwc->idx); in alpha_pmu_stop()
537 if (cpuc->enabled) in alpha_pmu_stop()
545 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in alpha_pmu_start() local
557 cpuc->idx_mask |= 1UL<<hwc->idx; in alpha_pmu_start()
558 if (cpuc->enabled) in alpha_pmu_start()
716 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in alpha_pmu_enable() local
718 if (cpuc->enabled) in alpha_pmu_enable()
721 cpuc->enabled = 1; in alpha_pmu_enable()
724 if (cpuc->n_events > 0) { in alpha_pmu_enable()
726 maybe_change_configuration(cpuc); in alpha_pmu_enable()
730 wrperfmon(PERFMON_CMD_DESIRED_EVENTS, cpuc->config); in alpha_pmu_enable()
731 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_pmu_enable()
742 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); in alpha_pmu_disable() local
744 if (!cpuc->enabled) in alpha_pmu_disable()
747 cpuc->enabled = 0; in alpha_pmu_disable()
748 cpuc->n_added = 0; in alpha_pmu_disable()
750 wrperfmon(PERFMON_CMD_DISABLE, cpuc->idx_mask); in alpha_pmu_disable()
800 struct cpu_hw_events *cpuc; in alpha_perf_event_irq_handler() local
807 cpuc = &__get_cpu_var(cpu_hw_events); in alpha_perf_event_irq_handler()
814 wrperfmon(PERFMON_CMD_DISABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
821 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
828 for (j = 0; j < cpuc->n_events; j++) { in alpha_perf_event_irq_handler()
829 if (cpuc->current_idx[j] == idx) in alpha_perf_event_irq_handler()
833 if (unlikely(j == cpuc->n_events)) { in alpha_perf_event_irq_handler()
835 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
839 event = cpuc->event[j]; in alpha_perf_event_irq_handler()
845 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
861 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()