================ @@ -246,22 +246,37 @@ ContextNode *getFlatProfile(FunctionData &Data, GUID Guid, ContextNode *getUnhandledContext(FunctionData &Data, GUID Guid, uint32_t NumCounters) { - // 1) if we are under a root (regardless if this thread is collecting or not a + + // 1) if we are currently collecting a contextual profile, fetch a ContextNode + // in the `Unhandled` set. We want to do this regardless of `ProfilingStarted` + // to (hopefully) offset the penalty of creating these contexts to before + // profiling. + // + // 2) if we are under a root (regardless if this thread is collecting or not a // contextual profile for that root), do not collect a flat profile. We want // to keep flat profiles only for activations that can't happen under a root, // to avoid confusing profiles. We can, for example, combine flattened and // flat profiles meaningfully, as we wouldn't double-count anything. // - // 2) to avoid lengthy startup, don't bother with flat profiles until the + // 3) to avoid lengthy startup, don't bother with flat profiles until the ---------------- snehasish wrote:
"the profiling has started"? https://github.com/llvm/llvm-project/pull/131417 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits