Lines Matching refs:cpuc
390 static void maybe_change_configuration(struct cpu_hw_events *cpuc) in maybe_change_configuration() argument
394 if (cpuc->n_added == 0) in maybe_change_configuration()
398 for (j = 0; j < cpuc->n_events; j++) { in maybe_change_configuration()
399 struct perf_event *pe = cpuc->event[j]; in maybe_change_configuration()
401 if (cpuc->current_idx[j] != PMC_NO_INDEX && in maybe_change_configuration()
402 cpuc->current_idx[j] != pe->hw.idx) { in maybe_change_configuration()
403 alpha_perf_event_update(pe, &pe->hw, cpuc->current_idx[j], 0); in maybe_change_configuration()
404 cpuc->current_idx[j] = PMC_NO_INDEX; in maybe_change_configuration()
409 cpuc->idx_mask = 0; in maybe_change_configuration()
410 for (j = 0; j < cpuc->n_events; j++) { in maybe_change_configuration()
411 struct perf_event *pe = cpuc->event[j]; in maybe_change_configuration()
415 if (cpuc->current_idx[j] == PMC_NO_INDEX) { in maybe_change_configuration()
417 cpuc->current_idx[j] = idx; in maybe_change_configuration()
421 cpuc->idx_mask |= (1<<cpuc->current_idx[j]); in maybe_change_configuration()
423 cpuc->config = cpuc->event[0]->hw.config_base; in maybe_change_configuration()
434 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_add() local
455 n0 = cpuc->n_events; in alpha_pmu_add()
457 cpuc->event[n0] = event; in alpha_pmu_add()
458 cpuc->evtype[n0] = event->hw.event_base; in alpha_pmu_add()
459 cpuc->current_idx[n0] = PMC_NO_INDEX; in alpha_pmu_add()
461 if (!alpha_check_constraints(cpuc->event, cpuc->evtype, n0+1)) { in alpha_pmu_add()
462 cpuc->n_events++; in alpha_pmu_add()
463 cpuc->n_added++; in alpha_pmu_add()
486 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_del() local
494 for (j = 0; j < cpuc->n_events; j++) { in alpha_pmu_del()
495 if (event == cpuc->event[j]) { in alpha_pmu_del()
496 int idx = cpuc->current_idx[j]; in alpha_pmu_del()
501 while (++j < cpuc->n_events) { in alpha_pmu_del()
502 cpuc->event[j - 1] = cpuc->event[j]; in alpha_pmu_del()
503 cpuc->evtype[j - 1] = cpuc->evtype[j]; in alpha_pmu_del()
504 cpuc->current_idx[j - 1] = in alpha_pmu_del()
505 cpuc->current_idx[j]; in alpha_pmu_del()
512 cpuc->idx_mask &= ~(1UL<<idx); in alpha_pmu_del()
513 cpuc->n_events--; in alpha_pmu_del()
534 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_stop() local
537 cpuc->idx_mask &= ~(1UL<<hwc->idx); in alpha_pmu_stop()
546 if (cpuc->enabled) in alpha_pmu_stop()
554 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_start() local
566 cpuc->idx_mask |= 1UL<<hwc->idx; in alpha_pmu_start()
567 if (cpuc->enabled) in alpha_pmu_start()
727 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_enable() local
729 if (cpuc->enabled) in alpha_pmu_enable()
732 cpuc->enabled = 1; in alpha_pmu_enable()
735 if (cpuc->n_events > 0) { in alpha_pmu_enable()
737 maybe_change_configuration(cpuc); in alpha_pmu_enable()
741 wrperfmon(PERFMON_CMD_DESIRED_EVENTS, cpuc->config); in alpha_pmu_enable()
742 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_pmu_enable()
753 struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_pmu_disable() local
755 if (!cpuc->enabled) in alpha_pmu_disable()
758 cpuc->enabled = 0; in alpha_pmu_disable()
759 cpuc->n_added = 0; in alpha_pmu_disable()
761 wrperfmon(PERFMON_CMD_DISABLE, cpuc->idx_mask); in alpha_pmu_disable()
811 struct cpu_hw_events *cpuc; in alpha_perf_event_irq_handler() local
818 cpuc = this_cpu_ptr(&cpu_hw_events); in alpha_perf_event_irq_handler()
825 wrperfmon(PERFMON_CMD_DISABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
832 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
838 for (j = 0; j < cpuc->n_events; j++) { in alpha_perf_event_irq_handler()
839 if (cpuc->current_idx[j] == idx) in alpha_perf_event_irq_handler()
843 if (unlikely(j == cpuc->n_events)) { in alpha_perf_event_irq_handler()
845 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
849 event = cpuc->event[j]; in alpha_perf_event_irq_handler()
855 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()
871 wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask); in alpha_perf_event_irq_handler()