Commit 767ab1a3 authored by Leigh Stoller's avatar Leigh Stoller

Minor fix to stats code.

parent 56018efd
......@@ -1761,9 +1761,9 @@ sub PreRun($;$$)
#
# Initialiaize bookkeeping for a swap operation.
#
sub PreSwap($$$)
sub PreSwap($$$$)
{
my ($self, $swapper, $which) = @_;
my ($self, $swapper, $which, $estate) = @_;
# Must be a real reference.
return -1
......@@ -1773,8 +1773,7 @@ sub PreSwap($$$)
my $rsrcidx = $self->rsrcidx();
my $lastrsrc = $rsrcidx;
my $uid_idx = $swapper->uid_idx();
# XXX state is no longer "active" for swapmod of active experiment.
my $isactive = $self->swapin_time();
my $isactive = ($estate eq EXPTSTATE_ACTIVE);
#
# We should never get here with a lastrsrc in the stats record; it
......
......@@ -473,11 +473,11 @@ if (system("$parser -n $zeeopt $pid $gid $eid $nsfile") != 0) {
# Gather statistics; start the clock ticking.
#
if ($frontend || $batchmode) {
$experiment->PreSwap($this_user, TBDB_STATS_PRELOAD) == 0 or
$experiment->PreSwap($this_user, TBDB_STATS_PRELOAD, $exptstate) == 0 or
fatal("Preswap failed!");
}
else {
$experiment->PreSwap($this_user, TBDB_STATS_START) == 0 or
$experiment->PreSwap($this_user, TBDB_STATS_START, $exptstate) == 0 or
fatal("Preswap failed!");
}
......
......@@ -435,7 +435,7 @@ if ($waitmode) {
# Sanity check states in case someone changes something.
#
if ($estate eq EXPTSTATE_ACTIVE) {
$experiment->PreSwap($this_user, TBDB_STATS_SWAPOUT) == 0 or
$experiment->PreSwap($this_user, TBDB_STATS_SWAPOUT, $estate) == 0 or
fatal("Preswap failed!");
if ($experiment->Swap($Experiment::EXPT_SWAPOUT) != 0) {
......
......@@ -880,15 +880,15 @@ $SIG{QUIT} = 'DEFAULT';
# Gather stats; start clock ticking
#
if ($inout eq "in") {
$experiment->PreSwap($this_user, TBDB_STATS_SWAPIN) == 0 or
$experiment->PreSwap($this_user, TBDB_STATS_SWAPIN, $estate) == 0 or
fatal("Preswap failed!");
}
elsif ($inout eq "out") {
$experiment->PreSwap($this_user, TBDB_STATS_SWAPOUT) == 0 or
$experiment->PreSwap($this_user, TBDB_STATS_SWAPOUT, $estate) == 0 or
fatal("Preswap failed!");
}
elsif ($inout eq "modify") {
$experiment->PreSwap($this_user, TBDB_STATS_SWAPMODIFY) == 0 or
$experiment->PreSwap($this_user, TBDB_STATS_SWAPMODIFY, $estate) == 0 or
fatal("Preswap failed!");
}
......
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