Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4654 → Rev 4653

/trunk/uspace/app/trace/trace.c
46,7 → 46,6
#include <loader/loader.h>
#include <io/console.h>
#include <io/keycode.h>
#include <fibril_sync.h>
 
#include <libc.h>
 
72,8 → 71,6
 
uintptr_t thash;
volatile int paused;
fibril_condvar_t paused_cv;
fibril_mutex_t paused_lock;
 
void thread_trace_start(uintptr_t thread_hash);
 
456,17 → 453,13
 
while (!abort_trace) {
 
fibril_mutex_lock(&paused_lock);
if (paused) {
printf("Thread [%d] paused. Press R to resume.\n",
thread_id);
 
while (paused)
fibril_condvar_wait(&paused_cv, &paused_lock);
 
printf("Thread [%d] resumed.\n", thread_id);
printf("Press R to resume.\n");
while (paused) {
async_usleep(1000000);
}
printf("Resumed\n");
}
fibril_mutex_unlock(&paused_lock);
 
/* Run thread until an event occurs */
rc = udebug_go(phoneid, thread_hash,
488,9 → 481,6
break;
case UDEBUG_EVENT_STOP:
printf("Stop event\n");
fibril_mutex_lock(&paused_lock);
paused = 1;
fibril_mutex_unlock(&paused_lock);
break;
case UDEBUG_EVENT_THREAD_B:
event_thread_b(val0);
608,14 → 598,13
case KC_P:
printf("Pause...\n");
rc = udebug_stop(phoneid, thash);
if (rc != EOK)
printf("Error: stop -> %d\n", rc);
if (rc == EOK)
paused = 1;
else
printf("stop -> %d\n", rc);
break;
case KC_R:
fibril_mutex_lock(&paused_lock);
paused = 0;
fibril_condvar_broadcast(&paused_cv);
fibril_mutex_unlock(&paused_lock);
printf("Resume...\n");
break;
}
655,8 → 644,6
 
next_thread_id = 1;
paused = 0;
fibril_mutex_initialize(&paused_lock);
fibril_condvar_initialize(&paused_cv);
 
proto_init();