From 78c564bd5559e837d3823f00e1911ba1ac5a83ac Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 27 Oct 2014 09:38:31 +0100 Subject: [PATCH] Use cpu_stage() where expected in the CAN_USE_SYSCTL, HAVE_LIBSTATGRAB and HAVE_SYSCTLBYNAME codepaths. cpu_state() isnt a function. --- src/cpu.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/cpu.c b/src/cpu.c index fae7ab9a..cf0eb6fa 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -772,11 +772,11 @@ static int cpu_read (void) } for (i = 0; i < numcpu; i++) { - cpu_state (i, CPU_STATE_USER, (derive_t) cpuinfo[i][CP_USER]); - cpu_state (i, CPU_STATE_NICE, (derive_t) cpuinfo[i][CP_NICE]); - cpu_state (i, CPU_STATE_SYSTEM, (derive_t) cpuinfo[i][CP_SYS]); - cpu_state (i, CPU_STATE_IDLE, (derive_t) cpuinfo[i][CP_IDLE]); - cpu_state (i, CPU_STATE_INTERRUPT, (derive_t) cpuinfo[i][CP_INTR]); + cpu_stage (i, CPU_STATE_USER, (derive_t) cpuinfo[i][CP_USER], now); + cpu_stage (i, CPU_STATE_NICE, (derive_t) cpuinfo[i][CP_NICE], now); + cpu_stage (i, CPU_STATE_SYSTEM, (derive_t) cpuinfo[i][CP_SYS], now); + cpu_stage (i, CPU_STATE_IDLE, (derive_t) cpuinfo[i][CP_IDLE], now); + cpu_stage (i, CPU_STATE_INTERRUPT, (derive_t) cpuinfo[i][CP_INTR], now); } /* }}} #endif CAN_USE_SYSCTL */ @@ -797,11 +797,11 @@ static int cpu_read (void) } for (i = 0; i < numcpu; i++) { - cpu_state (i, CPU_STATE_USER, (derive_t) cpuinfo[i][CP_USER]); - cpu_state (i, CPU_STATE_NICE, (derive_t) cpuinfo[i][CP_NICE]); - cpu_state (i, CPU_STATE_SYSTEM, (derive_t) cpuinfo[i][CP_SYS]); - cpu_state (i, CPU_STATE_IDLE, (derive_t) cpuinfo[i][CP_IDLE]); - cpu_state (i, CPU_STATE_INTERRUPT, (derive_t) cpuinfo[i][CP_INTR]); + cpu_stage (i, CPU_STATE_USER, (derive_t) cpuinfo[i][CP_USER], now); + cpu_stage (i, CPU_STATE_NICE, (derive_t) cpuinfo[i][CP_NICE], now); + cpu_stage (i, CPU_STATE_SYSTEM, (derive_t) cpuinfo[i][CP_SYS], now); + cpu_stage (i, CPU_STATE_IDLE, (derive_t) cpuinfo[i][CP_IDLE], now); + cpu_stage (i, CPU_STATE_INTERRUPT, (derive_t) cpuinfo[i][CP_INTR], now); } /* }}} #endif HAVE_SYSCTL_KERN_CP_TIMES */ @@ -819,11 +819,11 @@ static int cpu_read (void) return (-1); } - cpu_state (0, CPU_STATE_USER, (derive_t) cpuinfo[CP_USER]); - cpu_state (0, CPU_STATE_NICE, (derive_t) cpuinfo[CP_NICE]); - cpu_state (0, CPU_STATE_SYSTEM, (derive_t) cpuinfo[CP_SYS]); - cpu_state (0, CPU_STATE_IDLE, (derive_t) cpuinfo[CP_IDLE]); - cpu_state (0, CPU_STATE_INTERRUPT, (derive_t) cpuinfo[CP_INTR]); + cpu_stage (0, CPU_STATE_USER, (derive_t) cpuinfo[CP_USER], now); + cpu_stage (0, CPU_STATE_NICE, (derive_t) cpuinfo[CP_NICE], now); + cpu_stage (0, CPU_STATE_SYSTEM, (derive_t) cpuinfo[CP_SYS], now); + cpu_stage (0, CPU_STATE_IDLE, (derive_t) cpuinfo[CP_IDLE], now); + cpu_stage (0, CPU_STATE_INTERRUPT, (derive_t) cpuinfo[CP_INTR], now); /* }}} #endif HAVE_SYSCTLBYNAME */ #elif defined(HAVE_LIBSTATGRAB) /* {{{ */ -- 2.30.2