Changeset a5c3f73 in mainline for uspace/app/trace/trace.c
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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();
Note:
See TracChangeset
for help on using the changeset viewer.