mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
Kernel: Track performance events for context switches
This commit is contained in:
parent
c94440860e
commit
8b2ace0326
6 changed files with 29 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <AK/Time.h>
|
||||
#include <Kernel/Debug.h>
|
||||
#include <Kernel/Panic.h>
|
||||
#include <Kernel/PerformanceManager.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/RTC.h>
|
||||
#include <Kernel/Scheduler.h>
|
||||
|
@ -365,6 +366,8 @@ bool Scheduler::context_switch(Thread* thread)
|
|||
}
|
||||
thread->set_state(Thread::Running);
|
||||
|
||||
PerformanceManager::add_context_switch_perf_event(*from_thread, *thread);
|
||||
|
||||
proc.switch_context(from_thread, thread);
|
||||
|
||||
// NOTE: from_thread at this point reflects the thread we were
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue