Time gets % CPU time for a task wrong for long jobs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
time (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Ubuntu OS version: oneiric
Description: Linaro 12.01
Release: 12.01
Package: time
Priority: standard
Section: utils
Installed-Size: 148
Maintainer: Ubuntu Developers <email address hidden>
Architecture: armel
Version: 1.7-23.1
Depends: libc6 (>= 2.4)
When time is used to measure the resources used for a long job the results returned do not match up; the manual says that the %-age CPU used is the elapsed time divided by the (user+system) time consumed by the job.
The example below shows that for a job that took 34 hours to run the claimed CPU utilization was only 25%, but in reality it should be 95%.
93186.56user 24134.59system 34:07:55elapsed 25%CPU (0avgtext+0avgdata 3268608maxresid
0inputs+0outputs (11010major+
$ expr 93186 + 24134
117320
$ expr 117320 / 36
3258
ie ~32 1/2 hours
Shorter jobs (a few minutes) seem to show the correct %-age, so I suspect an overflow somewhere.
Status changed to 'Confirmed' because the bug affects multiple users.