hbc_mini.c: make it work on NetBSD
This fixes the numbers by using the correct MIB to match the struct.
This commit is contained in:
@@ -789,7 +789,7 @@ static void plugin_cpu_monitor(conn_t *c, const config_t *cfg) {
|
|||||||
* Plugin: memory_monitor
|
* Plugin: memory_monitor
|
||||||
* Linux: /proc/meminfo
|
* Linux: /proc/meminfo
|
||||||
* FreeBSD: sysctl vm.stats.vm.*
|
* FreeBSD: sysctl vm.stats.vm.*
|
||||||
* NetBSD: sysctl vm.uvmexp (struct uvmexp)
|
* NetBSD: sysctl vm.uvmexp (struct uvmexp_sysctl)
|
||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
|
|
||||||
/* emit the common kvdict fields and send */
|
/* emit the common kvdict fields and send */
|
||||||
@@ -898,7 +898,7 @@ static void plugin_memory_monitor(conn_t *c, const config_t *cfg) {
|
|||||||
(void)cfg;
|
(void)cfg;
|
||||||
struct uvmexp_sysctl uvm;
|
struct uvmexp_sysctl uvm;
|
||||||
size_t len = sizeof(uvm);
|
size_t len = sizeof(uvm);
|
||||||
int mib[2] = {CTL_VM, VM_UVMEXP};
|
int mib[2] = {CTL_VM, VM_UVMEXP2};
|
||||||
if (sysctl(mib, 2, &uvm, &len, NULL, 0) != 0) return;
|
if (sysctl(mib, 2, &uvm, &len, NULL, 0) != 0) return;
|
||||||
|
|
||||||
long long ps = uvm.pagesize;
|
long long ps = uvm.pagesize;
|
||||||
|
|||||||
Reference in New Issue
Block a user