Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b73c66cc authored by Ajay Dudani's avatar Ajay Dudani Committed by Stephen Boyd
Browse files

proc: show present cpu instead of online cpu in /proc/stat



Some userspace applications use /proc/stat to determine how many CPUs
the system has. CPU hotplug can offline a CPU at runtime and causing the
offline CPU not present in /proc/stat if we only show online cpu in
/proc/stat.

Change-Id: I4fd0cfcdb174244044634389da2fbdef77744c19
Signed-off-by: default avatarAjay Dudani <adudani@codeaurora.org>
parent c976a584
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ static int show_stat(struct seq_file *p, void *v)
	seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest_nice));
	seq_putc(p, '\n');

	for_each_online_cpu(i) {
	for_each_present_cpu(i) {
		/* Copy values here to work around gcc-2.95.3, gcc-2.96 */
		user = kcpustat_cpu(i).cpustat[CPUTIME_USER];
		nice = kcpustat_cpu(i).cpustat[CPUTIME_NICE];