Linux cpuinfo count fixed for SMP PPC processors (bgo #621831)

libgtop processor count has been simply determined by the number
of sections in /proc/cpuinfo split by \n\n. On PPC processors
supporting SMP after the per-cpu description for each core a
new section is listed (after \n\n) with the common attributes
of the cores [1]. Work around this by only counting a section
as describing a CPU if it contains "processor" to fix bug #621831 [0]
[0] https://bugzilla.gnome.org/show_bug.cgi?id=621831
[1] https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/arch/powerpc/kernel/setup-common.c?id=9fc2105aeaaf56b0cf75296a84702d0f9e64437b#n319
This commit is contained in:
Robert Roth
2013-12-09 04:02:38 +02:00
parent 38bfee6739
commit 47bcd423b5

View File

@@ -51,7 +51,8 @@ init_sysinfo (glibtop *server)
sysinfo.ncpu++) { sysinfo.ncpu++) {
gchar **parts, **p; gchar **parts, **p;
if (g_strrstr (processors[sysinfo.ncpu], "processor" ) == NULL)
continue;
glibtop_entry * const cpuinfo = &sysinfo.cpuinfo[sysinfo.ncpu]; glibtop_entry * const cpuinfo = &sysinfo.cpuinfo[sysinfo.ncpu];
cpuinfo->labels = g_ptr_array_new (); cpuinfo->labels = g_ptr_array_new ();