From f421735e5d6acb3ea23374a422aa1dbbc94757ec Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 14 Jan 2005 08:23:43 +0000 Subject: [PATCH] When a Pintos run times out, report the load average. --- grading/lib/Pintos/Grading.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grading/lib/Pintos/Grading.pm b/grading/lib/Pintos/Grading.pm index 860720c..bf6099f 100644 --- a/grading/lib/Pintos/Grading.pm +++ b/grading/lib/Pintos/Grading.pm @@ -401,7 +401,12 @@ sub run_pintos { my ($cmd_line, %args) = @_; my ($retval) = xsystem ($cmd_line, %args); return 'ok' if $retval eq 'ok'; - return "Timed out after $args{TIMEOUT} seconds" if $retval eq 'timeout'; + if ($retval eq 'timeout') { + my ($msg) = "Timed out after $args{TIMEOUT} seconds"; + my ($load_avg) = `uptime` =~ /(load average:.*)$/i; + $msg .= " - $load_avg" if defined $load_avg; + return $msg; + } return 'Error running Bochs' if $retval eq 'error'; die; } -- 2.30.2