]> git.cworth.org Git - fips/commit
Fix CPU load reported on initial frame.
authorCarl Worth <cworth@cworth.org>
Tue, 12 Nov 2013 18:20:10 +0000 (10:20 -0800)
committerCarl Worth <cworth@cworth.org>
Tue, 12 Nov 2013 18:20:10 +0000 (10:20 -0800)
commit383fc95ff68a2b9a2772e2b12febb1830c32e260
tree6e3a1007fb391e1f91a926f3b7c5ae245eea47d6
parent85faadffd4f13cefceec2c3166b3e1596d4bfd35
Fix CPU load reported on initial frame.

We were seeing a result like this:

frame: 0 21.0526 20.9131 -4.54586e+17 0

while the frame obviously didn't take negative time.

The bug was subtracting an unintialized
metrics->previous_cpu_time_ts. In order to have this in place by the
end of the first frame, we need to do an initial query of the CPU time
when first creating our metrics object, (before starting the first
frame).

Thanks to Eric Anholt for identifying this bug.
metrics.c