It will be handy when trying to figure out CPU bound problems / benchmarks.
Signed-off-by: Loic Dachary <loic@dachary.org>
fclose(f);
}
+ // processor
+ f = fopen("/proc/cpuinfo", "r");
+ if (f) {
+ char buf[100];
+ while (!feof(f)) {
+ char *line = fgets(buf, sizeof(buf), f);
+ if (!line)
+ break;
+ if (strncmp(line, "model name", 10) == 0) {
+ char *c = strchr(buf, ':');
+ c++;
+ while (*c == ' ')
+ ++c;
+ char *nl = c;
+ while (*nl != '\n')
+ ++nl;
+ *nl = '\0';
+ (*pm)["cpu"] = c;
+ break;
+ }
+ }
+ fclose(f);
+ }
+
// distro info
f = fopen("/etc/lsb-release", "r");
if (f) {