mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ricardo B. Marlière" <rbm@suse.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	 John Hawley <warthog9@eaglescrag.net>
Cc: linux-kernel@vger.kernel.org, "Ricardo B. Marlière" <rbm@suse.com>
Subject: [PATCH] ktest: Store failure logs also in fatal paths
Date: Wed, 18 Mar 2026 16:00:43 -0300	[thread overview]
Message-ID: <20260318-ktest-fixes-v1-1-9dd94d46d84c@suse.com> (raw)

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.

Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
 tools/testing/ktest/ktest.pl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index de99b82d16ad..112f9ca2444b 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -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;

---
base-commit: 229517449879b3ca8ca5588593cbea6a67ba0ad2
change-id: 20260318-ktest-fixes-564376c0c56f

Best regards,
-- 
Ricardo B. Marlière <rbm@suse.com>


             reply	other threads:[~2026-03-18 19:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 19:00 Ricardo B. Marlière [this message]
2026-03-18 20:01 ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260318-ktest-fixes-v1-1-9dd94d46d84c@suse.com \
    --to=rbm@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=warthog9@eaglescrag.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®