[gnome-system-monitor] Show CPU speed for ppc64 processors.



commit 401d84dc4ed6cc0cea3d23b19debfc6e9e204f90
Author: Chris KÃhl <chrisk openismus com>
Date:   Sat Jul 2 08:59:35 2011 +0200

    Show CPU speed for ppc64 processors.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=619732

 src/sysinfo.cpp |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp
index 3ce7e1d..0038cc4 100644
--- a/src/sysinfo.cpp
+++ b/src/sysinfo.cpp
@@ -106,16 +106,25 @@ namespace {
 
       for (guint i = 0; i != info->ncpu; ++i) {
 	const char * const keys[] = { "model name", "cpu", "Processor" };
-	gchar *model = 0;
+	gchar *model = 0, *clock = 0;
+	guint last;
 
-	for (guint j = 0; !model && j != G_N_ELEMENTS(keys); ++j)
+	for (guint j = 0; !model && j != G_N_ELEMENTS(keys); ++j) {
+	  last = j;
 	  model = static_cast<char*>(g_hash_table_lookup(info->cpuinfo[i].values,
 							 keys[j]));
+	}
 
 	if (!model)
           continue;
 
-	this->processors.push_back(model);
+	if (!strcmp(keys[last], "cpu"))
+	  clock = static_cast<char*>(g_hash_table_lookup(info->cpuinfo[i].values,
+							 "clock"));
+	if (clock)
+	  this->processors.push_back(string(model) + " " + string(clock));
+	else
+	  this->processors.push_back(model);
       }
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]