instrumentation: Don't load query files before configure

Prevent the duplication of callbacks that came from loading instrumentation
queries both before and after configure.
This commit is contained in:
Martin Duffy
2025-08-05 13:53:34 -04:00
parent b85bdbf68d
commit 9b65be6da5
2 changed files with 5 additions and 5 deletions

View File

@@ -2664,7 +2664,6 @@ int cmake::ActualConfigure()
this->ConfigureLog = cm::make_unique<cmConfigureLog>(
cmStrCat(this->GetHomeOutputDirectory(), "/CMakeFiles"_s),
this->FileAPI->GetConfigureLogVersions());
this->Instrumentation->LoadQueries();
this->Instrumentation->CheckCDashVariable();
}
#endif
@@ -3109,10 +3108,6 @@ int cmake::Generate()
<< ms.count() / 1000.0L << "s)";
this->UpdateProgress(msg.str(), -1);
}
#if !defined(CMAKE_BOOTSTRAP)
this->Instrumentation->CollectTimingData(
cmInstrumentationQuery::Hook::PostGenerate);
#endif
if (!this->GraphVizFile.empty()) {
std::cout << "Generate graphviz: " << this->GraphVizFile << '\n';
this->GenerateGraphViz(this->GraphVizFile);
@@ -3132,6 +3127,8 @@ int cmake::Generate()
this->SaveCache(this->GetHomeOutputDirectory());
#if !defined(CMAKE_BOOTSTRAP)
this->Instrumentation->CollectTimingData(
cmInstrumentationQuery::Hook::PostGenerate);
this->GlobalGenerator->WriteInstallJson();
this->FileAPI->WriteReplies(cmFileAPI::IndexFor::Success);
#endif

View File

@@ -76,6 +76,9 @@ endif()
get_filename_component(dataDir ${index} DIRECTORY)
get_filename_component(v1 ${dataDir} DIRECTORY)
if (EXISTS ${v1}/${hook}.hook)
add_error("Received multiple triggers of the same hook: ${hook}")
endif()
file(WRITE ${v1}/${hook}.hook "${ERROR_MESSAGE}")
if (NOT ERROR_MESSAGE MATCHES "^$")