Commit 312021d4 authored by Kevin Atkinson's avatar Kevin Atkinson

More tbreport changes from Mike Kasick <mkasick@andrew.cmu.edu>:

- Added tblog support to nscheck.

- Added ns_parse_failed error to nscheck.

- Added invocation column to report_errors to differentiate between assign
  runs in infeasible resource assignments.
parent ca2360a4
......@@ -371,6 +371,8 @@ CREATE TABLE errors (
script smallint(3) NOT NULL default '0',
cause varchar(16) NOT NULL default '',
confidence float NOT NULL default '0',
need_more_info ?? NOT NULL default '0',
mesg text NOT NULL,
PRIMARY KEY (session)
) TYPE=MyISAM;
......@@ -2177,6 +2179,7 @@ CREATE TABLE `report_error` (
`seq` int(10) unsigned NOT NULL,
`stamp` int(10) unsigned NOT NULL,
`session` int(10) unsigned NOT NULL,
`invocation` int(10) unsigned NOT NULL,
`attempt` tinyint(1) NOT NULL,
`severity` smallint(3) NOT NULL,
`script` smallint(3) NOT NULL,
......
......@@ -3649,7 +3649,6 @@ last_net_act,last_cpu_act,last_ext_act);
unlock tables;
4.83: Add a per-experiment port registration table. See tmcd.c
CREATE TABLE port_registration (
......@@ -3661,3 +3660,7 @@ last_net_act,last_cpu_act,last_ext_act);
PRIMARY KEY (pid,eid,service)
) TYPE=MyISAM;
4.84: Add "invocation" column to report_error
alter table report_error
add column invocation integer unsigned not null after session;
......@@ -873,13 +873,14 @@ sub tbreport( $@ ) {
$seq = new_seq_num() unless defined $seq;
my $session = $ENV{TBLOG_SESSION};
my $attempt = $ENV{TBLOG_ATTEMPT};
my $session = $ENV{TBLOG_SESSION};
my $invocation = $ENV{TBLOG_INVOCATION};
my $attempt = $ENV{TBLOG_ATTEMPT};
croak("error_type must be _0-9A-Za-z") unless $error_type =~ /^\w+$/;
my $sql = sprintf("insert into report_error (seq, stamp, session, attempt, severity, script, error_type) values(%d, UNIX_TIMESTAMP(now()), %d, %d, %d, %d, %s)",
$seq, $session, $attempt, $severity, $script_num, DBQuoteSpecial($error_type));
my $sql = sprintf("insert into report_error (seq, stamp, session, invocation, attempt, severity, script, error_type) values(%d, UNIX_TIMESTAMP(now()), %d, %d, %d, %d, %d, %s)",
$seq, $session, $invocation, $attempt, $severity, $script_num, DBQuoteSpecial($error_type));
DBQueryFatal($sql);
......
......@@ -29,7 +29,7 @@ my $optlist = "";
#
# Function phototype(s)
#
sub fatal($);
sub fatal($;$);
#
# Configure variables
......@@ -39,6 +39,12 @@ my $parser = "$TB/libexec/parse-ns";
my $status = 0;
my $dirname;
#
# Testbed Support libraries
#
use lib "@prefix@/lib";
use libtblog;
#
# Turn off line buffering on output
#
......@@ -137,20 +143,23 @@ chdir($dirname) or
#
if (system("$parser -n -a $nsfile") != 0) {
print "NS Parse failed!\n";
tberror({type => 'secondary', severity => SEV_SECONDARY,
error => ['ns_parse_failed']},
"NS Parse failed!");
$status = 1;
}
system("/bin/rm", "-rf", "$dirname");
exit $status;
sub fatal($)
sub fatal($;$)
{
my $parms = {};
$parms = shift if ref $_[0] eq 'HASH';
my($mesg) = $_[0];
system("/bin/rm", "-rf", "$dirname")
if (defined($dirname));
die("*** $0:\n".
" $mesg\n");
tbdie($parms, $mesg);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment