diff --git a/src/core/efw/DatabaseExperiment.cc b/src/core/efw/DatabaseExperiment.cc index 7a2bf6d4..a9c6bc3e 100644 --- a/src/core/efw/DatabaseExperiment.cc +++ b/src/core/efw/DatabaseExperiment.cc @@ -120,7 +120,7 @@ bool DatabaseExperiment::run() m_log << "Trying to inject @ instr #" << dec << injection_instr << endl; - simulator.clearListeners(); + simulator.clearListeners(this); if (!this->cb_before_fast_forward()) { continue; @@ -168,7 +168,7 @@ bool DatabaseExperiment::run() simulator.terminate(1); } - simulator.clearListeners(); + simulator.clearListeners(this); if (fsppilot->inject_bursts()) { /// INJECT BURST: @@ -194,7 +194,7 @@ bool DatabaseExperiment::run() m_log << "Resume done" << std::endl; this->cb_after_resume(listener); - simulator.clearListeners(); + simulator.clearListeners(this); } m_jc->sendResult(*param); this->cb_free_experiment_data(param); diff --git a/src/experiments/generic-experiment/experiment.cc b/src/experiments/generic-experiment/experiment.cc index 54b5278f..4183dd66 100644 --- a/src/experiments/generic-experiment/experiment.cc +++ b/src/experiments/generic-experiment/experiment.cc @@ -243,6 +243,15 @@ bool GenericExperiment::cb_start_experiment() { } +bool GenericExperiment::cb_before_fast_forward() +{ + if (enabled_e9_sol) { + // output may already appear *before* FI + simulator.addFlow(&e9_sol); + } + return true; +} + bool GenericExperiment::cb_before_resume() { if (enabled_trap) simulator.addListener(&l_trap); @@ -263,10 +272,6 @@ bool GenericExperiment::cb_before_resume() { simulator.addListener(*it); } - if (enabled_e9_sol) { - simulator.addFlow(&e9_sol); - } - return true; // everything OK } diff --git a/src/experiments/generic-experiment/experiment.hpp b/src/experiments/generic-experiment/experiment.hpp index ef6218e4..46f28187 100644 --- a/src/experiments/generic-experiment/experiment.hpp +++ b/src/experiments/generic-experiment/experiment.hpp @@ -98,6 +98,14 @@ public: */ virtual bool cb_start_experiment(); + /** + * Callback that is called before the fast forward is done. This + * can be used to add additional event listeners during the fast + * forward phase. If returning false, the experiment is canceled. + * @return \c true on success, \c false otherwise + */ + virtual bool cb_before_fast_forward(); + /** * Callback that is called before the resuming till crash has * started. This is called after the fault was injected. Here the