Changeset 96348adc in mainline for kernel/test/mm/slab2.c


Ignore:
Timestamp:
2006-12-12T17:24:58Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e13972
Parents:
34db7fa
Message:

cleanup tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/mm/slab2.c

    r34db7fa r96348adc  
    3838#include <synch/mutex.h>
    3939
    40 #ifdef CONFIG_BENCH
    41 #include <arch/cycle.h>
    42 #endif
    43 
    4440#define ITEM_SIZE 256
    4541
     
    7874                olddata1 = data1;
    7975                olddata2 = data2;
    80         }while(1);
     76        } while(1);
    8177        printf("done.\n");
    8278        /* We do not have memory - now deallocate cache2 */
     
    129125static void slabtest(void *priv)
    130126{
    131         void *data=NULL, *new;
     127        void *data = NULL, *new;
    132128
    133129        thread_detach(THREAD);
     
    173169        }
    174170
    175 
    176171        printf("Thread #%d finished\n", THREAD->tid);
    177172        slab_print_list();
    178173        semaphore_up(&thr_sem);
    179174}
    180 
    181175
    182176static void multitest(int size)
     
    196190                                      0);
    197191        semaphore_initialize(&thr_sem,0);
    198         for (i=0; i<THREADS; i++) { 
     192        for (i = 0; i < THREADS; i++) { 
    199193                if (!(t = thread_create(slabtest, NULL, TASK, 0, "slabtest")))
    200                         panic("could not create thread\n");
    201                 thread_ready(t);
     194                        printf("Could not create thread %d\n", i);
     195                else
     196                        thread_ready(t);
    202197        }
    203198        thread_sleep(1);
    204199        condvar_broadcast(&thread_starter);
    205200
    206         for (i=0; i<THREADS; i++)
     201        for (i = 0; i < THREADS; i++)
    207202                semaphore_down(&thr_sem);
    208203       
     
    211206}
    212207
    213 void test_slab2(void)
    214 {
    215 #ifdef CONFIG_BENCH
    216         uint64_t t0 = get_cycle();
    217 #endif
    218 
    219         printf("Running reclaim single-thread test .. pass1\n");
     208char * test_slab2(void)
     209{
     210        printf("Running reclaim single-thread test .. pass 1\n");
    220211        totalmemtest();
    221         printf("Running reclaim single-thread test .. pass2\n");
     212        printf("Running reclaim single-thread test .. pass 2\n");
    222213        totalmemtest();
    223214        printf("Reclaim test OK.\n");
     
    227218        multitest(8192);
    228219        printf("All done.\n");
    229 
    230 #ifdef CONFIG_BENCH
    231         uint64_t dt = get_cycle() - t0;
    232         printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt);
    233 #endif
    234 }
     220       
     221        return NULL;
     222}
Note: See TracChangeset for help on using the changeset viewer.