Lines Matching refs:cpu_top
131 int get_cpu_topology(struct cpupower_topology *cpu_top) in get_cpu_topology() argument
135 cpu_top->core_info = malloc(sizeof(struct cpuid_core_info) * cpus); in get_cpu_topology()
136 if (cpu_top->core_info == NULL) in get_cpu_topology()
138 cpu_top->pkgs = cpu_top->cores = 0; in get_cpu_topology()
140 cpu_top->core_info[cpu].cpu = cpu; in get_cpu_topology()
141 cpu_top->core_info[cpu].is_online = cpupower_is_cpu_online(cpu); in get_cpu_topology()
145 &(cpu_top->core_info[cpu].pkg)) < 0) { in get_cpu_topology()
146 cpu_top->core_info[cpu].pkg = -1; in get_cpu_topology()
147 cpu_top->core_info[cpu].core = -1; in get_cpu_topology()
153 &(cpu_top->core_info[cpu].core)) < 0) { in get_cpu_topology()
154 cpu_top->core_info[cpu].pkg = -1; in get_cpu_topology()
155 cpu_top->core_info[cpu].core = -1; in get_cpu_topology()
160 qsort(cpu_top->core_info, cpus, sizeof(struct cpuid_core_info), in get_cpu_topology()
166 last_pkg = cpu_top->core_info[0].pkg; in get_cpu_topology()
168 if (cpu_top->core_info[cpu].pkg != last_pkg && in get_cpu_topology()
169 cpu_top->core_info[cpu].pkg != -1) { in get_cpu_topology()
171 last_pkg = cpu_top->core_info[cpu].pkg; in get_cpu_topology()
172 cpu_top->pkgs++; in get_cpu_topology()
175 if (!(cpu_top->core_info[0].pkg == -1)) in get_cpu_topology()
176 cpu_top->pkgs++; in get_cpu_topology()
188 void cpu_topology_release(struct cpupower_topology cpu_top) in cpu_topology_release() argument
190 free(cpu_top.core_info); in cpu_topology_release()