Changeset 654a30a in mainline
- Timestamp:
- 2009-07-21T19:50:40Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8e1dc00
- Parents:
- 9d8a1ed
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/trace.c
r9d8a1ed r654a30a 47 47 #include <io/console.h> 48 48 #include <io/keycode.h> 49 #include <fibril_sync.h> 49 50 50 51 #include <libc.h> … … 72 73 uintptr_t thash; 73 74 volatile int paused; 75 fibril_condvar_t paused_cv; 76 fibril_mutex_t paused_lock; 74 77 75 78 void thread_trace_start(uintptr_t thread_hash); … … 454 457 while (!abort_trace) { 455 458 459 fibril_mutex_lock(&paused_lock); 456 460 if (paused) { 457 printf("Press R to resume.\n"); 458 while (paused) { 459 async_usleep(1000000); 460 } 461 printf("Resumed\n"); 461 printf("Thread [%d] paused. Press R to resume.\n", 462 thread_id); 463 464 while (paused) 465 fibril_condvar_wait(&paused_cv, &paused_lock); 466 467 printf("Thread [%d] resumed.\n", thread_id); 462 468 } 469 fibril_mutex_unlock(&paused_lock); 463 470 464 471 /* Run thread until an event occurs */ … … 482 489 case UDEBUG_EVENT_STOP: 483 490 printf("Stop event\n"); 491 fibril_mutex_lock(&paused_lock); 492 paused = 1; 493 fibril_mutex_unlock(&paused_lock); 484 494 break; 485 495 case UDEBUG_EVENT_THREAD_B: … … 599 609 printf("Pause...\n"); 600 610 rc = udebug_stop(phoneid, thash); 601 if (rc == EOK) 602 paused = 1; 603 else 604 printf("stop -> %d\n", rc); 611 if (rc != EOK) 612 printf("Error: stop -> %d\n", rc); 605 613 break; 606 614 case KC_R: 615 fibril_mutex_lock(&paused_lock); 607 616 paused = 0; 617 fibril_condvar_broadcast(&paused_cv); 618 fibril_mutex_unlock(&paused_lock); 608 619 printf("Resume...\n"); 609 620 break; … … 645 656 next_thread_id = 1; 646 657 paused = 0; 658 fibril_mutex_initialize(&paused_lock); 659 fibril_condvar_initialize(&paused_cv); 647 660 648 661 proto_init();
Note:
See TracChangeset
for help on using the changeset viewer.