Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'linux-cpupower-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux

Pull cpupower utility fixes for 4.15-rc2 from Shuah Khan:

"This update consists of fixes to tool's handling of offline cpus.

The first patch fixes the tool to find information on the cpu it
is running on, instead of always looking for cpu0 and failing if
cpu0 happens to be offline.

The second patch fixes the incorrect check for offline cpu status."

* tag 'linux-cpupower-4.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
cpupower : Fix cpupower working when cpu0 is offline
cpupowerutils: bench - Fix cpu online check

+7 -4
+1 -1
tools/power/cpupower/bench/system.c
··· 61 61 62 62 dprintf("set %s as cpufreq governor\n", governor); 63 63 64 - if (cpupower_is_cpu_online(cpu) != 0) { 64 + if (cpupower_is_cpu_online(cpu) != 1) { 65 65 perror("cpufreq_cpu_exists"); 66 66 fprintf(stderr, "error: cpu %u does not exist\n", cpu); 67 67 return -1;
+6 -3
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
··· 130 130 { 131 131 int num; 132 132 char *tmp; 133 + int this_cpu; 134 + 135 + this_cpu = sched_getcpu(); 133 136 134 137 /* Assume idle state count is the same for all CPUs */ 135 - cpuidle_sysfs_monitor.hw_states_num = cpuidle_state_count(0); 138 + cpuidle_sysfs_monitor.hw_states_num = cpuidle_state_count(this_cpu); 136 139 137 140 if (cpuidle_sysfs_monitor.hw_states_num <= 0) 138 141 return NULL; 139 142 140 143 for (num = 0; num < cpuidle_sysfs_monitor.hw_states_num; num++) { 141 - tmp = cpuidle_state_name(0, num); 144 + tmp = cpuidle_state_name(this_cpu, num); 142 145 if (tmp == NULL) 143 146 continue; 144 147 ··· 149 146 strncpy(cpuidle_cstates[num].name, tmp, CSTATE_NAME_LEN - 1); 150 147 free(tmp); 151 148 152 - tmp = cpuidle_state_desc(0, num); 149 + tmp = cpuidle_state_desc(this_cpu, num); 153 150 if (tmp == NULL) 154 151 continue; 155 152 strncpy(cpuidle_cstates[num].desc, tmp, CSTATE_DESC_LEN - 1);