MCPcopy Create free account
hub / github.com/HelenOS/helenos / thread_update_accounting

Function thread_update_accounting

kernel/generic/src/proc/thread.c:833–846  ·  view source on GitHub ↗

Update accounting of current thread. * * Note that thread_lock on THREAD must be already held and * interrupts must be already disabled. * * @param user True to update user accounting, false for kernel. * */

Source from the content-addressed store, hash-verified

831 *
832 */
833void thread_update_accounting(bool user)
834{
835 uint64_t time = get_cycle();
836
837 assert(interrupts_disabled());
838 assert(irq_spinlock_locked(&THREAD->lock));
839
840 if (user)
841 THREAD->ucycles += time - THREAD->last_cycle;
842 else
843 THREAD->kcycles += time - THREAD->last_cycle;
844
845 THREAD->last_cycle = time;
846}
847
848/** Find thread structure corresponding to thread ID.
849 *

Callers 4

task_get_accountingFunction · 0.85
cushionFunction · 0.85
syscall_handlerFunction · 0.85
exc_dispatchFunction · 0.85

Calls 3

irq_spinlock_lockedFunction · 0.85
get_cycleFunction · 0.50
interrupts_disabledFunction · 0.50

Tested by

no test coverage detected