SimulatorController: Selection between multiple experiments

If the user enabled multiple experiments, it does not make sense to
execute them concurrently. Therefore, we now only register all enabled
experiments and choose one experiment on fail-client startup. For this
selection, the user can either set the FAIL_EXPERIMENT environment
variable or invoke the tool with a specific argv[0]. For the
bin/-folder, we create symlinks for this mechanism.

With this change, the generic-tracing and generic-experiment can be
compiled into the same executable and we could distribute a "standard"
version of FAIL*.
This commit is contained in:
Christian Dietrich
2020-12-14 12:04:03 +01:00
committed by Horst Schirmeier
parent 2ecdba92a5
commit 5929eac85c
5 changed files with 95 additions and 7 deletions

View File

@ -2,5 +2,10 @@
set(EXPERIMENTS_ACTIVATED "" CACHE STRING "Activated experiments (a semicolon-separated list of fail/src/experiments/ subdirectories)")
foreach(experiment_name ${EXPERIMENTS_ACTIVATED})
add_subdirectory(${experiment_name})
add_subdirectory(${experiment_name})
# Create symlink
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${EXECUTABLE_OUTPUT_PATH}/fail-client
${EXECUTABLE_OUTPUT_PATH}/fail-${experiment_name}
)
endforeach(experiment_name)

View File

@ -12,7 +12,7 @@
aspect @EXPERIMENT_TYPE@ExperimentHook {
advice execution ("void fail::SimulatorController::initExperiments()") : after () {
fail::simulator.addFlow(new @EXPERIMENT_TYPE@);
fail::simulator.addExperiment("@EXPERIMENT_NAME@", new @EXPERIMENT_TYPE@);
}
};