Commit 13336431 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Preliminary and rudimentary code for recording the dynamic event stream.

Going to a file instead of the DB (too much hassle). This needs more
work as I am still unclear as to how timelines, sequences, etc fit
into the event stream.

The file is placed in the archive and committed with each Run and Swapout.

At present, only template derived experiments do this ...
parent 9130277f
......@@ -21,10 +21,10 @@ use POSIX ":sys_wait_h";
sub usage()
{
print "Usage: eventsys.proxy -u user -g gid -e pid/eid -k keyfile ".
"-l logfile start|stop|replay\n";
"-l logfile -t record_file start|stop|replay\n";
exit(-1);
}
my $optlist = "u:e:k:dl:g:";
my $optlist = "u:e:k:dl:g:t:";
my $debug = 0;
my $user;
my $pid;
......@@ -32,6 +32,7 @@ my $eid;
my $gid;
my $keyfile;
my $logfile;
my $recordfile;
my $action;
#
......@@ -91,6 +92,9 @@ if (! defined($options{"u"}) ||
if (defined($options{"d"})) {
$debug = 1;
}
if (defined($options{"t"})) {
$recordfile = $options{"t"};
}
$logfile = $options{"l"};
$keyfile = $options{"k"};
......@@ -220,7 +224,9 @@ $ENV{'USER'} = $user;
$ENV{'LOGNAME'} = $user;
# And run it.
exec("$sched " . ($debug ? "-d" : "") . " -s localhost -k $keyfile $pid $eid");
exec("$sched " . ($debug ? "-d" : "") .
($recordfile ? " -t $recordfile" : "") .
" -s localhost -k $keyfile $pid $eid");
die("*** $0:\n".
" Could not exec $sched!");
......@@ -62,6 +62,7 @@ use lib "@prefix@/lib";
use libdb;
use libtestbed;
use libtblog;
use Template;
#
# Turn off line buffering on output
......@@ -76,6 +77,7 @@ my $proxy = "$TB/sbin/eventsys.proxy";
my $debug = 1;
my $force = 0;
my $expstate;
my $exptidx;
my $dbuid;
#
......@@ -174,6 +176,11 @@ if (! TBGroupUnixInfo($pid, $gid, \$unix_gid, \$unix_gidname)) {
tbdie("Could not get unix group info for $pid/$gid!");
}
# Need this to see if its a template experiment.
if (! TBExptIDX($pid, $eid, \$exptidx)) {
tbdie("Could not get experiment index for $pid/$gid!");
}
#
# Pase the whole thing off to the proxy, which might be local when running
# in UNIFIED_BOSS_AND_OPS mode. Become real root either way; the proxy will
......@@ -182,6 +189,8 @@ if (! TBGroupUnixInfo($pid, $gid, \$unix_gid, \$unix_gidname)) {
my $cmd = $proxy;
$cmd .= " -d"
if ($debug);
$cmd .= " -t " . TBExptUserDir($pid, $eid) . "/archive/events"
if (Template::Instance->LookupByExptidx($exptidx));
$cmd .= " -l " . TBExptUserDir($pid, $eid) . "/logs/event-sched.log";
$cmd .= " -k " . TBDB_EVENTKEY($pid, $eid);
$cmd .= " -g " . $unix_gidname;
......
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