]> git.hungrycats.org Git - linux/commit
[PATCH] show aggregate per-process counters in /proc/PID/stat 2
authorLev Makhlis <lev_makhlis@bmc.com>
Mon, 18 Oct 2004 15:54:26 +0000 (08:54 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 18 Oct 2004 15:54:26 +0000 (08:54 -0700)
commit9a349eb78cdd466f57d963c78b0265d026588a88
treea80f8f61b90cd8dda4c5ad2818c370baf443d96a
parentbf719d26a5c1ebe5ceed46f47bebefa4beae1f34
[PATCH] show aggregate per-process counters in /proc/PID/stat 2

Add up resource usage counters for live and dead threads to show aggregate
per-process usage in /proc/<pid>/stat.  This mirrors the new getrusage()
semantics.  /proc/<pid>/task/<tid>/stat still has the per-thread usage.

After moving the counter aggregation loop inside a task->sighand lock to
avoid nasty race conditions, it has survived stress-testing with '(while
true; do sleep 1 & done) & top -d 0.1'

Signed-off-by: Lev Makhlis <mlev@despammed.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/proc/array.c