Lines Matching refs:hwc

103 static int validate_event(const struct hw_perf_event *hwc)  in validate_event()  argument
105 switch (hwc->config_base) { in validate_event()
111 if ((hwc->config >= 6 && hwc->config <= 31) || in validate_event()
112 (hwc->config >= 38 && hwc->config <= 63) || in validate_event()
113 (hwc->config >= 80 && hwc->config <= 127)) in validate_event()
123 static int validate_ctr_version(const struct hw_perf_event *hwc) in validate_ctr_version() argument
131 switch (hwc->config_base) { in validate_ctr_version()
141 if ((cpuhw->info.csvn == 1 && hwc->config > 159) || in validate_ctr_version()
142 (cpuhw->info.csvn == 2 && hwc->config > 175) || in validate_ctr_version()
143 (cpuhw->info.csvn > 2 && hwc->config > 255)) in validate_ctr_version()
152 static int validate_ctr_auth(const struct hw_perf_event *hwc) in validate_ctr_auth() argument
161 ctrs_state = cpumf_state_ctl[hwc->config_base]; in validate_ctr_auth()
326 struct hw_perf_event *hwc = &event->hw; in __hw_perf_event_init() local
375 hwc->config = ev; in __hw_perf_event_init()
376 hwc->config_base = get_counter_set(ev); in __hw_perf_event_init()
383 err = validate_event(hwc); in __hw_perf_event_init()
399 err = validate_ctr_auth(hwc); in __hw_perf_event_init()
401 err = validate_ctr_version(hwc); in __hw_perf_event_init()
479 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_start() local
481 if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED))) in cpumf_pmu_start()
484 if (WARN_ON_ONCE(hwc->config == -1)) in cpumf_pmu_start()
488 WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE)); in cpumf_pmu_start()
490 hwc->state = 0; in cpumf_pmu_start()
493 ctr_set_enable(&cpuhw->state, hwc->config_base); in cpumf_pmu_start()
494 ctr_set_start(&cpuhw->state, hwc->config_base); in cpumf_pmu_start()
504 atomic_inc(&cpuhw->ctr_set[hwc->config_base]); in cpumf_pmu_start()
510 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_stop() local
512 if (!(hwc->state & PERF_HES_STOPPED)) { in cpumf_pmu_stop()
517 if (!atomic_dec_return(&cpuhw->ctr_set[hwc->config_base])) in cpumf_pmu_stop()
518 ctr_set_stop(&cpuhw->state, hwc->config_base); in cpumf_pmu_stop()
522 if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) { in cpumf_pmu_stop()