feat: graphing in MTK toolkit, kernel exposes CPU time, Processes app Performance tab

This commit is contained in:
2026-05-02 15:26:59 +02:00
parent e98071e97e
commit 3919d166f7
12 changed files with 553 additions and 11 deletions
+1
View File
@@ -107,6 +107,7 @@ namespace Montauk {
buf[count].name[j] = '\0';
}
buf[count].heapUsed = Sched::g_allocatedPages[i] * 0x1000;
buf[count].cpuTimeMs = proc->cpuTimeMs;
count++;
}
return count;
+1
View File
@@ -407,6 +407,7 @@ namespace Montauk {
uint8_t _pad[3];
char name[64];
uint64_t heapUsed; // heapNext - UserHeapBase (bytes)
uint64_t cpuTimeMs; // accumulated scheduler runtime
};
// Bluetooth scan result (returned by SYS_BTSCAN)
+4
View File
@@ -163,6 +163,7 @@ namespace Sched {
processTable[i].stackBase = 0;
processTable[i].entryPoint = 0;
processTable[i].sliceRemaining = 0;
processTable[i].cpuTimeMs = 0;
processTable[i].pml4Phys = 0;
processTable[i].kernelStackTop = 0;
processTable[i].userStackTop = 0;
@@ -353,6 +354,7 @@ namespace Sched {
proc.stackBase = (uint64_t)kernelStackBase;
proc.entryPoint = entry;
proc.sliceRemaining = TimeSliceMs;
proc.cpuTimeMs = 0;
proc.pml4Phys = pml4Phys;
proc.kernelStackTop = kernelStackTop;
proc.userStackTop = UserStackTop - 8;
@@ -638,6 +640,8 @@ namespace Sched {
return;
}
processTable[slot].cpuTimeMs += elapsedMs;
// Check if another CPU requested this process be killed.
// We are on the CPU running it, so ExitProcess is safe here.
if (processTable[slot].killPending) {
+1
View File
@@ -42,6 +42,7 @@ namespace Sched {
uint64_t stackBase; // Bottom of allocated kernel stack (lowest address)
uint64_t entryPoint;
uint64_t sliceRemaining; // Milliseconds left in current time slice
uint64_t cpuTimeMs; // Accumulated scheduler runtime in milliseconds
uint64_t pml4Phys; // Physical address of per-process PML4
uint64_t kernelStackTop; // Top of kernel stack (for TSS RSP0 / SYSCALL)
uint64_t userStackTop; // User-space stack top