/branches/tracing/kernel/generic/src/tdebug/systdebug.c |
---|
File deleted |
/branches/tracing/kernel/generic/src/tdebug/tdebug.c |
---|
File deleted |
/branches/tracing/kernel/generic/src/interrupt/interrupt.c |
---|
47,7 → 47,6 |
#include <panic.h> |
#include <print.h> |
#include <symtab.h> |
#include <tdebug/tdebug.h> |
static struct { |
const char *name; |
87,19 → 86,8 |
void exc_dispatch(int n, istate_t *istate) |
{ |
ASSERT(n < IVT_ITEMS); |
if (THREAD && istate_from_uspace(istate)) { |
/* Record userspace state */ |
THREAD->tdebug.uspace_state = istate; |
} |
exc_table[n].f(n + IVT_FIRST, istate); |
if (THREAD && istate_from_uspace(istate)) { |
/* Clear it again (mostly for dev. and debugging purposes) */ |
THREAD->tdebug.uspace_state = NULL; |
} |
/* This is a safe place to exit exiting thread */ |
if (THREAD && THREAD->interrupted && istate_from_uspace(istate)) |
thread_exit(); |
/branches/tracing/kernel/generic/src/proc/task.c |
---|
57,7 → 57,6 |
#include <errno.h> |
#include <func.h> |
#include <syscall/copy.h> |
#include <tdebug/tdebug.h> |
#ifndef LOADED_PROG_STACK_PAGES_NO |
#define LOADED_PROG_STACK_PAGES_NO 1 |
171,10 → 170,7 |
ta->capabilities = 0; |
ta->cycles = 0; |
/* init tdebug related stuff */ |
tdebug_task_init(ta); |
ipc_answerbox_init(&ta->answerbox); |
for (i = 0; i < IPC_MAX_PHONES; i++) |
ipc_phone_init(&ta->phones[i]); |
/branches/tracing/kernel/generic/src/proc/thread.c |
---|
68,7 → 68,6 |
#include <syscall/copy.h> |
#include <errno.h> |
#include <console/klog.h> |
#include <tdebug/tdebug.h> |
/** Thread states */ |
342,14 → 341,10 |
avltree_node_initialize(&t->threads_tree_node); |
t->threads_tree_node.key = (uintptr_t) t; |
// t->threads_tree_node.key = (avltree_key_t) t->tid; |
/* might depend on previous initialization */ |
thread_create_arch(t); |
thread_create_arch(t); |
/* init tdebug stuff */ |
tdebug_thread_init(t); |
if (!(flags & THREAD_FLAG_NOATTACH)) |
thread_attach(t, task); |
447,7 → 442,6 |
if (THREAD->flags & THREAD_FLAG_USPACE) { |
ipc_cleanup(); |
futex_cleanup(); |
tdebug_cleanup(); |
klog_printf("Cleanup of task %llu completed.", |
TASK->taskid); |
} |
755,56 → 749,6 |
return 0; |
} |
struct fbiw { |
thread_id_t tid; |
thread_t *t; |
}; |
static bool find_by_id_walker(avltree_node_t *node, void *arg) |
{ |
thread_t *t = avltree_get_instance(node, thread_t, threads_tree_node); |
struct fbiw *s = (struct fbiw *)arg; |
if (t->tid == s->tid) { |
/* found it! */ |
s->t = t; |
return false; |
} |
return true; /* continue */ |
} |
/** Find thread structure corresponding to thread ID. |
* |
* The threads_lock must be already held by the caller of this function |
* and interrupts must be disabled. |
* |
* @param id Thread ID. |
* |
* @return Thread structure address or NULL if there is no such thread ID. |
*/ |
thread_t *thread_find_by_id(thread_id_t id) |
{ |
struct fbiw s; |
s.t = NULL; |
s.tid = id; |
avltree_walk(&threads_tree, find_by_id_walker, &s); |
return s.t; |
/* |
// ANO, takhle krasne by to fungovalo, kdyby threads_tree |
// nepouzival jako klic pointer na vlakno misto tid |
avltree_node_t *node; |
node = avltree_search(&threads_tree, (avltree_key_t) id); |
if (node) |
return avltree_get_instance(node, thread_t, threads_tree_node); |
return NULL;*/ |
} |
/** Syscall for getting TID. |
* |
* @param uspace_thread_id Userspace address of 8-byte buffer where to store |
/branches/tracing/kernel/generic/src/syscall/syscall.c |
---|
44,8 → 44,6 |
#include <errno.h> |
#include <arch.h> |
#include <debug.h> |
#include <tdebug/tdebug.h> |
#include <tdebug/systdebug.h> |
#include <ipc/sysipc.h> |
#include <synch/futex.h> |
#include <ddi/ddi.h> |
107,15 → 105,7 |
task_kill(TASK->taskid); |
thread_exit(); |
} |
if (tdebug_have_monitor()) { |
/* generate a syscall debug event */ |
tdebug_syscall_event(a1, a2, a3, a4, a5, a6, id, rc); |
/* a good place to stop */ |
tdebug_stopping_point(); |
} |
if (THREAD->interrupted) |
thread_exit(); |
168,16 → 158,7 |
(syshandler_t) sys_sysinfo_value, |
/* Debug calls */ |
(syshandler_t) sys_debug_enable_console, |
/* Task debugging calls */ |
(syshandler_t) sys_tdebug_attach_task, |
(syshandler_t) sys_tdebug_detach_task, |
(syshandler_t) sys_tdebug_continue_thread, |
(syshandler_t) sys_tdebug_get_syscall_args, |
(syshandler_t) sys_tdebug_set_event_mask, |
(syshandler_t) sys_tdebug_stop_thread, |
(syshandler_t) sys_tdebug_stop_task |
(syshandler_t) sys_debug_enable_console |
}; |
/** @} |