Separate boundaries for output tracing and injection
* L4SYS_FUNC_{ENTRY,EXIT} now determines the range upon
which an experiment is run. These instructions produce the
output that is relevant for the experiment.
* L4SYS_FILTER_{ENTRY,EXIT} determine a subset of the
above instructions. FI experiments are performed on this
subset (between first occurrence of FILTER_ENTRY and first
occurrence of FILTER_EXIT inclusively).
Change-Id: I37d2189d8256b6b707a0a33984f2b2656071d983
This commit is contained in:
@ -228,11 +228,12 @@ void L4SysExperiment::collectInstructionTrace(fail::BPSingleListener& bp)
|
|||||||
|
|
||||||
#ifdef L4SYS_FILTER_INSTRUCTIONS
|
#ifdef L4SYS_FILTER_INSTRUCTIONS
|
||||||
ofstream instr_list_file(L4SYS_INSTRUCTION_LIST, ios::binary);
|
ofstream instr_list_file(L4SYS_INSTRUCTION_LIST, ios::binary);
|
||||||
RangeSetInstructionFilter rsif(L4SYS_FILTER);
|
RangeSetInstructionFilter filtering(L4SYS_FILTER);
|
||||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||||
|
|
||||||
size_t count = 0, accepted = 0;
|
size_t count = 0, accepted = 0;
|
||||||
map<address_t, unsigned> times_called_map;
|
map<address_t, unsigned> times_called_map;
|
||||||
|
bool injecting = false;
|
||||||
|
|
||||||
while (bp.getTriggerInstructionPointer() != L4SYS_FUNC_EXIT) {
|
while (bp.getTriggerInstructionPointer() != L4SYS_FUNC_EXIT) {
|
||||||
simulator.addListenerAndResume(&bp);
|
simulator.addListenerAndResume(&bp);
|
||||||
@ -245,10 +246,19 @@ void L4SysExperiment::collectInstructionTrace(fail::BPSingleListener& bp)
|
|||||||
unsigned times_called = times_called_map[curr_addr];
|
unsigned times_called = times_called_map[curr_addr];
|
||||||
times_called++;
|
times_called++;
|
||||||
times_called_map[curr_addr] = times_called;
|
times_called_map[curr_addr] = times_called;
|
||||||
|
|
||||||
|
if (curr_addr == L4SYS_FILTER_ENTRY) {
|
||||||
|
injecting = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (curr_addr == L4SYS_FILTER_EXIT) {
|
||||||
|
injecting = false;
|
||||||
|
}
|
||||||
|
|
||||||
// now check if we want to add the instruction for fault injection
|
// now check if we want to add the instruction for fault injection
|
||||||
if (rsif.isValidInstr(curr_addr,
|
if (injecting and filtering.isValidInstr(curr_addr,
|
||||||
reinterpret_cast<char const*>(calculateInstructionAddress()))) {
|
reinterpret_cast<char const*>(calculateInstructionAddress()))
|
||||||
|
) {
|
||||||
accepted++;
|
accepted++;
|
||||||
TraceInstr new_instr;
|
TraceInstr new_instr;
|
||||||
log << "writing IP " << hex << curr_addr << " counter "
|
log << "writing IP " << hex << curr_addr << " counter "
|
||||||
|
|||||||
@ -6,10 +6,21 @@
|
|||||||
|
|
||||||
// the bounds of the program (space, instructions and time)
|
// the bounds of the program (space, instructions and time)
|
||||||
#define L4SYS_ADDRESS_SPACE 0x1fd4c000
|
#define L4SYS_ADDRESS_SPACE 0x1fd4c000
|
||||||
|
|
||||||
|
// FUNC_{ENTRY,EXIT} specifies the range that needs to
|
||||||
|
// be captured to log program output properly
|
||||||
#define L4SYS_FUNC_ENTRY 0x010002a0
|
#define L4SYS_FUNC_ENTRY 0x010002a0
|
||||||
#define L4SYS_FUNC_EXIT 0x01000380
|
#define L4SYS_FUNC_EXIT 0x01000380
|
||||||
|
// FILTER_{ENTRY,EXIT} specifies the range that injections
|
||||||
|
// should be carried out on (should be a subset of the above)
|
||||||
|
// and only works with FILTER_INSTRUCTIONS turned on
|
||||||
|
#define L4SYS_FILTER_ENTRY 0x0100031c
|
||||||
|
#define L4SYS_FILTER_EXIT 0x01000380
|
||||||
|
|
||||||
// select instruction filtering
|
// select instruction filtering
|
||||||
|
// XXX: this should be always on and the code should be
|
||||||
|
// reworked to do the non-filtering work with an empty
|
||||||
|
// filter list
|
||||||
#define L4SYS_FILTER_INSTRUCTIONS 1
|
#define L4SYS_FILTER_INSTRUCTIONS 1
|
||||||
|
|
||||||
// kernel: 2377547, userland: 79405472
|
// kernel: 2377547, userland: 79405472
|
||||||
|
|||||||
Reference in New Issue
Block a user