summaryrefslogtreecommitdiffstats
path: root/linux/LinuxMachine.h
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2023-06-05 10:04:05 +1000
committerBenBE <BenBE@geshi.org>2023-06-06 12:18:36 +0200
commit0fb0d75433191ce8056ff1b32ae371f4c4b0a6e0 (patch)
treeba1b7d85e4469016af43eef67d7488ac2daa7e1c /linux/LinuxMachine.h
parentb810678a8dcb708b452864f5991f007920161bdb (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/LinuxMachine.h')
-rw-r--r--linux/LinuxMachine.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux/LinuxMachine.h b/linux/LinuxMachine.h
index 7dba905f..c3076a30 100644
--- a/linux/LinuxMachine.h
+++ b/linux/LinuxMachine.h
@@ -61,10 +61,13 @@ typedef struct LinuxMachine_ {
Machine super;
long jiffies;
- long long boottime;
int pageSize;
int pageSizeKB;
+ /* see Linux kernel source for further detail, fs/proc/stat.c */
+ unsigned int runningTasks; /* procs_running from /proc/stat */
+ long long boottime; /* btime field from /proc/stat */
+
double period;
CPUData* cpuData;

© 2014-2024 Faster IT GmbH | imprint | privacy policy