================
@@ -145,27 +180,32 @@ struct llvm::TimeTraceProfiler {
     DurationType Duration = E.End - E.Start;
 
     // Only include sections longer or equal to TimeTraceGranularity msec.
-    if (duration_cast<microseconds>(Duration).count() >= TimeTraceGranularity)
+    if (duration_cast<microseconds>(Duration).count() >= TimeTraceGranularity) 
{
       Entries.emplace_back(E);
+      if (&Stack.back()->Event == &E) {
----------------
usx95 wrote:

I think instead of this check, we should instead find the entry in stack which 
corresponds to this entry (similar to how the entry is deleted from the stack).

I think this is primarily because ending an async event can end a non-top 
element of the stack.

https://github.com/llvm/llvm-project/pull/103039
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to