Lines Matching +full:test +full:-
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Please send e-mail to yardleyb@us.ibm.com if you have
69 void linear_read_write_test(test_ll_t * test) in linear_read_write_test() argument
71 OFF_T *pVal1 = (OFF_T *) test->env->shared_mem; in linear_read_write_test()
74 if (test->args->flags & CLD_FLG_W) { in linear_read_write_test()
75 test->env->bContinue = TRUE; in linear_read_write_test()
76 *(pVal1 + OFF_WLBA) = test->args->start_lba; in linear_read_write_test()
77 test->args->test_state = DIRCT_INC(test->args->test_state); in linear_read_write_test()
78 test->env->lastAction.oper = WRITER; in linear_read_write_test()
79 test->args->test_state = SET_OPER_W(test->args->test_state); in linear_read_write_test()
80 test->args->test_state = SET_wFST_TIME(test->args->test_state); in linear_read_write_test()
81 // srand(test->args->seed); /* reseed so we can re create the same random trans… in linear_read_write_test()
82 memset(test->env->action_list, 0, in linear_read_write_test()
83 sizeof(action_t) * test->args->t_kids); in linear_read_write_test()
84 test->env->action_list_entry = 0; in linear_read_write_test()
85 test->env->wcount = 0; in linear_read_write_test()
86 test->env->rcount = 0; in linear_read_write_test()
87 if (test->args->flags & CLD_FLG_CYC) in linear_read_write_test()
88 if (test->args->cycles == 0) { in linear_read_write_test()
89 pMsg(INFO, test->args, in linear_read_write_test()
91 (unsigned long)test->env->pass_count); in linear_read_write_test()
93 pMsg(INFO, test->args, in linear_read_write_test()
95 (unsigned long)test->env->pass_count, in linear_read_write_test()
96 test->args->cycles); in linear_read_write_test()
98 pMsg(INFO, test->args, "Starting write pass\n"); in linear_read_write_test()
100 CreateTestChild(ChildTimer, test); in linear_read_write_test()
101 for (i = 0; i < test->args->t_kids; i++) { in linear_read_write_test()
102 CreateTestChild(ChildMain, test); in linear_read_write_test()
105 cleanUpTestChildren(test); in linear_read_write_test()
108 /* If the write test failed don't start the read test */ in linear_read_write_test()
109 if (!(TST_STS(test->args->test_state))) { in linear_read_write_test()
113 if (test->args->flags & CLD_FLG_R) { in linear_read_write_test()
114 test->env->bContinue = TRUE; in linear_read_write_test()
115 *(pVal1 + OFF_RLBA) = test->args->start_lba; in linear_read_write_test()
116 test->args->test_state = DIRCT_INC(test->args->test_state); in linear_read_write_test()
117 test->env->lastAction.oper = READER; in linear_read_write_test()
118 test->args->test_state = SET_OPER_R(test->args->test_state); in linear_read_write_test()
119 test->args->test_state = SET_rFST_TIME(test->args->test_state); in linear_read_write_test()
120 // srand(test->args->seed); /* reseed so we can re create the same random trans… in linear_read_write_test()
121 memset(test->env->action_list, 0, in linear_read_write_test()
122 sizeof(action_t) * test->args->t_kids); in linear_read_write_test()
123 test->env->action_list_entry = 0; in linear_read_write_test()
124 test->env->wcount = 0; in linear_read_write_test()
125 test->env->rcount = 0; in linear_read_write_test()
126 if (test->args->flags & CLD_FLG_CYC) in linear_read_write_test()
127 if (test->args->cycles == 0) { in linear_read_write_test()
128 pMsg(INFO, test->args, in linear_read_write_test()
130 (unsigned long)test->env->pass_count); in linear_read_write_test()
132 pMsg(INFO, test->args, in linear_read_write_test()
134 (unsigned long)test->env->pass_count, in linear_read_write_test()
135 test->args->cycles); in linear_read_write_test()
137 pMsg(INFO, test->args, "Starting read pass\n"); in linear_read_write_test()
139 CreateTestChild(ChildTimer, test); in linear_read_write_test()
140 for (i = 0; i < test->args->t_kids; i++) { in linear_read_write_test()
141 CreateTestChild(ChildMain, test); in linear_read_write_test()
144 cleanUpTestChildren(test); in linear_read_write_test()
148 unsigned long init_data(test_ll_t * test, unsigned char **data_buffer_unaligned) in init_data() argument
157 pMsg(ERR, test->args, in init_data()
162 if ((test->env->mutexs.MutexACTION = in init_data()
164 pMsg(ERR, test->args, in init_data()
169 if ((test->env->mutexs.MutexIO = in init_data()
171 pMsg(ERR, test->args, in init_data()
180 test->env->mutexs = mutexs; in init_data()
184 if (test->args->seed == 0) in init_data()
185 test->args->seed = test->args->pid; in init_data()
186 srand(test->args->seed); in init_data()
190 test->env->bmp_siz = in init_data()
191 (((((size_t) test->args->vsiz)) / 8) == in init_data()
192 0) ? 1 : ((((size_t) test->args->vsiz)) / 8); in init_data()
193 if ((test->args->vsiz / 8) != 0) in init_data()
194 test->env->bmp_siz += 1; /* account for rounding error */ in init_data()
197 data_buffer_size = ((test->args->htrsiz * BLK_SIZE) * 2); in init_data()
200 pMsg(ERR, test->args, in init_data()
202 return (-1); in init_data()
205 if ((test->env->action_list = in init_data()
206 (action_t *) ALLOC(sizeof(action_t) * test->args->t_kids)) == in init_data()
208 pMsg(ERR, test->args, in init_data()
210 return (-1); in init_data()
213 test->env->data_buffer = in init_data()
216 if ((test->env->shared_mem = in init_data()
217 (void *)ALLOC(test->env->bmp_siz + BMP_OFFSET)) == NULL) { in init_data()
218 pMsg(ERR, test->args, "Failed to allocate bitmap memory\n"); in init_data()
219 return (-1); in init_data()
222 memset(test->env->shared_mem, 0, test->env->bmp_siz + BMP_OFFSET); in init_data()
223 memset(test->env->data_buffer, 0, data_buffer_size); in init_data()
224 memset(test->env->action_list, 0, in init_data()
225 sizeof(action_t) * test->args->t_kids); in init_data()
226 test->env->action_list_entry = 0; in init_data()
228 pVal1 = (OFF_T *) test->env->shared_mem; in init_data()
229 *(pVal1 + OFF_WLBA) = test->args->start_lba; in init_data()
230 *(pVal1 + OFF_RLBA) = test->args->start_lba; in init_data()
231 test->args->test_state = SET_STS_PASS(test->args->test_state); in init_data()
232 test->args->test_state = SET_wFST_TIME(test->args->test_state); in init_data()
233 test->args->test_state = SET_rFST_TIME(test->args->test_state); in init_data()
234 test->args->test_state = DIRCT_INC(test->args->test_state); in init_data()
235 if (test->args->flags & CLD_FLG_W) { in init_data()
236 test->env->lastAction.oper = WRITER; in init_data()
237 test->args->test_state = SET_OPER_W(test->args->test_state); in init_data()
239 test->env->lastAction.oper = READER; in init_data()
240 test->args->test_state = SET_OPER_R(test->args->test_state); in init_data()
244 switch (test->args->flags & CLD_FLG_PTYPS) { in init_data()
246 for (i = 0; i < sizeof(test->args->pattern); i++) { in init_data()
247 if ((test->args-> in init_data()
249 (((sizeof(test->args->pattern) - 1) - in init_data()
254 if (i == sizeof(test->args->pattern)) in init_data()
256 fill_buffer(test->env->data_buffer, data_buffer_size, in init_data()
257 &test->args->pattern, in init_data()
258 sizeof(test->args->pattern) - i, CLD_FLG_FPTYPE); in init_data()
261 fill_buffer(test->env->data_buffer, data_buffer_size, NULL, 0, in init_data()
265 fill_buffer(test->env->data_buffer, data_buffer_size, 0, 0, in init_data()
270 pMsg(WARN, test->args, "Unknown fill pattern\n"); in init_data()
271 return (-1); in init_data()
278 DWORD WINAPI threadedMain(test_ll_t * test) in threadedMain() argument
284 test_ll_t *test = (test_ll_t *) vtest; in threadedMain() local
296 test->args->pid = GETPID(); in threadedMain()
298 init_gbl_data(test->env); in threadedMain()
300 if (make_assumptions(test->args) < 0) { in threadedMain()
303 if (check_conclusions(test->args) < 0) { in threadedMain()
306 if (test->args->flags & CLD_FLG_DUMP) { in threadedMain()
311 do_dump(test->args); in threadedMain()
314 ulRV = init_data(test, &data_buffer_unaligned); in threadedMain()
318 pVal1 = (OFF_T *) test->env->shared_mem; in threadedMain()
321 pMsg(START, test->args, "Start args: %s\n", test->args->argstr); in threadedMain()
327 test->env->pass_count++; in threadedMain()
328 test->env->start_time = time(NULL); in threadedMain()
329 if (test->args->flags & CLD_FLG_RPTYPE) { /* force random data to be different each cycle */ in threadedMain()
330 fill_buffer(test->env->data_buffer, in threadedMain()
331 ((test->args->htrsiz * BLK_SIZE) * 2), NULL, in threadedMain()
334 sharedMem = test->env->shared_mem; in threadedMain()
335 memset(sharedMem + BMP_OFFSET, 0, test->env->bmp_siz); in threadedMain()
336 if ((test->args->flags & CLD_FLG_LINEAR) in threadedMain()
337 && !(test->args->flags & CLD_FLG_NTRLVD)) { in threadedMain()
338 linear_read_write_test(test); in threadedMain()
340 /* we only reset the end time if not running a linear read / write test */ in threadedMain()
341 test->env->end_time = in threadedMain()
342 test->env->start_time + test->args->run_time; in threadedMain()
343 test->env->bContinue = TRUE; in threadedMain()
344 *(pVal1 + OFF_WLBA) = test->args->start_lba; in threadedMain()
345 test->args->test_state = in threadedMain()
346 DIRCT_INC(test->args->test_state); in threadedMain()
347 test->args->test_state = in threadedMain()
348 SET_wFST_TIME(test->args->test_state); in threadedMain()
349 test->args->test_state = in threadedMain()
350 SET_rFST_TIME(test->args->test_state); in threadedMain()
351 if (test->args->flags & CLD_FLG_W) { in threadedMain()
352 test->env->lastAction.oper = WRITER; in threadedMain()
353 test->args->test_state = in threadedMain()
354 SET_OPER_W(test->args->test_state); in threadedMain()
356 test->env->lastAction.oper = READER; in threadedMain()
357 test->args->test_state = in threadedMain()
358 SET_OPER_R(test->args->test_state); in threadedMain()
360 memset(test->env->action_list, 0, in threadedMain()
361 sizeof(action_t) * test->args->t_kids); in threadedMain()
362 test->env->action_list_entry = 0; in threadedMain()
363 test->env->wcount = 0; in threadedMain()
364 test->env->rcount = 0; in threadedMain()
366 if (test->args->flags & CLD_FLG_CYC) in threadedMain()
367 if (test->args->cycles == 0) { in threadedMain()
368 pMsg(INFO, test->args, in threadedMain()
370 (unsigned long)test->env-> in threadedMain()
373 pMsg(INFO, test->args, in threadedMain()
375 (unsigned long)test->env-> in threadedMain()
376 pass_count, test->args->cycles); in threadedMain()
378 pMsg(INFO, test->args, "Starting pass\n"); in threadedMain()
381 CreateTestChild(ChildTimer, test); in threadedMain()
382 for (i = 0; i < test->args->t_kids; i++) { in threadedMain()
383 CreateTestChild(ChildMain, test); in threadedMain()
386 cleanUpTestChildren(test); in threadedMain()
389 update_cyc_stats(test->env); in threadedMain()
390 if ((test->args->flags & CLD_FLG_CYC) in threadedMain()
391 && (test->args->flags & CLD_FLG_PCYC)) { in threadedMain()
392 print_stats(test->args, test->env, CYCLE); in threadedMain()
394 update_gbl_stats(test->env); in threadedMain()
403 if (!(test->args->flags & CLD_FLG_CYC)) { in threadedMain()
406 if ((test->args->cycles > 0) in threadedMain()
407 && (test->env->pass_count >= test->args->cycles)) { in threadedMain()
411 } while (TST_STS(test->args->test_state)); in threadedMain()
412 print_stats(test->args, test->env, TOTAL); in threadedMain()
415 FREE(test->env->shared_mem); in threadedMain()
421 if (TST_STS(test->args->test_state)) { in threadedMain()
423 pMsg(END, test->args, in threadedMain()
424 "User Interrupt: Test Done (Passed)\n"); in threadedMain()
426 pMsg(END, test->args, "Test Done (Passed)\n"); in threadedMain()
430 pMsg(END, test->args, in threadedMain()
431 "User Interrupt: Test Done (Failed)\n"); in threadedMain()
433 pMsg(END, test->args, "Test Done (Failed)\n"); in threadedMain()
440 * Creates a new test structure and adds it to the list of
441 * test structures already available. Allocate all memory
442 * needed by the new test.
444 * Returns the newly created test structure
452 "%d : Could not allocate memory for new test.\n", in getNewTest()
459 if ((pNewTest->args = in getNewTest()
462 "%d : Could not allocate memory for new test.\n", in getNewTest()
467 if ((pNewTest->env = (test_env_t *) ALLOC(sizeof(test_env_t))) == NULL) { in getNewTest()
469 "%d : Could not allocate memory for new test.\n", in getNewTest()
471 FREE(pNewTest->args); in getNewTest()
475 memcpy(pNewTest->args, &cleanArgs, sizeof(child_args_t)); in getNewTest()
476 memcpy(pNewTest->env, &cleanEnv, sizeof(test_env_t)); in getNewTest()
478 pNewTest->next = testList; in getNewTest()
516 memset(newTest->args->device, 0, in run()
518 strncpy(newTest->args->device, in run()
571 cleanArgs.stop_lba = -1; in main()
572 cleanArgs.stop_blk = -1; in main()
578 for (i = 1; i < argc - 1; i++) { in main()
580 (MAX_ARG_LEN - 1) - strlen(cleanArgs.argstr)); in main()
582 (MAX_ARG_LEN - 1) - strlen(cleanArgs.argstr)); in main()