Changeset a5c3f73 in mainline for uspace/app/trace/trace.c


Ignore:
Timestamp:
2008-09-19T11:30:04Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
356acd0
Parents:
f7176b1
Message:

trace: 64-bit-related fixes

File:
1 edited

Legend:

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

    rf7176b1 ra5c3f73  
    5656
    5757#define THBUF_SIZE 64
    58 unsigned thread_hash_buf[THBUF_SIZE];
    59 unsigned n_threads;
     58uintptr_t thread_hash_buf[THBUF_SIZE];
     59int n_threads;
    6060
    6161int next_thread_id;
     
    6464int abort_trace;
    6565
    66 unsigned thash;
     66uintptr_t thash;
    6767volatile int paused;
    6868
    69 void thread_trace_start(unsigned thread_hash);
     69void thread_trace_start(uintptr_t thread_hash);
    7070
    7171static proto_t *proto_console;
     
    126126        }
    127127
    128         n_threads = tb_copied / sizeof(unsigned);
     128        n_threads = tb_copied / sizeof(uintptr_t);
    129129
    130130        printf("Threads:");
    131131        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));
    135135
    136136        return 0;
     
    197197}
    198198
    199 static void print_sc_args(unsigned *sc_args, int n)
     199static void print_sc_args(sysarg_t *sc_args, int n)
    200200{
    201201        int i;
    202202
    203203        putchar('(');
    204         if (n > 0) printf("%d", sc_args[0]);
     204        if (n > 0) printf("%ld", sc_args[0]);
    205205        for (i = 1; i < n; i++) {
    206                 printf(", %d", sc_args[i]);
     206                printf(", %ld", sc_args[i]);
    207207        }
    208208        putchar(')');
    209209}
    210210
    211 static void sc_ipc_call_async_fast(unsigned *sc_args, int sc_rc)
     211static void sc_ipc_call_async_fast(sysarg_t *sc_args, sysarg_t sc_rc)
    212212{
    213213        ipc_call_t call;
    214         int phoneid;
     214        ipcarg_t phoneid;
    215215       
    216216        if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY)
     
    229229}
    230230
    231 static void sc_ipc_call_async_slow(unsigned *sc_args, int sc_rc)
     231static void sc_ipc_call_async_slow(sysarg_t *sc_args, sysarg_t sc_rc)
    232232{
    233233        ipc_call_t call;
     
    245245}
    246246
    247 static void sc_ipc_call_sync_fast(unsigned *sc_args)
     247static void sc_ipc_call_sync_fast(sysarg_t *sc_args)
    248248{
    249249        ipc_call_t question, reply;
     
    273273}
    274274
    275 static void sc_ipc_call_sync_slow(unsigned *sc_args)
     275static void sc_ipc_call_sync_slow(sysarg_t *sc_args)
    276276{
    277277        ipc_call_t question, reply;
     
    291291}
    292292
    293 static void sc_ipc_wait(unsigned *sc_args, int sc_rc)
     293static void sc_ipc_wait(sysarg_t *sc_args, int sc_rc)
    294294{
    295295        ipc_call_t call;
     
    308308}
    309309
    310 static void event_syscall_b(unsigned thread_id, unsigned thread_hash,  unsigned sc_id, int sc_rc)
    311 {
    312         unsigned sc_args[6];
     310static 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];
    313314        int rc;
    314315
     
    335336}
    336337
    337 static void event_syscall_e(unsigned thread_id, unsigned thread_hash,  unsigned sc_id, int sc_rc)
    338 {
    339         unsigned sc_args[6];
     338static 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];
    340342        int rv_type;
    341343        int rc;
     
    383385}
    384386
    385 static void event_thread_b(unsigned hash)
     387static void event_thread_b(uintptr_t hash)
    386388{
    387389        async_serialize_start();
    388         printf("New thread, hash 0x%x\n", hash);
     390        printf("New thread, hash 0x%lx\n", hash);
    389391        async_serialize_end();
    390392
     
    396398        int rc;
    397399        unsigned ev_type;
    398         unsigned thread_hash;
     400        uintptr_t thread_hash;
    399401        unsigned thread_id;
    400         unsigned val0, val1;
    401 
    402         thread_hash = (unsigned)thread_hash_arg;
     402        sysarg_t val0, val1;
     403
     404        thread_hash = (uintptr_t)thread_hash_arg;
    403405        thread_id = next_thread_id++;
    404406
    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);
    406408
    407409        while (!abort_trace) {
     
    439441                                break;
    440442                        case UDEBUG_EVENT_THREAD_E:
    441                                 printf("Thread 0x%x exited\n", val0);
     443                                printf("Thread 0x%lx exited\n", val0);
    442444                                abort_trace = 1;
    443445                                break;
     
    454456}
    455457
    456 void thread_trace_start(unsigned thread_hash)
     458void thread_trace_start(uintptr_t thread_hash)
    457459{
    458460        fid_t fid;
     
    673675
    674676        if (task_id != 0) {
    675                 if (argc == 0) return;
     677                if (argc == 0) return 0;
    676678                printf("Extra arguments\n");
    677679                print_syntax();
Note: See TracChangeset for help on using the changeset viewer.