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

Minor fix to stats code.

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