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