Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_soft.c
| Show First 20 Lines • Show All 450 Lines • ▼ Show 20 Lines | pmc_soft_initialize(struct pmc_mdep *md) | ||||
| md->pmd_npmc += SOFT_NPMCS; | md->pmd_npmc += SOFT_NPMCS; | ||||
| ast_register(TDA_HWPMC, ASTR_UNCOND, 0, ast_hwpmc); | ast_register(TDA_HWPMC, ASTR_UNCOND, 0, ast_hwpmc); | ||||
| } | } | ||||
| void | void | ||||
| pmc_soft_finalize(struct pmc_mdep *md) | pmc_soft_finalize(struct pmc_mdep *md) | ||||
| { | { | ||||
| #ifdef INVARIANTS | PMCDBG0(MDP, INI, 1, "soft-finalize"); | ||||
| int i, ncpus; | |||||
| ncpus = pmc_cpu_max(); | for (int i = 0; i < pmc_cpu_max(); i++) | ||||
| for (i = 0; i < ncpus; i++) | |||||
| KASSERT(soft_pcpu[i] == NULL, ("[soft,%d] non-null pcpu cpu %d", | KASSERT(soft_pcpu[i] == NULL, ("[soft,%d] non-null pcpu cpu %d", | ||||
| __LINE__, i)); | __LINE__, i)); | ||||
| KASSERT(md->pmd_classdep[PMC_CLASS_INDEX_SOFT].pcd_class == | |||||
| PMC_CLASS_SOFT, ("[soft,%d] class mismatch", __LINE__)); | |||||
| #endif | |||||
| ast_deregister(TDA_HWPMC); | ast_deregister(TDA_HWPMC); | ||||
| free(soft_pcpu, M_PMC); | free(soft_pcpu, M_PMC); | ||||
| soft_pcpu = NULL; | soft_pcpu = NULL; | ||||
| } | } | ||||