Lines Matching full:probe

1 //===- SampleProfileProbe.cpp - Pseudo probe Instrumentation -------------===//
38 #define DEBUG_TYPE "pseudo-probe"
44 VerifyPseudoProbe("verify-pseudo-probe", cl::init(false), cl::Hidden,
45 cl::desc("Do pseudo probe verification"));
48 "verify-pseudo-probe-funcs", cl::Hidden,
52 UpdatePseudoProbe("update-pseudo-probe", cl::init(true), cl::Hidden,
53 cl::desc("Update pseudo probe distribution factor"));
98 "\n*** Pseudo Probe Verification After " + PassID.str() + " ***\n"; in runAfterPass()
139 if (std::optional<PseudoProbe> Probe = extractProbe(I)) { in collectProbeFactors() local
141 ProbeFactors[{Probe->Id, Hash}] += Probe->Factor; in collectProbeFactors()
160 dbgs() << "Probe " << I.first.first << "\tprevious factor " in verifyProbeFactors()
191 // This discrepancy in probe ID could cause profile mismatching issues.
205 // Handle the call-to-invoke conversion case: make sure that the probe id and in computeBlocksToIgnore()
207 // probe, we only keep the head block probe id and ignore the block ids of the in computeBlocksToIgnore()
208 // normal dests. For callsite probe, it's different to block probe, there is in computeBlocksToIgnore()
224 // only instrument probe in the head block, ignore the normal dests.
347 // Since the GUID from probe desc and inline stack are computed separately, we in instrumentOneFunc()
358 // Assign an artificial debug line to a probe that doesn't come with a real in instrumentOneFunc()
359 // line. A probe not having a debug line will get an incomplete inline in instrumentOneFunc()
360 // context. This will cause samples collected on the probe to be counted in instrumentOneFunc()
365 "Expecting pseudo probe or call instructions"); in instrumentOneFunc()
373 << " Probe gets an artificial debug line\n"; in instrumentOneFunc()
380 // Probe basic blocks. in instrumentOneFunc()
384 // Insert a probe before an instruction with a valid debug line number which in instrumentOneFunc()
385 // will be assigned to the probe. The line number will be used later to in instrumentOneFunc()
386 // model the inline context when the probe is inlined into other functions. in instrumentOneFunc()
408 auto *Probe = Builder.CreateCall(ProbeFn, Args); in instrumentOneFunc() local
409 AssignDebugLoc(Probe); in instrumentOneFunc()
412 if (auto DIL = Probe->getDebugLoc()) { in instrumentOneFunc()
415 Probe->setDebugLoc(DIL); in instrumentOneFunc()
420 // Probe both direct calls and indirect calls. Direct calls are probed so that in instrumentOneFunc()
421 // their probe ID can be used as an call site identifier to represent a in instrumentOneFunc()
432 // and type of a callsite probe. This gets rid of the dependency on in instrumentOneFunc()
443 // synthesize probe-based sample counts, which are in instrumentOneFunc()
457 // Create the pseudo probe desc metadata beforehand. in run()
479 // Collect the sum of execution weight for each probe. in runOnFunction()
483 if (std::optional<PseudoProbe> Probe = extractProbe(I)) { in runOnFunction() local
485 ProbeFactors[{Probe->Id, Hash}] += BBProfileCount(&Block); in runOnFunction()
493 if (std::optional<PseudoProbe> Probe = extractProbe(I)) { in runOnFunction() local
495 float Sum = ProbeFactors[{Probe->Id, Hash}]; in runOnFunction()