Lines Matching refs:hwc
105 static int validate_event(const struct hw_perf_event *hwc) in validate_event() argument
107 switch (hwc->config_base) { in validate_event()
113 if ((hwc->config >= 6 && hwc->config <= 31) || in validate_event()
114 (hwc->config >= 38 && hwc->config <= 63) || in validate_event()
115 (hwc->config >= 80 && hwc->config <= 127)) in validate_event()
125 static int validate_ctr_version(const struct hw_perf_event *hwc) in validate_ctr_version() argument
133 switch (hwc->config_base) { in validate_ctr_version()
143 if ((cpuhw->info.csvn == 1 && hwc->config > 159) || in validate_ctr_version()
144 (cpuhw->info.csvn == 2 && hwc->config > 175) || in validate_ctr_version()
145 (cpuhw->info.csvn > 2 && hwc->config > 255)) in validate_ctr_version()
154 static int validate_ctr_auth(const struct hw_perf_event *hwc) in validate_ctr_auth() argument
167 ctrs_state = cpumf_state_ctl[hwc->config_base]; in validate_ctr_auth()
332 struct hw_perf_event *hwc = &event->hw; in __hw_perf_event_init() local
381 hwc->config = ev; in __hw_perf_event_init()
382 hwc->config_base = get_counter_set(ev); in __hw_perf_event_init()
389 err = validate_event(hwc); in __hw_perf_event_init()
405 err = validate_ctr_auth(hwc); in __hw_perf_event_init()
407 err = validate_ctr_version(hwc); in __hw_perf_event_init()
485 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_start() local
487 if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED))) in cpumf_pmu_start()
490 if (WARN_ON_ONCE(hwc->config == -1)) in cpumf_pmu_start()
494 WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE)); in cpumf_pmu_start()
496 hwc->state = 0; in cpumf_pmu_start()
499 ctr_set_enable(&cpuhw->state, hwc->config_base); in cpumf_pmu_start()
500 ctr_set_start(&cpuhw->state, hwc->config_base); in cpumf_pmu_start()
510 atomic_inc(&cpuhw->ctr_set[hwc->config_base]); in cpumf_pmu_start()
516 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_stop() local
518 if (!(hwc->state & PERF_HES_STOPPED)) { in cpumf_pmu_stop()
523 if (!atomic_dec_return(&cpuhw->ctr_set[hwc->config_base])) in cpumf_pmu_stop()
524 ctr_set_stop(&cpuhw->state, hwc->config_base); in cpumf_pmu_stop()
528 if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) { in cpumf_pmu_stop()