Always produce cpuX entries, even in the case when there is only one CPU

in the system. This is consistent with what real linuxes do.

PR:		kern/75848
Submitted by:	Andriy Gapon <avg@icyb.net.ua>
MFC after:	3 days
This commit is contained in:
sobomax 2005-03-06 22:28:14 +00:00
parent 1bc82499df
commit 6f0b5d23e8

View File

@ -424,13 +424,12 @@ linprocfs_dostat(PFS_FILL_ARGS)
T2J(cp_time[CP_NICE]),
T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/),
T2J(cp_time[CP_IDLE]));
if (mp_ncpus > 1)
for (i = 0; i < mp_ncpus; ++i)
sbuf_printf(sb, "cpu%d %ld %ld %ld %ld\n", i,
T2J(cp_time[CP_USER]) / mp_ncpus,
T2J(cp_time[CP_NICE]) / mp_ncpus,
T2J(cp_time[CP_SYS]) / mp_ncpus,
T2J(cp_time[CP_IDLE]) / mp_ncpus);
for (i = 0; i < mp_ncpus; ++i)
sbuf_printf(sb, "cpu%d %ld %ld %ld %ld\n", i,
T2J(cp_time[CP_USER]) / mp_ncpus,
T2J(cp_time[CP_NICE]) / mp_ncpus,
T2J(cp_time[CP_SYS]) / mp_ncpus,
T2J(cp_time[CP_IDLE]) / mp_ncpus);
sbuf_printf(sb,
"disk 0 0 0 0\n"
"page %u %u\n"