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

ProfileViewer: Allow filtering samples in a specific time range

You can now select the time range you want on the profile timeline.
The tree view will update automatically as you alter the range.

Unfortunately this causes the treeview to collapse all of its nodes.
It would be nice to solve this somehow in the future so that nodes
can stay open.
This commit is contained in:
Andreas Kling 2019-12-14 19:10:12 +01:00
parent a3e7c99ffe
commit 3fd2304dad
4 changed files with 109 additions and 29 deletions

View file

@ -94,12 +94,22 @@ public:
u64 first_timestamp() const { return m_first_timestamp; }
u64 last_timestamp() const { return m_first_timestamp; }
void set_timestamp_filter_range(u64 start, u64 end);
void clear_timestamp_filter_range();
bool has_timestamp_filter_range() const { return m_has_timestamp_filter_range; }
private:
explicit Profile(const JsonArray&, Vector<NonnullRefPtr<ProfileNode>>&&, u64 first_timestamp, u64 last_timestamp);
explicit Profile(const JsonArray&);
void rebuild_tree();
JsonArray m_json;
RefPtr<ProfileModel> m_model;
Vector<NonnullRefPtr<ProfileNode>> m_roots;
u64 m_first_timestamp { 0 };
u64 m_last_timestamp { 0 };
bool m_has_timestamp_filter_range { false };
u64 m_timestamp_filter_range_start { 0 };
u64 m_timestamp_filter_range_end { 0 };
};