From 2299b022022891c84cd6fb3e4666c92bae442b4c Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 12 May 2005 00:15:27 +0000 Subject: [PATCH] dont reconvert for cpu total --- src/os/aix/aix_sigar.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index f07e553b..8afb1a0b 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -662,11 +662,7 @@ int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu) cpu->sys = SIGAR_TICK2SEC(data.cpu[CPU_KERNEL]); cpu->idle = SIGAR_TICK2SEC(data.cpu[CPU_IDLE]); cpu->wait = SIGAR_TICK2SEC(data.cpu[CPU_WAIT]); - cpu->total = 0; - - for (i=0; itotal += SIGAR_TICK2SEC(data.cpu[i]); - } + cpu->total = cpu->user + cpu->sys + cpu->idle + cpu->wait; return SIGAR_OK; } @@ -729,11 +725,7 @@ static int sigar_cpu_list_get_kmem(sigar_t *sigar, sigar_cpu_list_t *cpulist) cpu->nice = 0; /* N/A */ cpu->sys = SIGAR_TICK2SEC(info->cpu[CPU_KERNEL]); cpu->idle = SIGAR_TICK2SEC(info->cpu[CPU_IDLE]); - cpu->total = 0; - - for (j=0; jtotal += SIGAR_TICK2SEC(info->cpu[j]); - } + cpu->total = cpu->user + cpu->sys + cpu->idle + cpu->wait; } return SIGAR_OK;