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

Message ID 20221202115936.016fce23@gandalf.local.home
State New
Headers
Series ktest.pl minconfig: Unset configs instead of just removing them |

Commit Message

Steven Rostedt Dec. 2, 2022, 4:59 p.m. UTC
  From: Steven Rostedt <rostedt@goodmis.org>

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.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

John 'Warthog9' Hawley Dec. 2, 2022, 9:40 p.m. UTC | #1
On 12/2/22 08:59, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
> 
> 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.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>   tools/testing/ktest/ktest.pl | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
> index 590518144167..56135e7d2295 100755
> --- a/tools/testing/ktest/ktest.pl
> +++ b/tools/testing/ktest/ktest.pl
> @@ -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;
>   

Reviewed-by: John 'Warthog9' Hawley (VMware) <warthog9@eaglescrag.net>
  

Patch

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 590518144167..56135e7d2295 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -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;