Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ea0e063 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt
Browse files

ktest: Monitor kernel while running of user tests



Record the console of tests to both the console and the log.
Also, record the bug reports afte the test has completed.
Currently, if a kernel bug happens while running the userland
test, the test stops and will not record the kernel bug. This
makes it difficult to solve what happened.

Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 4651920e
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -1110,6 +1110,7 @@ sub do_run_test {


	    # we are not guaranteed to get a full line
	    # we are not guaranteed to get a full line
	    $full_line .= $line;
	    $full_line .= $line;
	    doprint $line;


	    if ($full_line =~ /call trace:/i) {
	    if ($full_line =~ /call trace:/i) {
		$bug = 1;
		$bug = 1;
@@ -1126,6 +1127,19 @@ sub do_run_test {
    } while (!$child_done && !$bug);
    } while (!$child_done && !$bug);


    if ($bug) {
    if ($bug) {
	my $failure_start = time;
	my $now;
	do {
	    $line = wait_for_input($monitor_fp, 1);
	    if (defined($line)) {
		doprint $line;
	    }
	    $now = time;
	    if ($now - $failure_start >= $stop_after_failure) {
		last;
	    }
	} while (defined($line));

	doprint "Detected kernel crash!\n";
	doprint "Detected kernel crash!\n";
	# kill the child with extreme prejudice
	# kill the child with extreme prejudice
	kill 9, $child_pid;
	kill 9, $child_pid;