[Dependency Scanning] Keep track of how many filesystem module lookups the dependency scanner performs on a given scan

This commit is contained in:
Artem Chikin
2024-12-05 14:26:56 -08:00
parent 25d32fc7a3
commit 48387eed55
5 changed files with 17 additions and 8 deletions

View File

@@ -248,6 +248,7 @@ ModuleDependencyScanningWorker::scanFilesystemForClangModuleDependency(
template <typename Function, typename... Args>
auto ModuleDependencyScanner::withDependencyScanningWorker(Function &&F,
Args &&...ArgList) {
NumLookups++;
auto getWorker = [this]() -> std::unique_ptr<ModuleDependencyScanningWorker> {
std::lock_guard<std::mutex> guard(WorkersLock);
// If we have run out of workers, something has gone wrong as we must never