Skip to contentSkip to conversation

ktest: Store failure logs also in fatal paths

PATCH New Steven Rostedt 1 participant 1 message Apr 1 Ktest

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 ktest: Store failure logs also in fatal paths

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest.git
for-next

Head SHA1: 81fca7087466bd81fff7100d824b2c788edf7a97

Ricardo B. Marlière (1):
ktest: Store failure logs also in fatal paths

----

 tools/testing/ktest/ktest.pl | 5 +++++
 1 file changed, 5 insertions(+)
---------------------------
commit 81fca7087466bd81fff7100d824b2c788edf7a97
Author: Ricardo B. Marlière <[email protected]>
Date:   Wed Mar 18 16:00:43 2026 -0300

ktest: Store failure logs also in fatal paths

STORE_FAILURES was only saved from fail(), so paths that reached dodie() could exit without preserving failure logs.

That includes fatal hook paths such as:

POST_BUILD_DIE = 1

and ordinary failures when:

DIE_ON_FAILURE = 1

Call save_logs("fail", ...) from dodie() too so fatal failures keep the same STORE_FAILURES artifacts as non-fatal fail() paths.

tools/testing/ktest/ktest.pl +5 -0
index de99b82d16ad..112f9ca2444b 100755
@@ -1635,6 +1635,11 @@ sub dodie {
 	print " See $opt{LOG_FILE} for more info.\n";
     }
 
+    # Fatal paths bypass fail(), so STORE_FAILURES needs to be handled here.
+    if (defined($store_failures)) {
+	save_logs("fail", $store_failures);
+    }
+
     if ($email_on_error) {
 	my $name = get_test_name;
 	my $log_file;