Lines Matching refs:hwc

37 static int validate_ctr_version(const struct hw_perf_event *hwc)  in validate_ctr_version()  argument
46 switch (hwc->config_base) { in validate_ctr_version()
54 hwc->config > 79) || in validate_ctr_version()
55 (cpuhw->info.csvn >= 6 && hwc->config > 83)) in validate_ctr_version()
61 if ((cpuhw->info.csvn == 1 && hwc->config > 159) || in validate_ctr_version()
62 (cpuhw->info.csvn == 2 && hwc->config > 175) || in validate_ctr_version()
64 && hwc->config > 255) || in validate_ctr_version()
65 (cpuhw->info.csvn >= 6 && hwc->config > 287)) in validate_ctr_version()
95 static int validate_ctr_auth(const struct hw_perf_event *hwc) in validate_ctr_auth() argument
108 ctrs_state = cpumf_ctr_ctl[hwc->config_base]; in validate_ctr_auth()
205 struct hw_perf_event *hwc = &event->hw; in __hw_perf_event_init() local
266 hwc->config = ev; in __hw_perf_event_init()
267 hwc->config_base = set; in __hw_perf_event_init()
288 err = validate_ctr_auth(hwc); in __hw_perf_event_init()
290 err = validate_ctr_version(hwc); in __hw_perf_event_init()
366 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_start() local
368 if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED))) in cpumf_pmu_start()
371 if (WARN_ON_ONCE(hwc->config == -1)) in cpumf_pmu_start()
375 WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE)); in cpumf_pmu_start()
377 hwc->state = 0; in cpumf_pmu_start()
380 ctr_set_enable(&cpuhw->state, hwc->config_base); in cpumf_pmu_start()
381 ctr_set_start(&cpuhw->state, hwc->config_base); in cpumf_pmu_start()
391 atomic_inc(&cpuhw->ctr_set[hwc->config_base]); in cpumf_pmu_start()
397 struct hw_perf_event *hwc = &event->hw; in cpumf_pmu_stop() local
399 if (!(hwc->state & PERF_HES_STOPPED)) { in cpumf_pmu_stop()
404 if (!atomic_dec_return(&cpuhw->ctr_set[hwc->config_base])) in cpumf_pmu_stop()
405 ctr_set_stop(&cpuhw->state, hwc->config_base); in cpumf_pmu_stop()
409 if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) { in cpumf_pmu_stop()