[llvm-branch-commits] [compiler-rt] [llvm] [ctxprof] Track unhandled call targets (PR #131417)
Snehasish Kumar via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Mar 17 21:10:06 PDT 2025
================
@@ -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
More information about the llvm-branch-commits
mailing list