cpn: Generic wrapper for injection point

As for the pandaboard to navigate fast to the injection
instruction we need to deliver a hop chain to the fail-client,
this commit adds a generic wrapper for a injection point.
For now we have only the two options hop chain and instruction
offset, so it is activated via a cmake ON/OFF switch.

Change-Id: Ic01a07a30ac386d4316e6d6d271baf1549db966a
This commit is contained in:
Lars Rademacher
2013-11-14 23:58:02 +01:00
parent 227f0fd7b4
commit c142818325
18 changed files with 747 additions and 4 deletions

View File

@ -7,15 +7,31 @@ set(SRCS
## Setup desired protobuf descriptions HERE ##
set(PROTOS
FailControlMessage.proto
DatabaseCampaignMessage.proto
${CMAKE_CURRENT_BINARY_DIR}/DatabaseCampaignMessage.proto
TracePlugin.proto
)
## Set concrete implementation of InjectionPointMessage
# ToDo: Define seperate symbol, so it can also be used in other build types
if(CONFIG_INJECTIONPOINT_HOPS)
set(PROTOS ${PROTOS} InjectionPointHopsMessage.proto)
set(CONCRETE_INJECTION_POINT InjectionPointHopsMessage.proto)
else(CONFIG_INJECTIONPOINT_HOPS)
set(PROTOS ${PROTOS} InjectionPointStepsMessage.proto)
set(CONCRETE_INJECTION_POINT InjectionPointStepsMessage.proto)
endif(CONFIG_INJECTIONPOINT_HOPS)
# Configure concrete protobuf message to be included by campaign message
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DatabaseCampaignMessage.proto.in
${CMAKE_CURRENT_BINARY_DIR}/DatabaseCampaignMessage.proto)
#### PROTOBUFS ####
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# Let protobuf compiler find defined file (DatabaseCampaignMessage) in binary tree
set(PROTOBUF_IMPORT_DIRS ${PROTOBUF_IMPORT_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTOS})
add_library(fail-comm ${SRCS} ${PROTO_SRCS} ${PROTO_HDRS})

View File

@ -4,14 +4,22 @@ extend google.protobuf.FieldOptions {
optional bool sql_ignore = 32383 [ default = false];
}
import "@CONCRETE_INJECTION_POINT@";
message DatabaseCampaignMessage {
required int32 pilot_id = 1 [(sql_primary_key) = true];
required int32 variant_id = 2 [(sql_ignore) = true];
required int32 fspmethod_id = 3 [(sql_ignore) = true];
// ToDo: injection_instr can be deleted if all experiments switched to
// using generic InjectionPointMessage
required int32 injection_instr = 4 [(sql_ignore) = true];
optional int32 injection_instr_absolute = 5 [(sql_ignore) = true];
required int32 data_address = 6 [(sql_ignore) = true];
required int32 data_width = 7 [(sql_ignore) = true];
required string variant = 8 [(sql_ignore) = true];
required string benchmark = 9 [(sql_ignore) = true];
required InjectionPointMessage injection_point = 10 [(sql_ignore) = true];
}

View File

@ -0,0 +1,23 @@
message InjectionPointMessage {
// Costs of the hop chain on the PandaBoard
// ToDo: Could be eliminated, but it is nice for evaluation
optional uint32 costs = 3;
// If checkpoint must be used for this hop chain, id is set properly
optional uint32 checkpoint_id = 1;
// Repeated groups can't be defined as notempty, so a manual
// non-empty check is required at usage
// As we assume hops to always watch addresses of length 1, we
// don't encode the length in here
repeated group Hops = 2 {
required uint64 address = 1;
enum AccessType {
EXECUTE = 1;
READ = 2;
WRITE = 3;
}
required AccessType accesstype = 2;
}
}

View File

@ -0,0 +1,3 @@
message InjectionPointMessage {
required int32 injection_instr = 1;
}