Changeset 6a585dd in mainline


Ignore:
Timestamp:
2012-12-05T17:53:57Z (12 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
207e8880
Parents:
d22e567
Message:

rcubench: Removed unused code.

File:
1 edited

Legend:

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

    rd22e567 r6a585dd  
    5959        size_t iters;
    6060        size_t nthreads;
    61         size_t array_size;
    62         size_t *array;
    6361        futex_t done_threads;
    6462       
     
    7270{
    7371        const size_t iters = bench->iters;
     72        int val = 0;
    7473       
    7574        for (size_t i = 0; i < iters; ++i) {
    76                 int val = 0;
    7775                __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &val);
    7876                __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &val);
     
    181179static void print_usage(void)
    182180{
    183         printf("rcubench [test-name] [k-iterations] [n-threads] {work-size}\n");
     181        printf("rcubench [test-name] [k-iterations] [n-threads]\n");
    184182        printf("Available tests: \n");
    185183        printf("  sys-futex.. threads make wakeup/sleepdown futex syscalls in a loop\n");
     
    188186        printf("  sema     .. threads down/up separate futexes.\n");
    189187        printf("eg:\n");
    190         printf("  rcubench ke-futex  100000 3 4\n");
     188        printf("  rcubench sys-futex  100000 3\n");
    191189        printf("  rcubench lock 100000 2 ..runs futex_lock/unlock in a loop\n");
    192190        printf("  rcubench sema 100000 2 ..runs futex_down/up in a loop\n");
     
    239237        }
    240238       
    241         /* Set work array size. */
    242         if (argc > 4) {
    243                 uint32_t work_size = 0;
    244                 ret = str_uint32_t(argv[4], NULL, 0, true, &work_size);
    245 
    246                 if (ret == EOK && work_size <= 10000) {
    247                         bench->array_size = work_size;
    248                 } else {
    249                         *err = "Err: Work size too large";
    250                         return false;
    251                 }
    252         } else {
    253                 bench->array_size = 0;
    254         }
    255        
    256         /* Allocate work array. */
    257         if (0 < bench->array_size) {
    258                 bench->array = malloc(bench->array_size * sizeof(size_t));
    259                 if (!bench->array) {
    260                         *err = "Err: Failed to allocate work array";
    261                         return false;
    262                 }
    263         } else {
    264                 bench->array = NULL;
    265         }
    266        
    267239        return true;
    268240}
Note: See TracChangeset for help on using the changeset viewer.