Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_uncore.c
| Show First 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | ucf_config_pmc(int cpu, int ri, struct pmc *pm) | ||||
| uncore_pcpu[cpu]->pc_uncorepmcs[ri + uncore_ucf_ri].phw_pmc = pm; | uncore_pcpu[cpu]->pc_uncorepmcs[ri + uncore_ucf_ri].phw_pmc = pm; | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| static int | static int | ||||
| ucf_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) | ucf_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) | ||||
| { | { | ||||
| int error; | |||||
| struct pmc_hw *phw; | struct pmc_hw *phw; | ||||
| char ucf_name[PMC_NAME_MAX]; | |||||
| phw = &uncore_pcpu[cpu]->pc_uncorepmcs[ri + uncore_ucf_ri]; | phw = &uncore_pcpu[cpu]->pc_uncorepmcs[ri + uncore_ucf_ri]; | ||||
| (void) snprintf(ucf_name, sizeof(ucf_name), "UCF-%d", ri); | snprintf(pi->pm_name, PMC_NAME_MAX, "UCF-%d", ri); | ||||
| if ((error = copystr(ucf_name, pi->pm_name, PMC_NAME_MAX, | |||||
| NULL)) != 0) | |||||
| return (error); | |||||
| pi->pm_class = PMC_CLASS_UCF; | pi->pm_class = PMC_CLASS_UCF; | ||||
| if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { | if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { | ||||
| pi->pm_enabled = TRUE; | pi->pm_enabled = TRUE; | ||||
| *ppmc = phw->phw_pmc; | *ppmc = phw->phw_pmc; | ||||
| } else { | } else { | ||||
| pi->pm_enabled = FALSE; | pi->pm_enabled = FALSE; | ||||
| *ppmc = NULL; | *ppmc = NULL; | ||||
| ▲ Show 20 Lines • Show All 300 Lines • ▼ Show 20 Lines | ucp_config_pmc(int cpu, int ri, struct pmc *pm) | ||||
| uncore_pcpu[cpu]->pc_uncorepmcs[ri].phw_pmc = pm; | uncore_pcpu[cpu]->pc_uncorepmcs[ri].phw_pmc = pm; | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| static int | static int | ||||
| ucp_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) | ucp_describe(int cpu, int ri, struct pmc_info *pi, struct pmc **ppmc) | ||||
| { | { | ||||
| int error; | |||||
| struct pmc_hw *phw; | struct pmc_hw *phw; | ||||
| char ucp_name[PMC_NAME_MAX]; | |||||
| phw = &uncore_pcpu[cpu]->pc_uncorepmcs[ri]; | phw = &uncore_pcpu[cpu]->pc_uncorepmcs[ri]; | ||||
| (void) snprintf(ucp_name, sizeof(ucp_name), "UCP-%d", ri); | snprintf(pi->pm_name, PMC_NAME_MAX, "UCP-%d", ri); | ||||
| if ((error = copystr(ucp_name, pi->pm_name, PMC_NAME_MAX, | |||||
| NULL)) != 0) | |||||
| return (error); | |||||
| pi->pm_class = PMC_CLASS_UCP; | pi->pm_class = PMC_CLASS_UCP; | ||||
| if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { | if (phw->phw_state & PMC_PHW_FLAG_IS_ENABLED) { | ||||
| pi->pm_enabled = TRUE; | pi->pm_enabled = TRUE; | ||||
| *ppmc = phw->phw_pmc; | *ppmc = phw->phw_pmc; | ||||
| } else { | } else { | ||||
| pi->pm_enabled = FALSE; | pi->pm_enabled = FALSE; | ||||
| *ppmc = NULL; | *ppmc = NULL; | ||||
| ▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines | |||||