From nobody Mon Oct 6 15:12:23 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5853B11712 for ; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870029; cv=none; b=ed11NIikucZC9TFb8J4S/lspWWW/EDGR2qr17dZva9QIlOOXnzEYEEZdU0vj+bT3EiwAMBsNuTVof6qmKlCmcwRAM5plHOC2S6P5YK9ilR5/Nl0Dyq3ggqBDdVL0TPfqr6N/Uk+UEe8t92pe5rlR6yB2YvEbAcykrf80pSPX87E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870029; c=relaxed/simple; bh=/R2ql7W1+e3579dR27SG6VrGFvEoDyaZ+gKAlEYsEcg=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=U/4fZKXdbJpWUHIVBTGImVht4BtABCUoxzf0O2/jpJNjVJBysu8NYyBCt29Mgoa3o0ABADmJiFIdhJ/1WZxx1mH6HC7x/LsZJO1bGQGtTQc6zETadHfLMtaTa5KZTHfBcLp9DuqtxzMGXSdziP0+Bm9+tNztk8SSZyCqhOZEmg8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jikutjqy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jikutjqy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F198C4CEF5; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752870029; bh=/R2ql7W1+e3579dR27SG6VrGFvEoDyaZ+gKAlEYsEcg=; h=Date:From:To:Cc:Subject:References:From; b=jikutjqyllPOAfUiHlM/jboq1tzn9Dva6oMgos0vwD6FHZHxqV7CSml+hueF2XKem FHncWyy3D6BEi0riH5NsaPV4faCP9cIFmym1VQ1Oc0a+i0C/PzRakb87WG3J2/gf8s UvcIGSV7SS0Utr1AUL6olAprx9uNXLHeFNMhktWV+Dx7ugtMyF4uVTz5/vSt1Ll/ej 9aYTXx3cpsBs0pb3L/RE7Iizyj09GcxheDkwmAlh0cUD4dJZyG7lqAExru6hfTb8DU EI+TjZkbddc/I5yAtStzqgM0RIcIhes16h78aEMRFf7qdABI9wDC1UI0Gmq8xtynxs NzfQEA8KQtoDA== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1ucrZd-00000007Qcc-1amE; Fri, 18 Jul 2025 16:20:53 -0400 Message-ID: <20250718202053.231478909@kernel.org> User-Agent: quilt/0.68 Date: Fri, 18 Jul 2025 16:18:41 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [PATCH 1/5] ktest.pl: Add -D option to override options References: <20250718201840.714067501@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt Add -D option that lets the user override options 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" options 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. In the above example, it will happen on test 2. 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 option 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 option 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 Mon Oct 6 15:12:23 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AE49D21A92F for ; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870029; cv=none; b=R74eBz+QfHcjcatiNN9MpvuHhLkvL5wMpZoVA2hKzZlUmO6Pby86kz23WatIPBqcxEUNg6IHq59x//XGsFjUrTBaO+SAmmf3cwf2r7s1/FHLHIxYGTTUZZflpJ0J3cU2zeekryCnPrWc5wrk+ayD9t/fxdBespcOv23PAeNYcwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870029; c=relaxed/simple; bh=rRg0o+hItQud96owWCmMg3FvtAzGw1eqcD4S/uWJRss=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=a1eLLWxHP/eZ6NGgACj/EKC7bIHHg8pAuyZUw98gQNjTiTYMHVlP6W7qYKz7GhSs87Js0ZA9e/rsVJZXeiqdqxJoainxams5e94BylrjfcjYdN7xs0NnOVXb6v1GknZ1vWP+w9VHcYyA11hCbNEbF8Bhd4Xk1AJNpau9ADM5cuY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lw9fJl3N; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lw9fJl3N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35999C4CEF6; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752870029; bh=rRg0o+hItQud96owWCmMg3FvtAzGw1eqcD4S/uWJRss=; h=Date:From:To:Cc:Subject:References:From; b=lw9fJl3Nu/ci5avNIubJzOTo0Plk3taRi+X7Go0041EdppoORSIthviROERD7Dvu6 lv0uYYJNJr8BLStDf8e6EMDB6iok2N2iEVFj1wTge+rLKUXZmXyNxmrxBSaSZHZRzD St7po6YrlwCFgUAmhYE9L5vrkkvFW77r09Jly33EXTT3KQ1zisOUkIAJldeTd/kLq/ YVEdwAvAF7q7PmPAt4yM0P8fzLJ30sMKhIR7MI/MLEy6ew94DwpDgjJH9hiUl1NqI8 n04bKxIRy28umCSp9ORaTJCXBBCE0tj2ubOvmjNZCQGEcwZr7mk+MAfZ8KcHUNT5fm HNn6yWnD5ZujA== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1ucrZd-00000007Qd6-2I7F; Fri, 18 Jul 2025 16:20:53 -0400 Message-ID: <20250718202053.399653933@kernel.org> User-Agent: quilt/0.68 Date: Fri, 18 Jul 2025 16:18:42 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [PATCH 2/5] ktest.pl: Allow command option -D to override temp variables References: <20250718201840.714067501@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt Currently -D only updates the persistent options 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 Mon Oct 6 15:12:23 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C5D9E21ABDB for ; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870029; cv=none; b=TWdiYkO9oSxJkTs3jd8xdCFiJ1tCm96z2sxi6Ej1Je6/DXIRvPxNghfCQQtafq87UIu2O17OZJRdPGSp4fKemW49aoYDxCwpcxmhhteG8gfj7qyz+0RlfeWyTiTVzPqNcjdbRfS/7jO1KwD3iKkrpJM2LdANcjeinFfn0Qn1QQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870029; c=relaxed/simple; bh=rg4fTUaMM/kHfvtLxs2wKzoNwqSYHAn9IkmBpAPV87s=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=N7ZUEn0vLzpuqS79jr21WITT07+WH8mjrZJddMKUMWRF0dzR+R84wTKyG1hulgCnhe4ZKjOlXwM46oIt+0OcS7Ozr8j4oGJqyyrf64L/mFRkbV1DZ4r+EF7TxzDCWQ9t7cV3cEqKFSTLbTMtVMiKycOrmYiYEzjeP8LEn9fk/AU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qDDSq6oc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qDDSq6oc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 728B5C4CEF1; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752870029; bh=rg4fTUaMM/kHfvtLxs2wKzoNwqSYHAn9IkmBpAPV87s=; h=Date:From:To:Cc:Subject:References:From; b=qDDSq6oc1efqk9N09duCFCYpAS8bzegdnO0gIVnSz1IAoothZQn1ePUw85vAAjsV/ SpokLxs7ISQljk0uVsyP754ReBghxJCp8Ue047nTkjEovtpBdhj0wZYLHTi3L2GnyN EivREcsKnSWFEvvWPTdTv62tzMoz2MaG3xZEP6K50k8B3/8nh3CkFk4mhi8ppq0H13 J86M/sYN7lJbwtKQ3v9gFvkFhEW4pIVTnUJg4A6icdFVWxMRj4lRv5RATAtRJXSH/h 91BT2LtKzdtLVOiv2JqrOoYyTXa8m10EyXv+GsNkxho9r3mhDV6DzY2FVcFYkAoMuT Bg/tx0qxA6dgA== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1ucrZd-00000007Qda-2zIM; Fri, 18 Jul 2025 16:20:53 -0400 Message-ID: <20250718202053.567246162@kernel.org> User-Agent: quilt/0.68 Date: Fri, 18 Jul 2025 16:18:43 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [PATCH 3/5] ktest.pl: Have -D option work without a space References: <20250718201840.714067501@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Mon Oct 6 15:12:23 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C5D3F21ABC8 for ; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870029; cv=none; b=gnPu/xE8td5QZVJcRpZPEMpMy7xo7UeaeiO3NwGypVFgUskUwM1WcFDDhxJ4cgu8h5UUgEGe+DpY+7reG6gpPfU3V8IYXOA7SYMVQSPfsGaxiWPDAD7f98TTrbu81aK9chUGlqzETUAjs6Hb/UZb4fPd8pDdoPfRrw9Zzx6UyDU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870029; c=relaxed/simple; bh=jRP/zOTvSPvZdc4E51dkUoMDxpQIXxmewk+hZU8kexs=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=rQzlXXp61bEwlMZJUL7c4iIKOVSyylMxts0ePUgxsYKsgf5HPZa6P7zkGnoCVFWJzayjmGcct81Yljpe/aOP2jDlv/BdCqc1weVwfZjzcf952ztBlTBV3p846DvIyEHcgOJUeq0pgCfuDSUHlxIFjnjeEr20ilMtId5MkHrkCEo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PuTiaZH2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PuTiaZH2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 859A6C4CEED; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752870029; bh=jRP/zOTvSPvZdc4E51dkUoMDxpQIXxmewk+hZU8kexs=; h=Date:From:To:Cc:Subject:References:From; b=PuTiaZH2EPR7k5rcXbpwCv2aT8efgnn5ahadooWRcNcc7Zso6PHFbe1Gzx9yyv54y 0yz6SJdqHuktZO3PmT6O5jK3cDB8/Tux8n7E6k63rioBLOPy82bgRBwHQhT8ofs9Dq sdeu0qu3hHdI6p0u7C2TUCSZVK/R/WUoD/d7P2f1sqVHLEPg68ZoyWcuPKWeJRJYjP leEkEUDOz4Uk0ISfwATbJaLDtX130rwSybH10xfwm6+uKBPrErmoW+MS63pHjUrASg jjaQNS08Ul5A7CM7084qe3ApC+rMvtIlZcO3mGA0MaTeJiXPcHA7qs7EWE5gTXHkZM L8Yt2RD7K5ZIQ== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1ucrZd-00000007Qe4-3ga8; Fri, 18 Jul 2025 16:20:53 -0400 Message-ID: <20250718202053.732189428@kernel.org> User-Agent: quilt/0.68 Date: Fri, 18 Jul 2025 16:18:44 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [PATCH 4/5] ktest.pl: Prevent recursion of default variable options References: <20250718201840.714067501@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 From nobody Mon Oct 6 15:12:23 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 19EA121C9F4 for ; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870030; cv=none; b=H0G+zsxMFE3SUjNF2dFECIviI7lv4/a0Zg+hhGH8petIEKc2YOvj4vwtByyxkvXaJB0kcAQ1AcKAI20vCrCvATUey7b5sY5whC/6vFRU/kqcBp0ONWoCfsNT+cq7QUUYvYI/jsm2E3cig/JV4HMACupay3UIiufJ8DUgF3J5uxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752870030; c=relaxed/simple; bh=gL/Ib6V/Rr7s1q7a9+wV2U4ANTgm6sYkqvsTPVoZdC4=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=WvxhHAkeCVCD+EWEccINPtNaOtHe6kLUTI7p+4ueYBEYcvyEqNVuCUo1i8sfsS8RvCrhsbGVWDFi/IGL/Fi/xEzY1PBfHxtZVYQtCh2ZfLoPC+twoQ5+wueyjQPGjlVLoqkQYzU6Yx66UqTMetxtWGpsUuLBRLR/M2jAQLKZjMc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fDIx5E8h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fDIx5E8h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD200C4CEF7; Fri, 18 Jul 2025 20:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752870029; bh=gL/Ib6V/Rr7s1q7a9+wV2U4ANTgm6sYkqvsTPVoZdC4=; h=Date:From:To:Cc:Subject:References:From; b=fDIx5E8hAvFHAzfMAMbvGKQvKtd0zGC/Cg2JQ53qxsZQ166QkP6YDvbiW+0Fe5ThU hXPUprWOTiSQz5tKuzlxWRCJPBoK84snIkXrrjALB11WFzXPS/KHHkSkdybPqMCnmT VVkeDVtVh53QCbCxlRlRwUyLOy0lKCxzbO7NHdjR4SaZytKuotIll2zEHCeY3smiTd nRFdPQvGg7XFro+2tWCIvzFiVbzqmvYnuNorr5oAXOho65AXu2ei1LG1sE+iESUTct QE4Xl2M1aZzG7Qya8OoFPOewp5ZgNTn9re358CrH6k9KDlwzexyjoGRF6x299x83PZ 5jkiAc6tro8fA== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1ucrZe-00000007QeY-0BIl; Fri, 18 Jul 2025 16:20:54 -0400 Message-ID: <20250718202053.898022631@kernel.org> User-Agent: quilt/0.68 Date: Fri, 18 Jul 2025 16:18:45 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [PATCH 5/5] ktest.pl: Always display BUILD_DIR and OUTPUT_DIR at the start of tests References: <20250718201840.714067501@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt As ktest.pl can run in various different directories, to make sure the test is running in the proper directory with the proper source and proper destination directory, display the content of BUILD_DIR and OUTPUT_DIR at the start of every test. This can be helpful for the test runner to stop the test if a test is running in the wrong location instead of finding out after the test has completed. Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index b2971430d7e4..c460838dfd6f 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -4539,6 +4539,10 @@ for (my $i =3D 1; $i <=3D $opt{"NUM_TESTS"}; $i++) { =20 doprint "RUNNING TEST $i of $opt{NUM_TESTS}$name with option $test_typ= e $run_type$installme\n\n"; =20 + # Always show which build directory and output directory is being used + doprint "BUILD_DIR=3D$builddir\n"; + doprint "OUTPUT_DIR=3D$outputdir\n\n"; + if (defined($pre_test)) { my $ret =3D run_command $pre_test; if (!$ret && defined($pre_test_die) && --=20 2.47.2