Lines Matching +full:sync +full:- +full:branches
5 * SPDX-License-Identifier: BSD-3-Clause
50 return &p_[(count_-1)*size]; in mappend()
53 // a quick self-terminating text-safe varint scheme
58 x = -x; in leb16_print()
63 printf("%c", (nibble < 10) ? '0'+nibble : 'a'+nibble-10); in leb16_print()
87 nibble = nibble - '0'; in leb16_parse()
89 nibble = nibble - 'a' + 10; in leb16_parse()
106 return neg ? -x : x; in leb16_parse()
144 ((size_t)(&__stop__test_suites - &__start__test_suites))
273 exit(-1); in test_define()
280 (test_define_cache_count+(8*sizeof(unsigned))-1) in test_define_flush()
289 geometry->defines, TEST_GEOMETRY_DEFINE_COUNT}; in test_define_geometry()
310 suite->define_names, suite->define_count}; in test_define_suite()
313 if (lfs_max(suite->define_count, TEST_IMPLICIT_DEFINE_COUNT) in test_define_suite()
317 lfs_max(suite->define_count, TEST_IMPLICIT_DEFINE_COUNT)); in test_define_suite()
321 (ncount+(8*sizeof(unsigned))-1) in test_define_suite()
334 suite->define_count, in test_define_suite()
368 suite->define_count, in test_define_suite()
395 if (case_->defines) { in test_define_perm()
397 case_->defines + perm*suite->define_count, in test_define_perm()
398 suite->define_count}; in test_define_perm()
440 size_t test_step_stop = -1;
482 if (now - test_trace_time < (1000*1000*1000) / test_trace_freq) { in test_trace()
496 if (now - test_trace_open_time < 100*1000*1000) { in test_trace()
503 if (strcmp(test_trace_path, "-") == 0) { in test_trace()
583 printf("%s:", case_->name); in perm_printid()
586 suite->define_count, in perm_printid()
595 // only print power-cycles if any occured in perm_printid()
607 struct test_seen_branch *branches; member
627 suite->define_count, in test_seen_insert()
635 for (size_t i = 0; i < seen->branch_count; i++) { in test_seen_insert()
636 if (seen->branches[i].define == define) { in test_seen_insert()
637 branch = &seen->branches[i]; in test_seen_insert()
646 (void**)&seen->branches, in test_seen_insert()
648 &seen->branch_count, in test_seen_insert()
649 &seen->branch_capacity); in test_seen_insert()
650 branch->define = define; in test_seen_insert()
651 branch->branch = (test_seen_t){NULL, 0, 0}; in test_seen_insert()
654 seen = &branch->branch; in test_seen_insert()
661 for (size_t i = 0; i < seen->branch_count; i++) { in test_seen_cleanup()
662 test_seen_cleanup(&seen->branches[i].branch); in test_seen_cleanup()
664 free(seen->branches); in test_seen_cleanup()
709 // skip non-reentrant tests when powerloss testing in case_forperm()
711 && !(case_->flags & TEST_REENTRANT)) { in case_forperm()
725 for (size_t k = 0; k < case_->permutations; k++) { in case_forperm()
751 // skip non-reentrant tests when powerloss testing in case_forperm()
753 && !(case_->flags & TEST_REENTRANT)) { in case_forperm()
784 state->total += 1; in perm_count()
786 if (case_->filter && !case_->filter()) { in perm_count()
790 state->filtered += 1; in perm_count()
796 printf("%-23s %7s %7s %7s %11s\n", in summary()
839 (!flags) ? "-" : ""); in summary()
840 printf("%-23s %7s %7zu %7zu %11s\n", in summary()
857 name_width = 4*((name_width+1+4-1)/4)-1; in list_suites()
859 printf("%-*s %7s %7s %11s\n", in list_suites()
900 (!test_suites[i].flags) ? "-" : ""); in list_suites()
901 printf("%-*s %7s %7zu %11s\n", in list_suites()
922 name_width = 4*((name_width+1+4-1)/4)-1; in list_cases()
924 printf("%-*s %7s %11s\n", name_width, "case", "flags", "perms"); in list_cases()
957 ? "-" : ""); in list_cases()
958 printf("%-*s %7s %11s\n", in list_cases()
977 name_width = 4*((name_width+1+4-1)/4)-1; in list_suite_paths()
979 printf("%-*s %s\n", name_width, "suite", "path"); in list_suite_paths()
1002 printf("%-*s %s\n", in list_suite_paths()
1021 name_width = 4*((name_width+1+4-1)/4)-1; in list_case_paths()
1023 printf("%-*s %s\n", name_width, "case", "path"); in list_case_paths()
1036 printf("%-*s %s\n", in list_case_paths()
1065 for (size_t i = 0; i < defines->define_count; i++) { in list_defines_add()
1066 if (strcmp(defines->defines[i].name, name) == 0) { in list_defines_add()
1068 for (size_t j = 0; j < defines->defines[i].value_count; j++) { in list_defines_add()
1069 if (defines->defines[i].values[j] == value) { in list_defines_add()
1075 (void**)&defines->defines[i].values, in list_defines_add()
1077 &defines->defines[i].value_count, in list_defines_add()
1078 &defines->defines[i].value_capacity) = value; in list_defines_add()
1086 (void**)&defines->defines, in list_defines_add()
1088 &defines->define_count, in list_defines_add()
1089 &defines->define_capacity); in list_defines_add()
1090 define->name = name; in list_defines_add()
1091 define->values = malloc(sizeof(intmax_t)); in list_defines_add()
1092 define->values[0] = value; in list_defines_add()
1093 define->value_count = 1; in list_defines_add()
1094 define->value_capacity = 1; in list_defines_add()
1109 d < lfs_max(suite->define_count, in perm_list_defines()
1131 d < lfs_max(suite->define_count, in perm_list_permutation_defines()
1177 if (j != defines.defines[i].value_count-1) { in list_defines()
1225 if (j != defines.defines[i].value_count-1) { in list_permutation_defines()
1261 if (j != defines.defines[i].value_count-1) { in list_implicit_defines()
1299 name_width = 4*((name_width+1+4-1)/4)-1; in list_geometries()
1305 printf("%-*s %7s %7s %7s %7s %11s\n", in list_geometries()
1310 printf("%-*s %7ju %7ju %7ju %7ju %11ju\n", in list_geometries()
1322 // scenarios to run tests under power-loss
1341 .sync = lfs_emubd_sync, in run_powerloss_none()
1371 exit(-1); in run_powerloss_none()
1379 case_->run(&cfg); in run_powerloss_none()
1389 exit(-1); in run_powerloss_none()
1417 .sync = lfs_emubd_sync, in run_powerloss_linear()
1451 exit(-1); in run_powerloss_linear()
1454 // run the test, increasing power-cycles as power-loss events occur in run_powerloss_linear()
1462 case_->run(&cfg); in run_powerloss_linear()
1466 // power-loss! in run_powerloss_linear()
1487 exit(-1); in run_powerloss_linear()
1510 .sync = lfs_emubd_sync, in run_powerloss_log()
1544 exit(-1); in run_powerloss_log()
1547 // run the test, increasing power-cycles as power-loss events occur in run_powerloss_log()
1555 case_->run(&cfg); in run_powerloss_log()
1559 // power-loss! in run_powerloss_log()
1580 exit(-1); in run_powerloss_log()
1601 .sync = lfs_emubd_sync, in run_powerloss_cycles()
1635 exit(-1); in run_powerloss_cycles()
1638 // run the test, increasing power-cycles as power-loss events occur in run_powerloss_cycles()
1646 case_->run(&cfg); in run_powerloss_cycles()
1650 // power-loss! in run_powerloss_cycles()
1669 exit(-1); in run_powerloss_cycles()
1676 lfs_emubd_t *branches; member
1689 // append to branches in powerloss_exhaustive_branch()
1691 (void**)&state->branches, in powerloss_exhaustive_branch()
1693 &state->branch_count, in powerloss_exhaustive_branch()
1694 &state->branch_capacity); in powerloss_exhaustive_branch()
1697 exit(-1); in powerloss_exhaustive_branch()
1700 // create copy-on-write copy in powerloss_exhaustive_branch()
1701 int err = lfs_emubd_copy(state->cfg, branch); in powerloss_exhaustive_branch()
1704 exit(-1); in powerloss_exhaustive_branch()
1708 lfs_emubd_setpowercycles(state->cfg, 1); in powerloss_exhaustive_branch()
1722 .branches = NULL, in run_powerloss_exhaustive_layer()
1728 // branches as we do so in run_powerloss_exhaustive_layer()
1730 bdcfg->powerloss_data = &state; in run_powerloss_exhaustive_layer()
1733 case_->run(cfg); in run_powerloss_exhaustive_layer()
1739 exit(-1); in run_powerloss_exhaustive_layer()
1746 (void**)&cycles->cycles, in run_powerloss_exhaustive_layer()
1748 &cycles->cycle_count, in run_powerloss_exhaustive_layer()
1749 &cycles->cycle_capacity); in run_powerloss_exhaustive_layer()
1752 exit(-1); in run_powerloss_exhaustive_layer()
1757 perm_printid(suite, case_, cycles->cycles, cycles->cycle_count); in run_powerloss_exhaustive_layer()
1761 cfg->context = &state.branches[i]; in run_powerloss_exhaustive_layer()
1764 cfg, bdcfg, depth-1); in run_powerloss_exhaustive_layer()
1767 cycles->cycle_count -= 1; in run_powerloss_exhaustive_layer()
1771 free(state.branches); in run_powerloss_exhaustive_layer()
1790 .sync = lfs_emubd_sync, in run_powerloss_exhaustive()
1823 exit(-1); in run_powerloss_exhaustive()
1826 // run the test, increasing power-cycles as power-loss events occur in run_powerloss_exhaustive()
1852 "Run with no power-losses.",
1853 "Run with exponentially-decreasing power-losses.",
1854 "Run with linearly-decreasing power-losses.",
1855 "Run a all permutations of power-losses, this may take a while.",
1856 "Run a all permutations of n power-losses.",
1857 "Run a custom comma-separated set of power-losses.",
1858 "Run a custom leb16-encoded set of power-losses.",
1861 // default to -Pnone,linear, which provides a good heuristic while still
1878 name_width = 4*((name_width+1+4-1)/4)-1; in list_powerlosses()
1880 printf("%-*s %s\n", name_width, "scenario", "description"); in list_powerlosses()
1883 printf("%-*s %s\n", in list_powerlosses()
1890 printf("%-*s %s\n", name_width, "1,2,3", builtin_powerlosses_help[i+0]); in list_powerlosses()
1891 printf("%-*s %s\n", name_width, "{1,2,3}", builtin_powerlosses_help[i+1]); in list_powerlosses()
1892 printf("%-*s %s\n", name_width, ":1248g1", builtin_powerlosses_help[i+2]); in list_powerlosses()
1909 && (test_step-test_step_start) % test_step_step == 0)) { in perm_run()
1916 if (case_->filter && !case_->filter()) { in perm_run()
1923 powerloss->run( in perm_run()
1924 powerloss->cycles, powerloss->cycle_count, in perm_run()
1994 {"list-suites", no_argument, NULL, OPT_LIST_SUITES},
1995 {"list-cases", no_argument, NULL, OPT_LIST_CASES},
1996 {"list-suite-paths", no_argument, NULL, OPT_LIST_SUITE_PATHS},
1997 {"list-case-paths", no_argument, NULL, OPT_LIST_CASE_PATHS},
1998 {"list-defines", no_argument, NULL, OPT_LIST_DEFINES},
1999 {"list-permutation-defines",
2001 {"list-implicit-defines",
2003 {"list-geometries", no_argument, NULL, OPT_LIST_GEOMETRIES},
2004 {"list-powerlosses", no_argument, NULL, OPT_LIST_POWERLOSSES},
2011 {"trace-backtrace", no_argument, NULL, OPT_TRACE_BACKTRACE},
2012 {"trace-period", required_argument, NULL, OPT_TRACE_PERIOD},
2013 {"trace-freq", required_argument, NULL, OPT_TRACE_FREQ},
2014 {"read-sleep", required_argument, NULL, OPT_READ_SLEEP},
2015 {"prog-sleep", required_argument, NULL, OPT_PROG_SLEEP},
2016 {"erase-sleep", required_argument, NULL, OPT_ERASE_SLEEP},
2027 "List all defines in this test-runner.",
2028 "List explicit defines in this test-runner.",
2029 "List implicit defines in this test-runner.",
2031 "List the available power-loss scenarios.",
2033 "Comma-separated list of disk geometries to test.",
2034 "Comma-separated list of power-loss scenarios to test.",
2035 "Comma-separated range of test permutations to run (start,stop,step).",
2069 indent = printf(" -%c, --%s ", in main()
2073 indent = printf(" --%s ", in main()
2078 indent = printf(" -%c %s, --%s %s ", in main()
2084 indent = printf(" --%s %s ", in main()
2090 // a quick, hacky, byte-level method for text wrapping in main()
2095 (int)(24-1-indent), in main()
2162 override->name = optarg; in main()
2165 // parse comma-separated permutations in main()
2167 override->defines = NULL; in main()
2168 override->permutations = 0; in main()
2183 intmax_t stop = -1; in main()
2200 stop = -1; in main()
2240 (void**)&override->defines, in main()
2242 &override->permutations, in main()
2253 (void**)&override->defines, in main()
2255 &override->permutations, in main()
2266 assert(override->permutations > 0); in main()
2271 exit(-1); in main()
2307 // comma-separated read/prog/erase/count in main()
2333 geometry->defines[READ_SIZE_i] in main()
2335 geometry->defines[PROG_SIZE_i] in main()
2337 geometry->defines[ERASE_SIZE_i] in main()
2340 geometry->defines[PROG_SIZE_i] in main()
2342 geometry->defines[ERASE_SIZE_i] in main()
2345 geometry->defines[ERASE_SIZE_i] in main()
2349 geometry->defines[ERASE_COUNT_i] in main()
2356 // leb16-encoded read/prog/erase/count in main()
2377 geometry->defines[READ_SIZE_i] in main()
2379 geometry->defines[PROG_SIZE_i] in main()
2381 geometry->defines[ERASE_SIZE_i] in main()
2384 geometry->defines[PROG_SIZE_i] in main()
2386 geometry->defines[ERASE_SIZE_i] in main()
2389 geometry->defines[ERASE_SIZE_i] in main()
2393 geometry->defines[ERASE_COUNT_i] in main()
2404 exit(-1); in main()
2427 // parse the comma separated list of power-loss scenarios in main()
2436 // parse the power-loss scenario in main()
2439 // named power-loss scenario in main()
2452 // comma-separated permutation in main()
2489 // leb16-encoded permutation in main()
2538 fprintf(stderr, "error: unknown power-loss scenario: %s\n", in main()
2540 exit(-1); in main()
2557 test_step_stop = -1; in main()
2574 test_step_stop = -1; in main()
2604 exit(-1); in main()
2619 fprintf(stderr, "error: invalid trace-period: %s\n", optarg); in main()
2620 exit(-1); in main()
2628 fprintf(stderr, "error: invalid trace-freq: %s\n", optarg); in main()
2629 exit(-1); in main()
2637 fprintf(stderr, "error: invalid read-sleep: %s\n", optarg); in main()
2638 exit(-1); in main()
2647 fprintf(stderr, "error: invalid prog-sleep: %s\n", optarg); in main()
2648 exit(-1); in main()
2657 fprintf(stderr, "error: invalid erase-sleep: %s\n", optarg); in main()
2658 exit(-1); in main()
2664 case -1: in main()
2668 exit(-1); in main()
2702 if (name_len > 5 && strcmp(&name[name_len-5], ".toml") == 0) { in main()
2703 name[name_len-5] = '\0'; in main()
2729 (ncount-define_count)*sizeof(test_define_t)); in main()
2750 exit(-1); in main()