Changes in uspace/app/trace/trace.c [19f857a:28a3e74] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/trace/trace.c
r19f857a r28a3e74 36 36 #include <stdlib.h> 37 37 #include <unistd.h> 38 #include <ipc/ipc.h>39 38 #include <fibril.h> 40 39 #include <errno.h> … … 54 53 #include <libc.h> 55 54 56 / / Temporary: service and method names55 /* Temporary: service and method names */ 57 56 #include "proto.h" 58 57 #include <ipc/services.h> … … 149 148 int rc; 150 149 151 rc = ipc_connect_kbox(task_id);150 rc = async_connect_kbox(task_id); 152 151 153 152 if (rc == ENOTSUP) { … … 161 160 if (rc < 0) { 162 161 printf("Error connecting\n"); 163 printf("ipc_connect_task(%" PRI dTASKID") -> %d ", task_id, rc);162 printf("ipc_connect_task(%" PRIu64 ") -> %d ", task_id, rc); 164 163 return rc; 165 164 } … … 200 199 printf("Threads:"); 201 200 for (i = 0; i < n_threads; i++) { 202 printf(" [%d] (hash %p)", 1 +i,thread_hash_buf[i]);203 } 204 printf("\ntotal of % u threads\n", tb_needed / sizeof(uintptr_t));201 printf(" [%d] (hash %p)", 1 + i, (void *) thread_hash_buf[i]); 202 } 203 printf("\ntotal of %zu threads\n", tb_needed / sizeof(uintptr_t)); 205 204 206 205 return 0; … … 224 223 case V_HASH: 225 224 case V_PTR: 226 printf("%p", val);225 printf("%p", (void *) val); 227 226 break; 228 227 … … 248 247 case V_CHAR: 249 248 if (sval >= 0x20 && sval < 0x7f) { 250 printf("'%c'", sval);249 printf("'%c'", (char) sval); 251 250 } else { 252 251 switch (sval) { … … 257 256 case '\t': printf("'\\t'"); break; 258 257 case '\\': printf("'\\\\'"); break; 259 default: printf("'\\x%02 lX'", val); break;258 default: printf("'\\x%02" PRIxn "'", val); break; 260 259 } 261 260 } … … 277 276 278 277 putchar('('); 279 if (n > 0) printf("%" PRI dSYSARG, sc_args[0]);278 if (n > 0) printf("%" PRIun, sc_args[0]); 280 279 for (i = 1; i < n; i++) { 281 printf(", %" PRI dSYSARG, sc_args[i]);280 printf(", %" PRIun, sc_args[i]); 282 281 } 283 282 putchar(')'); … … 287 286 { 288 287 ipc_call_t call; 289 ipcarg_t phoneid;288 sysarg_t phoneid; 290 289 291 290 if (sc_rc == (sysarg_t) IPC_CALLRET_FATAL || … … 295 294 phoneid = sc_args[0]; 296 295 297 IPC_SET_ METHOD(call, sc_args[1]);296 IPC_SET_IMETHOD(call, sc_args[1]); 298 297 IPC_SET_ARG1(call, sc_args[2]); 299 298 IPC_SET_ARG2(call, sc_args[3]); … … 331 330 phoneidx = sc_args[0]; 332 331 333 IPC_SET_ METHOD(question, sc_args[1]);332 IPC_SET_IMETHOD(question, sc_args[1]); 334 333 IPC_SET_ARG1(question, sc_args[2]); 335 334 IPC_SET_ARG2(question, sc_args[3]); … … 489 488 { 490 489 async_serialize_start(); 491 printf("New thread, hash 0x%lx\n",hash);490 printf("New thread, hash %p\n", (void *) hash); 492 491 async_serialize_end(); 493 492 … … 510 509 } 511 510 512 printf("Start tracing thread [%d] (hash %p).\n", thread_id, thread_hash); 511 printf("Start tracing thread [%u] (hash %p).\n", 512 thread_id, (void *) thread_hash); 513 513 514 514 while (!abort_trace) { … … 516 516 fibril_mutex_lock(&state_lock); 517 517 if (paused) { 518 printf("Thread [% d] paused. Press R to resume.\n",518 printf("Thread [%u] paused. Press R to resume.\n", 519 519 thread_id); 520 520 … … 522 522 fibril_condvar_wait(&state_cv, &state_lock); 523 523 524 printf("Thread [% d] resumed.\n", thread_id);524 printf("Thread [%u] resumed.\n", thread_id); 525 525 } 526 526 fibril_mutex_unlock(&state_lock); … … 554 554 break; 555 555 case UDEBUG_EVENT_THREAD_E: 556 printf("Thread % pexited.\n", val0);556 printf("Thread %" PRIun " exited.\n", val0); 557 557 fibril_mutex_lock(&state_lock); 558 558 abort_trace = true; … … 744 744 abort_trace = true; 745 745 udebug_end(phoneid); 746 ipc_hangup(phoneid);746 async_hangup(phoneid); 747 747 748 748 ipcp_cleanup(); … … 872 872 static display_mask_t parse_display_mask(const char *text) 873 873 { 874 display_mask_t dm ;874 display_mask_t dm = 0; 875 875 const char *c = text; 876 876 … … 927 927 } 928 928 } else { 929 printf("Uknown option '% s'\n", arg[0]);929 printf("Uknown option '%c'\n", arg[0]); 930 930 print_syntax(); 931 931 return -1; … … 984 984 rc = connect_task(task_id); 985 985 if (rc < 0) { 986 printf("Failed connecting to task %" PRI dTASKID".\n", task_id);986 printf("Failed connecting to task %" PRIu64 ".\n", task_id); 987 987 return 1; 988 988 } 989 989 990 printf("Connected to task %" PRI dTASKID".\n", task_id);990 printf("Connected to task %" PRIu64 ".\n", task_id); 991 991 992 992 if (task_ldr != NULL)
Note:
See TracChangeset
for help on using the changeset viewer.