Lines Matching refs:cpu_top
65 int get_cpu_topology(struct cpupower_topology *cpu_top) in get_cpu_topology() argument
69 cpu_top->core_info = malloc(sizeof(struct cpuid_core_info) * cpus); in get_cpu_topology()
70 if (cpu_top->core_info == NULL) in get_cpu_topology()
72 cpu_top->pkgs = cpu_top->cores = 0; in get_cpu_topology()
74 cpu_top->core_info[cpu].cpu = cpu; in get_cpu_topology()
75 cpu_top->core_info[cpu].is_online = sysfs_is_cpu_online(cpu); in get_cpu_topology()
79 &(cpu_top->core_info[cpu].pkg)) < 0) { in get_cpu_topology()
80 cpu_top->core_info[cpu].pkg = -1; in get_cpu_topology()
81 cpu_top->core_info[cpu].core = -1; in get_cpu_topology()
87 &(cpu_top->core_info[cpu].core)) < 0) { in get_cpu_topology()
88 cpu_top->core_info[cpu].pkg = -1; in get_cpu_topology()
89 cpu_top->core_info[cpu].core = -1; in get_cpu_topology()
94 qsort(cpu_top->core_info, cpus, sizeof(struct cpuid_core_info), in get_cpu_topology()
100 last_pkg = cpu_top->core_info[0].pkg; in get_cpu_topology()
102 if (cpu_top->core_info[cpu].pkg != last_pkg && in get_cpu_topology()
103 cpu_top->core_info[cpu].pkg != -1) { in get_cpu_topology()
105 last_pkg = cpu_top->core_info[cpu].pkg; in get_cpu_topology()
106 cpu_top->pkgs++; in get_cpu_topology()
109 if (!cpu_top->core_info[0].pkg == -1) in get_cpu_topology()
110 cpu_top->pkgs++; in get_cpu_topology()
122 void cpu_topology_release(struct cpupower_topology cpu_top) in cpu_topology_release() argument
124 free(cpu_top.core_info); in cpu_topology_release()