mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
Profiler: Cache parsed DWARF debug information in disassembly view
This changes browsing through disassembled functions in Profiler from a painfully sluggish experience into quite a swift one. It's especially true for profiling the kernel, as it has more than 10 megabytes of DWARF data to churn through.
This commit is contained in:
parent
8e1f882ac9
commit
b883652a83
5 changed files with 19 additions and 4 deletions
|
@ -54,7 +54,7 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
|
|||
, m_node(node)
|
||||
{
|
||||
FlatPtr base_address = 0;
|
||||
OwnPtr<Debug::DebugInfo> debug_info;
|
||||
const Debug::DebugInfo* debug_info;
|
||||
const ELF::Image* elf;
|
||||
if (auto maybe_kernel_base = Symbolication::kernel_base(); maybe_kernel_base.has_value() && m_node.address() >= *maybe_kernel_base) {
|
||||
if (!g_kernel_debuginfo_object.has_value())
|
||||
|
@ -63,7 +63,9 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
|
|||
elf = try_load_kernel_binary();
|
||||
if (elf == nullptr)
|
||||
return;
|
||||
debug_info = make<Debug::DebugInfo>(g_kernel_debuginfo_object->elf, String::empty(), base_address);
|
||||
if (g_kernel_debug_info == nullptr)
|
||||
g_kernel_debug_info = make<Debug::DebugInfo>(g_kernel_debuginfo_object->elf, String::empty(), base_address);
|
||||
debug_info = g_kernel_debug_info.ptr();
|
||||
} else {
|
||||
auto& process = node.process();
|
||||
auto library_data = process.library_metadata.library_containing(node.address());
|
||||
|
@ -73,7 +75,7 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
|
|||
}
|
||||
base_address = library_data->base;
|
||||
elf = &library_data->object->elf;
|
||||
debug_info = make<Debug::DebugInfo>(library_data->object->elf, String::empty(), base_address);
|
||||
debug_info = &library_data->load_debug_info(base_address);
|
||||
}
|
||||
|
||||
VERIFY(elf != nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue