Changeset b584cd4 in mainline


Ignore:
Timestamp:
2010-06-11T23:56:16Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fd3a631f
Parents:
214ec25c
Message:

Update thread's last_cycle seems to be actually needed to properly account kernel processing time.

Current limitation: The exception handler which executes clock() (and eventually scheduler()) gets charged with all the cycles of the other threads which are being scheduled as a consequence of the preemption.
TODO Examine the "measure2" branch whether it has a solution or look for a solution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/interrupt/interrupt.c

    r214ec25c rb584cd4  
    103103#endif
    104104       
    105         uint64_t begin_cycle = get_cycle();
    106        
    107105        /* Account user cycles */
    108106        if (THREAD) {
    109107                irq_spinlock_lock(&THREAD->lock, false);
    110                 THREAD->ucycles += begin_cycle - THREAD->last_cycle;
     108                thread_update_accounting(true);
    111109                irq_spinlock_unlock(&THREAD->lock, false);
    112110        }
     111       
     112        uint64_t begin_cycle = get_cycle();
    113113       
    114114#ifdef CONFIG_UDEBUG
     
    130130        /* Account exception handling */
    131131        uint64_t end_cycle = get_cycle();
     132       
    132133        exc_table[n].cycles += end_cycle - begin_cycle;
    133134        exc_table[n].count++;
Note: See TracChangeset for help on using the changeset viewer.