Changeset a5c3f73 in mainline
- Timestamp:
- 2008-09-19T11:30:04Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 356acd0
- Parents:
- f7176b1
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/ipcp.c
rf7176b1 ra5c3f73 45 45 46 46 typedef struct { 47 i nt phone_hash;47 ipcarg_t phone_hash; 48 48 ipc_call_t question; 49 49 oper_t *oper; 50 50 51 i nt call_hash;51 ipc_callid_t call_hash; 52 52 53 53 link_t link; … … 98 98 hs = hash_table_get_instance(item, pending_call_t, link); 99 99 100 // FIXME: this will fail if sizeof(long) < sizeof(void *). 100 101 return key[0] == hs->call_hash; 101 102 } … … 135 136 136 137 if (oper != NULL) { 137 printf("%s (% d)", oper->name, method);138 printf("%s (%ld)", oper->name, method); 138 139 return; 139 140 } 140 141 141 printf("% d", method);142 printf("%ld", method); 142 143 } 143 144 … … 199 200 200 201 if ((display_mask & DM_IPC) != 0) { 201 printf("Call ID: 0x% x, phone: %d, proto: %s, method: ", hash,202 printf("Call ID: 0x%lx, phone: %d, proto: %s, method: ", hash, 202 203 phone, (proto ? proto->name : "n/a")); 203 204 ipc_m_print(proto, IPC_GET_METHOD(*call)); 204 printf(" args: (% u, %u, %u, %u, %u)\n", args[1], args[2],205 printf(" args: (%lu, %lu, %lu, %lu, %lu)\n", args[1], args[2], 205 206 args[3], args[4], args[5]); 206 207 } … … 258 259 ipc_call_t *answer) 259 260 { 260 i nt phone;261 ipcarg_t phone; 261 262 ipcarg_t method; 262 263 ipcarg_t service; 263 i nt retval;264 ipcarg_t retval; 264 265 proto_t *proto; 265 266 int cphone; … … 278 279 279 280 if ((display_mask & DM_IPC) != 0) { 280 printf("Response to 0x% x: retval=%d, args = (%u, %u, %u, %u, %u)\n",281 printf("Response to 0x%lx: retval=%ld, args = (%lu, %lu, %lu, %lu, %lu)\n", 281 282 hash, retval, IPC_GET_ARG1(*answer), 282 283 IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer), … … 333 334 /* printf("phone: %d, method: ", call->in_phone_hash); 334 335 ipc_m_print(IPC_GET_METHOD(*call)); 335 printf(" args: (% u, %u, %u, %u, %u)\n",336 printf(" args: (%lu, %lu, %lu, %lu, %lu)\n", 336 337 IPC_GET_ARG1(*call), 337 338 IPC_GET_ARG2(*call), … … 344 345 /* Not a response */ 345 346 if ((display_mask & DM_IPC) != 0) { 346 printf("Not a response (hash %d)\n", hash);347 printf("Not a response (hash 0x%lx)\n", hash); 347 348 } 348 349 return; -
uspace/app/trace/trace.c
rf7176b1 ra5c3f73 56 56 57 57 #define THBUF_SIZE 64 58 u nsignedthread_hash_buf[THBUF_SIZE];59 unsignedn_threads;58 uintptr_t thread_hash_buf[THBUF_SIZE]; 59 int n_threads; 60 60 61 61 int next_thread_id; … … 64 64 int abort_trace; 65 65 66 u nsignedthash;66 uintptr_t thash; 67 67 volatile int paused; 68 68 69 void thread_trace_start(u nsignedthread_hash);69 void thread_trace_start(uintptr_t thread_hash); 70 70 71 71 static proto_t *proto_console; … … 126 126 } 127 127 128 n_threads = tb_copied / sizeof(u nsigned);128 n_threads = tb_copied / sizeof(uintptr_t); 129 129 130 130 printf("Threads:"); 131 131 for (i = 0; i < n_threads; i++) { 132 printf(" [%d] (hash 0x% x)", 1+i, thread_hash_buf[i]);133 } 134 printf("\ntotal of %u threads\n", tb_needed /sizeof(unsigned));132 printf(" [%d] (hash 0x%lx)", 1+i, thread_hash_buf[i]); 133 } 134 printf("\ntotal of %u threads\n", tb_needed / sizeof(uintptr_t)); 135 135 136 136 return 0; … … 197 197 } 198 198 199 static void print_sc_args( unsigned*sc_args, int n)199 static void print_sc_args(sysarg_t *sc_args, int n) 200 200 { 201 201 int i; 202 202 203 203 putchar('('); 204 if (n > 0) printf("% d", sc_args[0]);204 if (n > 0) printf("%ld", sc_args[0]); 205 205 for (i = 1; i < n; i++) { 206 printf(", % d", sc_args[i]);206 printf(", %ld", sc_args[i]); 207 207 } 208 208 putchar(')'); 209 209 } 210 210 211 static void sc_ipc_call_async_fast( unsigned *sc_args, int sc_rc)211 static void sc_ipc_call_async_fast(sysarg_t *sc_args, sysarg_t sc_rc) 212 212 { 213 213 ipc_call_t call; 214 i nt phoneid;214 ipcarg_t phoneid; 215 215 216 216 if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY) … … 229 229 } 230 230 231 static void sc_ipc_call_async_slow( unsigned *sc_args, int sc_rc)231 static void sc_ipc_call_async_slow(sysarg_t *sc_args, sysarg_t sc_rc) 232 232 { 233 233 ipc_call_t call; … … 245 245 } 246 246 247 static void sc_ipc_call_sync_fast( unsigned*sc_args)247 static void sc_ipc_call_sync_fast(sysarg_t *sc_args) 248 248 { 249 249 ipc_call_t question, reply; … … 273 273 } 274 274 275 static void sc_ipc_call_sync_slow( unsigned*sc_args)275 static void sc_ipc_call_sync_slow(sysarg_t *sc_args) 276 276 { 277 277 ipc_call_t question, reply; … … 291 291 } 292 292 293 static void sc_ipc_wait( unsigned*sc_args, int sc_rc)293 static void sc_ipc_wait(sysarg_t *sc_args, int sc_rc) 294 294 { 295 295 ipc_call_t call; … … 308 308 } 309 309 310 static void event_syscall_b(unsigned thread_id, unsigned thread_hash, unsigned sc_id, int sc_rc) 311 { 312 unsigned sc_args[6]; 310 static void event_syscall_b(unsigned thread_id, uintptr_t thread_hash, 311 unsigned sc_id, sysarg_t sc_rc) 312 { 313 sysarg_t sc_args[6]; 313 314 int rc; 314 315 … … 335 336 } 336 337 337 static void event_syscall_e(unsigned thread_id, unsigned thread_hash, unsigned sc_id, int sc_rc) 338 { 339 unsigned sc_args[6]; 338 static void event_syscall_e(unsigned thread_id, uintptr_t thread_hash, 339 unsigned sc_id, sysarg_t sc_rc) 340 { 341 sysarg_t sc_args[6]; 340 342 int rv_type; 341 343 int rc; … … 383 385 } 384 386 385 static void event_thread_b(u nsignedhash)387 static void event_thread_b(uintptr_t hash) 386 388 { 387 389 async_serialize_start(); 388 printf("New thread, hash 0x% x\n", hash);390 printf("New thread, hash 0x%lx\n", hash); 389 391 async_serialize_end(); 390 392 … … 396 398 int rc; 397 399 unsigned ev_type; 398 u nsignedthread_hash;400 uintptr_t thread_hash; 399 401 unsigned thread_id; 400 unsignedval0, val1;401 402 thread_hash = (u nsigned)thread_hash_arg;402 sysarg_t val0, val1; 403 404 thread_hash = (uintptr_t)thread_hash_arg; 403 405 thread_id = next_thread_id++; 404 406 405 printf("Start tracing thread [%d] (hash 0x% x)\n", thread_id, thread_hash);407 printf("Start tracing thread [%d] (hash 0x%lx)\n", thread_id, thread_hash); 406 408 407 409 while (!abort_trace) { … … 439 441 break; 440 442 case UDEBUG_EVENT_THREAD_E: 441 printf("Thread 0x% x exited\n", val0);443 printf("Thread 0x%lx exited\n", val0); 442 444 abort_trace = 1; 443 445 break; … … 454 456 } 455 457 456 void thread_trace_start(u nsignedthread_hash)458 void thread_trace_start(uintptr_t thread_hash) 457 459 { 458 460 fid_t fid; … … 673 675 674 676 if (task_id != 0) { 675 if (argc == 0) return ;677 if (argc == 0) return 0; 676 678 printf("Extra arguments\n"); 677 679 print_syntax(); -
uspace/lib/libc/generic/udebug.c
rf7176b1 ra5c3f73 58 58 size_t *copied, size_t *needed) 59 59 { 60 unsigned dest_addr;61 62 60 return async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ, 63 (sysarg_t)buffer, n, &dest_addr, copied, needed);61 (sysarg_t)buffer, n, NULL, copied, needed); 64 62 } 65 63
Note:
See TracChangeset
for help on using the changeset viewer.