mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Added last task ticks counter
This commit is contained in:
parent
c4a2f645de
commit
df24131e48
@ -57,7 +57,7 @@ namespace Recovery
|
|||||||
char TicksText[128];
|
char TicksText[128];
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
sprintf(TicksText, "Scheduler Ticks: %ld", TaskManager->GetSchedulerTicks());
|
sprintf(TicksText, "%016ld / %016ld - Sched. / Last Task Ticks", TaskManager->GetSchedulerTicks(), TaskManager->GetLastTaskTicks());
|
||||||
wdgRecWin->SetText(SchedLblHnd, TicksText);
|
wdgRecWin->SetText(SchedLblHnd, TicksText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -458,6 +458,7 @@ namespace Tasking
|
|||||||
}
|
}
|
||||||
CPU::x64::writecr3({.raw = (uint64_t)KernelPageTable}); /* Restore kernel page table for safety reasons. */
|
CPU::x64::writecr3({.raw = (uint64_t)KernelPageTable}); /* Restore kernel page table for safety reasons. */
|
||||||
uint64_t SchedTmpTicks = CPU::Counter();
|
uint64_t SchedTmpTicks = CPU::Counter();
|
||||||
|
this->LastTaskTicks = SchedTmpTicks - this->LastTaskTicks;
|
||||||
CPUData *CurrentCPU = GetCurrentCPU();
|
CPUData *CurrentCPU = GetCurrentCPU();
|
||||||
schedbg("Scheduler called on CPU %d.", CurrentCPU->ID);
|
schedbg("Scheduler called on CPU %d.", CurrentCPU->ID);
|
||||||
schedbg("%d: %ld%%", CurrentCPU->ID, GetUsage(CurrentCPU->ID));
|
schedbg("%d: %ld%%", CurrentCPU->ID, GetUsage(CurrentCPU->ID));
|
||||||
|
@ -230,6 +230,7 @@ namespace Tasking
|
|||||||
PCB *IdleProcess = nullptr;
|
PCB *IdleProcess = nullptr;
|
||||||
TCB *IdleThread = nullptr;
|
TCB *IdleThread = nullptr;
|
||||||
Atomic<uint64_t> SchedulerTicks = 0;
|
Atomic<uint64_t> SchedulerTicks = 0;
|
||||||
|
Atomic<uint64_t> LastTaskTicks = 0;
|
||||||
|
|
||||||
bool InvalidPCB(PCB *pcb);
|
bool InvalidPCB(PCB *pcb);
|
||||||
bool InvalidTCB(TCB *tcb);
|
bool InvalidTCB(TCB *tcb);
|
||||||
@ -263,6 +264,7 @@ namespace Tasking
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
uint64_t GetSchedulerTicks() { return SchedulerTicks.Load(); }
|
uint64_t GetSchedulerTicks() { return SchedulerTicks.Load(); }
|
||||||
|
uint64_t GetLastTaskTicks() { return LastTaskTicks.Load(); }
|
||||||
Vector<PCB *> GetProcessList() { return ListProcess; }
|
Vector<PCB *> GetProcessList() { return ListProcess; }
|
||||||
Security *GetSecurityManager() { return &SecurityManager; }
|
Security *GetSecurityManager() { return &SecurityManager; }
|
||||||
void Panic() { StopScheduler = true; }
|
void Panic() { StopScheduler = true; }
|
||||||
|
@ -86,6 +86,18 @@ public:
|
|||||||
VectorSize--;
|
VectorSize--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__no_instrument_function void remove(const T &Value)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < VectorSize; i++)
|
||||||
|
{
|
||||||
|
if (VectorBuffer[i] == Value)
|
||||||
|
{
|
||||||
|
remove(i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
__no_instrument_function size_t capacity() const { return VectorCapacity; }
|
__no_instrument_function size_t capacity() const { return VectorCapacity; }
|
||||||
|
|
||||||
__no_instrument_function size_t size() const { return VectorSize; }
|
__no_instrument_function size_t size() const { return VectorSize; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user