Commit c7ed326f authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'ktest-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest

Pull config-bisect changes from Steven Rostedt:
 "The big change here is the rewrite of config-bisect.  The old way
  never worked properly as it assumed the bad config was a subset of the
  good config, and just found the config that would break the build.

  The new way does a diff of the bad config verses the good config and
  makes the similar until it finds that one config works and the other
  does not and reports the config that makes that difference.  The two
  configs do not need to be related.  It is much more useful now:

* tag 'ktest-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
  ktest: Update documentation on config_bisect
  ktest: Add the config bisect manual back
  ktest: Remove unused functions
  ktest: Put back in the CONFIG_BISECT_CHECK
  ktest: Rewrite the config-bisect to actually work
  ktest: Some cleanup for improving readability
  ktest: add 2nd parameter of run_command() to set the redirect target file
parents e4ca4308 4c16b1d6
...@@ -72,7 +72,7 @@ my %default = ( ...@@ -72,7 +72,7 @@ my %default = (
"IGNORE_UNUSED" => 0, "IGNORE_UNUSED" => 0,
); );
my $ktest_config; my $ktest_config = "ktest.conf";
my $version; my $version;
my $have_version = 0; my $have_version = 0;
my $machine; my $machine;
...@@ -149,7 +149,6 @@ my $bisect_ret_abort; ...@@ -149,7 +149,6 @@ my $bisect_ret_abort;
my $bisect_ret_default; my $bisect_ret_default;
my $in_patchcheck = 0; my $in_patchcheck = 0;
my $run_test; my $run_test;
my $redirect;
my $buildlog; my $buildlog;
my $testlog; my $testlog;
my $dmesg; my $dmesg;
...@@ -522,7 +521,7 @@ sub read_ync { ...@@ -522,7 +521,7 @@ sub read_ync {
return read_prompt 1, $prompt; return read_prompt 1, $prompt;
} }
sub get_ktest_config { sub get_mandatory_config {
my ($config) = @_; my ($config) = @_;
my $ans; my $ans;
...@@ -553,29 +552,29 @@ sub get_ktest_config { ...@@ -553,29 +552,29 @@ sub get_ktest_config {
} }
} }
sub get_ktest_configs { sub get_mandatory_configs {
get_ktest_config("MACHINE"); get_mandatory_config("MACHINE");
get_ktest_config("BUILD_DIR"); get_mandatory_config("BUILD_DIR");
get_ktest_config("OUTPUT_DIR"); get_mandatory_config("OUTPUT_DIR");
if ($newconfig) { if ($newconfig) {
get_ktest_config("BUILD_OPTIONS"); get_mandatory_config("BUILD_OPTIONS");
} }
# options required for other than just building a kernel # options required for other than just building a kernel
if (!$buildonly) { if (!$buildonly) {
get_ktest_config("POWER_CYCLE"); get_mandatory_config("POWER_CYCLE");
get_ktest_config("CONSOLE"); get_mandatory_config("CONSOLE");
} }
# options required for install and more # options required for install and more
if ($buildonly != 1) { if ($buildonly != 1) {
get_ktest_config("SSH_USER"); get_mandatory_config("SSH_USER");
get_ktest_config("BUILD_TARGET"); get_mandatory_config("BUILD_TARGET");
get_ktest_config("TARGET_IMAGE"); get_mandatory_config("TARGET_IMAGE");
} }
get_ktest_config("LOCALVERSION"); get_mandatory_config("LOCALVERSION");
return if ($buildonly); return if ($buildonly);
...@@ -583,7 +582,7 @@ sub get_ktest_configs { ...@@ -583,7 +582,7 @@ sub get_ktest_configs {
if (!defined($rtype)) { if (!defined($rtype)) {
if (!defined($opt{"GRUB_MENU"})) { if (!defined($opt{"GRUB_MENU"})) {
get_ktest_config("REBOOT_TYPE"); get_mandatory_config("REBOOT_TYPE");
$rtype = $entered_configs{"REBOOT_TYPE"}; $rtype = $entered_configs{"REBOOT_TYPE"};
} else { } else {
$rtype = "grub"; $rtype = "grub";
...@@ -591,16 +590,16 @@ sub get_ktest_configs { ...@@ -591,16 +590,16 @@ sub get_ktest_configs {
} }
if ($rtype eq "grub") { if ($rtype eq "grub") {
get_ktest_config("GRUB_MENU"); get_mandatory_config("GRUB_MENU");
} }
if ($rtype eq "grub2") { if ($rtype eq "grub2") {
get_ktest_config("GRUB_MENU"); get_mandatory_config("GRUB_MENU");
get_ktest_config("GRUB_FILE"); get_mandatory_config("GRUB_FILE");
} }
if ($rtype eq "syslinux") { if ($rtype eq "syslinux") {
get_ktest_config("SYSLINUX_LABEL"); get_mandatory_config("SYSLINUX_LABEL");
} }
} }
...@@ -1090,7 +1089,7 @@ sub read_config { ...@@ -1090,7 +1089,7 @@ sub read_config {
$test_case = __read_config $config, \$test_num; $test_case = __read_config $config, \$test_num;
# make sure we have all mandatory configs # make sure we have all mandatory configs
get_ktest_configs; get_mandatory_configs;
# was a test specified? # was a test specified?
if (!$test_case) { if (!$test_case) {
...@@ -1529,7 +1528,7 @@ sub fail { ...@@ -1529,7 +1528,7 @@ sub fail {
} }
sub run_command { sub run_command {
my ($command) = @_; my ($command, $redirect) = @_;
my $dolog = 0; my $dolog = 0;
my $dord = 0; my $dord = 0;
my $pid; my $pid;
...@@ -2265,9 +2264,7 @@ sub build { ...@@ -2265,9 +2264,7 @@ sub build {
# Run old config regardless, to enforce min configurations # Run old config regardless, to enforce min configurations
make_oldconfig; make_oldconfig;
$redirect = "$buildlog"; my $build_ret = run_command "$make $build_options", $buildlog;
my $build_ret = run_command "$make $build_options";
undef $redirect;
if (defined($post_build)) { if (defined($post_build)) {
# Because a post build may change the kernel version # Because a post build may change the kernel version
...@@ -2360,9 +2357,7 @@ sub child_run_test { ...@@ -2360,9 +2357,7 @@ sub child_run_test {
$poweroff_on_error = 0; $poweroff_on_error = 0;
$die_on_failure = 1; $die_on_failure = 1;
$redirect = "$testlog"; run_command $run_test, $testlog or $failed = 1;
run_command $run_test or $failed = 1;
undef $redirect;
exit $failed; exit $failed;
} }
...@@ -2789,12 +2784,17 @@ my %dependency; ...@@ -2789,12 +2784,17 @@ my %dependency;
sub assign_configs { sub assign_configs {
my ($hash, $config) = @_; my ($hash, $config) = @_;
doprint "Reading configs from $config\n";
open (IN, $config) open (IN, $config)
or dodie "Failed to read $config"; or dodie "Failed to read $config";
while (<IN>) { while (<IN>) {
chomp;
if (/^((CONFIG\S*)=.*)/) { if (/^((CONFIG\S*)=.*)/) {
${$hash}{$2} = $1; ${$hash}{$2} = $1;
} elsif (/^(# (CONFIG\S*) is not set)/) {
${$hash}{$2} = $1;
} }
} }
...@@ -2807,27 +2807,6 @@ sub process_config_ignore { ...@@ -2807,27 +2807,6 @@ sub process_config_ignore {
assign_configs \%config_ignore, $config; assign_configs \%config_ignore, $config;
} }
sub read_current_config {
my ($config_ref) = @_;
%{$config_ref} = ();
undef %{$config_ref};
my @key = keys %{$config_ref};
if ($#key >= 0) {
print "did not delete!\n";
exit;
}
open (IN, "$output_config");
while (<IN>) {
if (/^(CONFIG\S+)=(.*)/) {
${$config_ref}{$1} = $2;
}
}
close(IN);
}
sub get_dependencies { sub get_dependencies {
my ($config) = @_; my ($config) = @_;
...@@ -2846,53 +2825,97 @@ sub get_dependencies { ...@@ -2846,53 +2825,97 @@ sub get_dependencies {
return @deps; return @deps;
} }
sub save_config {
my ($pc, $file) = @_;
my %configs = %{$pc};
doprint "Saving configs into $file\n";
open(OUT, ">$file") or dodie "Can not write to $file";
foreach my $config (keys %configs) {
print OUT "$configs{$config}\n";
}
close(OUT);
}
sub create_config { sub create_config {
my @configs = @_; my ($name, $pc) = @_;
open(OUT, ">$output_config") or dodie "Can not write to $output_config"; doprint "Creating old config from $name configs\n";
foreach my $config (@configs) { save_config $pc, $output_config;
print OUT "$config_set{$config}\n";
my @deps = get_dependencies $config; make_oldconfig;
foreach my $dep (@deps) { }
print OUT "$config_set{$dep}\n";
# compare two config hashes, and return configs with different vals.
# It returns B's config values, but you can use A to see what A was.
sub diff_config_vals {
my ($pa, $pb) = @_;
# crappy Perl way to pass in hashes.
my %a = %{$pa};
my %b = %{$pb};
my %ret;
foreach my $item (keys %a) {
if (defined($b{$item}) && $b{$item} ne $a{$item}) {
$ret{$item} = $b{$item};
} }
} }
# turn off configs to keep off return %ret;
foreach my $config (keys %config_off) { }
print OUT "# $config is not set\n";
}
# turn off configs that should be off for now # compare two config hashes and return the configs in B but not A
foreach my $config (@config_off_tmp) { sub diff_configs {
print OUT "# $config is not set\n"; my ($pa, $pb) = @_;
}
my %ret;
foreach my $config (keys %config_ignore) { # crappy Perl way to pass in hashes.
print OUT "$config_ignore{$config}\n"; my %a = %{$pa};
my %b = %{$pb};
foreach my $item (keys %b) {
if (!defined($a{$item})) {
$ret{$item} = $b{$item};
}
} }
close(OUT);
make_oldconfig; return %ret;
} }
# return if two configs are equal or not
# 0 is equal +1 b has something a does not
# +1 if a and b have a different item.
# -1 if a has something b does not
sub compare_configs { sub compare_configs {
my (%a, %b) = @_; my ($pa, $pb) = @_;
foreach my $item (keys %a) { my %ret;
if (!defined($b{$item})) {
print "diff $item\n"; # crappy Perl way to pass in hashes.
my %a = %{$pa};
my %b = %{$pb};
foreach my $item (keys %b) {
if (!defined($a{$item})) {
return 1;
}
if ($a{$item} ne $b{$item}) {
return 1; return 1;
} }
delete $b{$item};
} }
my @keys = keys %b; foreach my $item (keys %a) {
if ($#keys) { if (!defined($b{$item})) {
print "diff2 $keys[0]\n"; return -1;
}
} }
return -1 if ($#keys >= 0);
return 0; return 0;
} }
...@@ -2900,24 +2923,13 @@ sub compare_configs { ...@@ -2900,24 +2923,13 @@ sub compare_configs {
sub run_config_bisect_test { sub run_config_bisect_test {
my ($type) = @_; my ($type) = @_;
return run_bisect_test $type, "oldconfig"; my $ret = run_bisect_test $type, "oldconfig";
}
sub process_passed {
my (%configs) = @_;
doprint "These configs had no failure: (Enabling them for further compiles)\n"; if ($bisect_manual) {
# Passed! All these configs are part of a good compile. $ret = answer_bisect;
# Add them to the min options.
foreach my $config (keys %configs) {
if (defined($config_list{$config})) {
doprint " removing $config\n";
$config_ignore{$config} = $config_list{$config};
delete $config_list{$config};
}
} }
doprint "config copied to $outputdir/config_good\n";
run_command "cp -f $output_config $outputdir/config_good"; return $ret;
} }
sub process_failed { sub process_failed {
...@@ -2928,253 +2940,225 @@ sub process_failed { ...@@ -2928,253 +2940,225 @@ sub process_failed {
doprint "***************************************\n\n"; doprint "***************************************\n\n";
} }
sub run_config_bisect { # used for config bisecting
my $good_config;
my $bad_config;
my @start_list = keys %config_list; sub process_new_config {
my ($tc, $nc, $gc, $bc) = @_;
if ($#start_list < 0) { my %tmp_config = %{$tc};
doprint "No more configs to test!!!\n"; my %good_configs = %{$gc};
return -1; my %bad_configs = %{$bc};
my %new_configs;
my $runtest = 1;
my $ret;
create_config "tmp_configs", \%tmp_config;
assign_configs \%new_configs, $output_config;
$ret = compare_configs \%new_configs, \%bad_configs;
if (!$ret) {
doprint "New config equals bad config, try next test\n";
$runtest = 0;
}
if ($runtest) {
$ret = compare_configs \%new_configs, \%good_configs;
if (!$ret) {
doprint "New config equals good config, try next test\n";
$runtest = 0;
}
} }
doprint "***** RUN TEST ***\n"; %{$nc} = %new_configs;
return $runtest;
}
sub run_config_bisect {
my ($pgood, $pbad) = @_;
my $type = $config_bisect_type; my $type = $config_bisect_type;
my $ret;
my %current_config;
my $count = $#start_list + 1; my %good_configs = %{$pgood};
doprint " $count configs to test\n"; my %bad_configs = %{$pbad};
my $half = int($#start_list / 2); my %diff_configs = diff_config_vals \%good_configs, \%bad_configs;
my %b_configs = diff_configs \%good_configs, \%bad_configs;
my %g_configs = diff_configs \%bad_configs, \%good_configs;
do { my @diff_arr = keys %diff_configs;
my @tophalf = @start_list[0 .. $half]; my $len_diff = $#diff_arr + 1;
# keep the bottom half off my @b_arr = keys %b_configs;
if ($half < $#start_list) { my $len_b = $#b_arr + 1;
@config_off_tmp = @start_list[$half + 1 .. $#start_list];
} else {
@config_off_tmp = ();
}
create_config @tophalf; my @g_arr = keys %g_configs;
read_current_config \%current_config; my $len_g = $#g_arr + 1;
$count = $#tophalf + 1; my $runtest = 1;
doprint "Testing $count configs\n"; my %new_configs;
my $found = 0; my $ret;
# make sure we test something
foreach my $config (@tophalf) {
if (defined($current_config{$config})) {
logit " $config\n";
$found = 1;
}
}
if (!$found) {
# try the other half
doprint "Top half produced no set configs, trying bottom half\n";
# keep the top half off # First, lets get it down to a single subset.
@config_off_tmp = @tophalf; # Is the problem with a difference in values?
@tophalf = @start_list[$half + 1 .. $#start_list]; # Is the problem with a missing config?
# Is the problem with a config that breaks things?
create_config @tophalf; # Enable all of one set and see if we get a new bad
read_current_config \%current_config; # or good config.
foreach my $config (@tophalf) {
if (defined($current_config{$config})) { # first set the good config to the bad values.
logit " $config\n";
$found = 1; doprint "d=$len_diff g=$len_g b=$len_b\n";
}
} # first lets enable things in bad config that are enabled in good config
if (!$found) {
doprint "Failed: Can't make new config with current configs\n"; if ($len_diff > 0) {
foreach my $config (@start_list) { if ($len_b > 0 || $len_g > 0) {
doprint " CONFIG: $config\n"; my %tmp_config = %bad_configs;
}
return -1; doprint "Set tmp config to be bad config with good config values\n";
} foreach my $item (@diff_arr) {
$count = $#tophalf + 1; $tmp_config{$item} = $good_configs{$item};
doprint "Testing $count configs\n";
} }
$ret = run_config_bisect_test $type; $runtest = process_new_config \%tmp_config, \%new_configs,
if ($bisect_manual) { \%good_configs, \%bad_configs;
$ret = answer_bisect;
} }
if ($ret) {
process_passed %current_config;
return 0;
} }
doprint "This config had a failure.\n"; if (!$runtest && $len_diff > 0) {
doprint "Removing these configs that were not set in this config:\n";
doprint "config copied to $outputdir/config_bad\n";
run_command "cp -f $output_config $outputdir/config_bad";
# A config exists in this group that was bad. if ($len_diff == 1) {
foreach my $config (keys %config_list) { process_failed $diff_arr[0];
if (!defined($current_config{$config})) { return 1;
doprint " removing $config\n";
delete $config_list{$config};
}
} }
my %tmp_config = %bad_configs;
@start_list = @tophalf; my $half = int($#diff_arr / 2);
my @tophalf = @diff_arr[0 .. $half];
if ($#start_list == 0) { doprint "Settings bisect with top half:\n";
process_failed $start_list[0]; doprint "Set tmp config to be bad config with some good config values\n";
return 1; foreach my $item (@tophalf) {
$tmp_config{$item} = $good_configs{$item};
} }
# remove half the configs we are looking at and see if $runtest = process_new_config \%tmp_config, \%new_configs,
# they are good. \%good_configs, \%bad_configs;
$half = int($#start_list / 2);
} while ($#start_list > 0);
# we found a single config, try it again unless we are running manually if (!$runtest) {
my %tmp_config = %bad_configs;
if ($bisect_manual) { doprint "Try bottom half\n";
process_failed $start_list[0];
return 1; my @bottomhalf = @diff_arr[$half+1 .. $#diff_arr];
foreach my $item (@bottomhalf) {
$tmp_config{$item} = $good_configs{$item};
} }
my @tophalf = @start_list[0 .. 0]; $runtest = process_new_config \%tmp_config, \%new_configs,
\%good_configs, \%bad_configs;
}
}
if ($runtest) {
$ret = run_config_bisect_test $type; $ret = run_config_bisect_test $type;
if ($ret) { if ($ret) {
process_passed %current_config; doprint "NEW GOOD CONFIG\n";
%good_configs = %new_configs;
run_command "mv $good_config ${good_config}.last";
save_config \%good_configs, $good_config;
%{$pgood} = %good_configs;
} else {
doprint "NEW BAD CONFIG\n";
%bad_configs = %new_configs;
run_command "mv $bad_config ${bad_config}.last";
save_config \%bad_configs, $bad_config;
%{$pbad} = %bad_configs;
}
return 0; return 0;
} }
process_failed $start_list[0]; fail "Hmm, need to do a mix match?\n";
return 1; return -1;
} }
sub config_bisect { sub config_bisect {
my ($i) = @_; my ($i) = @_;
my $start_config = $config_bisect; my $type = $config_bisect_type;
my $ret;
my $tmpconfig = "$tmpdir/use_config"; $bad_config = $config_bisect;
if (defined($config_bisect_good)) { if (defined($config_bisect_good)) {
process_config_ignore $config_bisect_good; $good_config = $config_bisect_good;
} } elsif (defined($minconfig)) {
$good_config = $minconfig;
# Make the file with the bad config and the min config
if (defined($minconfig)) {
# read the min config for things to ignore
run_command "cp $minconfig $tmpconfig" or
dodie "failed to copy $minconfig to $tmpconfig";
} else { } else {
unlink $tmpconfig; doprint "No config specified, checking if defconfig works";
$ret = run_bisect_test $type, "defconfig";
if (!$ret) {
fail "Have no good config to compare with, please set CONFIG_BISECT_GOOD";
return 1;
} }
$good_config = $output_config;
if (-f $tmpconfig) {
load_force_config($tmpconfig);
process_config_ignore $tmpconfig;
} }
# now process the start config # we don't want min configs to cause issues here.
run_command "cp $start_config $output_config" or doprint "Disabling 'MIN_CONFIG' for this test\n";
dodie "failed to copy $start_config to $output_config"; undef $minconfig;
# read directly what we want to check
my %config_check;
open (IN, $output_config)
or dodie "failed to open $output_config";
while (<IN>) {
if (/^((CONFIG\S*)=.*)/) {
$config_check{$2} = $1;
}
}
close(IN);
# Now run oldconfig with the minconfig my %good_configs;
make_oldconfig; my %bad_configs;
my %tmp_configs;
# check to see what we lost (or gained) doprint "Run good configs through make oldconfig\n";
open (IN, $output_config) assign_configs \%tmp_configs, $good_config;
or dodie "Failed to read $start_config"; create_config "$good_config", \%tmp_configs;
assign_configs \%good_configs, $output_config;
my %removed_configs; doprint "Run bad configs through make oldconfig\n";
my %added_configs; assign_configs \%tmp_configs, $bad_config;
create_config "$bad_config", \%tmp_configs;
assign_configs \%bad_configs, $output_config;
while (<IN>) { $good_config = "$tmpdir/good_config";
if (/^((CONFIG\S*)=.*)/) { $bad_config = "$tmpdir/bad_config";
# save off all options
$config_set{$2} = $1;
if (defined($config_check{$2})) {
if (defined($config_ignore{$2})) {
$removed_configs{$2} = $1;
} else {
$config_list{$2} = $1;
}
} elsif (!defined($config_ignore{$2})) {
$added_configs{$2} = $1;
$config_list{$2} = $1;
}
} elsif (/^# ((CONFIG\S*).*)/) {
# Keep these configs disabled
$config_set{$2} = $1;
$config_off{$2} = $1;
}
}
close(IN);
my @confs = keys %removed_configs; save_config \%good_configs, $good_config;
if ($#confs >= 0) { save_config \%bad_configs, $bad_config;
doprint "Configs overridden by default configs and removed from check:\n";
foreach my $config (@confs) {
doprint " $config\n";
}
}
@confs = keys %added_configs;
if ($#confs >= 0) {
doprint "Configs appearing in make oldconfig and added:\n";
foreach my $config (@confs) {
doprint " $config\n";
}
}
my %config_test;
my $once = 0;
@config_off_tmp = (); if (defined($config_bisect_check) && $config_bisect_check ne "0") {
if ($config_bisect_check ne "good") {
doprint "Testing bad config\n";
# Sometimes kconfig does weird things. We must make sure $ret = run_bisect_test $type, "useconfig:$bad_config";
# that the config we autocreate has everything we need if ($ret) {
# to test, otherwise we may miss testing configs, or fail "Bad config succeeded when expected to fail!";
# may not be able to create a new config. return 0;
# Here we create a config with everything set.
create_config (keys %config_list);
read_current_config \%config_test;
foreach my $config (keys %config_list) {
if (!defined($config_test{$config})) {
if (!$once) {
$once = 1;
doprint "Configs not produced by kconfig (will not be checked):\n";
}
doprint " $config\n";
delete $config_list{$config};
} }
} }
my $ret; if ($config_bisect_check ne "bad") {
doprint "Testing good config\n";
if (defined($config_bisect_check) && $config_bisect_check) { $ret = run_bisect_test $type, "useconfig:$good_config";
doprint " Checking to make sure bad config with min config fails\n"; if (!$ret) {
create_config keys %config_list; fail "Good config failed when expected to succeed!";
$ret = run_config_bisect_test $config_bisect_type; return 0;
if ($ret) { }
doprint " FAILED! Bad config with min config boots fine\n";
return -1;
} }
doprint " Bad config with min config fails as expected\n";
} }
do { do {
$ret = run_config_bisect; $ret = run_config_bisect \%good_configs, \%bad_configs;
} while (!$ret); } while (!$ret);
return $ret if ($ret < 0); return $ret if ($ret < 0);
...@@ -3455,29 +3439,6 @@ sub read_depends { ...@@ -3455,29 +3439,6 @@ sub read_depends {
read_kconfig($kconfig); read_kconfig($kconfig);
} }
sub read_config_list {
my ($config) = @_;
open (IN, $config)
or dodie "Failed to read $config";
while (<IN>) {
if (/^((CONFIG\S*)=.*)/) {
if (!defined($config_ignore{$2})) {
$config_list{$2} = $1;
}
}
}
close(IN);
}
sub read_output_config {
my ($config) = @_;
assign_configs \%config_ignore, $config;
}
sub make_new_config { sub make_new_config {
my @configs = @_; my @configs = @_;
...@@ -3863,7 +3824,7 @@ sub make_warnings_file { ...@@ -3863,7 +3824,7 @@ sub make_warnings_file {
success $i; success $i;
} }
$#ARGV < 1 or die "ktest.pl version: $VERSION\n usage: ktest.pl config-file\n"; $#ARGV < 1 or die "ktest.pl version: $VERSION\n usage: ktest.pl [config-file]\n";
if ($#ARGV == 0) { if ($#ARGV == 0) {
$ktest_config = $ARGV[0]; $ktest_config = $ARGV[0];
...@@ -3873,8 +3834,6 @@ if ($#ARGV == 0) { ...@@ -3873,8 +3834,6 @@ if ($#ARGV == 0) {
exit 0; exit 0;
} }
} }
} else {
$ktest_config = "ktest.conf";
} }
if (! -f $ktest_config) { if (! -f $ktest_config) {
......
...@@ -1098,49 +1098,35 @@ ...@@ -1098,49 +1098,35 @@
# #
# The way it works is this: # The way it works is this:
# #
# First it finds a config to work with. Since a different version, or # You can specify a good config with CONFIG_BISECT_GOOD, otherwise it
# MIN_CONFIG may cause different dependecies, it must run through this # will use the MIN_CONFIG, and if that's not specified, it will use
# preparation. # the config that comes with "make defconfig".
# #
# Overwrites any config set in the bad config with a config set in # It runs both the good and bad configs through a make oldconfig to
# either the MIN_CONFIG or ADD_CONFIG. Thus, make sure these configs # make sure that they are set up for the kernel that is checked out.
# are minimal and do not disable configs you want to test:
# (ie. # CONFIG_FOO is not set).
# #
# An oldconfig is run on the bad config and any new config that # It then reads the configs that are set, as well as the ones that are
# appears will be added to the configs to test. # not set for both the good and bad configs, and then compares them.
# It will set half of the good configs within the bad config (note,
# "set" means to make the bad config match the good config, a config
# in the good config that is off, will be turned off in the bad
# config. That is considered a "set").
# #
# Finally, it generates a config with the above result and runs it # It tests this new config and if it works, it becomes the new good
# again through make oldconfig to produce a config that should be # config, otherwise it becomes the new bad config. It continues this
# satisfied by kconfig. # process until there's only one config left and it will report that
# config.
# #
# Then it starts the bisect. # The "bad config" can also be a config that is needed to boot but was
# disabled because it depended on something that wasn't set.
# #
# The configs to test are cut in half. If all the configs in this # During this process, it saves the current good and bad configs in
# half depend on a config in the other half, then the other half # ${TMP_DIR}/good_config and ${TMP_DIR}/bad_config respectively.
# is tested instead. If no configs are enabled by either half, then # If you stop the test, you can copy them to a new location to
# this means a circular dependency exists and the test fails. # reuse them again.
# #
# A config is created with the test half, and the bisect test is run. # Although the MIN_CONFIG may be the config it starts with, the
# # MIN_CONFIG is ignored.
# If the bisect succeeds, then all configs in the generated config
# are removed from the configs to test and added to the configs that
# will be enabled for all builds (they will be enabled, but not be part
# of the configs to examine).
#
# If the bisect fails, then all test configs that were not enabled by
# the config file are removed from the test. These configs will not
# be enabled in future tests. Since current config failed, we consider
# this to be a subset of the config that we started with.
#
# When we are down to one config, it is considered the bad config.
#
# Note, the config chosen may not be the true bad config. Due to
# dependencies and selections of the kbuild system, mulitple
# configs may be needed to cause a failure. If you disable the
# config that was found and restart the test, if the test fails
# again, it is recommended to rerun the config_bisect with a new
# bad config without the found config enabled.
# #
# The option BUILD_TYPE will be ignored. # The option BUILD_TYPE will be ignored.
# #
...@@ -1160,13 +1146,16 @@ ...@@ -1160,13 +1146,16 @@
# CONFIG_BISECT_GOOD (optional) # CONFIG_BISECT_GOOD (optional)
# If you have a good config to start with, then you # If you have a good config to start with, then you
# can specify it with CONFIG_BISECT_GOOD. Otherwise # can specify it with CONFIG_BISECT_GOOD. Otherwise
# the MIN_CONFIG is the base. # the MIN_CONFIG is the base, if MIN_CONFIG is not set
# It will build a config with "make defconfig"
# #
# CONFIG_BISECT_CHECK (optional) # CONFIG_BISECT_CHECK (optional)
# Set this to 1 if you want to confirm that the config ktest # Set this to 1 if you want to confirm that the config ktest
# generates (the bad config with the min config) is still bad. # generates (the bad config with the min config) is still bad.
# It may be that the min config fixes what broke the bad config # It may be that the min config fixes what broke the bad config
# and the test will not return a result. # and the test will not return a result.
# Set it to "good" to test only the good config and set it
# to "bad" to only test the bad config.
# #
# Example: # Example:
# TEST_START # TEST_START
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment