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()
84 &(cpu_top->core_info[cpu].core)) < 0) in get_cpu_topology()
88 qsort(cpu_top->core_info, cpus, sizeof(struct cpuid_core_info), in get_cpu_topology()
94 last_pkg = cpu_top->core_info[0].pkg; in get_cpu_topology()
96 if(cpu_top->core_info[cpu].pkg != last_pkg) { in get_cpu_topology()
97 last_pkg = cpu_top->core_info[cpu].pkg; in get_cpu_topology()
98 cpu_top->pkgs++; in get_cpu_topology()
101 cpu_top->pkgs++; in get_cpu_topology()
113 void cpu_topology_release(struct cpupower_topology cpu_top) in cpu_topology_release() argument
115 free(cpu_top.core_info); in cpu_topology_release()