From nobody Thu Oct 9 13:50:23 2025 Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C51EA2EBDCC for ; Tue, 17 Jun 2025 15:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175030; cv=none; b=ezKljkx3opK52O//5FcgT0yka5j+EaZjJ57xSIdar4voJ1ysbQaBfX1sZeSYkjzzjAQ/Slnp/s0Mm+dTfv3efSRRldQlfLxizVgk2d+hYZGUSGGE1QTZA8YEdKnQcAayEb7OLiyt46PlTRnMKRA5+ycJ+7UNe483P4psvM0vcCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175030; c=relaxed/simple; bh=ZK6wdPM/LAMfxobRZbf8/Cd8P1nRnEFSuEy9Ztd/cu0=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=EU+SDPfbe6SoUp3RwbNnY1O6d0gD7JpZrPXyqxC5srJOdRci/3OOgID81yNKA1wHdtVL3WuMU5hmUQPLQxnkIMEE/E6qB5SI79dHkF6YPDY+c33c3hXrBzCbJcmfa7NrNz6ps5N03Vfw1nePs6mx7PKdM0ebiKpkRpNqn/Jn7Jw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D887A100AB5; Tue, 17 Jun 2025 15:43:46 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: nevets@goodmis.org) by omf01.hostedemail.com (Postfix) with ESMTPA id 93E7A60009; Tue, 17 Jun 2025 15:43:45 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uRYTX-000000029HK-2ps8; Tue, 17 Jun 2025 11:43:51 -0400 Message-ID: <20250617154351.528852085@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 17 Jun 2025 11:43:04 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , dhaval@gianis.ca Subject: [PATCH 1/4] ktest.pl: Add -D option to override variables References: <20250617154303.952651744@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 93E7A60009 X-Stat-Signature: c7x6w1wxtou1ggpm1hppeyn1sh8rc5m5 X-Rspamd-Server: rspamout06 X-Session-Marker: 6E657665747340676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX1+EogeoPDcIAbEAhpHecPtck4vBovZJ0hw= X-HE-Tag: 1750175025-600547 X-HE-Meta: U2FsdGVkX1+rlAn1Fb8dflKyHVqDWRmpbV5slNi5dCZHgv/3CDTRDQGd4N1b18mgq7WgoTf63V1neSh6BygSoSHLBbuurFTUW9NBNnJV1uPL9rJ2J+8KljwZUETGR2ykwCSGqDlmc/U/pbjkjxF4syY94GR5QgqFWPQC/R04CyKR10T2zO3WPW0AdNBqCreg4oJuCHCgVgiTPRalTW8KswkjFXpn2pA7yteubN4izuwqcjztYcC9OAYNq9UpDvyepzZgZFNjui1XVchKybVEWngxX8EnGRd+ZiZulSYt9xxdAin9HXjG/v6O4Sz6i7XCexyj8lSRm2IxDRSnaoV2GrKJg34h6X3zBGjGKwxEsx8rNUUs5VlLcMVm3trAJYCN+Zo05ISuEl+4kITnKugruA== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt Add -D option that lets the user override variables in the config. For instance, if the config has: BUILD_NOCLEAN=3D1 which prevents mrproper from being called before builds, and the user wants to call it once. The user can run: ktest -D BUILD_NOCLEAN=3D0 config And the default "BUILD_NOCLEAN" variable will be disabled. If the user wants to change the second test to do a build and not boot, the user can run: ktest -D 'TEST_TYPE[2]=3Dbuild' config Where the '[#]' is for the test to assign the variable for. Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 45 +++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index a5f7fdd0c1fb..8fcc09893986 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -21,6 +21,7 @@ my %opt; my %repeat_tests; my %repeats; my %evals; +my @command_vars; =20 #default opts my %default =3D ( @@ -1286,6 +1287,19 @@ sub read_config { =20 $test_case =3D __read_config $config, \$test_num; =20 + foreach my $val (@command_vars) { + chomp $val; + my %command_overrides; + if ($val =3D~ m/^\s*([A-Z_\[\]\d]+)\s*=3D\s*(.*?)\s*$/) { + my $lvalue =3D $1; + my $rvalue =3D $2; + + set_value($lvalue, $rvalue, 1, \%command_overrides, "COMMAND LINE"); + } else { + die "Invalid variable definition '$val'\n"; + } + } + # make sure we have all mandatory configs get_mandatory_configs; =20 @@ -4242,8 +4256,37 @@ sub cancel_test { die "\nCaught Sig Int, test interrupted: $!\n" } =20 -$#ARGV < 1 or die "ktest.pl version: $VERSION\n usage: ktest.pl [config-= file]\n"; +sub die_usage { + die << "EOF" +ktest.pl version: $VERSION + usage: ktest.pl [options] [config-file] + [options]: + -D value: Where value can act as an override. + -D BUILD_NOCLEAN=3D1 + Sets global BUILD_NOCLEAN to 1 + -D TEST_TYPE[2]=3Dbuild + Sets TEST_TYPE of test 2 to "build" + +EOF +; +} + +while ( $#ARGV >=3D 0 ) { + if ( $ARGV[0] eq "-D" ) { + shift; + die_usage if ($#ARGV < 1); + my $val =3D shift; + + $command_vars[$#command_vars + 1] =3D $val; + + } elsif ( $ARGV[0] eq "-h" ) { + die_usage; + } else { + last; + } +} =20 +$#ARGV < 1 or die_usage; if ($#ARGV =3D=3D 0) { $ktest_config =3D $ARGV[0]; if (! -f $ktest_config) { --=20 2.47.2 From nobody Thu Oct 9 13:50:23 2025 Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C53942ED844 for ; Tue, 17 Jun 2025 15:43:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175035; cv=none; b=brINIxHVY/2mn7Pt0ey7CHPFc76Xq4FIjQR+778RfcANp1cBdzA3t2mw+VzR3JTiNfPWhCGA4IoGItcRzbZRQIKE5rzXz/NiGIEdqT61ZE21l9awvE3VXGlU4jOYQxBLQkuw80BjdX12Qr/mwjWX3HXm6HRHvvtGVqqrq2u6IDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175035; c=relaxed/simple; bh=P5CLajP6UCO8cSIeq7vAlm70pO24MmcBN9J83+v7YjA=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ER8e2RFe1pbmMN5LvzWA5aaeBNTaLM/Dyciw3OpNR3KYGJIetqZ/XVU1IG/OpIpHcwZK+x1WGbn9eiQlAZHHFVeOR8pba1VdxwebaZRebZVFYxhdZCes3ozqzq63b+6WadrWNScX42eJk1tx6p19m8YieJNAfvsDKgYJnqNBp9I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id DECB3599EF; Tue, 17 Jun 2025 15:43:46 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: nevets@goodmis.org) by omf17.hostedemail.com (Postfix) with ESMTPA id 8D0BB18; Tue, 17 Jun 2025 15:43:45 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uRYTX-000000029Ho-3X9a; Tue, 17 Jun 2025 11:43:51 -0400 Message-ID: <20250617154351.696892698@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 17 Jun 2025 11:43:05 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , dhaval@gianis.ca Subject: [PATCH 2/4] ktest.pl: Allow command option -D to override temp variables References: <20250617154303.952651744@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 8D0BB18 X-Stat-Signature: itxyiwcabtem8chhgy93pjbsm4ec48o6 X-Rspamd-Server: rspamout07 X-Session-Marker: 6E657665747340676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX1/ggp3Z0EzBnulcQktgLG4KWJkNocTxjJg= X-HE-Tag: 1750175025-954248 X-HE-Meta: U2FsdGVkX18Bpq4Txw2dUewEILTVnyZibBIUlgj/NpauFWmaOLdJLape1bm53FmGJSVeVev+/5XHWO9FsmiZw8xBfoTDeyAtxMosXDFqvDd3kAt07V51arQQkaS6OuLEhW9mE2Qwyd+iO0ko7sID3V5S1vG2RTg0Fg2EE0Ke/p1EG0EEUgapjZbeFQ/Lfz84Ir/sUHcH9m/yjgIoNy1nuG58/vuSRBXWZQiyjvjAJjYuBcnzuuu3dkxi/O+l2NhHCt79niKP2vJ4ZKTflPtXDt6obkT2J786U9nxRE10n4tOE9skDT8SfJZ5ow/E0DPvoRv0bwXDml66LXFIM1scdaZojVaEfv36ntkfID0g2PV9CqCZ95GE0c+UQqoWFjm656+0E1IiRm7v8i6c2siu2w== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt Currently -D only updates the persistent variables that are defined with "=3D". Allow it to also override all temp variables that are defined with ":=3D". ktest.pl -D 'USE_TEMP_DIR:=3D1' -D 'TEST_TYPE[2]=3Dbuild' config Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 8fcc09893986..c441934f1def 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -22,6 +22,7 @@ my %repeat_tests; my %repeats; my %evals; my @command_vars; +my %command_tmp_vars; =20 #default opts my %default =3D ( @@ -901,14 +902,22 @@ sub set_eval { } =20 sub set_variable { - my ($lvalue, $rvalue) =3D @_; + my ($lvalue, $rvalue, $command) =3D @_; =20 + # Command line variables override all others + if (defined($command_tmp_vars{$lvalue})) { + return; + } if ($rvalue =3D~ /^\s*$/) { delete $variable{$lvalue}; } else { $rvalue =3D process_variables($rvalue); $variable{$lvalue} =3D $rvalue; } + + if (defined($command)) { + $command_tmp_vars{$lvalue} =3D 1; + } } =20 sub process_compare { @@ -4267,6 +4276,11 @@ ktest.pl version: $VERSION -D TEST_TYPE[2]=3Dbuild Sets TEST_TYPE of test 2 to "build" =20 + It can also override all temp variables. + -D USE_TEMP_DIR:=3D1 + Will override all variables that use + "USE_TEMP_DIR=3D" + EOF ; } @@ -4277,7 +4291,11 @@ while ( $#ARGV >=3D 0 ) { die_usage if ($#ARGV < 1); my $val =3D shift; =20 - $command_vars[$#command_vars + 1] =3D $val; + if ($val =3D~ m/(.*?):=3D(.*)$/) { + set_variable($1, $2, 1); + } else { + $command_vars[$#command_vars + 1] =3D $val; + } =20 } elsif ( $ARGV[0] eq "-h" ) { die_usage; --=20 2.47.2 From nobody Thu Oct 9 13:50:23 2025 Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 734652ECD2A for ; Tue, 17 Jun 2025 15:43:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175030; cv=none; b=jHUtgqymxbJQTb0ugzUZau1KGChlItlDwpKoa/szouNTR3b4N9EPhuTgY/LXJ7ewtR3vmNKtZejaIprW1IXhjQxyzOoC3JvxHZLPZcqp5O/QjeMH36vI4AmSvAuUfsFnuE210Iji9elzDUd7x84oVkJQp3LJdiVqdbaxMy8LYEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175030; c=relaxed/simple; bh=rg4fTUaMM/kHfvtLxs2wKzoNwqSYHAn9IkmBpAPV87s=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=NXCTqAFm5/QB9SK7F8NKgkhu4wzIBm0T1YIGZ7vrtlnvyidS/aSXPOA/EUhilbFHY7NylYuA04Fmpdf3olyEWq1wHsk3q68Gac4S7ytfN7ENRI33VxIiqXzC2KCi/aipge5nw8ijmtAoo5RXpN1i/pU1K1aQ227NghiddMr6lWo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 19AB9160530; Tue, 17 Jun 2025 15:43:47 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: nevets@goodmis.org) by omf09.hostedemail.com (Postfix) with ESMTPA id D021220024; Tue, 17 Jun 2025 15:43:45 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uRYTY-000000029II-02Qv; Tue, 17 Jun 2025 11:43:52 -0400 Message-ID: <20250617154351.862558407@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 17 Jun 2025 11:43:06 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , dhaval@gianis.ca Subject: [PATCH 3/4] ktest.pl: Have -D option work without a space References: <20250617154303.952651744@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Server: rspamout03 X-Rspamd-Queue-Id: D021220024 X-Stat-Signature: 5453fxy7qiegpd4i1rw837t4nuuambma X-Session-Marker: 6E657665747340676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX1+4tpKgCP2cFvbxCCAwLV2d6Z9ZlwSYfsY= X-HE-Tag: 1750175025-793769 X-HE-Meta: U2FsdGVkX1+qZW0H3WOiRIUTWM4AXpfPUX3rmGhfMtjDgPNvd+9R/lwJTqqW6Oe9L74tapjTADVQBCN57/vzF3Y1HhalzdE6sX0sViSw4ixy/QElkx93IbO1MIhigeY25Kujfwuhop3KeSCnaqRnePDK4M2GYn5jqNODUieqCfsHsODjzPqgx/v8TGjVVhyeLHH6tx++oNPM8rQNSvuyT3AyirgxtKU+33wfMm0JLtuCM8d4Sxdz6hgxFqDqyW/+V+WOoHRWLgeqEFghqfsOTHV+728HYR3SmeuwefI4vNP+6rFuZd4wvlpVodKnyhvaOmJ3opWyuMI9Ymr9S4IToL36vUiwtkAwPTlUW9e6Y7KVQZPofe3tefiVEdbvoWW2YQkdlUxjuTHt86byzjqr4Q== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt Allow -DBUILD_TYPE=3Dboot work the same as -D BUILD_TYPE=3Dboot just like normal single character option does in most applications. Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index c441934f1def..075c386af5e5 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -4297,6 +4297,15 @@ while ( $#ARGV >=3D 0 ) { $command_vars[$#command_vars + 1] =3D $val; } =20 + } elsif ( $ARGV[0] =3D~ m/^-D(.*)/) { + my $val =3D $1; + shift; + + if ($val =3D~ m/(.*?):=3D(.*)$/) { + set_variable($1, $2, 1); + } else { + $command_vars[$#command_vars + 1] =3D $val; + } } elsif ( $ARGV[0] eq "-h" ) { die_usage; } else { --=20 2.47.2 From nobody Thu Oct 9 13:50:23 2025 Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94D622ECD2F for ; Tue, 17 Jun 2025 15:43:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175030; cv=none; b=hUoXeOBoBKbK6XMCyZqjfSvL4P3SZ+jkSHohtiLRIUO06djqPeKy3XuZHhcARc7a1dHGVrZY1hI+lSGkOgefDokJ5KiKOURfcuVxHKdrZMkFseCjLhHam3auHh4/HtrRjl0XRdVaJLw2G37py7axUykFz0yP+gJj59C5SaK+9HM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750175030; c=relaxed/simple; bh=jRP/zOTvSPvZdc4E51dkUoMDxpQIXxmewk+hZU8kexs=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=g1BmVU3DHfK3QFUOvuby9yTGGWEdcCMUeeT9fd/t0vAPgfqk59rNT5SY1fin3PRDWo4/TPszlpMVoRPzt+iib7QuFSKIW5ptGR0Yz53AYJqoVwjHn24gw2vD2bu7GCd1MCsurLclpdLiCvAK/2tEvW4SnJIJzNKrnI0S6Mhou5w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 682CA16038B; Tue, 17 Jun 2025 15:43:47 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: nevets@goodmis.org) by omf19.hostedemail.com (Postfix) with ESMTPA id 15AF920026; Tue, 17 Jun 2025 15:43:46 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1uRYTY-000000029Im-0jZS; Tue, 17 Jun 2025 11:43:52 -0400 Message-ID: <20250617154352.029415598@goodmis.org> User-Agent: quilt/0.68 Date: Tue, 17 Jun 2025 11:43:07 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , dhaval@gianis.ca Subject: [PATCH 4/4] ktest.pl: Prevent recursion of default variable options References: <20250617154303.952651744@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: 15AF920026 X-Stat-Signature: wdodbgohwd9ygn7xaq35pqccefxe9m75 X-Session-Marker: 6E657665747340676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX1+OouqrzNlLVePYxXFGDt9gvobDCRBInqo= X-HE-Tag: 1750175026-974625 X-HE-Meta: U2FsdGVkX18Y3YrxJaNV8qiye04dkatnojpJuM/yquJ5WuuFaVTjRxojnANsI0Edorew26BcdTIvFUReO47oXzC24nFidtmwj8zRza0bxXpGNAu6IfTnzQWLmoOMh3EEaJOfJ0Uf2eGxH0qY/oRodkAnr3mFKSlXa5KlDMr1jFIhaLw2jDAda8qMi6vUQO+h9z2YJkfkXGyI5evIinbDQSd5zYYU8LlpVA+R/acPelguaeU4yCh/2MmSPVXKKev53pgC1eoOl+Wqhi8f6rdPBfODKe8LD9wEz5G21GwHwvw4iwEwWnpsGMhVGl6yGC7ykW75eAK8WDKPqylzJVZBd2umMIALum1jBz27zeHRxn36mNuxsMldCBlM+WqUouikRGjkbfsFofgKovbxA6jX8Q== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt If a default variable contains itself, do not recurse on it. For example: ADD_CONFIG :=3D ${CONFIG_DIR}/temp_config DEFAULTS ADD_CONFIG =3D ${CONFIG_DIR}/default_config ${ADD_CONFIG} The above works because the temp variable ADD_CONFIG (is a temp because it is created with ":=3D") is already defined, it will be substituted in the variable option. But if it gets commented out: # ADD_CONFIG :=3D ${CONFIG_DIR}/temp_config DEFAULTS ADD_CONFIG =3D ${CONFIG_DIR}/default_config ${ADD_CONFIG} Then the above will go into a recursive loop where ${ADD_CONFIG} will get replaced with the current definition of ADD_CONFIG which contains the ${ADD_CONFIG} and that will also try to get converted. ktest.pl will error after 100 attempts of recursion and fail. When replacing a variable with the default variable, if the default variable contains itself, do not replace it. Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 075c386af5e5..b2971430d7e4 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -1394,7 +1394,10 @@ sub __eval_option { # If a variable contains itself, use the default var if (($var eq $name) && defined($opt{$var})) { $o =3D $opt{$var}; - $retval =3D "$retval$o"; + # Only append if the default doesn't contain itself + if ($o !~ m/\$\{$var\}/) { + $retval =3D "$retval$o"; + } } elsif (defined($opt{$o})) { $o =3D $opt{$o}; $retval =3D "$retval$o"; --=20 2.47.2