Lines Matching refs:cpuip

102 	cpu_node_t *cpuip;
111 if ((cpuip = topo_mod_zalloc(mod, sizeof (cpu_node_t))) == NULL)
114 if ((cpuip->cn_kc = kstat_open()) == NULL) {
117 topo_mod_free(mod, cpuip, sizeof (cpu_node_t));
121 cpuip->cn_ncpustats = sysconf(_SC_CPUID_MAX);
122 if ((cpuip->cn_cpustats = topo_mod_zalloc(mod, (
123 cpuip->cn_ncpustats + 1) * sizeof (kstat_t *))) == NULL) {
124 (void) kstat_close(cpuip->cn_kc);
125 topo_mod_free(mod, cpuip, sizeof (cpu_node_t));
132 topo_mod_free(mod, cpuip->cn_cpustats,
133 (cpuip->cn_ncpustats + 1) * sizeof (kstat_t *));
134 (void) kstat_close(cpuip->cn_kc);
135 topo_mod_free(mod, cpuip, sizeof (cpu_node_t));
139 topo_mod_setspecific(mod, (void *)cpuip);
147 cpu_node_t *cpuip;
149 cpuip = topo_mod_getspecific(mod);
151 if (cpuip->cn_cpustats != NULL)
152 topo_mod_free(mod, cpuip->cn_cpustats,
153 (cpuip->cn_ncpustats + 1) * sizeof (kstat_t *));
155 (void) kstat_close(cpuip->cn_kc);
156 topo_mod_free(mod, cpuip, sizeof (cpu_node_t));
162 cpu_kstat_init(cpu_node_t *cpuip, int i)
166 if (cpuip->cn_cpustats[i] == NULL) {
167 if ((ksp = kstat_lookup(cpuip->cn_kc, "cpu_info", i, NULL)) ==
168 NULL || kstat_read(cpuip->cn_kc, ksp, NULL) < 0)
171 cpuip->cn_cpustats[i] = ksp;
173 ksp = cpuip->cn_cpustats[i];
182 topo_instance_t min, topo_instance_t max, cpu_node_t *cpuip)
190 for (i = 0; i <= cpuip->cn_ncpustats; i++) {
192 if ((cpu_id = cpu_kstat_init(cpuip, i)) < 0)
195 if ((ks = kstat_data_lookup(cpuip->cn_cpustats[i],
219 cpu_node_t *cpuip = (cpu_node_t *)arg;
230 cpuip->cn_ncpustats + 1) < 0) {
234 cpuip->cn_ncpustats + 1,
239 return (cpu_create(mod, pnode, name, min, max, cpuip));