thread cpu resource statistics bug fix
authorYufei Ren <renyufei83@gmail.com>
Sat, 20 Oct 2012 03:11:50 +0000 (23:11 -0400)
committerJens Axboe <axboe@kernel.dk>
Mon, 22 Oct 2012 08:02:34 +0000 (10:02 +0200)
commitf5fd0b1cd383c4a3cb8fb5078b7e93aecba8847e
tree2bcec409d862d9c18875c055d988b1460c0171ac
parent2557f7e66176884783053fc44bda91a6781a3725
thread cpu resource statistics bug fix

If `thread' option is enabled, resource usage should be thread
based instead of process based. For the following job,

fio --ioengine=cpuio --cpuload=50 --time_based --runtime=10 --name=j0 --numjobs=4 --thread

before patch, each thread CPU statistics:
...
  cpu          : usr=199.67%, sys=0.14%, ctx=1475, majf=0, minf=24
...

after patch:
...
  cpu          : usr=49.80%, sys=0.00%, ctx=79, majf=0, minf=18446744073709538943
...

Signed-off-by: Jens Axboe <axboe@kernel.dk>
os/os-linux.h
stat.c