Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hwpmc/hwpmc_tsc.c
| Show First 20 Lines • Show All 333 Lines • ▼ Show 20 Lines | pmc_tsc_initialize(struct pmc_mdep *md, int maxcpu) | ||||
| md->pmd_npmc += TSC_NPMCS; | md->pmd_npmc += TSC_NPMCS; | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| void | void | ||||
| pmc_tsc_finalize(struct pmc_mdep *md __diagused) | pmc_tsc_finalize(struct pmc_mdep *md __diagused) | ||||
| { | { | ||||
| #ifdef INVARIANTS | PMCDBG0(MDP, INI, 1, "tsc-finalize"); | ||||
| int i, ncpus; | |||||
| ncpus = pmc_cpu_max(); | for (int i = 0; i < pmc_cpu_max(); i++) | ||||
| for (i = 0; i < ncpus; i++) | |||||
| KASSERT(tsc_pcpu[i] == NULL, ("[tsc,%d] non-null pcpu cpu %d", | KASSERT(tsc_pcpu[i] == NULL, ("[tsc,%d] non-null pcpu cpu %d", | ||||
| __LINE__, i)); | __LINE__, i)); | ||||
| KASSERT(md->pmd_classdep[PMC_MDEP_CLASS_INDEX_TSC].pcd_class == | |||||
| PMC_CLASS_TSC, ("[tsc,%d] class mismatch", __LINE__)); | |||||
| #endif | |||||
| free(tsc_pcpu, M_PMC); | free(tsc_pcpu, M_PMC); | ||||
| tsc_pcpu = NULL; | tsc_pcpu = NULL; | ||||
| } | } | ||||