From 937052b231259a47d881d539ad5748245ef55b99 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Fri, 3 Jun 2022 08:55:20 +0200 Subject: New upstream version 3.2.1 --- freebsd/FreeBSDProcess.c | 2 +- freebsd/Platform.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'freebsd') diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c index 2746540..4eccfe7 100644 --- a/freebsd/FreeBSDProcess.c +++ b/freebsd/FreeBSDProcess.c @@ -37,7 +37,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { [M_VIRT] = { .name = "M_VIRT", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, .defaultSortDesc = true, }, [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, .defaultSortDesc = true, }, [ST_UID] = { .name = "ST_UID", .title = "UID", .description = "User ID of the process owner", .flags = 0, }, - [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, + [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = " CPU%", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, [PERCENT_NORM_CPU] = { .name = "PERCENT_NORM_CPU", .title = "NCPU%", .description = "Normalized percentage of the CPU time the process used in the last sampling (normalized by cpu count)", .flags = 0, .defaultSortDesc = true, .autoWidth = true, }, [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, .defaultSortDesc = true, }, [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, diff --git a/freebsd/Platform.c b/freebsd/Platform.c index d21fc80..1a731b7 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -227,6 +227,7 @@ double Platform_setCPUValues(Meter* this, unsigned int cpu) { void Platform_setMemoryValues(Meter* this) { const ProcessList* pl = this->pl; + const FreeBSDProcessList* fpl = (const FreeBSDProcessList*) pl; this->total = pl->totalMem; this->values[0] = pl->usedMem; @@ -234,6 +235,16 @@ void Platform_setMemoryValues(Meter* this) { // this->values[2] = "shared memory, like tmpfs and shm" this->values[3] = pl->cachedMem; // this->values[4] = "available memory" + + if (fpl->zfs.enabled) { + // ZFS does not shrink below the value of zfs_arc_min. + unsigned long long int shrinkableSize = 0; + if (fpl->zfs.size > fpl->zfs.min) + shrinkableSize = fpl->zfs.size - fpl->zfs.min; + this->values[0] -= shrinkableSize; + this->values[3] += shrinkableSize; + // this->values[4] += shrinkableSize; + } } void Platform_setSwapValues(Meter* this) { -- cgit v1.2.3