@@ -1218,12 +1218,18 @@ PluginManager::GetSymbolLocatorCreateCallbackAtIndex(uint32_t idx) {
1218
1218
}
1219
1219
1220
1220
ModuleSpec
1221
- PluginManager::LocateExecutableObjectFile (const ModuleSpec &module_spec) {
1221
+ PluginManager::LocateExecutableObjectFile (const ModuleSpec &module_spec,
1222
+ StatisticsMap &map) {
1222
1223
auto instances = GetSymbolLocatorInstances ().GetSnapshot ();
1223
1224
for (auto &instance : instances) {
1224
1225
if (instance.locate_executable_object_file ) {
1225
- std::optional<ModuleSpec> result =
1226
- instance.locate_executable_object_file (module_spec);
1226
+ StatsDuration time;
1227
+ std::optional<ModuleSpec> result;
1228
+ {
1229
+ ElapsedTime elapsed (time);
1230
+ result = instance.locate_executable_object_file (module_spec);
1231
+ }
1232
+ map.add (instance.name , time.get ().count ());
1227
1233
if (result)
1228
1234
return *result;
1229
1235
}
@@ -1232,12 +1238,19 @@ PluginManager::LocateExecutableObjectFile(const ModuleSpec &module_spec) {
1232
1238
}
1233
1239
1234
1240
FileSpec PluginManager::LocateExecutableSymbolFile (
1235
- const ModuleSpec &module_spec, const FileSpecList &default_search_paths) {
1241
+ const ModuleSpec &module_spec, const FileSpecList &default_search_paths,
1242
+ StatisticsMap &map) {
1236
1243
auto instances = GetSymbolLocatorInstances ().GetSnapshot ();
1237
1244
for (auto &instance : instances) {
1238
1245
if (instance.locate_executable_symbol_file ) {
1239
- std::optional<FileSpec> result = instance.locate_executable_symbol_file (
1240
- module_spec, default_search_paths);
1246
+ StatsDuration time;
1247
+ std::optional<FileSpec> result;
1248
+ {
1249
+ ElapsedTime elapsed (time);
1250
+ result = instance.locate_executable_symbol_file (module_spec,
1251
+ default_search_paths);
1252
+ }
1253
+ map.add (instance.name , time.get ().count ());
1241
1254
if (result)
1242
1255
return *result;
1243
1256
}
0 commit comments