]> granicus.if.org Git - llvm/commit
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)
commit12173bc1d5e82a8bc907a36733eb26daa9472935
tree846fb8fe9d80ea0fc86d58daecf980565a50f049
parent4ded9b43aa0a1970b33b08b95ab3621c575f91a7
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371039 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/TimeProfiler.cpp