Lines Matching full:args
47 int fill_cld_args(int argc, char **argv, child_args_t * args) in fill_cld_args() argument
62 pMsg(WARN, args, "Missing argument for perameter.\n"); in fill_cld_args()
68 pMsg(WARN, args, in fill_cld_args()
73 pMsg(WARN, args, in fill_cld_args()
79 pMsg(ERR, args, in fill_cld_args()
87 args->flags |= CLD_FLG_DUMP; in fill_cld_args()
91 pMsg(WARN, args, in fill_cld_args()
96 pMsg(WARN, args, in fill_cld_args()
100 args->seed = (unsigned int)strtol(optarg, NULL, 0); in fill_cld_args()
104 pMsg(WARN, args, in fill_cld_args()
112 args->flags &= ~CLD_FLG_ALLDIE; in fill_cld_args()
115 args->flags |= CLD_FLG_ERR_MARK; in fill_cld_args()
118 args->flags &= ~CLD_FLG_ERR_REREAD; in fill_cld_args()
121 args->flags &= ~CLD_FLG_LBA_SYNC; in fill_cld_args()
124 args->flags |= CLD_FLG_IO_SERIAL; in fill_cld_args()
127 args->flags |= CLD_FLG_WRITE_ONCE; in fill_cld_args()
130 args->flags |= CLD_FLG_UNIQ_WRT; in fill_cld_args()
133 args->flags |= CLD_FLG_TMO_ERROR; in fill_cld_args()
143 pMsg(INFO, args, "Version %s\n", VER_STR); in fill_cld_args()
147 pMsg(WARN, args, in fill_cld_args()
151 if (args->flags & (CLD_FLG_LINEAR | CLD_FLG_RANDOM)) { in fill_cld_args()
152 pMsg(WARN, args, in fill_cld_args()
158 args->flags |= CLD_FLG_LINEAR; in fill_cld_args()
160 args->flags |= in fill_cld_args()
163 args->flags |= CLD_FLG_RANDOM; in fill_cld_args()
165 args->flags |= in fill_cld_args()
168 pMsg(WARN, args, "Unknown Seek pattern\n"); in fill_cld_args()
173 if ((args->flags & (CLD_FLG_LINEAR)) && in fill_cld_args()
174 !(args->flags & CLD_FLG_LUND)) in fill_cld_args()
175 args->flags |= CLD_FLG_LUNU; in fill_cld_args()
177 if ((args->flags & (CLD_FLG_LINEAR)) && in fill_cld_args()
178 !(args->flags & CLD_FLG_LUNU)) in fill_cld_args()
179 args->flags |= CLD_FLG_LUND; in fill_cld_args()
183 pMsg(WARN, args, in fill_cld_args()
188 args->flags |= CLD_FLG_RTRSIZ; in fill_cld_args()
189 args->ltrsiz = strtoul(optarg, &leftovers, 10); in fill_cld_args()
191 args->ltrsiz *= 2; in fill_cld_args()
194 args->ltrsiz *= (2 * 1024); in fill_cld_args()
197 if (args->ltrsiz > 256) in fill_cld_args()
198 args->ltrsiz /= BLK_SIZE; in fill_cld_args()
201 pMsg(WARN, args, in fill_cld_args()
206 args->htrsiz = in fill_cld_args()
209 args->htrsiz *= 2; in fill_cld_args()
211 args->htrsiz *= (2 * 1024); in fill_cld_args()
213 if (args->htrsiz > 256) in fill_cld_args()
214 args->htrsiz /= BLK_SIZE; in fill_cld_args()
217 args->ltrsiz = atoi(optarg); in fill_cld_args()
219 args->ltrsiz *= 2; in fill_cld_args()
221 args->ltrsiz *= (2 * 1024); in fill_cld_args()
223 if (args->ltrsiz > 256) in fill_cld_args()
224 args->ltrsiz /= BLK_SIZE; in fill_cld_args()
226 args->htrsiz = args->ltrsiz; in fill_cld_args()
229 PDBG5(DBUG, args, "Parsed Transfer size: %ld\n", in fill_cld_args()
230 args->htrsiz); in fill_cld_args()
234 if (args->flags & CLD_FLG_PTYPS) { in fill_cld_args()
235 pMsg(WARN, args, in fill_cld_args()
240 args->flags |= CLD_FLG_CPTYPE; in fill_cld_args()
243 if (args->flags & CLD_FLG_PTYPS) { in fill_cld_args()
244 pMsg(WARN, args, in fill_cld_args()
249 args->flags |= CLD_FLG_LPTYPE; in fill_cld_args()
253 pMsg(WARN, args, in fill_cld_args()
257 if (args->flags & CLD_FLG_PTYPS) { in fill_cld_args()
258 pMsg(WARN, args, in fill_cld_args()
263 args->pattern = my_strtofft(optarg); in fill_cld_args()
264 args->flags |= CLD_FLG_FPTYPE; in fill_cld_args()
268 args->flags |= CLD_FLG_FSLIST; in fill_cld_args()
271 if (args->flags & CLD_FLG_PTYPS) { in fill_cld_args()
272 pMsg(WARN, args, in fill_cld_args()
277 args->flags |= CLD_FLG_RPTYPE; in fill_cld_args()
281 pMsg(WARN, args, in fill_cld_args()
286 pMsg(WARN, args, in fill_cld_args()
291 args->flags |= CLD_FLG_HBEAT; in fill_cld_args()
292 args->hbeat = atoi(optarg); in fill_cld_args()
294 args->hbeat *= 60; in fill_cld_args()
296 args->hbeat *= (time_t) (60 * 60); in fill_cld_args()
298 args->hbeat *= (time_t) (60 * 60 * 24); in fill_cld_args()
303 pMsg(WARN, args, in fill_cld_args()
308 pMsg(WARN, args, in fill_cld_args()
313 args->rperc = atoi(optarg); in fill_cld_args()
314 args->wperc = atoi((char *)(strchr(optarg, ':') + 1)); in fill_cld_args()
315 args->flags |= CLD_FLG_DUTY; in fill_cld_args()
318 args->flags |= CLD_FLG_R; in fill_cld_args()
321 args->flags |= CLD_FLG_W; in fill_cld_args()
325 pMsg(WARN, args, in fill_cld_args()
329 args->offset = atol(optarg); in fill_cld_args()
330 args->flags |= CLD_FLG_OFFSET; in fill_cld_args()
334 pMsg(WARN, args, in fill_cld_args()
339 args->retries = strtol(optarg, &leftovers, 10); in fill_cld_args()
340 args->retry_delay = in fill_cld_args()
344 args->retries = atoi(optarg); in fill_cld_args()
349 pMsg(WARN, args, in fill_cld_args()
353 args->flags |= CLD_FLG_ALT_MARK; in fill_cld_args()
354 args->alt_mark = my_strtofft(optarg); in fill_cld_args()
357 args->flags |= CLD_FLG_MBLK; in fill_cld_args()
359 pMsg(WARN, args, in fill_cld_args()
364 args->flags |= CLD_FLG_MRK_LBA; in fill_cld_args()
367 args->flags |= CLD_FLG_MRK_PASS; in fill_cld_args()
370 args->flags |= CLD_FLG_MRK_TIME; in fill_cld_args()
373 args->flags |= CLD_FLG_MRK_SEED; in fill_cld_args()
376 args->flags |= CLD_FLG_MRK_HOST; in fill_cld_args()
379 args->flags |= CLD_FLG_MRK_TARGET; in fill_cld_args()
382 args->flags |= CLD_FLG_MRK_ALL; in fill_cld_args()
390 pMsg(WARN, args, in fill_cld_args()
397 pMsg(WARN, args, in fill_cld_args()
402 pMsg(WARN, args, in fill_cld_args()
407 args->flags |= CLD_FLG_CMPR; in fill_cld_args()
408 args->cmp_lng = strtol(optarg, NULL, 0); in fill_cld_args()
410 args->cmp_lng <<= 10; in fill_cld_args()
412 args->cmp_lng *= 1000; in fill_cld_args()
414 args->cmp_lng <<= 20; in fill_cld_args()
416 args->cmp_lng *= 1000000; in fill_cld_args()
421 pMsg(WARN, args, in fill_cld_args()
426 pMsg(WARN, args, in fill_cld_args()
430 args->flags |= CLD_FLG_VSIZ; in fill_cld_args()
431 args->vsiz = my_strtofft(optarg); in fill_cld_args()
433 args->vsiz <<= 10; in fill_cld_args()
435 args->vsiz *= 1000; in fill_cld_args()
437 args->vsiz <<= 20; in fill_cld_args()
439 args->vsiz *= 1000000; in fill_cld_args()
441 args->vsiz <<= 30; in fill_cld_args()
443 args->vsiz *= 1000000000; in fill_cld_args()
448 pMsg(WARN, args, in fill_cld_args()
453 if (!(args->flags & CLD_FLG_BLK) && in fill_cld_args()
454 !(args->flags & CLD_FLG_FILE)) { in fill_cld_args()
455 args->flags |= CLD_FLG_RAW; in fill_cld_args()
457 pMsg(WARN, args, in fill_cld_args()
463 if (!(args->flags & CLD_FLG_RAW) && in fill_cld_args()
464 !(args->flags & CLD_FLG_FILE)) { in fill_cld_args()
465 args->flags |= CLD_FLG_BLK; in fill_cld_args()
467 pMsg(WARN, args, in fill_cld_args()
473 if (!(args->flags & CLD_FLG_RAW) && in fill_cld_args()
474 !(args->flags & CLD_FLG_BLK)) { in fill_cld_args()
475 args->flags |= CLD_FLG_FILE; in fill_cld_args()
477 pMsg(WARN, args, in fill_cld_args()
483 args->flags |= CLD_FLG_DIRECT; in fill_cld_args()
486 args->sync_interval = in fill_cld_args()
490 PDBG3(DBUG, args, "Parsed sync interval: %ld\n", in fill_cld_args()
491 args->sync_interval); in fill_cld_args()
493 if ((args->flags & CLD_FLG_DIRECT)) { in fill_cld_args()
494 pMsg(ERR, args, in fill_cld_args()
498 args->flags |= CLD_FLG_WFSYNC; in fill_cld_args()
503 pMsg(WARN, args, in fill_cld_args()
509 args->delayTimeMin = in fill_cld_args()
515 args->delayTimeMax = args->delayTimeMin; in fill_cld_args()
516 args->ioTimeout = in fill_cld_args()
522 args->delayTimeMax = in fill_cld_args()
525 args->ioTimeout = in fill_cld_args()
531 args->ioTimeout *= 60; in fill_cld_args()
533 args->ioTimeout *= (time_t) (60 * 60); in fill_cld_args()
535 args->ioTimeout *= in fill_cld_args()
539 args->delayTimeMin = in fill_cld_args()
541 args->delayTimeMax = args->delayTimeMin; in fill_cld_args()
546 pMsg(WARN, args, in fill_cld_args()
550 args->run_time = atoi(optarg); in fill_cld_args()
551 args->flags |= CLD_FLG_TMD; in fill_cld_args()
553 args->run_time *= 60; in fill_cld_args()
555 args->run_time *= (time_t) (60 * 60); in fill_cld_args()
557 args->run_time *= (time_t) (60 * 60 * 24); in fill_cld_args()
562 pMsg(WARN, args, in fill_cld_args()
566 args->seeks = atoi(optarg); in fill_cld_args()
567 args->flags |= CLD_FLG_SKS; in fill_cld_args()
569 args->seeks <<= 10; in fill_cld_args()
571 args->seeks *= 1000; in fill_cld_args()
573 args->seeks <<= 20; in fill_cld_args()
575 args->seeks *= 1000000; in fill_cld_args()
577 args->seeks <<= 30; in fill_cld_args()
579 args->seeks *= 1000000000; in fill_cld_args()
584 pMsg(WARN, args, in fill_cld_args()
589 pMsg(WARN, args, in fill_cld_args()
594 args->flags |= CLD_FLG_CYC; in fill_cld_args()
595 args->cycles = atol(optarg); in fill_cld_args()
599 pMsg(WARN, args, in fill_cld_args()
604 pMsg(WARN, args, in fill_cld_args()
610 pMsg(WARN, args, in fill_cld_args()
615 args->t_kids = atoi(optarg); in fill_cld_args()
619 pMsg(WARN, args, in fill_cld_args()
624 args->flags |= CLD_FLG_XFERS; in fill_cld_args()
627 args->flags |= CLD_FLG_TPUTS; in fill_cld_args()
633 args->flags |= CLD_FLG_RUNT; in fill_cld_args()
636 args->flags |= CLD_FLG_PCYC; in fill_cld_args()
639 args->flags |= CLD_FLG_PRFTYPS; in fill_cld_args()
646 pMsg(WARN, args, in fill_cld_args()
653 pMsg(WARN, args, in fill_cld_args()
657 args->flags |= CLD_FLG_BLK_RNG; in fill_cld_args()
659 args->start_blk = in fill_cld_args()
662 args->start_blk <<= 10; in fill_cld_args()
665 args->start_blk *= 1000; in fill_cld_args()
668 args->start_blk <<= 20; in fill_cld_args()
671 args->start_blk *= 1000000; in fill_cld_args()
674 args->start_blk <<= 30; in fill_cld_args()
677 args->start_blk *= 1000000000; in fill_cld_args()
682 pMsg(WARN, args, in fill_cld_args()
687 args->stop_blk = in fill_cld_args()
690 args->stop_blk <<= 10; in fill_cld_args()
692 args->stop_blk *= 1000; in fill_cld_args()
694 args->stop_blk <<= 20; in fill_cld_args()
696 args->stop_blk *= 1000000; in fill_cld_args()
698 args->stop_blk <<= 30; in fill_cld_args()
700 args->stop_blk *= 1000000000; in fill_cld_args()
703 args->start_blk = in fill_cld_args()
706 args->start_blk <<= 10; in fill_cld_args()
708 args->start_blk *= 1000; in fill_cld_args()
710 args->start_blk <<= 20; in fill_cld_args()
712 args->start_blk *= 1000000; in fill_cld_args()
714 args->start_blk <<= 30; in fill_cld_args()
716 args->start_blk *= 1000000000; in fill_cld_args()
722 pMsg(WARN, args, in fill_cld_args()
726 args->flags |= CLD_FLG_LBA_RNG; in fill_cld_args()
728 args->start_lba = in fill_cld_args()
731 args->start_lba <<= 10; in fill_cld_args()
734 args->start_lba *= 1000; in fill_cld_args()
737 args->start_lba <<= 20; in fill_cld_args()
740 args->start_lba *= 1000000; in fill_cld_args()
743 args->start_lba <<= 30; in fill_cld_args()
746 args->start_lba *= 1000000000; in fill_cld_args()
751 pMsg(WARN, args, in fill_cld_args()
756 args->stop_lba = in fill_cld_args()
759 args->stop_lba <<= 10; in fill_cld_args()
761 args->stop_lba *= 1000; in fill_cld_args()
763 args->stop_lba <<= 20; in fill_cld_args()
765 args->stop_lba *= 1000000; in fill_cld_args()
767 args->stop_lba <<= 30; in fill_cld_args()
769 args->stop_lba *= 1000000000; in fill_cld_args()
772 args->start_lba = in fill_cld_args()
775 args->start_lba <<= 10; in fill_cld_args()
777 args->start_lba *= 1000; in fill_cld_args()
779 args->start_lba <<= 20; in fill_cld_args()
781 args->start_lba *= 1000000; in fill_cld_args()
783 args->start_lba <<= 30; in fill_cld_args()
785 args->start_lba *= 1000000000; in fill_cld_args()
796 pMsg(WARN, args, "Unspecified target.\n"); in fill_cld_args()
799 strncpy(args->device, argv[optind], (DEV_NAME_LEN - 1)); in fill_cld_args()
803 int make_assumptions(child_args_t * args) in make_assumptions() argument
809 if (!(args->flags & CLD_FLG_IOTYPS)) { in make_assumptions()
811 rv = stat(args->device, &stat_buf); in make_assumptions()
814 strncat(args->argstr, "(-I f) ", in make_assumptions()
816 strlen(args->argstr)); in make_assumptions()
817 args->flags |= CLD_FLG_FILE; in make_assumptions()
819 strncat(args->argstr, "(-I b) ", in make_assumptions()
821 strlen(args->argstr)); in make_assumptions()
822 args->flags |= CLD_FLG_BLK; in make_assumptions()
825 strncat(args->argstr, "(-I r) ", in make_assumptions()
827 strlen(args->argstr)); in make_assumptions()
828 args->flags |= CLD_FLG_RAW; in make_assumptions()
832 pMsg(WARN, args, in make_assumptions()
834 args->device, GETLASTERROR()); in make_assumptions()
835 strncat(args->argstr, "(-I f) ", in make_assumptions()
836 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
837 args->flags |= CLD_FLG_FILE; in make_assumptions()
840 if ((args->flags & CLD_FLG_WFSYNC) && (0 == args->sync_interval)) { in make_assumptions()
841 pMsg(INFO, args, in make_assumptions()
843 args->sync_interval = 1; in make_assumptions()
846 if (args->ltrsiz <= 0) { in make_assumptions()
848 strncat(args->argstr, TmpStr, in make_assumptions()
849 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
850 args->ltrsiz = TRSIZ; in make_assumptions()
851 args->htrsiz = TRSIZ; in make_assumptions()
853 if (args->flags & CLD_FLG_LBA_RNG) { in make_assumptions()
854 args->start_blk = args->start_lba / args->htrsiz; in make_assumptions()
855 if (!(args->stop_lba < 0)) in make_assumptions()
856 args->stop_blk = args->stop_lba / args->htrsiz; in make_assumptions()
858 if (args->flags & CLD_FLG_BLK_RNG) { in make_assumptions()
859 args->start_lba = args->start_blk * args->htrsiz; in make_assumptions()
860 if (!(args->stop_blk < 0)) in make_assumptions()
861 args->stop_lba = in make_assumptions()
862 (args->stop_blk * args->htrsiz) + (args->htrsiz - in make_assumptions()
866 if ((args->vsiz <= 0) && (args->flags & CLD_FLG_FILE)) { in make_assumptions()
867 if (0 != get_file_size(args->device)) { /* file size retrieved */ in make_assumptions()
868 args->vsiz = get_file_size(args->device); in make_assumptions()
872 if ((args->vsiz <= 0) && !(args->flags & CLD_FLG_FILE)) { in make_assumptions()
873 args->vsiz = get_vsiz(args->device); in make_assumptions()
876 if ((args->vsiz <= 0) in make_assumptions()
877 && (args->flags & (CLD_FLG_LBA_RNG | CLD_FLG_BLK_RNG))) { in make_assumptions()
878 if (!(args->stop_lba < 0)) in make_assumptions()
879 args->vsiz = args->stop_lba + 1; in make_assumptions()
881 args->vsiz = args->start_lba + 1; in make_assumptions()
884 if (args->vsiz <= 0) { in make_assumptions()
885 args->vsiz = VSIZ; in make_assumptions()
887 if (!(args->flags & CLD_FLG_VSIZ)) { in make_assumptions()
888 sprintf(TmpStr, N_ASSUME, args->vsiz); in make_assumptions()
889 strncat(args->argstr, TmpStr, in make_assumptions()
890 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
893 if (args->stop_lba == -1) { in make_assumptions()
894 args->stop_lba = args->vsiz - 1; in make_assumptions()
896 if (args->stop_blk == -1) { in make_assumptions()
897 args->stop_blk = (args->stop_lba / (OFF_T) args->htrsiz); in make_assumptions()
899 if (args->t_kids == 0) { in make_assumptions()
901 strncat(args->argstr, TmpStr, in make_assumptions()
902 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
903 args->t_kids = KIDS; in make_assumptions()
905 if ((args->flags & (CLD_FLG_W | CLD_FLG_R)) == 0) { in make_assumptions()
906 if (args->flags & CLD_FLG_DUTY) { /* no read/write but duty cycle specified */ in make_assumptions()
907 if (args->rperc > 0) { in make_assumptions()
908 args->flags |= CLD_FLG_R; in make_assumptions()
909 strncat(args->argstr, "(-r) ", in make_assumptions()
911 strlen(args->argstr)); in make_assumptions()
913 if (args->wperc > 0) { in make_assumptions()
914 args->flags |= CLD_FLG_W; in make_assumptions()
915 strncat(args->argstr, "(-w) ", in make_assumptions()
917 strlen(args->argstr)); in make_assumptions()
920 strncat(args->argstr, "(-r) ", in make_assumptions()
921 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
922 args->flags |= CLD_FLG_R; in make_assumptions()
925 if (!(args->flags & CLD_FLG_PTYPS)) { in make_assumptions()
926 strncat(args->argstr, "(-c) ", in make_assumptions()
927 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
928 args->flags |= CLD_FLG_CPTYPE; in make_assumptions()
930 if (!(args->flags & CLD_FLG_SKTYPS)) { in make_assumptions()
931 strncat(args->argstr, "(-p R) ", in make_assumptions()
932 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
933 args->flags |= CLD_FLG_RANDOM; in make_assumptions()
935 if (!(args->flags & CLD_FLG_SKS)) { in make_assumptions()
936 if (args->start_blk == args->stop_blk) { /* diskcache test, w/ no seek count set */ in make_assumptions()
937 args->seeks = SEEKS; in make_assumptions()
938 } else if (args->flags & (CLD_FLG_BLK_RNG | CLD_FLG_LBA_RNG)) { /* range set, w/ no seek count */ in make_assumptions()
939 args->seeks = args->stop_blk - args->start_blk + 1; in make_assumptions()
942 args->seeks = in make_assumptions()
943 (args->vsiz > in make_assumptions()
944 0) ? (args->vsiz / args->htrsiz) : SEEKS; in make_assumptions()
946 if ((args->flags & CLD_FLG_LINEAR) && (args->flags & CLD_FLG_R) in make_assumptions()
947 && (args->flags & CLD_FLG_W)) { in make_assumptions()
948 args->seeks *= 2; in make_assumptions()
951 if (!(args->flags & CLD_FLG_TMD)) { in make_assumptions()
952 sprintf(TmpStr, L_ASSUME, args->seeks); in make_assumptions()
953 strncat(args->argstr, TmpStr, in make_assumptions()
954 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
957 if (!(args->flags & (CLD_FLG_SKS | CLD_FLG_TMD)) in make_assumptions()
958 || ((args->flags & CLD_FLG_CYC) in make_assumptions()
959 && !(args->flags & (CLD_FLG_SKS | CLD_FLG_TMD)))) { in make_assumptions()
960 args->flags |= CLD_FLG_SKS; in make_assumptions()
962 if (args->flags & (CLD_FLG_LINEAR)) { in make_assumptions()
963 if (!(args->flags & (CLD_FLG_LUNU | CLD_FLG_LUND))) { in make_assumptions()
964 strncat(args->argstr, "(-p u) ", in make_assumptions()
965 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
966 args->flags |= CLD_FLG_LUNU; in make_assumptions()
969 normalize_percs(args); in make_assumptions()
970 if (!(args->flags & CLD_FLG_DUTY) && (args->flags & CLD_FLG_RANDOM) in make_assumptions()
971 && !(args->flags & CLD_FLG_NTRLVD)) { in make_assumptions()
972 sprintf(TmpStr, "(-D %d:%d) ", args->rperc, args->wperc); in make_assumptions()
973 strncat(args->argstr, TmpStr, in make_assumptions()
974 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
975 args->flags |= CLD_FLG_DUTY; in make_assumptions()
977 if ((args->delayTimeMin == 0) && (args->delayTimeMax == 0) in make_assumptions()
978 && (args->ioTimeout == DEFAULT_IO_TIMEOUT)) { in make_assumptions()
979 strncat(args->argstr, "(-t 0:2m) ", in make_assumptions()
980 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
982 if (!(args->flags & CLD_FLG_OFFSET)) { in make_assumptions()
983 strncat(args->argstr, "(-o 0) ", in make_assumptions()
984 (MAX_ARG_LEN - 1) - strlen(args->argstr)); in make_assumptions()
992 * args and make assumtions. returns 0 on
995 int check_conclusions(child_args_t * args) in check_conclusions() argument
1001 if ((args->flags & CLD_FLG_DUTY) in check_conclusions()
1002 && ((args->flags & CLD_FLG_LINEAR) in check_conclusions()
1003 || (args->flags & CLD_FLG_NTRLVD))) { in check_conclusions()
1004 pMsg(WARN, args, in check_conclusions()
1008 if ((args->flags & CLD_FLG_BLK_RNG) && (args->flags & CLD_FLG_RTRSIZ)) { in check_conclusions()
1009 pMsg(WARN, args, in check_conclusions()
1013 if ((args->vsiz < 0) || (args->ltrsiz < 1) || (args->htrsiz < 1)) { in check_conclusions()
1014 pMsg(WARN, args, in check_conclusions()
1016 pMsg(WARN, args, MAXTRSIZ, (args->htrsiz * BLK_SIZE), in check_conclusions()
1017 args->vsiz); in check_conclusions()
1020 if (args->htrsiz < args->ltrsiz) { in check_conclusions()
1021 pMsg(ERR, args, in check_conclusions()
1023 args->ltrsiz, args->htrsiz); in check_conclusions()
1026 if (args->vsiz < (args->stop_lba - args->start_lba + 1)) { in check_conclusions()
1027 pMsg(ERR, args, "Volume stop block/lba exceeds volume size.\n"); in check_conclusions()
1030 if (args->vsiz < args->htrsiz) { in check_conclusions()
1031 pMsg(WARN, args, VSIZETS, args->vsiz, args->htrsiz); in check_conclusions()
1034 if ((args->flags & CLD_FLG_TMD) == 0 && (args->seeks <= 0)) { in check_conclusions()
1035 pMsg(WARN, args, TSEEK, args->seeks); in check_conclusions()
1038 if ((args->flags & CLD_FLG_SKS) && (args->t_kids > args->seeks)) { in check_conclusions()
1039 pMsg(WARN, args, in check_conclusions()
1043 if ((args->start_blk > args->vsiz) in check_conclusions()
1044 && !(args->flags & (CLD_FLG_BLK_RNG | CLD_FLG_LBA_RNG))) { in check_conclusions()
1045 pMsg(WARN, args, STBGTTLBA, args->start_blk, in check_conclusions()
1046 (args->vsiz / args->htrsiz)); in check_conclusions()
1049 if ((args->stop_blk > args->vsiz) in check_conclusions()
1050 && !(args->flags & (CLD_FLG_BLK_RNG | CLD_FLG_LBA_RNG))) { in check_conclusions()
1051 pMsg(WARN, args, SBGTTLBA, args->stop_blk, in check_conclusions()
1052 (args->vsiz / args->htrsiz)); in check_conclusions()
1055 if ((args->start_lba > args->vsiz) in check_conclusions()
1056 && !(args->flags & (CLD_FLG_BLK_RNG | CLD_FLG_LBA_RNG))) { in check_conclusions()
1057 pMsg(WARN, args, STLBAGTLBA, args->start_lba, args->vsiz); in check_conclusions()
1060 if ((args->stop_lba > args->vsiz) in check_conclusions()
1061 && !(args->flags & (CLD_FLG_BLK_RNG | CLD_FLG_LBA_RNG))) { in check_conclusions()
1062 pMsg(WARN, args, SLBAGTLBA, args->stop_lba, args->vsiz); in check_conclusions()
1065 if (args->start_blk > args->stop_blk) { in check_conclusions()
1066 pMsg(WARN, args, SBRSB, args->stop_blk, args->start_blk); in check_conclusions()
1069 if (args->start_lba > args->stop_lba) { in check_conclusions()
1070 pMsg(ERR, args, SLBARSLBA, args->stop_lba, args->start_lba); in check_conclusions()
1073 if ((args->flags & CLD_FLG_LBA_RNG) && (args->flags & CLD_FLG_BLK_RNG)) { in check_conclusions()
1074 pMsg(ERR, args, in check_conclusions()
1080 rv = stat(args->device, &stat_buf); in check_conclusions()
1083 if ((args->flags & CLD_FLG_FILE) && !IS_FILE(stat_buf.st_mode)) { in check_conclusions()
1084 pMsg(ERR, args, in check_conclusions()
1089 if ((args->flags & CLD_FLG_BLK) && !IS_BLK(stat_buf.st_mode)) { in check_conclusions()
1090 pMsg(ERR, args, in check_conclusions()
1096 if ((args->flags & CLD_FLG_RAW) && !S_ISCHR(stat_buf.st_mode)) { in check_conclusions()
1097 pMsg(ERR, args, in check_conclusions()
1102 if (args->flags & CLD_FLG_RAW) { in check_conclusions()
1103 pMsg(ERR, args, in check_conclusions()
1110 PDBG1(DBUG, args, in check_conclusions()
1112 args->device, GETLASTERROR()); in check_conclusions()
1116 if ((args->hbeat > 0) && (args->flags & CLD_FLG_TMD) in check_conclusions()
1117 && (args->hbeat > args->run_time)) { in check_conclusions()
1118 pMsg(ERR, args, in check_conclusions()
1122 if ((args->hbeat > 0) && !(args->flags & CLD_FLG_PRFTYPS)) { in check_conclusions()
1123 pMsg(ERR, args, in check_conclusions()
1127 if ((args->flags & CLD_FLG_W) && !(args->flags & CLD_FLG_R) in check_conclusions()
1128 && (args->flags & CLD_FLG_CMPR)) { in check_conclusions()
1129 pMsg(ERR, args, "Write only, ignoring option -E.\n"); in check_conclusions()
1131 if ((args->flags & CLD_FLG_TMD) && (args->flags & CLD_FLG_SKS)) { in check_conclusions()
1132 pMsg(ERR, args, in check_conclusions()
1136 if (((args->flags & CLD_FLG_R) && !(args->flags & CLD_FLG_W)) in check_conclusions()
1137 && (args->flags & CLD_FLG_ERR_MARK)) { in check_conclusions()
1138 pMsg(ERR, args, in check_conclusions()
1142 if (!(args->flags & CLD_FLG_ALLDIE) && (args->flags & CLD_FLG_ERR_MARK)) { in check_conclusions()
1143 pMsg(ERR, args, in check_conclusions()
1147 if ((glb_flags & GLB_FLG_KILL) && !(args->flags & CLD_FLG_ALLDIE)) { in check_conclusions()
1148 pMsg(ERR, args, in check_conclusions()
1152 if ((args->flags & CLD_FLG_LINEAR) && !(args->flags & CLD_FLG_NTRLVD) in check_conclusions()
1153 && (args->flags & CLD_FLG_TMD)) { in check_conclusions()
1154 pMsg(ERR, args, "Linear read / write test can not be timed.\n"); in check_conclusions()
1157 if ((args->flags & CLD_FLG_CMPR) in check_conclusions()
1158 && (args->cmp_lng > (args->ltrsiz * BLK_SIZE))) { in check_conclusions()
1159 pMsg(ERR, args, in check_conclusions()
1161 args->cmp_lng, args->ltrsiz * BLK_SIZE); in check_conclusions()
1164 if ((args->flags & CLD_FLG_OFFSET) && (args->offset > args->stop_lba)) { in check_conclusions()
1165 pMsg(ERR, args, LBAOFFGSLBA, args->offset, args->stop_lba); in check_conclusions()
1168 if ((args->flags & CLD_FLG_OFFSET) in check_conclusions()
1169 && ((args->offset + args->ltrsiz - 1) > args->stop_lba)) { in check_conclusions()
1170 pMsg(ERR, args, LBAOTSGSLBA, args->offset, args->ltrsiz, in check_conclusions()
1171 args->stop_lba); in check_conclusions()