Changeset c8404d4 in mainline
- Timestamp:
- 2009-07-22T18:31:10Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a5facfb
- Parents:
- 9ad5b5cc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/trace.c
r9ad5b5cc rc8404d4 69 69 int next_thread_id; 70 70 71 ipc_call_t thread_ipc_req[THBUF_SIZE]; 72 71 73 int phoneid; 72 74 bool abort_trace; … … 340 342 } 341 343 342 static void sc_ipc_call_sync_slow (sysarg_t *sc_args)344 static void sc_ipc_call_sync_slow_b(unsigned thread_id, sysarg_t *sc_args) 343 345 { 344 346 ipc_call_t question, reply; … … 347 349 memset(&question, 0, sizeof(question)); 348 350 rc = udebug_mem_read(phoneid, &question.args, sc_args[1], sizeof(question.args)); 349 printf("dmr->%d\n", rc); 350 if (rc < 0) return; 351 if (rc < 0) { 352 printf("Error: mem_read->%d\n", rc); 353 return; 354 } 355 356 thread_ipc_req[thread_id] = question; 357 } 358 359 static void sc_ipc_call_sync_slow_e(unsigned thread_id, sysarg_t *sc_args) 360 { 361 ipc_call_t question, reply; 362 int rc; 351 363 352 364 memset(&reply, 0, sizeof(reply)); 353 365 rc = udebug_mem_read(phoneid, &reply.args, sc_args[2], sizeof(reply.args)); 354 printf("dmr->%d\n", rc); 355 if (rc < 0) return; 356 357 ipcp_call_sync(sc_args[0], &question, &reply); 366 if (rc < 0) { 367 printf("Error: mem_read->%d\n", rc); 368 return; 369 } 370 371 ipcp_call_sync(sc_args[0], &thread_ipc_req[thread_id], &reply); 358 372 } 359 373 … … 400 414 } 401 415 416 switch (sc_id) { 417 case SYS_IPC_CALL_SYNC_SLOW: 418 sc_ipc_call_sync_slow_b(thread_id, sc_args); 419 break; 420 default: 421 break; 422 } 423 402 424 async_serialize_end(); 403 425 } … … 440 462 break; 441 463 case SYS_IPC_CALL_SYNC_SLOW: 442 sc_ipc_call_sync_slow (sc_args);464 sc_ipc_call_sync_slow_e(thread_id, sc_args); 443 465 break; 444 466 case SYS_IPC_WAIT: … … 471 493 thread_hash = (uintptr_t)thread_hash_arg; 472 494 thread_id = next_thread_id++; 495 if (thread_id >= THBUF_SIZE) { 496 printf("Too many threads.\n"); 497 return ELIMIT; 498 } 473 499 474 500 printf("Start tracing thread [%d] (hash 0x%lx).\n", thread_id, thread_hash);
Note:
See TracChangeset
for help on using the changeset viewer.