Skip to content

Commit 66a7974

Browse files
committed
Merge tag 'ktest-v7.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest
Pull ktest updates from Steven Rostedt: - Fix month in date timestamp used to create failure directories On failure, a directory is created to store the logs and config file to analyze the failure. The Perl function localtime is used to create the data timestamp of the directory. The month passed back from that function starts at 0 and not 1, but the timestamp used does not account for that. Thus for April 20, 2026, the timestamp of 20260320 is used, instead of 20260420. - Save the logfile to the failure directory Just the test log was saved to the directory on failure, but there's useful information in the full logfile that can be helpful to analyzing the failure. Save the logfile as well. * tag 'ktest-v7.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest: ktest: Add logfile to failure directory ktest: Fix the month in the name of the failure directory
2 parents 1e18ed5 + 932cdaf commit 66a7974

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tools/testing/ktest/ktest.pl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ sub save_logs {
18551855
my ($result, $basedir) = @_;
18561856
my @t = localtime;
18571857
my $date = sprintf "%04d%02d%02d%02d%02d%02d",
1858-
1900+$t[5],$t[4],$t[3],$t[2],$t[1],$t[0];
1858+
1900+$t[5],$t[4]+1,$t[3],$t[2],$t[1],$t[0];
18591859

18601860
my $type = $build_type;
18611861
if ($type =~ /useconfig/) {
@@ -1878,6 +1878,12 @@ sub save_logs {
18781878
"testlog" => $testlog,
18791879
);
18801880

1881+
if (defined($opt{"LOG_FILE"})) {
1882+
if (-f $opt{"LOG_FILE"}) {
1883+
cp $opt{"LOG_FILE"}, "$dir/logfile";
1884+
}
1885+
}
1886+
18811887
while (my ($name, $source) = each(%files)) {
18821888
if (-f "$source") {
18831889
cp "$source", "$dir/$name" or

0 commit comments

Comments
 (0)