vppinfra: preserve total_cpu_time across clock freq adjustment 78/24378/2
authorDave Barach <[email protected]>
Sun, 1 Dec 2019 13:59:03 +0000 (08:59 -0500)
committerAndrew Yourtchenko <[email protected]>
Thu, 6 Feb 2020 12:30:08 +0000 (12:30 +0000)
commit520c355b86fba01a65593c8c026373a36c87acc6
tree98b9020b0f30da9924f63d3f650fc28cadecd753
parent5b2eea6e0705b7e8f8b77f0efe6535885717cbee
vppinfra: preserve total_cpu_time across clock freq adjustment

If clib_time_verify_frequency() adjusts the clock frequency, transform
total_cpu_time to the new time coordinate space. Otherwise, we break
comparisons with previous clib_time_now() value.

Without this correction, time jumps in one direction or the other
depending on the sign of the frequency change. Reasonably harmless in
most cases, but under perfect storm conditions the wheels fall off.

Type: fix

Signed-off-by: Dave Barach <[email protected]>
Change-Id: I21802c2630e2c87ff817cd732b7d78bc022cd2d7
(cherry picked from commit e52d8d880ac644f07154bc2fb94035a198ed6688)
src/vppinfra/time.c
src/vppinfra/time.h