@@ -71,6 +71,7 @@ json::Value ModuleStats::ToJSON() const {
7171 module .try_emplace (" debugInfoHadIncompleteTypes" ,
7272 debug_info_had_incomplete_types);
7373 module .try_emplace (" symbolTableStripped" , symtab_stripped);
74+ module .try_emplace (" symbolsLoaded" , num_symbols_loaded);
7475 if (!symfile_path.empty ())
7576 module .try_emplace (" symbolFilePath" , symfile_path);
7677
@@ -293,7 +294,8 @@ llvm::json::Value DebuggerStats::ReportStatistics(
293294 double debug_parse_time = 0.0 ;
294295 double debug_index_time = 0.0 ;
295296 uint32_t symtabs_loaded = 0 ;
296- uint32_t symtabs_saved = 0 ;
297+ uint32_t symtabs_loaded_from_cache = 0 ;
298+ uint32_t symtabs_saved_to_cache = 0 ;
297299 uint32_t debug_index_loaded = 0 ;
298300 uint32_t debug_index_saved = 0 ;
299301 uint64_t debug_info_size = 0 ;
@@ -309,6 +311,7 @@ llvm::json::Value DebuggerStats::ReportStatistics(
309311 uint32_t num_modules_with_variable_errors = 0 ;
310312 uint32_t num_modules_with_incomplete_types = 0 ;
311313 uint32_t num_stripped_modules = 0 ;
314+ uint32_t num_symbols_loaded = 0 ;
312315 for (size_t image_idx = 0 ; image_idx < num_modules; ++image_idx) {
313316 Module *module = target != nullptr
314317 ? target->GetImages ().GetModuleAtIndex (image_idx).get ()
@@ -318,12 +321,15 @@ llvm::json::Value DebuggerStats::ReportStatistics(
318321 module_stat.symtab_index_time = module ->GetSymtabIndexTime ().get ().count ();
319322 Symtab *symtab = module ->GetSymtab (/* can_create=*/ false );
320323 if (symtab) {
324+ module_stat.num_symbols_loaded = symtab->GetNumSymbols ();
325+ num_symbols_loaded += module_stat.num_symbols_loaded ;
326+ symtabs_loaded++;
321327 module_stat.symtab_loaded_from_cache = symtab->GetWasLoadedFromCache ();
322328 if (module_stat.symtab_loaded_from_cache )
323- ++symtabs_loaded ;
329+ ++symtabs_loaded_from_cache ;
324330 module_stat.symtab_saved_to_cache = symtab->GetWasSavedToCache ();
325331 if (module_stat.symtab_saved_to_cache )
326- ++symtabs_saved ;
332+ ++symtabs_saved_to_cache ;
327333 }
328334 SymbolFile *sym_file = module ->GetSymbolFile (/* can_create=*/ false );
329335 if (sym_file) {
@@ -393,8 +399,9 @@ llvm::json::Value DebuggerStats::ReportStatistics(
393399 json::Object global_stats{
394400 {" totalSymbolTableParseTime" , symtab_parse_time},
395401 {" totalSymbolTableIndexTime" , symtab_index_time},
396- {" totalSymbolTablesLoadedFromCache" , symtabs_loaded},
397- {" totalSymbolTablesSavedToCache" , symtabs_saved},
402+ {" totalSymbolTablesLoaded" , symtabs_loaded},
403+ {" totalSymbolTablesLoadedFromCache" , symtabs_loaded_from_cache},
404+ {" totalSymbolTablesSavedToCache" , symtabs_saved_to_cache},
398405 {" totalDebugInfoParseTime" , debug_parse_time},
399406 {" totalDebugInfoIndexTime" , debug_index_time},
400407 {" totalDebugInfoIndexLoadedFromCache" , debug_index_loaded},
@@ -407,6 +414,7 @@ llvm::json::Value DebuggerStats::ReportStatistics(
407414 num_modules_with_incomplete_types},
408415 {" totalDebugInfoEnabled" , num_debug_info_enabled_modules},
409416 {" totalSymbolTableStripped" , num_stripped_modules},
417+ {" totalSymbolsLoaded" , num_symbols_loaded},
410418 };
411419
412420 if (include_targets) {
0 commit comments