[libgtop] Linux cpuinfo count fixed for SMP PPC processors (bgo #621831)
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgtop] Linux cpuinfo count fixed for SMP PPC processors (bgo #621831)
- Date: Mon, 9 Dec 2013 02:09:31 +0000 (UTC)
commit 47bcd423b5e58210d0283b09951ea3a68f54bb7e
Author: Robert Roth <robert roth off gmail com>
Date: Mon Dec 9 04:02:38 2013 +0200
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
sysdeps/linux/sysinfo.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/sysdeps/linux/sysinfo.c b/sysdeps/linux/sysinfo.c
index 01821aa..3ae9631 100644
--- a/sysdeps/linux/sysinfo.c
+++ b/sysdeps/linux/sysinfo.c
@@ -51,7 +51,8 @@ init_sysinfo (glibtop *server)
sysinfo.ncpu++) {
gchar **parts, **p;
-
+ if (g_strrstr (processors[sysinfo.ncpu], "processor" ) == NULL)
+ continue;
glibtop_entry * const cpuinfo = &sysinfo.cpuinfo[sysinfo.ncpu];
cpuinfo->labels = g_ptr_array_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]