From nobody Mon Oct 6 11:47:26 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 C005A23B635 for ; Mon, 21 Jul 2025 20:37:32 +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=1753130252; cv=none; b=RjC568F1UNNzdFI+fVRie2qjuYAyaDsJoRCKk1Mf8XZFhYGG/taSZ0UgR2VNv7ZZdPMltlGtsArxlWZe7bgPbNnXzsaxpRcn0WnKMBZkfi6NoJjo3nmoNbxy0ZMKHp9Hw9Ap2lpYnaUSGRwfF/fcD0ftXv1TavAGGrmfDlUzlnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753130252; c=relaxed/simple; bh=zlh+6trSwOsIx+Ra1qmBqMt/wUeLR93rdLKmqKOL5Po=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ph711xG/7CU6rIGdkj462o1KBHcUZnqmOlzKuuV1ImqOu5OArsSk4qia15HRvQ1UA7CUWiDgNk8wkEdDWYAwcuMtAu7SNeNwlO8jXNUtoinY79dmqOWYvCRL2AxlH80T8xdBdgAob9JohROxiZs1EWSaZL2nxiUSxwLvqF4uLxU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pdxiMJKZ; 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="pdxiMJKZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66FF3C4CEF4; Mon, 21 Jul 2025 20:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753130252; bh=zlh+6trSwOsIx+Ra1qmBqMt/wUeLR93rdLKmqKOL5Po=; h=Date:From:To:Cc:Subject:References:From; b=pdxiMJKZbXAvpzsQ6z5e4ASdqV6YIbTQll2vxSySf9FIGE9+XKHFUc+gQyJOj1Dxh qDw+HKuTJNiLCvyQVuEyL2Nr8vYgiMkDWvEhF2JkFsi2gtE6/Gc4cQ3Nykezcqf1w6 dCeqzoByBgwxAbQfr3HmmrWA/dxEuQ8d9AQtApSA93yXD7ga9UMAgQdby1n4exFPPU siAI1b1TYMjYnHqqY/PRkqZPB0VpoR5aK/RWK1oPjuUtTlKgep4R8PiTZW1U9qs8nV 7NhcklfO+/SLrdZ91pAHe67RXBbuEVqHUAp14R9hV1acnd5VPHSmW3jHjeAkGfBfy9 z0F8dd5yTEikQ== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1udxGt-00000009p3a-1gX4; Mon, 21 Jul 2025 16:38:03 -0400 Message-ID: <20250721203803.253425737@kernel.org> User-Agent: quilt/0.68 Date: Mon, 21 Jul 2025 16:37:40 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [for-next][PATCH 1/5] ktest.pl: Add -D option to override options References: <20250721203739.462938756@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. Cc: "John Warthog9 Hawley" Cc: Dhaval Giani Cc: Greg KH Link: https://lore.kernel.org/20250718202053.231478909@kernel.org 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..16e20d4137b3 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 11:47:26 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 E3D3535973 for ; Mon, 21 Jul 2025 20:37:32 +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=1753130253; cv=none; b=cd2hDYM2kFPZFaHTgoXyjzBU/eh0Vq0HHhxyqaP7/ZKnSWIZujcsy+DIpBgyZ+kpXFryw5hcw0uqjh+snqSVrjuECsva6Wf2azq3YH8BGLwsDPA4z0aLQLbpvk+71mtFLX8I+HQO9u+tBMANB464EMA0KVgL+JugeSSBAgBiUaY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753130253; c=relaxed/simple; bh=gc/tiouEgPfMaWrG2V9g+sCvkq8+ChO2L6JjUxXoeq4=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=CsF9E9ap13YI+iMU9Oh0b11/av4f5NpXHuPKlb1CWqXGqwy5FWFz97B85RPnZf8Bb7HkUap/lMIZD6QpMTMl96tpPhIDRIEId3JWLpS1oA+JkxpjjbicaOepJI6PfKUAeL1JEI2s4NYR5WEJJYamasIU/yXBd1MVUqqatwnuOdQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gH4Lr73G; 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="gH4Lr73G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83635C4CEF9; Mon, 21 Jul 2025 20:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753130252; bh=gc/tiouEgPfMaWrG2V9g+sCvkq8+ChO2L6JjUxXoeq4=; h=Date:From:To:Cc:Subject:References:From; b=gH4Lr73GVha9tvXVTB5WV3O/LBWXL37vE5JoTGcDFhtGE1hLwKwgUlMmQ2Hl9fn/E zgmucYbVv9QVxgWVOgBY8QYbarmTikCAURmzHq6GjxBRhm/IRAMc4V7Oad0c+6qPcF tHW2xDm1JOoIGMjXd76jV1wfgX2LMIlusLx+40MapDQBJqj5JOq69jo2y1ihsSJ0gE VO4XEoLZXU8jcVp7ZumBK4wgYAK+0jsqNlTsRTY2tz4VWy0Q0urZ9hHhbubBxfLnLH /+NJwu6gFirW/18PRyHCpaMWc64KdfmhdG240rnbQ+Ijt0lt6PuRhERpbio05+Ke3L gIFDsmet0ON3A== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1udxGt-00000009p44-2OMD; Mon, 21 Jul 2025 16:38:03 -0400 Message-ID: <20250721203803.422398121@kernel.org> User-Agent: quilt/0.68 Date: Mon, 21 Jul 2025 16:37:41 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [for-next][PATCH 2/5] ktest.pl: Allow command option -D to override temp variables References: <20250721203739.462938756@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 Cc: "John Warthog9 Hawley" Cc: Dhaval Giani Cc: Greg KH Link: https://lore.kernel.org/20250718202053.399653933@kernel.org 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 16e20d4137b3..7b94b9b83ee7 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 11:47:26 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 4984A23C502 for ; Mon, 21 Jul 2025 20:37:32 +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=1753130253; cv=none; b=SOwgMd49HCY/gVR5SlDdjEwzauuzZWqXyXY6F/IeAhFepjWxwc5bpC7jD5FZrIrH8357sqcnLCHlPDyFnVd0K98sx2ItQhNpf8JAQkrLw8f8K8B9gonYWmXWFhY97yQH/k0j2yLWtFiotC+cM0QIzn1ZtgeQ0iOG8zECOcDpyPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753130253; c=relaxed/simple; bh=p+5PwjEc555AtVNzBRcMCkoW7EoDC9oTDy0rdmx/P5k=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=JjONkjO93yW+RdCBGliMS4NLG9F4mg3pWF/zzeqXxl9wWw1kDPCgqR8CP4ImRFE33nWdlfg4nz9NKwQt+SAhsB/Jlq0QWWPNFEequpTSQMSrlA6kI5k08vco3lhlXgZDtPoYG/CHJJvKlkjF1X/5W7dSJwupaCz2JWpVy3xVMB0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sTqhjVxI; 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="sTqhjVxI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1122C4CEFB; Mon, 21 Jul 2025 20:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753130252; bh=p+5PwjEc555AtVNzBRcMCkoW7EoDC9oTDy0rdmx/P5k=; h=Date:From:To:Cc:Subject:References:From; b=sTqhjVxIyC7a5zRnrYDWqMxu4zjJdjhmY0vEkwzgJtRmsbVENqabXRQYM/IznE3s3 1Y1+4AYWFRv/Getl1I361ZCihYYvUjbWlVea5bmBYVdYabkawPr3iFUq4BJtovIP1X grg2aronIOYA/Lne4e9Ch/2maooHiYiaMgbe+PRwtcdE5aASmV2XzcmIRI6mFon/zc khJ6AnHa8YuaXu9VBOmTYxef4jwfR7OSUS/PsFimC65BVsKKylH/gF+H/SF6vcMmqZ d8BQkmWQ+0enN7B6/wTD8f6hN8w84B7wjwr2Vhp57IKqcB5gW/65MmOrtSookMSGp4 2fQxM9wmHS33A== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1udxGt-00000009p4Y-35Sa; Mon, 21 Jul 2025 16:38:03 -0400 Message-ID: <20250721203803.589718077@kernel.org> User-Agent: quilt/0.68 Date: Mon, 21 Jul 2025 16:37:42 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [for-next][PATCH 3/5] ktest.pl: Have -D option work without a space References: <20250721203739.462938756@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. Cc: "John Warthog9 Hawley" Cc: Dhaval Giani Cc: Greg KH Link: https://lore.kernel.org/20250718202053.567246162@kernel.org 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 7b94b9b83ee7..95e62929cda7 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 11:47:26 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 2257323C4E7 for ; Mon, 21 Jul 2025 20:37:33 +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=1753130253; cv=none; b=hetsHDXdnmKJl9VE2J0F74DVTrfKDvLnE/JK/v/UrA8wlAyav5ZpbkfBveC6gloenxoZ5LqGICBiFT4QSdCUYmvNv/bW/sSXC1D3sjELmYlBa9XVV2FG1gnF1ehgyfgwW2P4ubbX71OzSnxAhpP3j4FcBpOGvyACsxiZWOMzyWY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753130253; c=relaxed/simple; bh=47h6/gzbv25xAVIKLH1Nb7C8dT2KYdtCReAuB8pu30w=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=BvQdWSt2JuM3vWFYfMsE26C1eo9tEqsnRGNHaRNwmWxufCjhFDHIdwd2pn4tdWgnay/XZDLwbvK2cpyW2Eg8+cIUHBLOPx++meHSKHzGkXwA8mohsY0yql91XK0FoBbpH5wrqj9YeJyDk2R7ZUKaE2QYKyVhqvr3RJSyDkMcmTU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=F6Tn7885; 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="F6Tn7885" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFE63C4CEF4; Mon, 21 Jul 2025 20:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753130253; bh=47h6/gzbv25xAVIKLH1Nb7C8dT2KYdtCReAuB8pu30w=; h=Date:From:To:Cc:Subject:References:From; b=F6Tn7885Tj/fXxU/h+2FvDNn1OR1EDa2EotKmVuamETms0ikQy+X+FGrD6IB++KU3 PsB3A7qfD+GzE4tDFU/zla73vMOw5fz+/aZr3jWHjArmH+GwYBTr62ryNpt/RvYD1I 1WPZLImbT+XXlA1L8mNX2xAmpGydTYjUfuvVTBoZRiH+imdHMrsE7Iukl3iPA+kpkR baG2cIrfx/ej1ylqsoB6wLlRzQFkXRZKx3LtrwNegmET7SFo0LAt2yd+XZFomPMfUQ 2Ves7+AjgBBLimFWb9g9+e9oQpP9xC8UW3NjlWuqbPvi7XyBcE7dL4ZtwIdcx94Ppo KTo5z8kVlwakg== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1udxGt-00000009p52-3lsV; Mon, 21 Jul 2025 16:38:03 -0400 Message-ID: <20250721203803.753889067@kernel.org> User-Agent: quilt/0.68 Date: Mon, 21 Jul 2025 16:37:43 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [for-next][PATCH 4/5] ktest.pl: Prevent recursion of default variable options References: <20250721203739.462938756@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. Cc: "John Warthog9 Hawley" Cc: Dhaval Giani Cc: Greg KH Link: https://lore.kernel.org/20250718202053.732189428@kernel.org 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 95e62929cda7..3a679259f4e2 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 11:47:26 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 7302423D28E for ; Mon, 21 Jul 2025 20:37:33 +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=1753130253; cv=none; b=ns/3Kh9tkhzOcFJnYBIjmVPs3X+IEYqEappO7awWzJuWFB4Asp36jd8KiwBHnoCmAaQJY0PucZS+jC4/0Kl469VBGrZf45KYFmS1sIp1Ez5obmLXDHdV/tB0BwuzHFVhBW2PqHpw/NpCwmvTAA4r/9uBxEh2XtGu8dJoRo5ZKKw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753130253; c=relaxed/simple; bh=5geqAggurpwxkHUPjgRPgR//GEnUyyqKrqcPH7ocPb8=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=ndByyCYg5pVVxyjyNxgOi8Wc7ERScWvo53LoPhn1MlPjXtzYgvv0VRv/bhMpP6EYdEUsBVPrZJ04cBqA++PUfabQkbsqtLm8GT3yptE2weuu3AHE1QqLUJmfxWlF48SEinXG4OIG4tBd4eZIeNqq5et3ZhSirE5zno9b2oaqMJ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K0Ge/lA4; 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="K0Ge/lA4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02C83C4CEED; Mon, 21 Jul 2025 20:37:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753130253; bh=5geqAggurpwxkHUPjgRPgR//GEnUyyqKrqcPH7ocPb8=; h=Date:From:To:Cc:Subject:References:From; b=K0Ge/lA4qjkU3kUy9DfpJleQZUpOAP2a/SoWS0mauFBn3WrLDpWpx/gD8zJEA2mEP JcqgqXBBaY+cNW5gsAzP+fUShUDTkfLNd5+0uLWuBWIXlqNsCFn/f5pyRsnAfxRv/y 8YYMW8qM2RgV0Tgh7nE7inRBN5y9RzKA9+4H49Kqz4bo+471MET/jgxlLCZr7MMPuw NFBTUW8zMDKfEFOBe5JzVh+R1+bj5NsatMkRdfCHrXo9Lwq6MmUTwXZJTmnP1ST+X1 HBF7BsFLoSsuqxvwQCEMncOYkcRDq5ZgcsGE7HOyA0XzbqK3MKyjodrfDys3SGME5L wEu5jMUyGm1Eg== Received: from rostedt by gandalf with local (Exim 4.98.2) (envelope-from ) id 1udxGu-00000009p5X-0HgA; Mon, 21 Jul 2025 16:38:04 -0400 Message-ID: <20250721203803.920384166@kernel.org> User-Agent: quilt/0.68 Date: Mon, 21 Jul 2025 16:37:44 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Dhaval Giani , Greg KH Subject: [for-next][PATCH 5/5] ktest.pl: Always display BUILD_DIR and OUTPUT_DIR at the start of tests References: <20250721203739.462938756@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. Cc: "John Warthog9 Hawley" Cc: Dhaval Giani Cc: Greg KH Link: https://lore.kernel.org/20250718202053.898022631@kernel.org 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 3a679259f4e2..2d4ba097d510 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