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


Ignore:
Timestamp:
2011-01-27T16:36:35Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5b7a107
Parents:
0843f02
Message:
  • add support for printing uspace stack traces from kernel console (as a last resort debugging means)
  • change the semantics of waitq_interrupt_sleep() (require threads_lock to be held even before it is called)
  • minor cstyle
File:
1 edited

Legend:

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

    r0843f02 rdf58e44  
    6262#include <print.h>
    6363#include <debug.h>
     64#include <stacktrace.h>
    6465
    6566static void scheduler_separated_stack(void);
     
    7778 * Perform actions that need to be
    7879 * taken before the newly selected
    79  * tread is passed control.
     80 * thread is passed control.
    8081 *
    8182 * THREAD->lock is locked on entry
     
    8788       
    8889#ifdef CONFIG_FPU_LAZY
    89         if(THREAD == CPU->fpu_owner)
     90        if (THREAD == CPU->fpu_owner)
    9091                fpu_enable();
    9192        else
     
    100101        }
    101102#endif
     103       
     104        if (THREAD->btrace) {
     105                istate_t *istate = THREAD->udebug.uspace_state;
     106                if (istate != NULL) {
     107                        printf("Thread %" PRIu64 " stack trace:\n", THREAD->tid);
     108                        stack_trace_istate(istate);
     109                }
     110               
     111                THREAD->btrace = false;
     112        }
    102113}
    103114
     
    645656                                /*
    646657                                 * Ready thread on local CPU
    647                                  *
    648658                                 */
    649659                               
Note: See TracChangeset for help on using the changeset viewer.