• Hana Kim's avatar
    internal/trace: fix double counting in span analysis · ad638fbf
    Hana Kim authored
    When snapshotting the execution time stats of a goroutine
    we take into account the intermediate values kepts in the GDesc's
    gdesc field. At the end of goroutine analysis, we go through all
    goroutines and replace the GExecutionStat with the new snapshot.
    Here the mistake was that we replaced the GExecutionStat with
    the value that reflects the intermediate values, but did clear
    the intermediate values. So, when the following finalizeActiveSpans
    runs, it trieds to add the intermediate values again (double-counting)
    when taking a snapshot.
    
    Fix the issue by using the finalized GExecutionStat instead of
    recomputing the snapshot. While we are here, refactor the finalization
    logic so it can be used when processing GoEnd, GoStop events.
    
    Change-Id: Ibdb342214c29b65d4ea37e52b1f8b83f1fb20143
    Reviewed-on: https://go-review.googlesource.com/103157Reviewed-by: 's avatarPeter Weinberger <pjw@google.com>
    ad638fbf
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...