summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/linux/sysinfo.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sysdeps/linux/sysinfo.c b/sysdeps/linux/sysinfo.c
index 7dbd5eeb..c9a66653 100644
--- a/sysdeps/linux/sysinfo.c
+++ b/sysdeps/linux/sysinfo.c
@@ -37,6 +37,7 @@ static void
init_sysinfo (glibtop *server)
{
char* buffer;
+ gchar *buf, *line;
gchar ** processors;
if(G_LIKELY(sysinfo.flags)) return;
@@ -48,6 +49,24 @@ init_sysinfo (glibtop *server)
/* cpuinfo records are seperated by a blank line */
processors = g_strsplit(buffer, "\n\n", 0);
+ line = strtok(processors[0], "\n");
+
+ while(line != NULL)
+ {
+ if (strstr(line, "model name") != NULL)
+ {
+ buf = strchr(line, ':');
+
+ if (buf != NULL)
+ {
+ buf+=2; // we want to look at what's _after_ the ':'
+ sysinfo.model = buf;
+ }
+ break;
+ }
+ line = strtok(NULL, "\n");
+ }
+
g_free(buffer);
sysinfo.ncpu = 0;