MCPcopy Create free account
hub / github.com/Kitware/CMake / CollectTimingAfterBuild

Method CollectTimingAfterBuild

Source/cmInstrumentation.cxx:903–924  ·  view source on GitHub ↗

* Always called by ctest --wait-and-collect-instrumentation in a detached * process. Waits for the given PID to end before running the postBuild hook. * * See SpawnBuildDaemon() */

Source from the content-addressed store, hash-verified

901 * See SpawnBuildDaemon()
902 */
903int cmInstrumentation::CollectTimingAfterBuild(int ppid)
904{
905 // Check if another process is already instrumenting the build.
906 // This lock will be released when the process exits at the end of the build.
907 if (!this->LockBuildDaemon()) {
908 return 0;
909 }
910 std::function<int()> waitForBuild = [ppid]() -> int {
911 while (0 == uv_kill(ppid, 0)) {
912 cmSystemTools::Delay(100);
913 };
914 // FIXME(#27331): Investigate a cross-platform solution to obtain the exit
915 // code given the `ppid` above.
916 return 0;
917 };
918 int ret = this->InstrumentCommand(
919 "build", {}, [waitForBuild]() { return waitForBuild(); }, cm::nullopt,
920 cm::nullopt, LoadQueriesAfter::Yes);
921 this->buildLock.Release();
922 this->CollectTimingData(cmInstrumentationQuery::Hook::PostBuild);
923 return ret;
924}
925
926void cmInstrumentation::AddHook(cmInstrumentationQuery::Hook hook)
927{

Callers 1

mainFunction · 0.80

Calls 5

LockBuildDaemonMethod · 0.95
InstrumentCommandMethod · 0.95
CollectTimingDataMethod · 0.95
uv_killFunction · 0.50
ReleaseMethod · 0.45

Tested by 1

mainFunction · 0.64