1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57:45 +00:00

Profiler: Store signposts in the main event stream

Instead of keeping a separate Vector<Event> for signposts, let them live
in the main event stream. For fast iteration, we instead keep a cache of
the signpost event indices.
This commit is contained in:
Andreas Kling 2021-08-13 21:55:14 +02:00
parent f5db92448d
commit 2da817615e
3 changed files with 26 additions and 20 deletions

View file

@ -113,16 +113,15 @@ void TimelineTrack::paint_event(GUI::PaintEvent& event)
template<typename Callback>
void TimelineTrack::for_each_signpost(Callback callback)
{
for (auto& signpost : m_profile.signposts()) {
m_profile.for_each_signpost([&](auto& signpost) {
if (signpost.pid != m_process.pid)
continue;
return IterationDecision::Continue;
if (!m_process.valid_at(signpost.serial))
continue;
return IterationDecision::Continue;
if (callback(signpost) == IterationDecision::Break)
break;
}
return callback(signpost);
});
}
void TimelineTrack::mousemove_event(GUI::MouseEvent& event)