Skip to content

Commit f983a2b

Browse files
satoru-takeuchirostedt
authored andcommitted
ktest: add 2nd parameter of run_command() to set the redirect target file
If we'd like to set the redirect target file of run_command(), we should define $redirect before calling this function and should undef it after calling this function. Since it's user-unfriendly, add 2nd parameter of run_command() for this purpose. Link: http://lkml.kernel.org/r/87vbvwokq8.wl%satoru.takeuchi@gmail.com Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent a798c10 commit f983a2b

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

‎tools/testing/ktest/ktest.pl‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
my $bisect_ret_default;
150150
my $in_patchcheck = 0;
151151
my $run_test;
152-
my $redirect;
153152
my $buildlog;
154153
my $testlog;
155154
my $dmesg;
@@ -1529,7 +1528,7 @@ sub fail {
15291528
}
15301529

15311530
sub run_command {
1532-
my ($command) = @_;
1531+
my ($command, $redirect) = @_;
15331532
my $dolog = 0;
15341533
my $dord = 0;
15351534
my $pid;
@@ -2265,9 +2264,7 @@ sub build {
22652264
# Run old config regardless, to enforce min configurations
22662265
make_oldconfig;
22672266

2268-
$redirect = "$buildlog";
2269-
my $build_ret = run_command "$make $build_options";
2270-
undef $redirect;
2267+
my $build_ret = run_command "$make $build_options", $buildlog;
22712268

22722269
if (defined($post_build)) {
22732270
# Because a post build may change the kernel version
@@ -2360,9 +2357,7 @@ sub child_run_test {
23602357
$poweroff_on_error = 0;
23612358
$die_on_failure = 1;
23622359

2363-
$redirect = "$testlog";
2364-
run_command $run_test or $failed = 1;
2365-
undef $redirect;
2360+
run_command $run_test, $testlog or $failed = 1;
23662361

23672362
exit $failed;
23682363
}

0 commit comments

Comments
 (0)