dont reconvert for cpu total

This commit is contained in:
Doug MacEachern 2005-05-12 02:49:29 +00:00
parent 76b1d0f081
commit 6c1167c4d7
1 changed files with 2 additions and 6 deletions

View File

@ -323,7 +323,7 @@ int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist)
kstat_ctl_t *kc = sigar->kc; kstat_ctl_t *kc = sigar->kc;
kstat_t *ksp; kstat_t *ksp;
ulong cpuinfo[CPU_STATES]; ulong cpuinfo[CPU_STATES];
unsigned int i, n; unsigned int i;
sigar_kstat_update(sigar); sigar_kstat_update(sigar);
if (cpulist == &sigar->cpulist) { if (cpulist == &sigar->cpulist) {
@ -381,11 +381,7 @@ int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist)
cpu->idle = SIGAR_TICK2SEC(cpuinfo[CPU_IDLE]); cpu->idle = SIGAR_TICK2SEC(cpuinfo[CPU_IDLE]);
cpu->wait = SIGAR_TICK2SEC(cpuinfo[CPU_WAIT]); cpu->wait = SIGAR_TICK2SEC(cpuinfo[CPU_WAIT]);
cpu->nice = 0; /* no cpu->nice */ cpu->nice = 0; /* no cpu->nice */
cpu->total = 0; cpu->total = cpu->user + cpu->sys + cpu->idle + cpu->wait;
for (n=0; n<CPU_STATES; n++) {
cpu->total += cpuinfo[n];
}
} }
return SIGAR_OK; return SIGAR_OK;