Subversion Repositories HelenOS

Rev

Rev 2854 | Rev 2867 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2854 Rev 2862
Line 9... Line 9...
9
#include <syscall.h>
9
#include <syscall.h>
10
#include <ipc/ipc.h>
10
#include <ipc/ipc.h>
11
#include <fibril.h>
11
#include <fibril.h>
12
#include <errno.h>
12
#include <errno.h>
13
#include <udebug.h>
13
#include <udebug.h>
-
 
14
#include <async.h>
14
 
15
 
15
#include "syscalls.h"
16
#include "syscalls.h"
16
#include "errors.h"
17
#include "errors.h"
17
#include "debug_api.h"
18
#include "debug_api.h"
18
 
19
 
Line 21... Line 22...
21
unsigned n_threads;
22
unsigned n_threads;
22
 
23
 
23
int phoneid;
24
int phoneid;
24
int abort_trace;
25
int abort_trace;
25
 
26
 
26
volatile int print_cs;
-
 
27
 
-
 
28
void fcs_begin(volatile int *csvar)
-
 
29
{
-
 
30
    while (*csvar != 0) {
-
 
31
        fibril_yield();
-
 
32
        printf(" \b");
-
 
33
    }
-
 
34
 
-
 
35
    *csvar = 1;
-
 
36
}
-
 
37
 
-
 
38
void fcs_end(volatile int *csvar)
-
 
39
{
-
 
40
    *csvar = 0;
-
 
41
}
-
 
42
 
-
 
43
int task_connect(int taskid)
27
int task_connect(int taskid)
44
{
28
{
45
    int rc;
29
    int rc;
46
 
30
 
47
    printf("ipc_connect_task(%d)...\n", taskid);
31
    printf("ipc_connect_task(%d)...\n", taskid);
Line 167... Line 151...
167
        if (rc >= 0) {
151
        if (rc >= 0) {
168
            rc = debug_args_read(phoneid, threadid_buf[thread_idx],
152
            rc = debug_args_read(phoneid, threadid_buf[thread_idx],
169
                sc_args);
153
                sc_args);
170
        }
154
        }
171
 
155
 
172
//      printf("[%d]:begin\n", thread_idx);
-
 
173
        fcs_begin(&print_cs);
156
        async_serialize_start();
174
//      printf("[%d]:inside\n", thread_idx);
-
 
175
 
157
 
176
        printf("[%d] ", thread_idx);
158
        printf("[%d] ", thread_idx);
177
 
159
 
178
        /* Print syscall name, id and arguments */
160
        /* Print syscall name, id and arguments */
179
        if (rc >= 0) {
161
        if (rc >= 0) {
Line 181... Line 163...
181
            print_sc_args(sc_args, syscall_desc[sc_id].n_args);
163
            print_sc_args(sc_args, syscall_desc[sc_id].n_args);
182
            rv_type = syscall_desc[sc_id].rv_type;
164
            rv_type = syscall_desc[sc_id].rv_type;
183
            print_sc_retval(sc_rc, rv_type);
165
            print_sc_retval(sc_rc, rv_type);
184
        }
166
        }
185
 
167
 
186
//      printf("[%d]:end\n", thread_idx);
-
 
187
        fcs_end(&print_cs);
168
        async_serialize_end();
188
 
169
 
189
        switch (sc_id) {
170
        switch (sc_id) {
190
        case SYS_IPC_CALL_ASYNC_SLOW:
171
        case SYS_IPC_CALL_ASYNC_SLOW:
191
            sc_ipc_call_async_slow(sc_args);
172
            sc_ipc_call_async_slow(sc_args);
192
            break;
173
            break;
Line 247... Line 228...
247
    return;
228
    return;
248
}
229
}
249
 
230
 
250
int main(void)
231
int main(void)
251
{
232
{
252
    print_cs = 0;
-
 
253
 
-
 
254
    while (1) {
233
    while (1) {
255
        trace_active_task();
234
        trace_active_task();
256
    }
235
    }
257
}
236
}
258
 
237