Changeset cce6acf in mainline for kernel/generic/src/proc/scheduler.c


Ignore:
Timestamp:
2006-12-13T12:10:23Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e9db6f9e
Parents:
7e13972
Message:

thread CPU cycles accounting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/scheduler.c

    r7e13972 rcce6acf  
    4848#include <arch/asm.h>
    4949#include <arch/faddr.h>
     50#include <arch/cycle.h>
    5051#include <atomic.h>
    5152#include <synch/spinlock.h>
     
    309310        if (THREAD) {
    310311                spinlock_lock(&THREAD->lock);
     312               
     313                /* Update thread accounting */
     314                THREAD->cycles += get_cycle() - THREAD->last_cycle;
     315               
    311316#ifndef CONFIG_FPU_LAZY
    312317                fpu_context_save(THREAD->saved_fpu_context);
     
    316321                         * This is the place where threads leave scheduler();
    317322                         */
     323                       
     324                        /* Save current CPU cycle */
     325                        THREAD->last_cycle = get_cycle();
     326                       
    318327                        spinlock_unlock(&THREAD->lock);
    319328                        interrupts_restore(THREAD->saved_context.ipl);
Note: See TracChangeset for help on using the changeset viewer.