aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/ktest/ktest.pl46
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 8ce58d715aef..5ad891a08113 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -189,6 +189,9 @@ my $newconfig = 0;
189my %entered_configs; 189my %entered_configs;
190my %config_help; 190my %config_help;
191my %variable; 191my %variable;
192
193# force_config is the list of configs that we force enabled (or disabled)
194# in a .config file. The MIN_CONFIG and ADD_CONFIG configs.
192my %force_config; 195my %force_config;
193 196
194# do not force reboots on config problems 197# do not force reboots on config problems
@@ -1837,6 +1840,7 @@ sub make_oldconfig {
1837sub load_force_config { 1840sub load_force_config {
1838 my ($config) = @_; 1841 my ($config) = @_;
1839 1842
1843 doprint "Loading force configs from $config\n";
1840 open(IN, $config) or 1844 open(IN, $config) or
1841 dodie "failed to read $config"; 1845 dodie "failed to read $config";
1842 while (<IN>) { 1846 while (<IN>) {
@@ -2389,9 +2393,24 @@ sub bisect {
2389 success $i; 2393 success $i;
2390} 2394}
2391 2395
2396# config_ignore holds the configs that were set (or unset) for
2397# a good config and we will ignore these configs for the rest
2398# of a config bisect. These configs stay as they were.
2392my %config_ignore; 2399my %config_ignore;
2400
2401# config_set holds what all configs were set as.
2393my %config_set; 2402my %config_set;
2394 2403
2404# config_off holds the set of configs that the bad config had disabled.
2405# We need to record them and set them in the .config when running
2406# oldnoconfig, because oldnoconfig does not turn off new symbols, but
2407# instead just keeps the defaults.
2408my %config_off;
2409
2410# config_off_tmp holds a set of configs to turn off for now
2411my @config_off_tmp;
2412
2413# config_list is the set of configs that are being tested
2395my %config_list; 2414my %config_list;
2396my %null_config; 2415my %null_config;
2397 2416
@@ -2470,6 +2489,16 @@ sub create_config {
2470 } 2489 }
2471 } 2490 }
2472 2491
2492 # turn off configs to keep off
2493 foreach my $config (keys %config_off) {
2494 print OUT "# $config is not set\n";
2495 }
2496
2497 # turn off configs that should be off for now
2498 foreach my $config (@config_off_tmp) {
2499 print OUT "# $config is not set\n";
2500 }
2501
2473 foreach my $config (keys %config_ignore) { 2502 foreach my $config (keys %config_ignore) {
2474 print OUT "$config_ignore{$config}\n"; 2503 print OUT "$config_ignore{$config}\n";
2475 } 2504 }
@@ -2551,6 +2580,13 @@ sub run_config_bisect {
2551 do { 2580 do {
2552 my @tophalf = @start_list[0 .. $half]; 2581 my @tophalf = @start_list[0 .. $half];
2553 2582
2583 # keep the bottom half off
2584 if ($half < $#start_list) {
2585 @config_off_tmp = @start_list[$half + 1 .. $#start_list];
2586 } else {
2587 @config_off_tmp = ();
2588 }
2589
2554 create_config @tophalf; 2590 create_config @tophalf;
2555 read_current_config \%current_config; 2591 read_current_config \%current_config;
2556 2592
@@ -2567,7 +2603,11 @@ sub run_config_bisect {
2567 if (!$found) { 2603 if (!$found) {
2568 # try the other half 2604 # try the other half
2569 doprint "Top half produced no set configs, trying bottom half\n"; 2605 doprint "Top half produced no set configs, trying bottom half\n";
2606
2607 # keep the top half off
2608 @config_off_tmp = @tophalf;
2570 @tophalf = @start_list[$half + 1 .. $#start_list]; 2609 @tophalf = @start_list[$half + 1 .. $#start_list];
2610
2571 create_config @tophalf; 2611 create_config @tophalf;
2572 read_current_config \%current_config; 2612 read_current_config \%current_config;
2573 foreach my $config (@tophalf) { 2613 foreach my $config (@tophalf) {
@@ -2705,6 +2745,10 @@ sub config_bisect {
2705 $added_configs{$2} = $1; 2745 $added_configs{$2} = $1;
2706 $config_list{$2} = $1; 2746 $config_list{$2} = $1;
2707 } 2747 }
2748 } elsif (/^# ((CONFIG\S*).*)/) {
2749 # Keep these configs disabled
2750 $config_set{$2} = $1;
2751 $config_off{$2} = $1;
2708 } 2752 }
2709 } 2753 }
2710 close(IN); 2754 close(IN);
@@ -2727,6 +2771,8 @@ sub config_bisect {
2727 my %config_test; 2771 my %config_test;
2728 my $once = 0; 2772 my $once = 0;
2729 2773
2774 @config_off_tmp = ();
2775
2730 # Sometimes kconfig does weird things. We must make sure 2776 # Sometimes kconfig does weird things. We must make sure
2731 # that the config we autocreate has everything we need 2777 # that the config we autocreate has everything we need
2732 # to test, otherwise we may miss testing configs, or 2778 # to test, otherwise we may miss testing configs, or