-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb][Dwarf] Add missing timer when parsing .debug_abbrev. #86568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-lldb Author: Zequan Wu (ZequanWu) Changes
This moves Full diff: https://github.com/llvm/llvm-project/pull/86568.diff 1 Files Affected:
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 08ce7b82b0c16a..8039a35ed8941c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -145,8 +145,10 @@ static PluginProperties &GetGlobalPluginProperties() {
static const llvm::DWARFDebugLine::LineTable *
ParseLLVMLineTable(DWARFContext &context, llvm::DWARFDebugLine &line,
- dw_offset_t line_offset, dw_offset_t unit_offset) {
+ dw_offset_t line_offset, dw_offset_t unit_offset,
+ StatsDuration &parse_time) {
Log *log = GetLog(DWARFLog::DebugInfo);
+ ElapsedTime elapsed(parse_time);
llvm::DWARFDataExtractor data = context.getOrLoadLineData().GetAsLLVMDWARF();
llvm::DWARFContext &ctx = context.GetAsLLVM();
@@ -693,6 +695,7 @@ llvm::DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() {
if (debug_abbrev_data.GetByteSize() == 0)
return nullptr;
+ ElapsedTime elapsed(m_parse_time);
auto abbr =
std::make_unique<llvm::DWARFDebugAbbrev>(debug_abbrev_data.GetAsLLVM());
llvm::Error error = abbr->parse();
@@ -1228,10 +1231,9 @@ bool SymbolFileDWARF::ParseLineTable(CompileUnit &comp_unit) {
if (offset == DW_INVALID_OFFSET)
return false;
- ElapsedTime elapsed(m_parse_time);
llvm::DWARFDebugLine line;
- const llvm::DWARFDebugLine::LineTable *line_table =
- ParseLLVMLineTable(m_context, line, offset, dwarf_cu->GetOffset());
+ const llvm::DWARFDebugLine::LineTable *line_table = ParseLLVMLineTable(
+ m_context, line, offset, dwarf_cu->GetOffset(), m_parse_time);
if (!line_table)
return false;
|
✅ With the latest revision this PR passed the Python code formatter. |
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SymbolFileDWARF::ParseLineTable() does more work after using llvm to parse the line table and we still need to measure this. So I believe that the current timer was in the correct position. Parse time for DWARF means how long to we take to both parse and to cleanup the information for LLDB to use, so the entire SymbolFileDWARF::ParseLineTable() function should be measured.
The time spent on parsing
.debug_abbrev
is also part of debug info parsing time.