diff options
author | Daniel Lange <DLange@git.local> | 2022-05-02 16:04:21 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2022-05-02 16:04:21 +0200 |
commit | 1b805a31720727008b32b1129a167758519fd4db (patch) | |
tree | 900c84e10a25f2c8eaeec3ae54f1365688ce02a4 /netbsd | |
parent | a6822e98434cf7da6fab033898094976d881ee0f (diff) | |
download | debian_htop-1b805a31720727008b32b1129a167758519fd4db.tar.gz debian_htop-1b805a31720727008b32b1129a167758519fd4db.tar.bz2 debian_htop-1b805a31720727008b32b1129a167758519fd4db.zip |
New upstream version 3.2.0upstream/3.2.0
Diffstat (limited to 'netbsd')
-rw-r--r-- | netbsd/NetBSDProcess.c | 2 | ||||
-rw-r--r-- | netbsd/NetBSDProcessList.c | 5 | ||||
-rw-r--r-- | netbsd/Platform.c | 10 | ||||
-rw-r--r-- | netbsd/Platform.h | 4 |
4 files changed, 18 insertions, 3 deletions
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[]; |