From 421bdeec603b4fb1a4edec0e802c437fbe47fca0 Mon Sep 17 00:00:00 2001 From: Sohaib Date: Tue, 23 Mar 2021 08:27:05 +0200 Subject: Merging all the points related to calculating time in one place The end goal is to consolidate all the points in htop that can only work in live-only mode today, so that will be able to inject PCP archive mode and have a chance at it working. The biggest problem we've got at this moment is all the places that are independently asking the kernel to 'give me the time right now'. Each of those needs to be audited and ultimately changed to allow platforms to manage their own idea of time. So, all the calls to gettimeofday(2) and time(2) are potential problems. Ultimately I want to get these down to just one or two. Related to https://github.com/htop-dev/htop/pull/574 --- ProcessList.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ProcessList.h') diff --git a/ProcessList.h b/ProcessList.h index 3d9b8ff2..46944dbd 100644 --- a/ProcessList.h +++ b/ProcessList.h @@ -48,6 +48,9 @@ typedef struct ProcessList_ { Hashtable* displayTreeSet; Hashtable* draftingTreeSet; + struct timeval timestamp; /* time of the current sample */ + uint64_t timestampMs; /* current time in milliseconds */ + Panel* panel; int following; uid_t userId; -- cgit v1.2.3