Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2871 → Rev 2872

/branches/tracing/uspace/app/sctrace/sctrace.c
112,10 → 112,13
putchar(')');
}
 
void sc_ipc_call_async_fast(unsigned *sc_args)
void sc_ipc_call_async_fast(unsigned *sc_args, int sc_rc)
{
ipc_call_t call;
int phoneid;
if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY)
return;
 
phoneid = sc_args[0];
 
126,22 → 129,71
IPC_SET_ARG4(call, sc_args[5]);
IPC_SET_ARG5(call, 0);
 
ipc_parse_call_out(phoneid, &call);
ipc_parse_call_out(phoneid, &call, sc_rc);
}
 
void sc_ipc_call_async_slow(unsigned *sc_args)
void sc_ipc_call_async_slow(unsigned *sc_args, int sc_rc)
{
ipc_call_t call;
int rc;
 
if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY)
return;
 
memset(&call, 0, sizeof(call));
rc = debug_mem_read(phoneid, &call.args, sc_args[1], sizeof(call.args));
 
if (rc >= 0) {
ipc_parse_call_out(sc_args[0], &call);
ipc_parse_call_out(sc_args[0], &call, sc_rc);
}
}
 
void sc_ipc_call_sync_fast(unsigned *sc_args)
{
ipc_call_t question, reply;
int rc;
int phoneidx;
 
printf("sc_ipc_call_sync_fast()\n");
phoneidx = sc_args[0];
 
IPC_SET_METHOD(question, sc_args[1]);
IPC_SET_ARG1(question, sc_args[2]);
IPC_SET_ARG2(question, sc_args[3]);
IPC_SET_ARG3(question, sc_args[4]);
IPC_SET_ARG4(question, 0);
IPC_SET_ARG5(question, 0);
 
printf("memset\n");
memset(&reply, 0, sizeof(reply));
printf("debug_mem_read(phone=%d, buffer_ptr=%u, src_addr=%d, n=%d\n",
phoneid, &reply.args, sc_args[5], sizeof(reply.args));
rc = debug_mem_read(phoneid, &reply.args, sc_args[5], sizeof(reply.args));
printf("dmr->%d\n", rc);
if (rc < 0) return;
 
printf("call ipc_parse_call_sync\n");
ipc_parse_call_sync(phoneidx, &question, &reply);
}
 
void sc_ipc_call_sync_slow(unsigned *sc_args)
{
ipc_call_t question, reply;
int rc;
 
memset(&question, 0, sizeof(question));
rc = debug_mem_read(phoneid, &question.args, sc_args[1], sizeof(question.args));
printf("dmr->%d\n", rc);
if (rc < 0) return;
 
memset(&reply, 0, sizeof(reply));
rc = debug_mem_read(phoneid, &reply.args, sc_args[2], sizeof(reply.args));
printf("dmr->%d\n", rc);
if (rc < 0) return;
 
ipc_parse_call_sync(sc_args[0], &question, &reply);
}
 
void sc_ipc_wait(unsigned *sc_args, int sc_rc)
{
ipc_call_t call;
151,11 → 203,11
 
memset(&call, 0, sizeof(call));
rc = debug_mem_read(phoneid, &call, sc_args[0], sizeof(call));
printf("debug_mem_read(phone %d, dest %d, app-mem src %d, size %d -> %d\n",
phoneid, (int)&call, sc_args[0], sizeof(call), rc);
// printf("debug_mem_read(phone %d, dest %d, app-mem src %d, size %d -> %d\n",
// phoneid, (int)&call, sc_args[0], sizeof(call), rc);
 
if (rc >= 0) {
ipc_parse_call_in(&call);
ipc_parse_call_in(&call, sc_rc);
}
}
 
170,7 → 222,7
 
async_serialize_start();
 
printf("[%d] ", thread_id);
// printf("[%d] ", thread_id);
 
if (rc < 0) {
printf("error\n");
186,11 → 238,17
 
switch (sc_id) {
case SYS_IPC_CALL_ASYNC_FAST:
sc_ipc_call_async_fast(sc_args);
sc_ipc_call_async_fast(sc_args, sc_rc);
break;
case SYS_IPC_CALL_ASYNC_SLOW:
sc_ipc_call_async_slow(sc_args);
sc_ipc_call_async_slow(sc_args, sc_rc);
break;
case SYS_IPC_CALL_SYNC_FAST:
sc_ipc_call_sync_fast(sc_args);
break;
case SYS_IPC_CALL_SYNC_SLOW:
sc_ipc_call_sync_slow(sc_args);
break;
case SYS_IPC_WAIT:
sc_ipc_wait(sc_args, sc_rc);
break;
229,7 → 287,7
rc = debug_go(phoneid, thread_hash,
&ev_type, &val0, &val1);
 
printf("rc = %d, ev_type=%d\n", rc, ev_type);
// printf("rc = %d, ev_type=%d\n", rc, ev_type);
if (ev_type == UDEBUG_EVENT_FINISHED) {
printf("thread %u debugging finished\n", thread_id);
break;