mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +00:00
Profiler: Let the user ignore context switches
Now that the profiling timer is independent from the scheduler the user will get quite a few CPU samples from "within" the scheduler. These events are less useful when just profiling a user-mode process rather than the whole system. This patch adds an option to Profiler to hide these events.
This commit is contained in:
parent
c534f176bc
commit
d6b3513aab
Notes:
sideshowbarker
2024-07-18 18:11:58 +09:00
Author: https://github.com/gunnarbeutner
Commit: d6b3513aab
Pull-request: https://github.com/SerenityOS/serenity/pull/7090
Reviewed-by: https://github.com/awesomekling
4 changed files with 34 additions and 0 deletions
|
@ -71,6 +71,12 @@ void TimelineTrack::paint_event(GUI::PaintEvent& event)
|
|||
if (!m_process.valid_at(event.timestamp))
|
||||
continue;
|
||||
|
||||
if (!m_profile.show_scheduler() && !event.frames.is_empty()) {
|
||||
auto top_frame = event.frames[event.frames.size() - 1];
|
||||
if (top_frame.symbol == "Kernel::Scheduler::yield()")
|
||||
continue;
|
||||
}
|
||||
|
||||
auto& histogram = event.in_kernel ? kernel_histogram : usermode_histogram;
|
||||
histogram.insert(clamp_timestamp(event.timestamp), 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue