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 /solaris | |
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 'solaris')
-rw-r--r-- | solaris/Platform.c | 12 | ||||
-rw-r--r-- | solaris/Platform.h | 6 | ||||
-rw-r--r-- | solaris/SolarisProcess.c | 4 | ||||
-rw-r--r-- | solaris/SolarisProcessList.c | 7 |
4 files changed, 22 insertions, 7 deletions
diff --git a/solaris/Platform.c b/solaris/Platform.c index cdc79ae..20b4d13 100644 --- a/solaris/Platform.c +++ b/solaris/Platform.c @@ -40,6 +40,16 @@ in the source distribution for its full text. #include "SolarisProcessList.h" +const ScreenDefaults Platform_defaultScreens[] = { + { + .name = "Default", + .columns = "PID LWPID 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); + const SignalItem Platform_signals[] = { { .name = " 0 Cancel", .number = 0 }, { .name = " 1 SIGHUP", .number = 1 }, @@ -87,8 +97,6 @@ const SignalItem Platform_signals[] = { const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); -const ProcessField Platform_defaultFields[] = { PID, LWPID, USER, PRIORITY, NICE, M_VIRT, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; - const MeterClass* const Platform_meterTypes[] = { &CPUMeter_class, &ClockMeter_class, diff --git a/solaris/Platform.h b/solaris/Platform.h index b140788..1b3dc9f 100644 --- a/solaris/Platform.h +++ b/solaris/Platform.h @@ -52,12 +52,14 @@ typedef struct envAccum_ { char* env; } envAccum; +extern const ScreenDefaults Platform_defaultScreens[]; + +extern const unsigned int Platform_numberOfDefaultScreens; + extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; -extern const ProcessField Platform_defaultFields[]; - extern const MeterClass* const Platform_meterTypes[]; bool Platform_init(void); diff --git a/solaris/SolarisProcess.c b/solaris/SolarisProcess.c index b0f6d94..ae8bd70 100644 --- a/solaris/SolarisProcess.c +++ b/solaris/SolarisProcess.c @@ -40,8 +40,8 @@ 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, }, - [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, }, + [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, }, [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, .defaultSortDesc = true, }, diff --git a/solaris/SolarisProcessList.c b/solaris/SolarisProcessList.c index 71e85fc..0c619ae 100644 --- a/solaris/SolarisProcessList.c +++ b/solaris/SolarisProcessList.c @@ -451,7 +451,7 @@ static int SolarisProcessList_walkproc(psinfo_t* _psinfo, lwpsinfo_t* _lwpsinfo, Process_updateComm(proc, _psinfo->pr_fname); Process_updateCmdline(proc, _psinfo->pr_psargs, 0, 0); - if (proc->settings->flags & PROCESS_FLAG_CWD) { + if (proc->settings->ss->flags & PROCESS_FLAG_CWD) { SolarisProcessList_updateCwd(_psinfo->pr_pid, proc); } } @@ -463,8 +463,11 @@ static int SolarisProcessList_walkproc(psinfo_t* _psinfo, lwpsinfo_t* _lwpsinfo, proc->tgid = (_psinfo->pr_ppid * 1024); sproc->realppid = _psinfo->pr_ppid; sproc->realtgid = _psinfo->pr_ppid; + // See note above (in common section) about this BINARY FRACTION proc->percent_cpu = ((uint16_t)_psinfo->pr_pctcpu / (double)32768) * (double)100.0; + Process_updateCPUFieldWidths(proc->percent_cpu); + proc->time = _psinfo->pr_time.tv_sec; if (!preExisting) { // Tasks done only for NEW processes proc->isUserlandThread = false; @@ -492,6 +495,8 @@ static int SolarisProcessList_walkproc(psinfo_t* _psinfo, lwpsinfo_t* _lwpsinfo, proc->show = !(pl->settings->hideKernelThreads && proc->isKernelThread); } else { // We are not in the master LWP, so jump to the LWP handling code proc->percent_cpu = ((uint16_t)_lwpsinfo->pr_pctcpu / (double)32768) * (double)100.0; + Process_updateCPUFieldWidths(proc->percent_cpu); + proc->time = _lwpsinfo->pr_time.tv_sec; if (!preExisting) { // Tasks done only for NEW LWPs proc->isUserlandThread = true; |