Add sysinfo example
Retrieve cpu model via hashtable & number of logical cpu via exposed variable Signed off: Dr. James Dominic P. Guana <jdpguana@histark.com>
This commit is contained in:
committed by
Robert Roth
parent
f92f6ea029
commit
3d7870c961
@@ -39,10 +39,10 @@ main (int argc, char *argv [])
|
|||||||
sysinfo = glibtop_get_sysinfo ();
|
sysinfo = glibtop_get_sysinfo ();
|
||||||
model = g_hash_table_lookup (sysinfo->cpuinfo [1].values, "model name");
|
model = g_hash_table_lookup (sysinfo->cpuinfo [1].values, "model name");
|
||||||
|
|
||||||
printf ("\nProcessor Model: %s\n", g_strdup (model));
|
printf ("\nProcessor Model: %s\n", g_strdup (model));
|
||||||
printf ("Number of Cores: %d\n\n", sysinfo->ncpu);
|
printf ("Number of Cores: %d\n\n", sysinfo->ncpu);
|
||||||
|
|
||||||
glibtop_close ();
|
glibtop_close ();
|
||||||
|
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user