From patchwork Mon Jul 30 19:43:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 1256301 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 27257E00C6 for ; Mon, 30 Jul 2012 19:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754953Ab2G3Tpu (ORCPT ); Mon, 30 Jul 2012 15:45:50 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:27969 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754857Ab2G3TpE (ORCPT ); Mon, 30 Jul 2012 15:45:04 -0400 X-Authority-Analysis: v=2.0 cv=StQSGYy0 c=1 sm=0 a=s5Htg7xnQOKvHEu9STBOug==:17 a=OpT9cpI26MMA:10 a=Ciwy3NGCPMMA:10 a=C2gnn1LOoZAA:10 a=5SG0PmZfjMsA:10 a=bbbx4UPp9XUA:10 a=meVymXHHAAAA:8 a=20KFwNOVAAAA:8 a=9PgPiwaQxtW9giTdnEwA:9 a=QEXdDO2ut3YA:10 a=jEp0ucaQiEUA:10 a=jeBq3FmKZ4MA:10 a=dzec0Ahv_7lrcb-JrrAA:9 a=s5Htg7xnQOKvHEu9STBOug==:117 X-Cloudmark-Score: 0 X-Originating-IP: 72.230.195.127 Received: from [72.230.195.127] ([72.230.195.127:52004] helo=gandalf.stny.rr.com) by hrndva-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id B0/12-00797-F34E6105; Mon, 30 Jul 2012 19:45:03 +0000 Received: from rostedt by gandalf.stny.rr.com with local (Exim 4.80) (envelope-from ) id 1Svvtn-0002zg-6W; Mon, 30 Jul 2012 15:45:03 -0400 Message-Id: <20120730194503.137910183@goodmis.org> User-Agent: quilt/0.60-1 Date: Mon, 30 Jul 2012 15:43:20 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Linus Torvalds Subject: [PATCH 4/4] localmodconfig: Add debug environment variable LOCALMODCONFIG_DEBUG References: <20120730194316.768288008@goodmis.org> Content-Disposition: inline; filename=0004-localmodconfig-Add-debug-environment-variable-LOCALM.patch Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Steven Rostedt If the environment variable LOCALMODCONFIG_DEBUG is set, then debug output will appear in the make localmodconfig. This will simplify debugging what people get with their output, as I can just tell people to do: LOCALMODCONFIG_DEBUG=1 make localmodconfig 2>out.txt and have them send me the out.txt. I'll be able to see why things are not working as they think it should be. Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index fcfcb30..2fbbbc1 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -45,6 +45,16 @@ use strict; use Getopt::Long; +# set the environment variable LOCALMODCONFIG_DEBUG to get +# debug output. +my $debugprint = 0; +$debugprint = 1 if (defined($ENV{LOCALMODCONFIG_DEBUG})); + +sub dprint { + return if (!$debugprint); + print STDERR @_; +} + my $config = ".config"; my $uname = `uname -r`; @@ -389,6 +399,7 @@ foreach my $module (keys(%modules)) { my @arr = @{$objects{$module}}; foreach my $conf (@arr) { $configs{$conf} = $module; + dprint "$conf added by direct ($module)\n"; } } else { # Most likely, someone has a custom (binary?) module loaded. @@ -412,6 +423,8 @@ foreach my $line (@config_file) { my $repeat = 1; +my $depconfig; + # # Note, we do not care about operands (like: &&, ||, !) we want to add any # config that is in the depend list of another config. This script does @@ -440,6 +453,7 @@ sub parse_config_depends # We must make sure that this config has its # dependencies met. $repeat = 1; # do again + dprint "$conf selected by depend $depconfig\n"; $configs{$conf} = 1; } } else { @@ -473,15 +487,18 @@ sub parse_config_selects # Make sure that this config exists in the current .config file if (!defined($orig_configs{$conf})) { + dprint "$conf not set for $config select\n"; next; } # Check if something other than a module selects this config if (defined($orig_configs{$conf}) && $orig_configs{$conf} ne "m") { + dprint "$conf (non module) selects config, we are good\n"; # we are good with this return; } if (defined($configs{$conf})) { + dprint "$conf selects $config so we are good\n"; # A set config selects this config, we are good return; } @@ -506,6 +523,7 @@ sub parse_config_selects $repeat = 1; # Make this config need to be selected $configs{$next_config} = 1; + dprint "$next_config selected by select $config\n"; } my %process_selects; @@ -526,6 +544,7 @@ sub loop_depend { } $config =~ s/^CONFIG_//; + $depconfig = $config; if (defined($depends{$config})) { # This config has dependencies. Make sure they are also included @@ -546,6 +565,8 @@ sub loop_select { foreach my $config (keys %process_selects) { $config =~ s/^CONFIG_//; + dprint "Process select $config\n"; + # config has no prompt and must be selected. parse_config_selects $config, $selects{$config}; }