[users at i-scream] freebsd user sg_get_cpu_percent very different than top output.

Jesper Schmitz Mouridsen jesper at schmitz.computer
Tue Mar 14 09:58:09 GMT 2017


Hi.
This is on FreeBSD 11.0-RELEASE-p8
I'm trying to get libstatgrab to report the cpu-usage correctly 
(e.g with values like top).

When I max out the cpu use of libstatsgrab and statgrab still reports < 10%
for cpu userspace percent.
TOP:
CPU: 82.7% user,  0.0% nice, 13.2% system,  0.0% interrupt,  4.0% idle
Statgrab:
cpu.ctxsw: 0
cpu.idle: 88.292770
cpu.intrs: 0
cpu.iowait: 0.000000
cpu.kernel: 6.643582
cpu.nice: 0.000000
cpu.nvctxsw: 0
cpu.softintrs: 0
cpu.swap: 0.000000
cpu.syscalls: 0
cpu.time_taken: 1489484539
cpu.user: 5.039125

On Linux (in a vm, I also find significant difference between top and 
statgrab)
What am I missing?



More information about the users mailing list