summaryrefslogtreecommitdiff
path: root/Userland/DevTools/Profiler/Profile.h
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-08 01:33:43 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-08 09:53:53 +0200
commit210d2d270d3a71e215350b1c78b1e9f0f614d8cf (patch)
tree1d96afb0214d03a019e75a523c15bc2765da7ba6 /Userland/DevTools/Profiler/Profile.h
parent325d9445fdf3f0239abca2fecac7e7ee6a973762 (diff)
downloadserenity-210d2d270d3a71e215350b1c78b1e9f0f614d8cf.zip
Profiler: Let the user select more than one process
Diffstat (limited to 'Userland/DevTools/Profiler/Profile.h')
-rw-r--r--Userland/DevTools/Profiler/Profile.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/Userland/DevTools/Profiler/Profile.h b/Userland/DevTools/Profiler/Profile.h
index 4008884b92..cffc5f91f1 100644
--- a/Userland/DevTools/Profiler/Profile.h
+++ b/Userland/DevTools/Profiler/Profile.h
@@ -116,6 +116,17 @@ private:
Bitmap m_seen_events;
};
+struct ProcessFilter {
+ pid_t pid { 0 };
+ u64 start_valid { 0 };
+ u64 end_valid { 0 };
+
+ bool operator==(ProcessFilter const& rhs) const
+ {
+ return pid == rhs.pid && start_valid == rhs.start_valid && end_valid == rhs.end_valid;
+ }
+};
+
class Profile {
public:
static Result<NonnullOwnPtr<Profile>, String> load_from_perfcore_file(const StringView& path);
@@ -171,9 +182,10 @@ public:
void clear_timestamp_filter_range();
bool has_timestamp_filter_range() const { return m_has_timestamp_filter_range; }
- void set_process_filter(pid_t pid, u64 start_valid, u64 end_valid);
+ void add_process_filter(pid_t pid, u64 start_valid, u64 end_valid);
+ void remove_process_filter(pid_t pid, u64 start_valid, u64 end_valid);
void clear_process_filter();
- bool has_process_filter() const { return m_has_process_filter; }
+ bool has_process_filter() const { return !m_process_filters.is_empty(); }
bool process_filter_contains(pid_t pid, u32 timestamp);
bool is_inverted() const { return m_inverted; }
@@ -222,10 +234,7 @@ private:
u64 m_timestamp_filter_range_start { 0 };
u64 m_timestamp_filter_range_end { 0 };
- bool m_has_process_filter { false };
- pid_t m_process_filter_pid { 0 };
- u64 m_process_filter_start_valid { 0 };
- u64 m_process_filter_end_valid { 0 };
+ Vector<ProcessFilter> m_process_filters;
u32 m_deepest_stack_depth { 0 };
bool m_inverted { false };