]> granicus.if.org Git - sysstat/commit
pidstat: Report CPU usage for a process as the sum of all threads
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 31 Mar 2018 08:15:04 +0000 (10:15 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 31 Mar 2018 08:15:04 +0000 (10:15 +0200)
commita63e87996fd5a214ca7e7c511c713877d8d94300
tree853aa66b9aca7376bb5e0be66d80e113d3f8f370
parent144e1bc938de671f04ef12f82e0154a4181a80e9
pidstat: Report CPU usage for a process as the sum of all threads

Commit 52977c4 introduced a new macro (SP_VALUE_100()) to limit CPU
usage value displayed by pidstat to 100%. This was intended to be a
workaround for some corner cases where inaccurate statistics could be
provided by the kernel.
Yet this macro also limits the value to 100% even when a process uses
more than 100% of a core, e.g. when it starts several threads loading
the system. This patch reverts commit 52977c4 and reports CPU usage
for a process as the sum of CPU usage for all its threads.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
common.h
pidstat.c