Changeset cd8ad52 in mainline for kernel/test/synch


Ignore:
Timestamp:
2008-06-03T14:58:05Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b63f8569
Parents:
7ac426e
Message:

proper printf formatting

Location:
kernel/test/synch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/synch/rwlock3.c

    r7ac426e rcd8ad52  
    4646       
    4747        if (!sh_quiet)
    48                 printf("cpu%d, tid %llu: trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
     48                printf("cpu%u, tid %" PRIu64 ": trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
    4949       
    5050        rwlock_read_lock(&rwlock);
     
    5252       
    5353        if (!sh_quiet) {
    54                 printf("cpu%d, tid %llu: success\n", CPU->id, THREAD->tid);             
    55                 printf("cpu%d, tid %llu: trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);       
     54                printf("cpu%u, tid %" PRIu64 ": success\n", CPU->id, THREAD->tid);             
     55                printf("cpu%u, tid %" PRIu64 ": trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);       
    5656        }
    5757
     
    6060       
    6161        if (!sh_quiet)
    62                 printf("cpu%d, tid %llu: success\n", CPU->id, THREAD->tid);
     62                printf("cpu%u, tid %" PRIu64 ": success\n", CPU->id, THREAD->tid);
    6363       
    6464        atomic_dec(&thread_count);
     
    8989        while (atomic_get(&thread_count) > 0) {
    9090                if (!quiet)
    91                         printf("Threads left: %d\n", atomic_get(&thread_count));
     91                        printf("Threads left: %ld\n", atomic_get(&thread_count));
    9292                thread_sleep(1);
    9393        }
  • kernel/test/synch/rwlock4.c

    r7ac426e rcd8ad52  
    7575       
    7676        if (!sh_quiet)
    77                 printf("cpu%d, tid %llu w+ (%d)\n", CPU->id, THREAD->tid, to);
     77                printf("cpu%u, tid %" PRIu64 " w+ (%d)\n", CPU->id, THREAD->tid, to);
    7878       
    7979        rc = rwlock_write_lock_timeout(&rwlock, to);
    8080        if (SYNCH_FAILED(rc)) {
    8181                if (!sh_quiet)
    82                         printf("cpu%d, tid %llu w!\n", CPU->id, THREAD->tid);
     82                        printf("cpu%u, tid %" PRIu64 " w!\n", CPU->id, THREAD->tid);
    8383                atomic_dec(&thread_count);
    8484                return;
     
    8686       
    8787        if (!sh_quiet)
    88                 printf("cpu%d, tid %llu w=\n", CPU->id, THREAD->tid);
     88                printf("cpu%u, tid %" PRIu64 " w=\n", CPU->id, THREAD->tid);
    8989
    9090        if (rwlock.readers_in) {
     
    107107       
    108108        if (!sh_quiet)
    109                 printf("cpu%d, tid %llu w-\n", CPU->id, THREAD->tid);
     109                printf("cpu%u, tid %" PRIu64 " w-\n", CPU->id, THREAD->tid);
    110110        atomic_dec(&thread_count);
    111111}
     
    120120       
    121121        if (!sh_quiet)
    122                 printf("cpu%d, tid %llu r+ (%d)\n", CPU->id, THREAD->tid, to);
     122                printf("cpu%u, tid %" PRIu64 " r+ (%d)\n", CPU->id, THREAD->tid, to);
    123123       
    124124        rc = rwlock_read_lock_timeout(&rwlock, to);
    125125        if (SYNCH_FAILED(rc)) {
    126126                if (!sh_quiet)
    127                         printf("cpu%d, tid %llu r!\n", CPU->id, THREAD->tid);
     127                        printf("cpu%u, tid %" PRIu64 " r!\n", CPU->id, THREAD->tid);
    128128                atomic_dec(&thread_count);
    129129                return;
     
    131131       
    132132        if (!sh_quiet)
    133                 printf("cpu%d, tid %llu r=\n", CPU->id, THREAD->tid);
     133                printf("cpu%u, tid %" PRIu64 " r=\n", CPU->id, THREAD->tid);
    134134       
    135135        thread_usleep(30000);
     
    137137       
    138138        if (!sh_quiet)
    139                 printf("cpu%d, tid %llu r-\n", CPU->id, THREAD->tid);
     139                printf("cpu%u, tid %" PRIu64 " r-\n", CPU->id, THREAD->tid);
    140140        atomic_dec(&thread_count);
    141141}
     
    160160        context_save(&ctx);
    161161        if (!quiet) {
    162                 printf("sp=%#x, readers_in=%d\n", ctx.sp, rwlock.readers_in);
    163                 printf("Creating %d readers\n", rd);
     162                printf("sp=%#x, readers_in=%" PRIc "\n", ctx.sp, rwlock.readers_in);
     163                printf("Creating %" PRIu32 " readers\n", rd);
    164164        }
    165165       
     
    169169                        thread_ready(thrd);
    170170                else if (!quiet)
    171                         printf("Could not create reader %d\n", i);
     171                        printf("Could not create reader %" PRIu32 "\n", i);
    172172        }
    173173
    174174        if (!quiet)
    175                 printf("Creating %d writers\n", wr);
     175                printf("Creating %" PRIu32 " writers\n", wr);
    176176       
    177177        for (i = 0; i < wr; i++) {
     
    180180                        thread_ready(thrd);
    181181                else if (!quiet)
    182                         printf("Could not create writer %d\n", i);
     182                        printf("Could not create writer %" PRIu32 "\n", i);
    183183        }
    184184       
     
    188188        while (atomic_get(&thread_count) > 0) {
    189189                if (!quiet)
    190                         printf("Threads left: %d\n", atomic_get(&thread_count));
     190                        printf("Threads left: %ld\n", atomic_get(&thread_count));
    191191                thread_sleep(1);
    192192        }
  • kernel/test/synch/rwlock5.c

    r7ac426e rcd8ad52  
    109109       
    110110                while ((items_read.count != readers) || (items_written.count != writers)) {
    111                         printf("%zd readers remaining, %zd writers remaining, readers_in=%zd\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
     111                        printf("%d readers remaining, %d writers remaining, readers_in=%d\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
    112112                        thread_usleep(100000);
    113113                }
  • kernel/test/synch/semaphore2.c

    r7ac426e rcd8ad52  
    6868       
    6969        to = random(20000);
    70         printf("cpu%d, tid %llu down+ (%d)\n", CPU->id, THREAD->tid, to);
     70        printf("cpu%u, tid %" PRIu64 " down+ (%d)\n", CPU->id, THREAD->tid, to);
    7171        rc = semaphore_down_timeout(&sem, to);
    7272        if (SYNCH_FAILED(rc)) {
    73                 printf("cpu%d, tid %llu down!\n", CPU->id, THREAD->tid);
     73                printf("cpu%u, tid %" PRIu64 " down!\n", CPU->id, THREAD->tid);
    7474                return;
    7575        }
    7676       
    77         printf("cpu%d, tid %llu down=\n", CPU->id, THREAD->tid);       
     77        printf("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);
    7878        thread_usleep(random(30000));
    7979       
    8080        semaphore_up(&sem);
    81         printf("cpu%d, tid %llu up\n", CPU->id, THREAD->tid);
     81        printf("cpu%u, tid %" PRIu64 " up\n", CPU->id, THREAD->tid);
    8282}
    8383
     
    9292       
    9393        k = random(7) + 1;
    94         printf("Creating %d consumers\n", k);
     94        printf("Creating %" PRIu32 " consumers\n", k);
    9595        for (i = 0; i < k; i++) {
    9696                thrd = thread_create(consumer, NULL, TASK, 0, "consumer", false);
Note: See TracChangeset for help on using the changeset viewer.