Lines Matching refs:cpu_top
159 int get_cpu_topology(struct cpupower_topology *cpu_top) in get_cpu_topology() argument
163 cpu_top->core_info = malloc(sizeof(struct cpuid_core_info) * cpus); in get_cpu_topology()
164 if (cpu_top->core_info == NULL) in get_cpu_topology()
166 cpu_top->pkgs = cpu_top->cores = 0; in get_cpu_topology()
168 cpu_top->core_info[cpu].cpu = cpu; in get_cpu_topology()
169 cpu_top->core_info[cpu].is_online = cpupower_is_cpu_online(cpu); in get_cpu_topology()
173 &(cpu_top->core_info[cpu].pkg)) < 0) { in get_cpu_topology()
174 cpu_top->core_info[cpu].pkg = -1; in get_cpu_topology()
175 cpu_top->core_info[cpu].core = -1; in get_cpu_topology()
181 &(cpu_top->core_info[cpu].core)) < 0) { in get_cpu_topology()
182 cpu_top->core_info[cpu].pkg = -1; in get_cpu_topology()
183 cpu_top->core_info[cpu].core = -1; in get_cpu_topology()
188 qsort(cpu_top->core_info, cpus, sizeof(struct cpuid_core_info), in get_cpu_topology()
194 last_pkg = cpu_top->core_info[0].pkg; in get_cpu_topology()
196 if (cpu_top->core_info[cpu].pkg != last_pkg && in get_cpu_topology()
197 cpu_top->core_info[cpu].pkg != -1) { in get_cpu_topology()
199 last_pkg = cpu_top->core_info[cpu].pkg; in get_cpu_topology()
200 cpu_top->pkgs++; in get_cpu_topology()
203 if (!(cpu_top->core_info[0].pkg == -1)) in get_cpu_topology()
204 cpu_top->pkgs++; in get_cpu_topology()
216 void cpu_topology_release(struct cpupower_topology cpu_top) in cpu_topology_release() argument
218 free(cpu_top.core_info); in cpu_topology_release()