Changeset 09ab0a9a in mainline for kernel/test
- Timestamp:
- 2018-09-13T12:05:53Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cc74cb5
- Parents:
- b2aaaa0
- git-author:
- Jiri Svoboda <jiri@…> (2018-09-13 07:09:46)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-09-13 12:05:53)
- Location:
- kernel/test
- Files:
-
- 7 edited
-
cht/cht1.c (modified) (4 diffs)
-
smpcall/smpcall1.c (modified) (2 diffs)
-
synch/rcu1.c (modified) (15 diffs)
-
synch/workq-test-core.h (modified) (5 diffs)
-
synch/workqueue2.c (modified) (7 diffs)
-
synch/workqueue3.c (modified) (2 diffs)
-
test.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/cht/cht1.c
rb2aaaa0 r09ab0a9a 75 75 } 76 76 77 78 77 static cht_ops_t val_ops = { 79 78 .hash = val_hash, … … 93 92 94 93 /*-------------------------------------------------------------------*/ 95 96 94 97 95 static const char *do_sanity_test(cht_t *h) … … 441 439 } 442 440 443 444 441 /* Remove anything we may have inserted. */ 445 442 for (size_t i = 0; i < work->elem_cnt; ++i) { … … 559 556 /*-------------------------------------------------------------------*/ 560 557 561 562 558 const char *test_cht1(void) 563 559 { -
kernel/test/smpcall/smpcall1.c
rb2aaaa0 r09ab0a9a 48 48 #define EACH_CPU_INC_PER_ITER 2 49 49 50 51 50 static void inc(void *p) 52 51 { … … 60 59 ++*pcall_cnt; 61 60 } 62 63 61 64 62 static void test_thread(void *p) -
kernel/test/synch/rcu1.c
rb2aaaa0 r09ab0a9a 40 40 #include <synch/rcu.h> 41 41 42 43 42 #define MAX_THREADS 32 44 43 … … 134 133 } 135 134 136 137 135 static void join_one(void) 138 136 { … … 150 148 /*-------------------------------------------------------------------*/ 151 149 152 153 150 static void nop_reader(void *arg) 154 151 { … … 195 192 /*-------------------------------------------------------------------*/ 196 193 197 198 199 194 static void long_reader(void *arg) 200 195 { … … 236 231 237 232 /*-------------------------------------------------------------------*/ 238 239 233 240 234 static atomic_t nop_callbacks_cnt = 0; … … 363 357 size_t start_time; 364 358 } seq_item_t; 365 366 359 367 360 static errno_t seq_test_result = EOK; … … 460 453 get_seq(0, total_cnt, get_thread_cnt(), read_cnt); 461 454 462 463 455 for (size_t i = 0; i < get_thread_cnt(); ++i) { 464 456 item[i].update_cnt = total_cnt - read_cnt[i]; … … 496 488 497 489 /*-------------------------------------------------------------------*/ 498 499 490 500 491 static void reader_unlocked(rcu_item_t *item) … … 555 546 errno_t result; 556 547 } preempt_t; 557 558 548 559 549 static void preempted_unlocked(rcu_item_t *item) … … 607 597 TPRINTF("}reader_inside_cur\n"); 608 598 } 609 610 599 611 600 static void preempted_reader_cur(void *arg) … … 683 672 } 684 673 685 686 674 static bool do_one_reader_preempt(void (*f)(void *), const char *err) 687 675 { … … 772 760 } 773 761 774 775 762 static bool do_synch(void) 776 763 { … … 800 787 rcu_synchronize(); 801 788 join_one(); 802 803 789 804 790 if (synch->reader_done) { … … 857 843 } stress_t; 858 844 859 860 845 static void stress_reader(void *arg) 861 846 { … … 1006 991 const char *desc; 1007 992 }; 1008 1009 993 1010 994 const char *test_rcu1(void) -
kernel/test/synch/workq-test-core.h
rb2aaaa0 r09ab0a9a 36 36 #include <synch/workqueue.h> 37 37 38 39 38 typedef struct test_work { 40 39 work_t work_item; … … 46 45 static atomic_t call_cnt[WAVES]; 47 46 48 49 47 /* Fwd decl - implement in your actual test file.. */ 50 48 static int core_workq_enqueue(work_t *work_item, work_func_t func); 51 52 49 53 50 static bool new_wave(test_work_t *work) … … 62 59 } 63 60 } 64 65 61 66 62 static int is_pow2(int num) … … 170 166 WAVES, COUNT, exp_call_cnt * WAVES); 171 167 172 173 168 core_workq_enqueue(&work->work_item, reproduce); 174 169 … … 200 195 } 201 196 202 203 197 if (success) 204 198 return NULL; -
kernel/test/synch/workqueue2.c
rb2aaaa0 r09ab0a9a 32 32 #include <synch/workqueue.h> 33 33 34 35 34 #define WAVES 10 36 35 #define COUNT_POW 12 … … 45 44 #include "workq-test-core.h" 46 45 47 48 46 /*-------------------------------------------------------------------*/ 49 47 … … 56 54 TPRINTF("basic_test_work()"); 57 55 } 58 59 56 60 57 static void basic_test(void) … … 74 71 /*-------------------------------------------------------------------*/ 75 72 76 77 73 struct work_queue *workq = NULL; 78 74 … … 82 78 } 83 79 /*-------------------------------------------------------------------*/ 84 85 80 86 81 static const char *test_custom_workq_impl(bool stop, const char *qname) … … 108 103 } 109 104 110 111 105 static const char *test_custom_workq_stop(void) 112 106 { … … 117 111 return NULL; 118 112 } 119 120 113 121 114 const char *test_workqueue_all(void) -
kernel/test/synch/workqueue3.c
rb2aaaa0 r09ab0a9a 32 32 #include <synch/workqueue.h> 33 33 34 35 34 #define WAVES 10 36 35 #define COUNT_POW 12 … … 45 44 #include "workq-test-core.h" 46 45 47 48 46 static int core_workq_enqueue(work_t *work_item, work_func_t func) 49 47 { 50 48 return workq_global_enqueue(work_item, func); 51 49 } 52 53 54 50 55 51 static const char *do_test(bool exit_early) -
kernel/test/test.h
rb2aaaa0 r09ab0a9a 82 82 extern const char *test_rcu1(void); 83 83 84 85 84 extern test_t tests[]; 86 85
Note:
See TracChangeset
for help on using the changeset viewer.
