The DatabaseCampaign interacts with the MySQL tables that are created
by the import-trace and prune-trace tools. It does offer all
unfinished experiment pilots from the database to the
fail-clients. Those clients send back a (by the experiment) defined
protobuf message as a result. The custom protobuf message does have to
need the form:
import "DatabaseCampaignMessage.proto";
message ExperimentMsg {
required DatabaseCampaignMessage fsppilot = 1;
repeated group Result = 2 {
// custom fields
required int32 bitoffset = 1;
optional int32 result = 2;
}
}
The DatabaseCampaignMessage is the pilot identifier from the
database. For each of the repeated result entries a row in a table is
allocated. The structure of this table is constructed (by protobuf
reflection) from the description of the message. Each field in the
Result group becomes a column in the result table. For the given
example it would be:
CREATE TABLE result_ExperimentMessage(
pilot_id INT,
bitoffset INT NOT NULL,
result INT,
PRIMARY_KEY(pilot_id)
)
Change-Id: I28fb5488e739d4098b823b42426c5760331027f8
49 lines
2.2 KiB
CMake
49 lines
2.2 KiB
CMake
### Setup search paths for headers ##
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/core)
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR}/core/comm)
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/core)
|
|
|
|
# We need to control all the protoc import paths to ensure, that all
|
|
# protoc imports refer to the same root path. Otherwise the generated
|
|
# protoc headers are not comptabile.
|
|
SET(PROTOBUF_GENERATE_CPP_APPEND_PATH FALSE)
|
|
SET(PROTOBUF_IMPORT_DIRS "/usr/include;${CMAKE_CURRENT_SOURCE_DIR}/core/comm")
|
|
|
|
# Note: CMAKE_CURRENT_BINARY_DIR is needed to find "FailConfig.hpp", which
|
|
# is generated by CMake from config/FailConfig.hpp.in and stored in
|
|
# your build-dir. (The same goes for "FailControlMessage.pb.h", etc.)
|
|
# This is done in the "src"-folder because experiments need to include
|
|
# Fail* headers as well (see hierarchy of CMakeLists.txt's).
|
|
|
|
## Add CMakeLists from subdirectories ##
|
|
# The Fail* core source files (and it's subdirectories):
|
|
add_subdirectory(core)
|
|
|
|
# Here we add all user-defined experiments (which fills the target list)
|
|
add_subdirectory(experiments)
|
|
message(STATUS "[${PROJECT_NAME}] Chosen experiment targets:")
|
|
foreach(experiment_name ${EXPERIMENTS_ACTIVATED})
|
|
message(STATUS "[${PROJECT_NAME}] -> ${experiment_name}")
|
|
endforeach(experiment_name)
|
|
|
|
# Here we add activated plugins
|
|
add_subdirectory(plugins)
|
|
message(STATUS "[${PROJECT_NAME}] Chosen plugin targets:")
|
|
foreach(plugin_name ${PLUGINS_ACTIVATED})
|
|
message(STATUS "[${PROJECT_NAME}] -> ${plugin_name}")
|
|
endforeach(plugin_name)
|
|
|
|
# libfail: dummy library that pulls in all other libraries as dependencies
|
|
# (probably there's a smarter way to do that with cmake?)
|
|
add_library(fail dummy.cc)
|
|
|
|
## Setup build dependencies of the Fail* lib
|
|
## -> the Fail* targets and user defined experiment targets
|
|
# start/end-group: ld must iterate over these archives more than once to figure
|
|
# out which objects are needed
|
|
set(experiment_libraries "")
|
|
foreach(exp_or_plugin ${EXPERIMENTS_ACTIVATED} ${PLUGINS_ACTIVATED})
|
|
set(experiment_libraries ${experiment_libraries} fail-${exp_or_plugin})
|
|
endforeach(exp_or_plugin)
|
|
target_link_libraries(fail -Wl,-start-group fail-sal fail-cpn fail-efw fail-comm fail-util ${experiment_libraries} -Wl,-end-group)
|