1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

ProfileViewer: Don't skip the innermost frame when loading profiles

We were skipping the innermost frame as a workaround for the kernel
putting garbage data there. Now that the kernel puts the instruction
poiner there, we can load the frame normally! :^)
This commit is contained in:
Andreas Kling 2020-04-11 20:40:16 +02:00
parent b7ff3b5ad1
commit a4006e19d7

View file

@ -144,10 +144,11 @@ void Profile::rebuild_tree()
else
node = &node->find_or_create_child(symbol, address, offset, event.timestamp);
node->add_event_address(address);
node->increment_event_count();
if (is_innermost_frame)
if (is_innermost_frame) {
node->add_event_address(address);
node->increment_self_count();
}
return IterationDecision::Continue;
});
@ -217,7 +218,7 @@ OwnPtr<Profile> Profile::load_from_perfcore_file(const StringView& path)
}
auto stack_array = perf_event.get("stack").as_array();
for (ssize_t i = stack_array.values().size() - 1; i >= 1; --i) {
for (ssize_t i = stack_array.values().size() - 1; i >= 0; --i) {
auto& frame = stack_array.at(i);
auto ptr = frame.to_number<u32>();
u32 offset = 0;