Changeset ff14c520 in mainline for test


Ignore:
Timestamp:
2006-03-16T22:31:39Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
93165be
Parents:
37c57f2
Message:

It is now possible to associate symbolic names with both threads and tasks.
More verbose kconsole threads, tasks and scheduler commands.

Location:
test
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • test/fpu/fpu1/test.c

    r37c57f2 rff14c520  
    144144}
    145145
    146 
    147146void test(void)
    148147{
     
    156155
    157156        for (i=0; i<THREADS/2; i++) { 
    158                 if (!(t = thread_create(e, NULL, TASK, 0)))
     157                if (!(t = thread_create(e, NULL, TASK, 0, "e")))
    159158                        panic("could not create thread\n");
    160159                thread_ready(t);
    161                 if (!(t = thread_create(pi, NULL, TASK, 0)))
     160                if (!(t = thread_create(pi, NULL, TASK, 0, "pi")))
    162161                        panic("could not create thread\n");
    163162                thread_ready(t);
     
    173172        printf("Test passed.\n");
    174173}
    175 
    176 /*
    177 static void pi(void *data)
    178 {
    179 #undef PI_10e8 
    180 #define PI_10e8 3141592
    181 
    182 
    183         int i;
    184         double lpi, pi;
    185         double n, ab, ad;
    186 
    187 
    188         printf("pi test\n");
    189 
    190         waitq_sleep(&can_start);
    191 
    192 
    193         for (i = 0; i<ATTEMPTS; i++) {
    194                 lpi = -1;
    195                 pi = 0;
    196 
    197                 for (n=2, ab = sqrt(2); lpi != pi; n *= 2, ab = ad) {
    198                         double sc, cd;
    199 
    200                         sc = sqrt(1 - (ab*ab/4));
    201                         cd = 1 - sc;
    202                         ad = sqrt(ab*ab/4 + cd*cd);
    203                         lpi = pi;
    204                         pi = 2 * n * ad;
    205                 }
    206 
    207                 atomic_inc(&threads_ok);
    208                 if((int)(1000000*pi)!=PI_10e8)
    209                         panic("tid%d: pi*10e6=%d\n", THREAD->tid, (int) 1000000*pi);
    210         }
    211 
    212         printf("tid%d: pi*10e6=%d\n", THREAD->tid, (int) 1000000*pi);
    213 }
    214 */
  • test/fpu/mips1/test.c

    r37c57f2 rff14c520  
    113113
    114114        for (i=0; i<THREADS/2; i++) { 
    115                 if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0)))
     115                if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0, "testit1")))
    116116                        panic("could not create thread\n");
    117117                thread_ready(t);
    118                 if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0)))
     118                if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0, "testit2")))
    119119                        panic("could not create thread\n");
    120120                thread_ready(t);
  • test/fpu/sse1/test.c

    r37c57f2 rff14c520  
    113113
    114114        for (i=0; i<THREADS/2; i++) { 
    115                 if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0)))
     115                if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0, "testit1")))
    116116                        panic("could not create thread\n");
    117117                thread_ready(t);
    118                 if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0)))
     118                if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0, "testit2")))
    119119                        panic("could not create thread\n");
    120120                thread_ready(t);
  • test/mm/falloc2/test.c

    r37c57f2 rff14c520  
    4545#define THREADS 8
    4646
    47 static void thread(void * arg);
     47static void falloc(void * arg);
    4848static void failed(void);
    4949
    5050static atomic_t thread_count;
    5151
    52 void thread(void * arg)
     52void falloc(void * arg)
    5353{
    5454        int status, order, run, allocated, i;
     
    108108        for (i = 0; i < THREADS; i++) {
    109109                thread_t * thrd;
    110                 thrd = thread_create(thread, NULL, TASK, 0);
     110                thrd = thread_create(falloc, NULL, TASK, 0, "falloc");
    111111                if (thrd)
    112112                        thread_ready(thrd);
  • test/mm/slab1/test.c

    r37c57f2 rff14c520  
    109109semaphore_t thr_sem;
    110110
    111 static void thread(void *data)
     111static void slabtest(void *data)
    112112{
    113113        int offs = (int)(__native) data;
     
    139139        semaphore_initialize(&thr_sem,0);
    140140        for (i=0; i<THREADS; i++) { 
    141                 if (!(t = thread_create(thread, (void *)(__native)i, TASK, 0)))
     141                if (!(t = thread_create(slabtest, (void *)(__native)i, TASK, 0, "slabtest")))
    142142                        panic("could not create thread\n");
    143143                thread_ready(t);
  • test/mm/slab2/test.c

    r37c57f2 rff14c520  
    123123#define THREADS 8
    124124
    125 static void thread(void *priv)
     125static void slabtest(void *priv)
    126126{
    127127        void *data=NULL, *new;
     
    189189        semaphore_initialize(&thr_sem,0);
    190190        for (i=0; i<THREADS; i++) { 
    191                 if (!(t = thread_create(thread, NULL, TASK, 0)))
     191                if (!(t = thread_create(slabtest, NULL, TASK, 0, "slabtest")))
    192192                        panic("could not create thread\n");
    193193                thread_ready(t);
  • test/synch/rwlock2/test.c

    r37c57f2 rff14c520  
    7575        rwlock_read_lock(&rwlock);     
    7676       
    77         thrd = thread_create(writer, NULL, TASK, 0);
     77        thrd = thread_create(writer, NULL, TASK, 0, "writer");
    7878        if (thrd)
    7979                thread_ready(thrd);
  • test/synch/rwlock3/test.c

    r37c57f2 rff14c520  
    7878       
    7979        for (i=0; i<4; i++) {
    80                 thrd = thread_create(reader, NULL, TASK, 0);
     80                thrd = thread_create(reader, NULL, TASK, 0, "reader");
    8181                if (thrd)
    8282                        thread_ready(thrd);
  • test/synch/rwlock4/test.c

    r37c57f2 rff14c520  
    138138                printf("Creating %d readers\n", k);
    139139                for (i=0; i<k; i++) {
    140                         thrd = thread_create(reader, NULL, TASK, 0);
     140                        thrd = thread_create(reader, NULL, TASK, 0, "reader");
    141141                        if (thrd)
    142142                                thread_ready(thrd);
     
    148148                printf("Creating %d writers\n", k);
    149149                for (i=0; i<k; i++) {
    150                         thrd = thread_create(writer, NULL, TASK, 0);
     150                        thrd = thread_create(writer, NULL, TASK, 0, "writer");
    151151                        if (thrd)
    152152                                thread_ready(thrd);
  • test/synch/rwlock5/test.c

    r37c57f2 rff14c520  
    9696                for (j=0; j<(READERS+WRITERS)/2; j++) {
    9797                        for (k=0; k<i; k++) {
    98                                 thrd = thread_create(reader, NULL, TASK, 0);
     98                                thrd = thread_create(reader, NULL, TASK, 0, "reader");
    9999                                if (thrd)
    100100                                        thread_ready(thrd);
     
    103103                        }
    104104                        for (k=0; k<(4-i); k++) {
    105                                 thrd = thread_create(writer, NULL, TASK, 0);
     105                                thrd = thread_create(writer, NULL, TASK, 0, "writer");
    106106                                if (thrd)
    107107                                        thread_ready(thrd);
  • test/synch/semaphore1/test.c

    r37c57f2 rff14c520  
    100100                for (j=0; j<(CONSUMERS+PRODUCERS)/2; j++) {
    101101                        for (k=0; k<i; k++) {
    102                                 thrd = thread_create(consumer, NULL, TASK, 0);
     102                                thrd = thread_create(consumer, NULL, TASK, 0, "consumer");
    103103                                if (thrd)
    104104                                        thread_ready(thrd);
     
    107107                        }
    108108                        for (k=0; k<(4-i); k++) {
    109                                 thrd = thread_create(producer, NULL, TASK, 0);
     109                                thrd = thread_create(producer, NULL, TASK, 0, "producer");
    110110                                if (thrd)
    111111                                        thread_ready(thrd);
  • test/synch/semaphore2/test.c

    r37c57f2 rff14c520  
    108108                printf("Creating %d consumers\n", k);
    109109                for (i=0; i<k; i++) {
    110                         thrd = thread_create(consumer, NULL, TASK, 0);
     110                        thrd = thread_create(consumer, NULL, TASK, 0, "consumer");
    111111                        if (thrd)
    112112                                thread_ready(thrd);
  • test/thread/thread1/test.c

    r37c57f2 rff14c520  
    4040#define THREADS 5
    4141
    42 static void thread(void *data)
     42static void threadtest(void *data)
    4343{
    4444    while(1)
     
    5555
    5656        for (i=0; i<THREADS; i++) { 
    57                 if (!(t = thread_create(thread, NULL, TASK, 0)))
     57                if (!(t = thread_create(threadtest, NULL, TASK, 0, "threadtest")))
    5858                        panic("could not create thread\n");
    5959                thread_ready(t);
Note: See TracChangeset for help on using the changeset viewer.