Description[Tracing] Fix inaccurate timer calculation in runtime statistics.
Previously we reset runtime counters and dump them when we enter, exit top level
trace events respectively. However, there is gap between two top level trace
events and runtime counters may be activated, resetting the counters makes the
accumulated time inaccurate, and we may end up with negative time due to the
nature of how we accumulate time.
This patch fixes this problem by only resetting counters when there's no
counters active, and before dump counters, we traverse current active counters
to calculate their time, and then restart their timer.
BUG=chromium:658145
Committed: https://crrev.com/92d9a56a152dcefc8a3004e9812977c457fd4d14
Cr-Commit-Position: refs/heads/master@{#40653}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Address cbruni's comments #
Messages
Total messages: 25 (16 generated)
|