From 1b805a31720727008b32b1129a167758519fd4db Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 2 May 2022 16:04:21 +0200 Subject: New upstream version 3.2.0 --- netbsd/NetBSDProcess.c | 2 ++ netbsd/NetBSDProcessList.c | 5 ++++- netbsd/Platform.c | 10 +++++++++- netbsd/Platform.h | 4 +++- 4 files changed, 18 insertions(+), 3 deletions(-) (limited to 'netbsd') diff --git a/netbsd/NetBSDProcess.c b/netbsd/NetBSDProcess.c index 8d2b4c4..a7d59be 100644 --- a/netbsd/NetBSDProcess.c +++ b/netbsd/NetBSDProcess.c @@ -148,6 +148,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { .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", @@ -155,6 +156,7 @@ const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = { .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", diff --git a/netbsd/NetBSDProcessList.c b/netbsd/NetBSDProcessList.c index ab0f0b7..197a150 100644 --- a/netbsd/NetBSDProcessList.c +++ b/netbsd/NetBSDProcessList.c @@ -307,7 +307,7 @@ static void NetBSDProcessList_scanProcs(NetBSDProcessList* this) { } } - if (settings->flags & PROCESS_FLAG_CWD) { + if (settings->ss->flags & PROCESS_FLAG_CWD) { NetBSDProcessList_updateCwd(kproc, proc); } @@ -318,8 +318,11 @@ static void NetBSDProcessList_scanProcs(NetBSDProcessList* this) { proc->m_virt = kproc->p_vm_vsize; proc->m_resident = kproc->p_vm_rssize; + proc->percent_mem = (proc->m_resident * pageSizeKB) / (double)(this->super.totalMem) * 100.0; proc->percent_cpu = CLAMP(getpcpu(kproc), 0.0, this->super.activeCPUs * 100.0); + Process_updateCPUFieldWidths(proc->percent_cpu); + proc->nlwp = kproc->p_nlwps; proc->nice = kproc->p_nice - 20; proc->time = 100 * (kproc->p_rtime_sec + ((kproc->p_rtime_usec + 500000) / 1000000)); diff --git a/netbsd/Platform.c b/netbsd/Platform.c index 3b27548..1812ddd 100644 --- a/netbsd/Platform.c +++ b/netbsd/Platform.c @@ -66,7 +66,15 @@ in the source distribution for its full text. #define prop_number_signed_value prop_number_integer_value #endif -const ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_VIRT, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; +const ScreenDefaults Platform_defaultScreens[] = { + { + .name = "Main", + .columns = "PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command", + .sortKey = "PERCENT_CPU", + }, +}; + +const unsigned int Platform_numberOfDefaultScreens = ARRAYSIZE(Platform_defaultScreens); /* * See /usr/include/sys/signal.h diff --git a/netbsd/Platform.h b/netbsd/Platform.h index e650bcd..3ad51e2 100644 --- a/netbsd/Platform.h +++ b/netbsd/Platform.h @@ -34,7 +34,9 @@ in the source distribution for its full text. #define PLATFORM_LONG_OPTIONS \ // End of list -extern const ProcessField Platform_defaultFields[]; +extern const ScreenDefaults Platform_defaultScreens[]; + +extern const unsigned int Platform_numberOfDefaultScreens; /* see /usr/include/sys/signal.h */ extern const SignalItem Platform_signals[]; -- cgit v1.2.3