Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3427 → Rev 3428

/branches/tracing/kernel/generic/src/udebug/udebug.c
381,20 → 381,20
mutex_lock(&TASK->udebug.lock);
mutex_lock(&THREAD->udebug.lock);
 
printf("udebug_thread_e_event\n");
printf("- check state\n");
// printf("udebug_thread_e_event\n");
// printf("- check state\n");
 
/* Must only generate events when in debugging session */
if (THREAD->udebug.debug_active != true) {
printf("- debug_active: %s, udebug.stop: %s\n",
/* printf("- debug_active: %s, udebug.stop: %s\n",
THREAD->udebug.debug_active ? "yes(+)" : "no(-)",
THREAD->udebug.stop ? "yes(-)" : "no(+)");
THREAD->udebug.stop ? "yes(-)" : "no(+)");*/
mutex_unlock(&THREAD->udebug.lock);
mutex_unlock(&TASK->udebug.lock);
return;
}
 
printf("- trigger event\n");
// printf("- trigger event\n");
 
call = THREAD->udebug.go_call;
THREAD->udebug.go_call = NULL;
/branches/tracing/uspace/app/sctrace/sctrace.c
68,12 → 68,12
 
static proto_t *proto_console;
 
static int task_connect(int taskid)
static int task_connect(task_id_t task_id)
{
int rc;
 
printf("ipc_connect_task(%d)... ", taskid);
rc = ipc_connect_kbox(taskid);
printf("ipc_connect_task(%lld)... ", task_id);
rc = ipc_connect_kbox(task_id);
printf("-> %d\n", rc);
phoneid = rc;
if (rc < 0) return rc;
407,26 → 407,21
fibril_add_ready(fid);
}
 
static void trace_active_task(void)
static void trace_active_task(task_id_t task_id)
{
int taskid;
int i;
int rc;
int c;
 
printf("Syscall Tracer\n");
printf("Press 'c' to connect\n");
while ((i = getchar()) != 'c')
putchar(i);
 
taskid = 13;
rc = task_connect(taskid);
rc = task_connect(task_id);
if (rc < 0) {
printf("Failed to connect to task %d\n", taskid);
printf("Failed to connect to task %lld\n", task_id);
return;
}
 
printf("Connected to task %d\n", taskid);
printf("Connected to task %lld\n", task_id);
 
ipcp_init();
ipcp_connection_set(1, 0, proto_console);
506,9 → 501,9
proto_add_oper(p, CONSOLE_FLUSH, o);
o = oper_new("set_style");
proto_add_oper(p, CONSOLE_SET_STYLE, o);
o = oper_new("cursor_visibility");
proto_add_oper(p, CONSOLE_CURSOR_VISIBILITY, o);
o = oper_new("flush");
proto_add_oper(p, CONSOLE_CURSOR_VISIBILITY, o);
o = oper_new("cursor_visibility");
proto_add_oper(p, CONSOLE_FLUSH, o);
 
proto_console = p;
515,13 → 510,32
proto_register(SERVICE_CONSOLE, p);
}
 
int main(void)
static void print_syntax()
{
main_init();
printf("syntax: sctrace <task_id>\n");
}
 
while (1) {
trace_active_task();
int main(int argc, char *argv[])
{
task_id_t task_id;
char *err_p;
 
if (argc != 2) {
printf("Mising argument\n");
print_syntax();
return 1;
}
 
task_id = strtol(argv[1], &err_p, 10);
 
if (*err_p) {
printf("Task ID syntax error\n");
print_syntax();
return 1;
}
 
main_init();
trace_active_task(task_id);
}
 
/** @}