Lines Matching refs:pm
164 arm64_allocate_pmc(int cpu, int ri, struct pmc *pm,
216 pm->pm_md.pm_arm64.pm_arm64_evsel = config;
225 arm64_read_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t *v)
245 pm->pm_pcpu_state[cpu].pps_overflowcnt++;
250 tmp += 0x100000000llu * pm->pm_pcpu_state[cpu].pps_overflowcnt;
254 if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) {
271 arm64_write_pmc(int cpu, int ri, struct pmc *pm, pmc_value_t v)
279 if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
284 pm->pm_pcpu_state[cpu].pps_overflowcnt = v >> 32;
291 arm64_config_pmc(int cpu, int ri, struct pmc *pm)
295 PMCDBG3(MDP, CFG, 1, "cpu=%d ri=%d pm=%p", cpu, ri, pm);
304 KASSERT(pm == NULL || phw->phw_pmc == NULL,
305 ("[arm64,%d] pm=%p phw->pm=%p hwpmc not unconfigured",
306 __LINE__, pm, phw->phw_pmc));
308 phw->phw_pmc = pm;
314 arm64_start_pmc(int cpu, int ri, struct pmc *pm)
318 config = pm->pm_md.pm_arm64.pm_arm64_evsel;
338 arm64_stop_pmc(int cpu, int ri, struct pmc *pm __unused)
370 struct pmc *pm;
384 pm = arm64_pcpu[cpu]->pc_arm64pmcs[ri].phw_pmc;
385 if (pm == NULL)
398 pm->pm_pcpu_state[cpu].pps_overflowcnt += 1;
400 if (!PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
403 if (pm->pm_state != PMC_STATE_RUNNING)
406 error = pmc_process_interrupt(PMC_HR, pm, tf);
408 arm64_stop_pmc(cpu, ri, pm);
411 arm64_write_pmc(cpu, ri, pm, pm->pm_sc.pm_reloadcount);