Changeset 7e752b2 in mainline for uspace/app/trace


Ignore:
Timestamp:
2010-11-26T01:33:20Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bf61d3a
Parents:
202f57b
Message:
  • correct printf() formatting strings and corresponding arguments
  • minor cstyle changes and other small fixes
Location:
uspace/app/trace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/trace/ipcp.c

    r202f57b r7e752b2  
    137137
    138138        if (oper != NULL) {
    139                 printf("%s (%ld)", oper->name, method);
     139                printf("%s (%" PRIun ")", oper->name, method);
    140140                return;
    141141        }
    142142
    143         printf("%ld", method);
     143        printf("%" PRIun, method);
    144144}
    145145
     
    201201
    202202        if ((display_mask & DM_IPC) != 0) {
    203                 printf("Call ID: %p, phone: %d, proto: %s, method: ", hash,
    204                         phone, (proto ? proto->name : "n/a"));
     203                printf("Call ID: %p, phone: %d, proto: %s, method: ",
     204                    (void *) hash, phone,
     205                    (proto ? proto->name : "n/a"));
    205206                ipc_m_print(proto, IPC_GET_METHOD(*call));
    206                 printf(" args: (%" PRIuIPCARG ", %" PRIuIPCARG ", %" PRIuIPCARG
    207                     ", %" PRIuIPCARG ", %" PRIuIPCARG ")\n", args[1], args[2],
    208                     args[3], args[4], args[5]);
     207                printf(" args: (%" PRIun ", %" PRIun ", %" PRIun ", "
     208                    "%" PRIun ", %" PRIun ")\n",
     209                    args[1], args[2], args[3], args[4], args[5]);
    209210        }
    210211
     
    281282
    282283        if ((display_mask & DM_IPC) != 0) {
    283                 printf("Response to %p: retval=%ld, args = (%" PRIuIPCARG
    284                     ", %" PRIuIPCARG ", %" PRIuIPCARG ", %" PRIuIPCARG
    285                     ", %" PRIuIPCARG ")\n",
    286                     hash, retval, IPC_GET_ARG1(*answer),
     284                printf("Response to %p: retval=%" PRIdn ", args = (%" PRIun ", "
     285                    "%" PRIun ", %" PRIun ", %" PRIun ", %" PRIun ")\n",
     286                    (void *) hash, retval, IPC_GET_ARG1(*answer),
    287287                    IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer),
    288288                    IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer));
     
    340340                /* Not a response */
    341341                if ((display_mask & DM_IPC) != 0) {
    342                         printf("Not a response (hash %p)\n", hash);
     342                        printf("Not a response (hash %p)\n", (void *) hash);
    343343                }
    344344                return;
  • uspace/app/trace/trace.c

    r202f57b r7e752b2  
    161161        if (rc < 0) {
    162162                printf("Error connecting\n");
    163                 printf("ipc_connect_task(%" PRIdTASKID ") -> %d ", task_id, rc);
     163                printf("ipc_connect_task(%" PRIu64 ") -> %d ", task_id, rc);
    164164                return rc;
    165165        }
     
    200200        printf("Threads:");
    201201        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));
     202                printf(" [%d] (hash %p)", 1 + i, (void *) thread_hash_buf[i]);
     203        }
     204        printf("\ntotal of %zu threads\n", tb_needed / sizeof(uintptr_t));
    205205
    206206        return 0;
     
    224224        case V_HASH:
    225225        case V_PTR:
    226                 printf("%p", val);
     226                printf("%p", (void *) val);
    227227                break;
    228228
     
    248248        case V_CHAR:
    249249                if (sval >= 0x20 && sval < 0x7f) {
    250                         printf("'%c'", sval);
     250                        printf("'%c'", (char) sval);
    251251                } else {
    252252                        switch (sval) {
     
    257257                        case '\t': printf("'\\t'"); break;
    258258                        case '\\': printf("'\\\\'"); break;
    259                         default: printf("'\\x%02lX'", val); break;
     259                        default: printf("'\\x%02" PRIxn "'", val); break;
    260260                        }
    261261                }
     
    277277
    278278        putchar('(');
    279         if (n > 0) printf("%" PRIdSYSARG, sc_args[0]);
     279        if (n > 0) printf("%" PRIun, sc_args[0]);
    280280        for (i = 1; i < n; i++) {
    281                 printf(", %" PRIdSYSARG, sc_args[i]);
     281                printf(", %" PRIun, sc_args[i]);
    282282        }
    283283        putchar(')');
     
    489489{
    490490        async_serialize_start();
    491         printf("New thread, hash 0x%lx\n", hash);
     491        printf("New thread, hash %p\n", (void *) hash);
    492492        async_serialize_end();
    493493
     
    510510        }
    511511
    512         printf("Start tracing thread [%d] (hash %p).\n", thread_id, thread_hash);
     512        printf("Start tracing thread [%u] (hash %p).\n",
     513            thread_id, (void *) thread_hash);
    513514
    514515        while (!abort_trace) {
     
    516517                fibril_mutex_lock(&state_lock);
    517518                if (paused) {
    518                         printf("Thread [%d] paused. Press R to resume.\n",
     519                        printf("Thread [%u] paused. Press R to resume.\n",
    519520                            thread_id);
    520521
     
    522523                                fibril_condvar_wait(&state_cv, &state_lock);
    523524
    524                         printf("Thread [%d] resumed.\n", thread_id);
     525                        printf("Thread [%u] resumed.\n", thread_id);
    525526                }
    526527                fibril_mutex_unlock(&state_lock);
     
    554555                                break;
    555556                        case UDEBUG_EVENT_THREAD_E:
    556                                 printf("Thread %p exited.\n", val0);
     557                                printf("Thread %" PRIun " exited.\n", val0);
    557558                                fibril_mutex_lock(&state_lock);
    558559                                abort_trace = true;
     
    927928                                }
    928929                        } else {
    929                                 printf("Uknown option '%s'\n", arg[0]);
     930                                printf("Uknown option '%c'\n", arg[0]);
    930931                                print_syntax();
    931932                                return -1;
     
    984985        rc = connect_task(task_id);
    985986        if (rc < 0) {
    986                 printf("Failed connecting to task %" PRIdTASKID ".\n", task_id);
     987                printf("Failed connecting to task %" PRIu64 ".\n", task_id);
    987988                return 1;
    988989        }
    989990
    990         printf("Connected to task %" PRIdTASKID ".\n", task_id);
     991        printf("Connected to task %" PRIu64 ".\n", task_id);
    991992
    992993        if (task_ldr != NULL)
Note: See TracChangeset for help on using the changeset viewer.