1
Fork 0
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:
Gunnar Beutner 2021-05-14 07:48:53 +02:00 committed by Andreas Kling
parent c94440860e
commit 8b2ace0326
6 changed files with 29 additions and 2 deletions

View file

@ -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