1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

Profiler: Parse and paint profile signpost events :^)

Signposts generated by perf_event(PERF_EVENT_SIGNPOST) now show up in
profile timelines, and if you hover them you get a tooltip with the two
arguments passed with the event.
This commit is contained in:
Andreas Kling 2021-08-11 20:05:41 +02:00
parent 9ae8cd823c
commit 00b11d7577
4 changed files with 81 additions and 5 deletions

View file

@ -176,10 +176,16 @@ public:
int tid { 0 };
u32 lost_samples { 0 };
bool in_kernel { false };
// FIXME: Put event type-specific arguments in a union to save memory.
FlatPtr arg1 {};
FlatPtr arg2 {};
Vector<Frame> frames;
};
const Vector<Event>& events() const { return m_events; }
Vector<Event> const& signposts() const { return m_signposts; }
const Vector<size_t>& filtered_event_indices() const { return m_filtered_event_indices; }
u64 length_in_ms() const { return m_last_timestamp - m_first_timestamp; }
@ -220,7 +226,7 @@ public:
}
private:
Profile(Vector<Process>, Vector<Event>);
Profile(Vector<Process>, Vector<Event> events, Vector<Event> signposts);
void rebuild_tree();
@ -237,6 +243,7 @@ private:
Vector<Process> m_processes;
Vector<Event> m_events;
Vector<Event> m_signposts;
bool m_has_timestamp_filter_range { false };
u64 m_timestamp_filter_range_start { 0 };