/branches/tracing/uspace/app/sctrace/debug_api.c |
---|
79,5 → 79,12 |
tid, (sysarg_t)ev_type, (sysarg_t)sc_id, (sysarg_t)sc_rc); |
} |
int debug_stop(unsigned phoneid, unsigned tid) |
{ |
return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_STOP, |
tid); |
} |
/** @} |
*/ |
/branches/tracing/uspace/app/sctrace/debug_api.h |
---|
43,6 → 43,7 |
int debug_args_read(unsigned phoneid, unsigned tid, unsigned *buffer); |
int debug_go(unsigned phoneid, unsigned tid, unsigned *ev_type, |
unsigned *sc_id, unsigned *sc_rc); |
int debug_stop(unsigned phoneid, unsigned tid); |
#endif |
/branches/tracing/uspace/app/sctrace/sctrace.c |
---|
62,6 → 62,9 |
int phoneid; |
int abort_trace; |
unsigned thash; |
volatile int paused; |
void thread_trace_start(unsigned thread_hash); |
static proto_t *proto_console; |
334,6 → 337,16 |
case UDEBUG_EVENT_SYSCALL: |
event_syscall(thread_id, thread_hash, val0, (int)val1); |
break; |
case UDEBUG_EVENT_STOP: |
printf("stop event\n"); |
printf("waiting for resume\n"); |
while (paused) { |
usleep(1000000); |
fibril_yield(); |
printf("."); |
} |
printf("resumed\n"); |
break; |
case UDEBUG_EVENT_NEW_THREAD: |
event_new_thread(val0); |
break; |
352,6 → 365,8 |
{ |
fid_t fid; |
thash = thread_hash; |
fid = fibril_create(trace_loop, (void *)thread_hash); |
if (fid == 0) { |
printf("Warning: Failed creating fibril\n"); |
364,6 → 379,7 |
int taskid; |
int i; |
int rc; |
int c; |
printf("Syscall Tracer\n"); |
printf("Press 'c' to connect\n"); |
394,7 → 410,18 |
thread_trace_start(thread_hash_buf[i]); |
} |
getchar(); |
while(1) { |
c = getchar(); |
if (c == 'q') break; |
if (c == 'p') { |
paused = 1; |
rc = debug_stop(phoneid, thash); |
printf("stop -> %d\n", rc); |
} |
if (c == 'r') { |
paused = 0; |
} |
} |
printf("terminate debugging session...\n"); |
abort_trace = 1; |
413,6 → 440,7 |
oper_t *o; |
next_thread_id = 1; |
paused = 0; |
proto_init(); |
/branches/tracing/uspace/app/tester/debug/debug1.c |
---|
43,26 → 43,33 |
#include <vfs/vfs.h> |
#include <errno.h> |
static ipc_call_t call; |
char * test_debug1(bool quiet) |
{ |
int rc; |
thread_id_t tid; |
// ipc_call_t call; |
done = 0; |
getchar(); |
if (mount("tmpfs", "/", "nulldev0") != EOK) |
return "mount() failed.\n"; |
getchar(); |
/* while(1) { |
printf("."); |
ipc_wait_for_call(&call); |
}*/ |
// getchar(); |
// if (mount("tmpfs", "/", "nulldev0") != EOK) |
// return "mount() failed.\n"; |
// getchar(); |
// printf("running debug1 test\n"); |
// rc = thread_create(t_proc, NULL, "test", &tid); |
//printf("(active) wait for thread 'test'\n"); |
// while (!done) { |
// usleep(20000000); |
// printf("."); |
// } |
while (!done) { |
usleep(1*1000*1000); |
printf("."); |
} |
// printf("done\n"); |
return NULL; |