mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 15:04:33 +00:00
Track which core was used to schedule
This commit is contained in:
parent
59ebcdfa8e
commit
b0e0415b3e
@ -258,6 +258,8 @@ namespace Recovery
|
||||
wdgDbgWin->CreateButton({245, 340, 25, 15}, "90%", (uintptr_t)BufBight90);
|
||||
wdgDbgWin->CreateButton({275, 340, 25, 15}, "100%", (uintptr_t)BufBight100);
|
||||
|
||||
GraphicalUserInterface::Handle wdgDbgCurrentCPUSchedCoreLbl = wdgDbgWin->CreateLabel({5, 355, 0, 0}, "CPU Scheduled Core: Unknown");
|
||||
|
||||
DbgWin->AddWidget(wdgDbgWin);
|
||||
|
||||
char TicksText[128];
|
||||
@ -268,6 +270,8 @@ namespace Recovery
|
||||
{
|
||||
sprintf(TicksText, "%016ld / %016ld", TaskManager->GetSchedulerTicks(), TaskManager->GetLastTaskTicks());
|
||||
wdgDbgWin->SetText(SchedLblHnd, TicksText);
|
||||
sprintf(TicksText, "CPU Scheduled Core: %ld", TaskManager->GetLastCore());
|
||||
wdgDbgWin->SetText(wdgDbgCurrentCPUSchedCoreLbl, TicksText);
|
||||
static int RefreshMemCounter = 0;
|
||||
if (RefreshMemCounter-- == 0)
|
||||
{
|
||||
|
@ -481,6 +481,7 @@ namespace Tasking
|
||||
uint64_t SchedTmpTicks = TimeManager->GetCounter();
|
||||
this->LastTaskTicks.store(SchedTmpTicks - this->SchedulerTicks.load());
|
||||
CPUData *CurrentCPU = GetCurrentCPU();
|
||||
this->LastCore.store(CurrentCPU->ID);
|
||||
schedbg("Scheduler called on CPU %d.", CurrentCPU->ID);
|
||||
schedbg("%d: %ld%%", CurrentCPU->ID, GetUsage(CurrentCPU->ID));
|
||||
|
||||
|
@ -244,6 +244,7 @@ namespace Tasking
|
||||
TCB *CleanupThread = nullptr;
|
||||
std::atomic_uint64_t SchedulerTicks = 0;
|
||||
std::atomic_uint64_t LastTaskTicks = 0;
|
||||
std::atomic_int LastCore = 0;
|
||||
bool StopScheduler = false;
|
||||
bool InvalidPCB(PCB *pcb);
|
||||
bool InvalidTCB(TCB *tcb);
|
||||
@ -275,6 +276,7 @@ namespace Tasking
|
||||
void SetCleanupThread(TCB *Thread) { CleanupThread = Thread; }
|
||||
uint64_t GetSchedulerTicks() { return SchedulerTicks.load(); }
|
||||
uint64_t GetLastTaskTicks() { return LastTaskTicks.load(); }
|
||||
uint64_t GetLastCore() { return LastCore.load(); }
|
||||
std::vector<PCB *> GetProcessList() { return ProcessList; }
|
||||
Security *GetSecurityManager() { return &SecurityManager; }
|
||||
void CleanupProcessesThread();
|
||||
|
Loading…
x
Reference in New Issue
Block a user