Hi,
I am porting a C program from Linux To FreeBSD (wmmon FYI) and I would like
to know how i can get cpu(s) load as I can read them from "top" command.
I found in other posts here sysctl dev.cpu but that me gives always 100%.
I would need to get what "top" calls { "user", "system", "interrupt" and "idle" } ...
or least two cathegories "idle" and "not-idle".
What I see from "sysctl.dev.cpu"
What "top" shows
I thought about reading "top" code, but if I understood well, "top" is part
of the FreeBSD-system, so I would need to download all the system source to read it and
my disk space is very very scarce. I only have 1GB available now. I guess I can't do that.
Bye
Nicola
I am porting a C program from Linux To FreeBSD (wmmon FYI) and I would like
to know how i can get cpu(s) load as I can read them from "top" command.
I found in other posts here sysctl dev.cpu but that me gives always 100%.
I would need to get what "top" calls { "user", "system", "interrupt" and "idle" } ...
or least two cathegories "idle" and "not-idle".
What I see from "sysctl.dev.cpu"
Code:
dev.cpu.0.cx_method: C1/hlt
dev.cpu.0.cx_usage_counters: 2062148
dev.cpu.0.cx_usage: 100.00% last 5097us
dev.cpu.0.cx_lowest: C2
dev.cpu.0.cx_supported: C1/1/0
dev.cpu.0.%domain: 0
dev.cpu.0.%parent: acpi0
dev.cpu.0.%pnpinfo: _HID=none _UID=0
dev.cpu.0.%location: handle=\_SB_.CP00 _PXM=0
dev.cpu.0.%driver: cpu
dev.cpu.0.%desc: ACPI CPU
dev.cpu.%parent:
Code:
...
CPU: 3.5% user, 0.0% nice, 2.4% system, 1.2% interrupt, 92.9% idle
...
of the FreeBSD-system, so I would need to download all the system source to read it and
my disk space is very very scarce. I only have 1GB available now. I guess I can't do that.
Bye
Nicola