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 --- unsupported/Platform.c | 12 ++++++++++-- unsupported/Platform.h | 6 ++++-- unsupported/UnsupportedProcess.c | 5 ++--- unsupported/UnsupportedProcessList.c | 3 ++- 4 files changed, 18 insertions(+), 8 deletions(-) (limited to 'unsupported') diff --git a/unsupported/Platform.c b/unsupported/Platform.c index e55de4a..33d7c41 100644 --- a/unsupported/Platform.c +++ b/unsupported/Platform.c @@ -27,14 +27,22 @@ in the source distribution for its full text. #include "UptimeMeter.h" +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); + const SignalItem Platform_signals[] = { { .name = " 0 Cancel", .number = 0 }, }; const unsigned int Platform_numberOfSignals = ARRAYSIZE(Platform_signals); -const ProcessField Platform_defaultFields[] = { PID, 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/unsupported/Platform.h b/unsupported/Platform.h index 7f4ad9a..5c874d4 100644 --- a/unsupported/Platform.h +++ b/unsupported/Platform.h @@ -20,12 +20,14 @@ in the source distribution for its full text. #include "unsupported/UnsupportedProcess.h" +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/unsupported/UnsupportedProcess.c b/unsupported/UnsupportedProcess.c index b1f63c6..5e27fe9 100644 --- a/unsupported/UnsupportedProcess.c +++ b/unsupported/UnsupportedProcess.c @@ -35,8 +35,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, }, @@ -100,6 +100,5 @@ const ProcessClass UnsupportedProcess_class = { .compare = Process_compare }, .writeField = UnsupportedProcess_writeField, - .getCommandStr = NULL, .compareByKey = UnsupportedProcess_compareByKey }; diff --git a/unsupported/UnsupportedProcessList.c b/unsupported/UnsupportedProcessList.c index b64de41..5291797 100644 --- a/unsupported/UnsupportedProcessList.c +++ b/unsupported/UnsupportedProcessList.c @@ -51,7 +51,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { Process_updateCmdline(proc, "", 0, 0); Process_updateExe(proc, "/path/to/executable"); - if (proc->settings->flags & PROCESS_FLAG_CWD) { + if (proc->settings->ss->flags & PROCESS_FLAG_CWD) { free_and_xStrdup(&proc->procCwd, "/current/working/directory"); } @@ -70,6 +70,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { proc->percent_cpu = 2.5; proc->percent_mem = 2.5; + Process_updateCPUFieldWidths(proc->percent_cpu); proc->st_uid = 0; proc->user = "nobody"; /* Update whenever proc->st_uid is changed */ -- cgit v1.2.3