diff options
author | Nathan Scott <nathans@redhat.com> | 2023-06-05 10:04:05 +1000 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-06-06 12:18:36 +0200 |
commit | 0fb0d75433191ce8056ff1b32ae371f4c4b0a6e0 (patch) | |
tree | ba1b7d85e4469016af43eef67d7488ac2daa7e1c /linux/LinuxProcessList.c | |
parent | b810678a8dcb708b452864f5991f007920161bdb (diff) |
Fix Linux running tasks count in the Tasks Meter, a recent regression
The recent split of machine-wide metric gathering from process metrics
gathering introduced a regression in the Linux running task accounting.
The way we extract this value from /proc/stat (which typically is used
for machine-wide metrics) conspired with a now-incorrectly placed init-
to-zero at the start of the per-process sampling, caused this value to
always be zero by the time the Tasks Meter used it.
Fix this by making it much more clear that Linux has this special case
handling of runningTasks.
Resolves #1256
Diffstat (limited to 'linux/LinuxProcessList.c')
-rw-r--r-- | linux/LinuxProcessList.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index e0a33e28..cd3a2607 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1312,6 +1312,9 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, openat_arg_ const ScreenSettings* ss = settings->ss; const struct dirent* entry; + /* set runningTasks from /proc/stat (from Machine_scanCPUTime) */ + pl->runningTasks = lhost->runningTasks; + #ifdef HAVE_OPENAT int dirFd = openat(parentFd, dirname, O_RDONLY | O_DIRECTORY | O_NOFOLLOW); if (dirFd < 0) |