Changeset 0313ff0 in mainline for kernel/generic/src/proc/thread.c


Ignore:
Timestamp:
2006-12-14T12:35:57Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
def5207
Parents:
cd896e2
Message:

accumulate task accounting, run tests as separate kernel task

File:
1 edited

Legend:

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

    rcd896e2 r0313ff0  
    114114        THREAD->last_cycle = get_cycle();
    115115
    116         /* this is where each thread wakes up after its creation */
     116        /* This is where each thread wakes up after its creation */
    117117        spinlock_unlock(&THREAD->lock);
    118118        interrupts_enable();
    119119
    120120        f(arg);
     121       
     122        /* Accumulate accounting to the task */
     123        ipl_t ipl = interrupts_disable();
     124       
     125        spinlock_lock(&THREAD->lock);
     126        thread_update_accounting();
     127        uint64_t cycles = THREAD->cycles;
     128        THREAD->cycles = 0;
     129        spinlock_unlock(&THREAD->lock);
     130       
     131        spinlock_lock(&TASK->lock);
     132        TASK->cycles += cycles;
     133        spinlock_unlock(&TASK->lock);
     134       
     135        interrupts_restore(ipl);
     136       
    121137        thread_exit();
    122138        /* not reached */
     
    534550        spinlock_lock(&threads_lock);
    535551       
    536         printf("tid    name       address    state    task       ctx code       stack      cycles     cpu  kst        wq\n");
     552        printf("tid    name       address    state    task       ctx code       stack      cycles     cpu  kstack     waitqueue\n");
    537553        printf("------ ---------- ---------- -------- ---------- --- ---------- ---------- ---------- ---- ---------- ----------\n");
    538554
     
    604620 * interrupts must be already disabled.
    605621 *
    606  * @param t Pointer to thread.
    607  *
    608622 */
    609623void thread_update_accounting(void)
Note: See TracChangeset for help on using the changeset viewer.