Fix time-trace breaking flame graph assumptions
authorRussell Gallop <russell.gallop@gmail.com>
Thu, 5 Sep 2019 09:26:04 +0000 (09:26 +0000)
committerRussell Gallop <russell.gallop@gmail.com>
Thu, 5 Sep 2019 09:26:04 +0000 (09:26 +0000)
commitc6fda60d71ad4958a2ae0e6c11a89e39cddb6d70
tree6cea47093df536967cd36a4bf366bc217ca783a9
parent32048464ee3e3fe8c23ea4183f2fedc09a20b2b3
Fix time-trace breaking flame graph assumptions

-ftime-trace could break flame-graph assumptions on Windows, with an
inner scope overrunning outer scopes. This was due to the way that times
were truncated. Changed this so time_points for the flame-graph are
truncated instead of durations, preserving the relative order of event
starts and ends.

I have tried to retain the extra precision for the totals, which count
thousands or millions of events.

Added assert to check this property holds in future.

Fixes PR43043

Differential Revision: https://reviews.llvm.org/D66411

llvm-svn: 371039
llvm/lib/Support/TimeProfiler.cpp