[SIGAR-14] Fix sigar_cpu_t.total on Linux and Solaris with multi-core CPUs

This commit is contained in:
Doug MacEachern committed 2006-09-07 14:10:24 +00:00
1 parent d8159a6024
commit 9d7275a29b
3 files changed
+7 -3

No files matched your search

+2 -2
View File
@@ -293,7 +293,7 @@ int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu)
cpu->idle += xcpu->idle;
cpu->nice += xcpu->nice;
cpu->wait += xcpu->wait;
cpu->total += xcpu->total;
cpu->total = xcpu->total;
}
return SIGAR_OK;
@@ -384,7 +384,7 @@ int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist)
cpu->idle += SIGAR_TICK2SEC(cpuinfo[CPU_IDLE]);
cpu->wait += SIGAR_TICK2SEC(cpuinfo[CPU_WAIT]);
cpu->nice += 0; /* no cpu->nice */
cpu->total += cpu->user + cpu->sys + cpu->idle + cpu->wait;
cpu->total = cpu->user + cpu->sys + cpu->idle + cpu->wait;
}
return SIGAR_OK;