Changeset 1b20da0 in mainline for kernel/test


Ignore:
Timestamp:
2018-02-28T17:52:03Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3061bc1
Parents:
df6ded8
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
Message:

style: Remove trailing whitespace on non-empty lines, in certain file types.

Command used: tools/srepl '\([^[:space:]]\)\s\+$' '\1' -- *.c *.h *.py *.sh *.s *.S *.ag

Location:
kernel/test
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/cht/cht1.c

    rdf6ded8 r1b20da0  
    180180                if (val->unique_id != v[0]->unique_id)
    181181                        return "Found item with a different key.";
    182                 if (val->mark) 
     182                if (val->mark)
    183183                        return "Found twice the same node.";
    184184                val->mark = true;
     
    186186       
    187187        for (int i = 0; i < 3; ++i) {
    188                 if (!v[i]->mark) 
     188                if (!v[i]->mark)
    189189                        return "Did not find all duplicates";
    190190               
     
    306306        .equal = stress_equal,
    307307        .key_equal = stress_key_equal,
    308         .remove_callback = stress_rm_callback   
     308        .remove_callback = stress_rm_callback
    309309};
    310310
     
    319319                        if (!s) {
    320320                                TPRINTF("[out-of-mem]\n");
    321                                 goto out_of_mem;                               
     321                                goto out_of_mem;
    322322                        }
    323323                       
     
    405405                                        rcu_read_lock();
    406406                                        cht_link_t *dup;
    407                                         if (!cht_insert_unique(work->h, &work->elem[elem_idx].link, 
     407                                        if (!cht_insert_unique(work->h, &work->elem[elem_idx].link,
    408408                                                &dup)) {
    409409                                                TPRINTF("Err: already inserted\n");
     
    419419                } else {
    420420                        rcu_read_lock();
    421                         cht_link_t *item = 
     421                        cht_link_t *item =
    422422                                cht_find(work->h, (void*)work->elem[elem_idx].key);
    423423                        rcu_read_unlock();
     
    525525                if (i < op_thread_cnt)
    526526                        thr[i] = thread_create(op_stresser, &pwork[i], TASK, 0, "cht-op-stress");
    527                 else 
     527                else
    528528                        thr[i] = thread_create(resize_stresser, &pwork[i], TASK, 0, "cht-resize");
    529529               
     
    567567        printf("Basic sanity test: ok.\n");
    568568       
    569         if (!do_stress()) 
     569        if (!do_stress())
    570570                return "CHT stress test failed.";
    571571        else
  • kernel/test/smpcall/smpcall1.c

    rdf6ded8 r1b20da0  
    3939#include <proc/thread.h>
    4040
    41 /* 
    42  * Maximum total number of smp_calls in the system is: 
    43  *  162000 == 9^2 * 1000 * 2 
     41/*
     42 * Maximum total number of smp_calls in the system is:
     43 *  162000 == 9^2 * 1000 * 2
    4444 *  == MAX_CPUS^2 * ITERATIONS * EACH_CPU_INC_PER_ITER
    4545 */
     
    5454
    5555        size_t *pcall_cnt = (size_t*)p;
    56         /* 
    57          * No synchronization. Tests if smp_calls makes changes 
    58          * visible to the caller. 
     56        /*
     57         * No synchronization. Tests if smp_calls makes changes
     58         * visible to the caller.
    5959         */
    6060        ++*pcall_cnt;
     
    7272                /* Synchronous version. */
    7373                for (unsigned cpu_id = 0; cpu_id < cpu_count; ++cpu_id) {
    74                         /* 
    75                          * smp_call should make changes by inc() visible on this cpu. 
    76                          * As a result we can pass it our pcall_cnt and not worry 
     74                        /*
     75                         * smp_call should make changes by inc() visible on this cpu.
     76                         * As a result we can pass it our pcall_cnt and not worry
    7777                         * about other synchronization.
    7878                         */
     
    8080                }
    8181               
    82                 /* 
    83                  * Async calls run in parallel on different cpus, so passing the 
     82                /*
     83                 * Async calls run in parallel on different cpus, so passing the
    8484                 * same counter would clobber it without additional synchronization.
    8585                 */
     
    120120        /* Create a wired thread on each cpu. */
    121121        for (unsigned int id = 0; id < cpu_count; ++id) {
    122                 thread[id] = thread_create(test_thread, &call_cnt[id], TASK, 
     122                thread[id] = thread_create(test_thread, &call_cnt[id], TASK,
    123123                        THREAD_FLAG_NONE, "smp-call-test");
    124124               
     
    134134        size_t exp_calls_sum = exp_calls * cpu_count;
    135135       
    136         TPRINTF("Running %zu wired threads. Expecting %zu calls. Be patient.\n", 
     136        TPRINTF("Running %zu wired threads. Expecting %zu calls. Be patient.\n",
    137137                running_thread_cnt, exp_calls_sum);
    138138
     
    162162                                TPRINTF("Error: %zu instead of %zu cpu%zu's calls were"
    163163                                        " acknowledged.\n", call_cnt[i], exp_calls, i);
    164                         } 
     164                        }
    165165                }
    166166               
  • kernel/test/synch/rcu1.c

    rdf6ded8 r1b20da0  
    8282        assert(thread[k] == NULL);
    8383       
    84         thread[k] = thread_create(func, arg, TASK, THREAD_FLAG_NONE, 
     84        thread[k] = thread_create(func, arg, TASK, THREAD_FLAG_NONE,
    8585                "test-rcu-thread");
    8686               
     
    223223        get_seq(10, 1000 * 1000, get_thread_cnt(), seq);
    224224       
    225         TPRINTF("\nRun %zu thr: repeat long reader sections, will preempt, no cbs.\n", 
     225        TPRINTF("\nRun %zu thr: repeat long reader sections, will preempt, no cbs.\n",
    226226                get_thread_cnt());
    227227       
     
    273273        size_t max_used_mem = sizeof(rcu_item_t) * exp_cnt;
    274274       
    275         TPRINTF("\nRun %zu thr: post %zu no-op callbacks (%zu B used), no readers.\n", 
     275        TPRINTF("\nRun %zu thr: post %zu no-op callbacks (%zu B used), no readers.\n",
    276276                get_thread_cnt(), exp_cnt, max_used_mem);
    277277       
     
    414414                        rcu_read_unlock();
    415415                       
    416                         if (seq_test_result != EOK) 
     416                        if (seq_test_result != EOK)
    417417                                return;
    418418                }
     
    476476       
    477477        TPRINTF("\nRun %zu th: check callback completion time in readers. "
    478                 "%zu callbacks total (max %" PRIu64 " %s used). Be patient.\n", 
     478                "%zu callbacks total (max %" PRIu64 " %s used). Be patient.\n",
    479479                get_thread_cnt(), total_cbs, mem_units, mem_suffix);
    480480       
     
    490490        } else if (seq_test_result == ERACE) {
    491491                TPRINTF("\nERROR: race detected!!\n");
    492         } 
     492        }
    493493       
    494494        return seq_test_result == EOK;
     
    531531        p->exited = false;
    532532       
    533         run_one(reader_exit, p);       
     533        run_one(reader_exit, p);
    534534        join_one();
    535535       
     
    575575        rcu_read_unlock();
    576576
    577         /* 
    578          * Start GP after exiting reader section w/ preemption. 
     577        /*
     578         * Start GP after exiting reader section w/ preemption.
    579579         * Just check that the callback does not lock up and is not lost.
    580580         */
     
    590590       
    591591        TPRINTF("reader_inside_cur{ ");
    592         /* 
    593          * Start a GP and try to finish the reader before 
    594          * the GP ends (including preemption). 
     592        /*
     593         * Start a GP and try to finish the reader before
     594         * the GP ends (including preemption).
    595595         */
    596596        rcu_call(&p->e.rcu, preempted_unlocked);
     
    667667        rcu_call(&p->e.rcu, preempted_unlocked);
    668668
    669         /* 
    670          * Preempt twice while GP is running after we've been known 
     669        /*
     670         * Preempt twice while GP is running after we've been known
    671671         * to hold up the GP just to make sure multiple preemptions
    672672         * are properly tracked if a reader is delaying the cur GP.
     
    695695        p->result = EOK;
    696696       
    697         run_one(f, p); 
     697        run_one(f, p);
    698698        join_one();
    699699       
     
    718718        bool ok = true;
    719719       
    720         ok = do_one_reader_preempt(preempted_reader_prev, 
     720        ok = do_one_reader_preempt(preempted_reader_prev,
    721721                "Err: preempted_reader_prev()\n");
    722722        success = success && ok;
    723723       
    724         ok = do_one_reader_preempt(preempted_reader_inside_cur, 
     724        ok = do_one_reader_preempt(preempted_reader_inside_cur,
    725725                "Err: preempted_reader_inside_cur()\n");
    726726        success = success && ok;
    727727       
    728         ok = do_one_reader_preempt(preempted_reader_cur, 
     728        ok = do_one_reader_preempt(preempted_reader_cur,
    729729                "Err: preempted_reader_cur()\n");
    730730        success = success && ok;
    731731       
    732         ok = do_one_reader_preempt(preempted_reader_next1, 
     732        ok = do_one_reader_preempt(preempted_reader_next1,
    733733                "Err: preempted_reader_next1()\n");
    734734        success = success && ok;
    735735
    736         ok = do_one_reader_preempt(preempted_reader_next2, 
     736        ok = do_one_reader_preempt(preempted_reader_next2,
    737737                "Err: preempted_reader_next2()\n");
    738738        success = success && ok;
     
    788788        synch->synch_running = false;
    789789       
    790         run_one(synch_reader, synch);   
     790        run_one(synch_reader, synch);
    791791       
    792792        /* Wait for the reader to enter its critical section. */
     
    866866                rcu_read_unlock();
    867867               
    868                 /* 
     868                /*
    869869                 * Do some work outside of the reader section so we are not always
    870870                 * preempted in the reader section.
     
    905905        size_t cb_per_thread = 1000 * 1000;
    906906        bool done = false;
    907         stress_t master = { .iters = cb_per_thread, .master = true }; 
    908         stress_t worker = { .iters = cb_per_thread, .master = false }; 
     907        stress_t master = { .iters = cb_per_thread, .master = true };
     908        stress_t worker = { .iters = cb_per_thread, .master = false };
    909909       
    910910        size_t thread_cnt = min(MAX_THREADS / 2, config.cpu_active);
     
    921921
    922922        TPRINTF("\nStress: Run %zu nop-readers and %zu updaters. %zu callbacks"
    923                 " total (max %" PRIu64 " %s used). Be very patient.\n", 
     923                " total (max %" PRIu64 " %s used). Be very patient.\n",
    924924                reader_cnt, updater_cnt, exp_upd_calls, mem_units, mem_suffix);
    925925       
     
    10441044                completed_gps += delta_gps;
    10451045
    1046                 if (ok) { 
    1047                         TPRINTF("\nSubtest %s() ok (GPs: %" PRIu64 ").\n", 
     1046                if (ok) {
     1047                        TPRINTF("\nSubtest %s() ok (GPs: %" PRIu64 ").\n",
    10481048                                test_func[i].desc, delta_gps);
    10491049                } else {
    10501050                        TPRINTF("\nFailed: %s(). Pausing for 5 secs.\n", test_func[i].desc);
    10511051                        thread_sleep(5);
    1052                 } 
     1052                }
    10531053        }
    10541054
  • kernel/test/synch/semaphore2.c

    rdf6ded8 r1b20da0  
    7575        }
    7676       
    77         TPRINTF("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);       
     77        TPRINTF("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);
    7878        thread_usleep(random(30000));
    7979       
  • kernel/test/synch/workq-test-core.h

    rdf6ded8 r1b20da0  
    111111                --work->count_down;
    112112
    113                 /* 
    114                  * Enqueue a child if count_down is power-of-2. 
    115                  * Leads to exponential growth. 
     113                /*
     114                 * Enqueue a child if count_down is power-of-2.
     115                 * Leads to exponential growth.
    116116                 */
    117117                if (is_pow2(work->count_down + 1)) {
     
    124124               
    125125                if (!core_workq_enqueue(work_item, reproduce)) {
    126                         if (work->master) 
     126                        if (work->master)
    127127                                TPRINTF("\nErr: Master work item exiting prematurely!\n");
    128128
     
    161161         * k == COUNT_POW
    162162         * 2^k == COUNT + 1
    163          * 
     163         *
    164164         * We have "k" branching points. Therefore:
    165165         * exp_call_cnt == k*2^(k-1) + 2^k == (k + 2) * 2^(k-1)
     
    167167        size_t exp_call_cnt = (COUNT_POW + 2) * (1 << (COUNT_POW - 1));
    168168       
    169         TPRINTF("waves: %d, count_down: %d, total expected calls: %zu\n", 
     169        TPRINTF("waves: %d, count_down: %d, total expected calls: %zu\n",
    170170                WAVES, COUNT, exp_call_cnt * WAVES);
    171171       
     
    179179       
    180180        for (int i = 0; i < WAVES; ++i) {
    181                 while (atomic_get(&call_cnt[i]) < exp_call_cnt 
     181                while (atomic_get(&call_cnt[i]) < exp_call_cnt
    182182                        && sleep_cnt < max_sleep_cnt) {
    183183                        TPRINTF(".");
     
    197197                        TPRINTF("Error: %" PRIua " calls in wave %d, but %zu expected.\n",
    198198                                atomic_get(&call_cnt[i]), i, exp_call_cnt);
    199                 } 
     199                }
    200200        }
    201201       
  • kernel/test/synch/workqueue3.c

    rdf6ded8 r1b20da0  
    6363                TPRINTF("\nSecond run:\n");
    6464                err = run_workq_core(exit_early);
    65         } 
     65        }
    6666
    6767        TPRINTF("Done.\n");
Note: See TracChangeset for help on using the changeset viewer.