From: Landry Breuil Date: Mon, 27 Oct 2014 08:38:31 +0000 (+0100) Subject: Use cpu_stage() where expected in the CAN_USE_SYSCTL, HAVE_LIBSTATGRAB and HAVE_SYSCT... X-Git-Tag: collectd-5.5.0~168^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=78c564bd5559e837d3823f00e1911ba1ac5a83ac;p=collectd.git Use cpu_stage() where expected in the CAN_USE_SYSCTL, HAVE_LIBSTATGRAB and HAVE_SYSCTLBYNAME codepaths. cpu_state() isnt a function. --- 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) /* {{{ */