Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] runner: Show why we dump the task state
@ 2020-04-07  8:31 Chris Wilson
  2020-04-07  8:33 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Chris Wilson @ 2020-04-07  8:31 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala, Chris Wilson

Include the reason why we are dumping the task state (test timeout) in
the kmsg log prior to the task state. Hopefully this helps when reading
the dump.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
---
 runner/executor.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 1b69f9c57..25e3187a3 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -678,9 +678,20 @@ static bool sysrq(char cmd)
 	return success;
 }
 
-static void show_kernel_task_state(void)
+static const char *show_kernel_task_state(const char *msg)
 {
+	int fd;
+
+	fd = open("/dev/kmsg", O_WRONlY);
+	if (fd != -1) {
+		write(fd, "<4>[IGT] ", 7);
+		write(fd, msg, strlen(msg));
+		close(fd);
+	}
+
 	sysrq('t');
+
+	return msg;
 }
 
 static const char *need_to_timeout(struct settings *settings,
@@ -725,16 +736,12 @@ static const char *need_to_timeout(struct settings *settings,
 		return "Killing the test because the kernel is tainted.\n";
 
 	if (settings->per_test_timeout != 0 &&
-	    time_since_subtest > settings->per_test_timeout) {
-		show_kernel_task_state();
-		return "Per-test timeout exceeded. Killing the current test with SIGQUIT.\n";
-	}
+	    time_since_subtest > settings->per_test_timeout)
+		return show_kernel_task_state("Per-test timeout exceeded. Killing the current test with SIGQUIT.\n");
 
 	if (settings->inactivity_timeout != 0 &&
-	    time_since_activity > settings->inactivity_timeout) {
-		show_kernel_task_state();
-		return "Inactivity timeout exceeded. Killing the current test with SIGQUIT.\n";
-	}
+	    time_since_activity > settings->inactivity_timeout)
+		return show_kernel_task_state("Inactivity timeout exceeded. Killing the current test with SIGQUIT.\n");
 
 	return NULL;
 }
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-04-07 16:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-07  8:31 [igt-dev] [PATCH i-g-t] runner: Show why we dump the task state Chris Wilson
2020-04-07  8:33 ` [igt-dev] ✗ Fi.CI.BUILD: failure for " Patchwork
2020-04-07  8:34 ` [igt-dev] [PATCH i-g-t] " Chris Wilson
2020-04-07  8:35 ` Chris Wilson
2020-04-07  8:42   ` Jani Nikula
2020-04-07  8:43     ` Chris Wilson
2020-04-07  9:51       ` Jani Nikula
2020-04-07  9:55   ` Petri Latvala
2020-04-07  9:58     ` Chris Wilson
2020-04-07  8:42 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2020-04-07  9:27 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Show why we dump the task state (rev2) Patchwork
2020-04-07 10:07 ` [igt-dev] [PATCH i-g-t v2] runner: Show why we dump the task state Chris Wilson
2020-04-07 10:41 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Show why we dump the task state (rev3) Patchwork
2020-04-07 16:38 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox