Add modules stats into the "statistics dump" command.

The new module stats adds the ability to measure the time it takes to parse and index the symbol tables for each module, and reports modules statistics in the output of "statistics dump" along with the path, UUID and triple of the module. The time it takes to parse and index the symbol tables are also aggregated into new top level key/value pairs at the target level.

Differential Revision: https://reviews.llvm.org/D112279
This commit is contained in:
Greg Clayton
2021-10-21 16:01:00 -07:00
parent cdb335ffaf
commit c571988e9d
13 changed files with 247 additions and 51 deletions

View File

@@ -2692,9 +2692,6 @@ Symtab *ObjectFileELF::GetSymtab() {
if (!module_sp)
return nullptr;
Progress progress(llvm::formatv("Parsing symbol table for {0}",
m_file.GetFilename().AsCString("<Unknown>")));
// We always want to use the main object file so we (hopefully) only have one
// cached copy of our symtab, dynamic sections, etc.
ObjectFile *module_obj_file = module_sp->GetObjectFile();
@@ -2702,6 +2699,10 @@ Symtab *ObjectFileELF::GetSymtab() {
return module_obj_file->GetSymtab();
if (m_symtab_up == nullptr) {
Progress progress(
llvm::formatv("Parsing symbol table for {0}",
m_file.GetFilename().AsCString("<Unknown>")));
ElapsedTime elapsed(module_sp->GetSymtabParseTime());
SectionList *section_list = module_sp->GetSectionList();
if (!section_list)
return nullptr;