summaryrefslogtreecommitdiffstats
path: root/dragonflybsd
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2023-07-29 03:32:53 +0800
committerBenBE <BenBE@geshi.org>2023-08-18 12:52:28 +0200
commitc6fd64fce8502a4e557711abe9fee394763ac52c (patch)
tree7829bd52c6344efb98d2f784e06cf3674d07e6d9 /dragonflybsd
parent47ae966660612a449b7313273ac3d3f1c0d46796 (diff)
More robust logic for CPU process percentages (Linux & PCP)
* Use saturatingSub() when subtracting CPU time and I/O read/write bytes of processes so that the values would never go negative (causing unsigned integer wraparound). * The CPU percentages of processes are now NaN if the time interval between measures (the "delta time") is zero. Make the conditional explicit and avoid division by zero. Previously the percentage values would be 0.0. Note: The saturatingSub() function is not used in cpu_delay_percent, blkio_delay_percent and swapin_delay_percent with a comment added that explains the reason. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Diffstat (limited to 'dragonflybsd')
0 files changed, 0 insertions, 0 deletions

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