Skip to contentSkip to conversation

ktest.pl minconfig: Unset configs instead of just removing them

PATCH In review Steven Rostedt 2 participants 2 messages Dec 2, 2022 Ktest

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 ktest.pl minconfig: Unset configs instead of just removing them

From: Steven Rostedt <[email protected]>

After a full run of a make_min_config test, I noticed there were a lot of CONFIGs still enabled that really should not be. Looking at them, I noticed they were all defined as "default y". The issue is that the test simple removes the config and re-runs make oldconfig, which enables it again because it is set to default 'y'. Instead, explicitly disable the config with writing "# CONFIG_FOO is not set" to the file to keep it from being set again.

With this change, one of my box's minconfigs went from 768 configs set, down to 521 configs set.

---
 tools/testing/ktest/ktest.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +2 -1
index 590518144167..56135e7d2295 100755
@@ -3775,9 +3775,10 @@ sub test_this_config {
     # .config to make sure it is missing the config that
     # we had before
     my %configs = %min_configs;
-    delete $configs{$config};
+    $configs{$config} = "# $config is not set";
     make_new_config ((values %configs), (values %keep_configs));
     make_oldconfig;
+    delete $configs{$config};
     undef %configs;
     assign_configs \%configs, $output_config;
 
Signature · 1 line
2.35.1
Reviewed-by John 'Warthog9' Hawley (VMware) on v1 1/1
#1 lore raw
Quoted 24 lines · Steven Rostedt

From: Steven Rostedt <[email protected]>

After a full run of a make_min_config test, I noticed there were a lot of CONFIGs still enabled that really should not be. Looking at them, I noticed they were all defined as "default y". The issue is that the test simple removes the config and re-runs make oldconfig, which enables it again because it is set to default 'y'. Instead, explicitly disable the config with writing "# CONFIG_FOO is not set" to the file to keep it from being set again.

With this change, one of my box's minconfigs went from 768 configs set, down to 521 configs set.

---
  tools/testing/ktest/ktest.pl | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +0 -0
index 590518144167..56135e7d2295 100755
@@ -3775,9 +3775,10 @@ sub test_this_config {
      # .config to make sure it is missing the config that

tools/testing/ktest/ktest.pl sub test_this_config { · line 3784

Quoted 10 lines
tools/testing/ktest/ktest.pl +2 -1
      # we had before
      my %configs = %min_configs;
-    delete $configs{$config};
+    $configs{$config} = "# $config is not set";
      make_new_config ((values %configs), (values %keep_configs));
      make_oldconfig;
+    delete $configs{$config};
      undef %configs;
      assign_configs \%configs, $output_config;