/branches/tracing/kernel/generic/src/proc/thread.c |
---|
422,11 → 422,25 |
atomic_inc(&task->refcount); |
atomic_inc(&task->lifecount); |
list_append(&t->th_link, &task->th_head); |
/* |
* Copy task debugging state to thread struct. |
* The thread needs to know it is being debugged, |
* otherwise it would neither stop nor respond to |
* debug ops. |
*/ |
if (t->flags & THREAD_FLAG_USPACE) { |
if (task->dt_state == UDEBUG_TS_BEGINNING || |
task->dt_state == UDEBUG_TS_ACTIVE) { |
t->debug_active = true; |
} |
} |
/* FIXME: this must be done very carefully.. an unstoppable |
thread cannot appear just-so, it must be possible to catch it. */ |
if (t->flags & THREAD_FLAG_USPACE) |
++task->not_stoppable_count; |
list_append(&t->th_link, &task->th_head); |
} |
/** Add thread to the threads tree. |
/branches/tracing/kernel/generic/src/udebug/udebug.c |
---|
79,7 → 79,9 |
ipl = interrupts_disable(); |
spinlock_lock(&THREAD->debug_lock); |
if (THREAD->debug_active == true) { |
/* Must only generate events when in debugging session and have go */ |
if (THREAD->debug_active == true && |
THREAD->debug_stop == false) { |
klog_printf("udebug_syscall_event"); |
call = THREAD->debug_go_call; |
IPC_SET_RETVAL(call->data, 0); |
/branches/tracing/uspace/app/sctrace/sctrace.c |
---|
23,6 → 23,23 |
int phoneid; |
int abort_trace; |
volatile int print_cs; |
void fcs_begin(volatile int *csvar) |
{ |
while (*csvar != 0) { |
fibril_yield(); |
printf(" \b"); |
} |
*csvar = 1; |
} |
void fcs_end(volatile int *csvar) |
{ |
*csvar = 0; |
} |
int task_connect(int taskid) |
{ |
int rc; |
152,6 → 169,10 |
sc_args); |
} |
// printf("[%d]:begin\n", thread_idx); |
fcs_begin(&print_cs); |
// printf("[%d]:inside\n", thread_idx); |
printf("[%d] ", thread_idx); |
/* Print syscall name, id and arguments */ |
162,6 → 183,9 |
print_sc_retval(sc_rc, rv_type); |
} |
// printf("[%d]:end\n", thread_idx); |
fcs_end(&print_cs); |
switch (sc_id) { |
case SYS_IPC_CALL_ASYNC_SLOW: |
sc_ipc_call_async_slow(sc_args); |
225,6 → 249,8 |
int main(void) |
{ |
print_cs = 0; |
while (1) { |
trace_active_task(); |
} |
/branches/tracing/uspace/app/tester/debug/debug1.c |
---|
22,7 → 22,7 |
printf("running debug1 test\n"); |
rc = thread_create(t_proc, NULL, "test", &tid); |
printf("(active) wait for thread 'test'\n"); |
//printf("(active) wait for thread 'test'\n"); |
while (!done) { |
usleep(5000000); |
printf("."); |