Changeset 741fd16 in mainline


Ignore:
Timestamp:
2008-11-21T22:14:24Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
32e6c9c
Parents:
384c488
Message:

Stoppability sections must be much smaller (design error). Also fix deadlock in udebug_stop(). Fix pause functionality in tracer.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/sysipc.c

    r384c488 r741fd16  
    456456
    457457        if (!(res = request_preprocess(&call, phone))) {
     458#ifdef CONFIG_UDEBUG
     459                udebug_stoppable_begin();
     460#endif
    458461                rc = ipc_call_sync(phone, &call);
     462#ifdef CONFIG_UDEBUG
     463                udebug_stoppable_end();
     464#endif
    459465                if (rc != EOK)
    460466                        return rc;
    461467                process_answer(&call);
     468
    462469        } else {
    463470                IPC_SET_RETVAL(call.data, res);
     
    496503
    497504        if (!(res = request_preprocess(&call, phone))) {
     505#ifdef CONFIG_UDEBUG
     506                udebug_stoppable_begin();
     507#endif
    498508                rc = ipc_call_sync(phone, &call);
     509#ifdef CONFIG_UDEBUG
     510                udebug_stoppable_end();
     511#endif
    499512                if (rc != EOK)
    500513                        return rc;
     
    799812        call_t *call;
    800813
    801 restart:       
     814restart:
     815
     816#ifdef CONFIG_UDEBUG
     817        udebug_stoppable_begin();
     818#endif 
    802819        call = ipc_wait_for_call(&TASK->answerbox, usec,
    803820            flags | SYNCH_FLAGS_INTERRUPTIBLE);
     821
     822#ifdef CONFIG_UDEBUG
     823        udebug_stoppable_end();
     824#endif
    804825        if (!call)
    805826                return 0;
  • kernel/generic/src/synch/futex.c

    r384c488 r741fd16  
    116116        pte_t *t;
    117117        ipl_t ipl;
     118        int rc;
    118119       
    119120        ipl = interrupts_disable();
     
    135136
    136137        futex = futex_find(paddr);
    137        
    138         return (unative_t) waitq_sleep_timeout(&futex->wq, usec, flags |
     138
     139#ifdef CONFIG_UDEBUG
     140        udebug_stoppable_begin();
     141#endif
     142        rc = waitq_sleep_timeout(&futex->wq, usec, flags |
    139143            SYNCH_FLAGS_INTERRUPTIBLE);
     144
     145#ifdef CONFIG_UDEBUG
     146        udebug_stoppable_end();
     147#endif
     148        return (unative_t) rc;
    140149}
    141150
  • kernel/generic/src/syscall/syscall.c

    r384c488 r741fd16  
    106106        udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, 0, false);
    107107#endif
    108 
    109108        if (id < SYSCALL_END) {
    110 #ifdef CONFIG_UDEBUG
    111                 udebug_stoppable_begin();
    112 #endif
    113109                rc = syscall_table[id](a1, a2, a3, a4, a5, a6);
    114110        } else {
     
    123119#ifdef CONFIG_UDEBUG
    124120        udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, rc, true);
    125         udebug_stoppable_end();
    126 #endif
    127        
     121#endif 
    128122        return rc;
    129123}
  • kernel/generic/src/udebug/udebug_ops.c

    r384c488 r741fd16  
    318318
    319319        LOG("udebug_stop()\n");
    320         mutex_lock(&TASK->udebug.lock);
    321320
    322321        /*
     
    355354        _thread_op_end(t);
    356355
     356        mutex_lock(&TASK->udebug.lock);
    357357        ipc_answer(&TASK->answerbox, call);
    358358        mutex_unlock(&TASK->udebug.lock);
  • uspace/app/trace/trace.c

    r384c488 r741fd16  
    450450        while (!abort_trace) {
    451451
     452                if (paused) {
     453                        printf("Waiting for resume\n");
     454                        while (paused) {
     455                                usleep(1000000);
     456                                fibril_yield();
     457                                printf(".");
     458                        }
     459                        printf("Resumed\n");
     460                }
     461
    452462                /* Run thread until an event occurs */
    453463                rc = udebug_go(phoneid, thread_hash,
     
    470480                        case UDEBUG_EVENT_STOP:
    471481                                printf("Stop event\n");
    472                                 printf("Waiting for resume\n");
    473                                 while (paused) {
    474                                         usleep(1000000);
    475                                         fibril_yield();
    476                                         printf(".");
    477                                 }
    478                                 printf("Resumed\n");
    479482                                break;
    480483                        case UDEBUG_EVENT_THREAD_B:
     
    581584                if (c == 'q') break;
    582585                if (c == 'p') {
     586                        printf("Pause...\n");
    583587                        paused = 1;
    584588                        rc = udebug_stop(phoneid, thash);
     
    587591                if (c == 'r') {
    588592                        paused = 0;
     593                        printf("Resume...\n");
    589594                }
    590595        }
Note: See TracChangeset for help on using the changeset viewer.