From 96e2a4259eb0cdf279b83d899f805d274d13a94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 13 Oct 2020 16:03:37 +0200 Subject: Continue to update generic data in paused mode Generic data, as CPU and memory usage, are used by Meters. In paused mode they would stop receiving updates and especially Graph Meters would stop showing continuous data. Improves: #214 Closes: #253 --- darwin/DarwinProcessList.c | 6 +++++- darwin/DarwinProcessList.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'darwin') diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c index 10d0697f..f6f08b50 100644 --- a/darwin/DarwinProcessList.c +++ b/darwin/DarwinProcessList.c @@ -144,7 +144,7 @@ void ProcessList_delete(ProcessList* this) { free(this); } -void ProcessList_goThroughEntries(ProcessList* super) { +void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { DarwinProcessList *dpl = (DarwinProcessList *)super; bool preExisting = true; struct kinfo_proc *ps; @@ -158,6 +158,10 @@ void ProcessList_goThroughEntries(ProcessList* super) { ProcessList_getVMStats(&dpl->vm_stats); openzfs_sysctl_updateArcStats(&dpl->zfs); + // in pause mode only gather global data for meters (CPU/memory/...) + if (pauseProcessUpdate) + return; + /* Get the time difference */ dpl->global_diff = 0; for(int i = 0; i < dpl->super.cpuCount; ++i) { diff --git a/darwin/DarwinProcessList.h b/darwin/DarwinProcessList.h index 58102d35..44a847dc 100644 --- a/darwin/DarwinProcessList.h +++ b/darwin/DarwinProcessList.h @@ -51,6 +51,6 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, ui void ProcessList_delete(ProcessList* this); -void ProcessList_goThroughEntries(ProcessList* super); +void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate); #endif -- cgit v1.2.3