Time accounting based on TSC
- as thre are still KERNEL and IDLE entries, time accounting for kernel and idle time works the same as for any other process - everytime we stop accounting for the currently running process, kernel or idle, we read the TSC counter and increment the p_cycles entry. - the process cycles inherently include some of the kernel cycles as we can stop accounting for the process only after we save its context and we start accounting just before we restore its context - this assumes that the system does not scale the CPU frequency which will be true for ... long time ;-)
This commit is contained in:
@@ -152,14 +152,12 @@ PUBLIC int do_getinfo(struct proc * caller, message * m_ptr)
|
||||
break;
|
||||
}
|
||||
case GET_IDLETSC: {
|
||||
#ifdef CONFIG_IDLE_TSC
|
||||
length = sizeof(idle_tsc);
|
||||
src_vir = (vir_bytes) &idle_tsc;
|
||||
struct proc * idl;
|
||||
|
||||
idl = proc_addr(IDLE);
|
||||
length = sizeof(idl->p_cycles);
|
||||
src_vir = (vir_bytes) &idl->p_cycles;
|
||||
break;
|
||||
#else
|
||||
kprintf("do_getinfo: kernel not compiled with CONFIG_IDLE_TSC\n");
|
||||
return(EINVAL);
|
||||
#endif
|
||||
}
|
||||
case GET_AOUTHEADER: {
|
||||
int hdrindex, index = m_ptr->I_VAL_LEN2_E;
|
||||
|
||||
Reference in New Issue
Block a user