exchange experimentInfo.hpp by experiment.conf which is know paresd during
runtime (no recompile anymore)
This commit is contained in:
@ -8,15 +8,6 @@
|
||||
using namespace std;
|
||||
using namespace fail;
|
||||
|
||||
// Check if configuration dependencies are satisfied:
|
||||
#if !defined(CONFIG_EVENT_BREAKPOINTS) || !defined(CONFIG_SR_RESTORE) || \
|
||||
!defined(CONFIG_EVENT_MEMREAD) || !defined(CONFIG_EVENT_MEMWRITE) || \
|
||||
!defined(CONFIG_SR_SAVE) || \
|
||||
!defined(CONFIG_EVENT_IOPORT)
|
||||
#error This experiment needs: breakpoints, memory accesses, I/O port events, \
|
||||
save, and restore. Enable these in the configuration.
|
||||
#endif
|
||||
|
||||
L4SysExperiment::L4SysExperiment()
|
||||
: m_jc("localhost"), log("L4Sys", false)
|
||||
{
|
||||
@ -37,8 +28,6 @@ void L4SysExperiment::terminate(int reason) {
|
||||
simulator.terminate(reason);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool L4SysExperiment::run()
|
||||
{
|
||||
srand(time(NULL));
|
||||
|
||||
73
src/experiments/l4-sys/experiment.conf
Normal file
73
src/experiments/l4-sys/experiment.conf
Normal file
@ -0,0 +1,73 @@
|
||||
#experiment specific config
|
||||
address_space=0x1fd77000
|
||||
|
||||
# if address_space_trace is not set then we use address_space for tracing
|
||||
#address_space_trace=0x0
|
||||
|
||||
func_entry=0x20000216
|
||||
func_exit=0x2000029c
|
||||
|
||||
# if filter entry/exit is not set, then (filter_entry=func_entry) and
|
||||
# (filter_exit = func_exit)
|
||||
filter_entry=0x2000022f
|
||||
filter_exit=0x20000252
|
||||
|
||||
#default break_* value is 0
|
||||
#break_blink=0xdead
|
||||
#break_longjmp=0xdead
|
||||
#break_exit=0xdead
|
||||
|
||||
#experiment values calculated during preparation
|
||||
numinstr=16
|
||||
totinstr=58401
|
||||
|
||||
#default config
|
||||
emul_ips=5000000
|
||||
max_instr_bytes=15
|
||||
|
||||
#default files
|
||||
state_folder=l4sys.state
|
||||
instruction_list=ip.list
|
||||
golden_run=golden.out
|
||||
filter=filter.list
|
||||
trace=trace.pb
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -140,8 +140,9 @@ private:
|
||||
* combination.
|
||||
*/
|
||||
void doRegisterInjection(int regDesc, int bit);
|
||||
|
||||
|
||||
int updateConfig(std::string parameter, std::string value);
|
||||
|
||||
void setupFilteredBreakpoint(fail::BPSingleListener* bp, int instOffset, std::string instr_list);
|
||||
|
||||
void parseOptions(L4SysConfig&);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "experiment.hpp"
|
||||
#include "experimentInfo.hpp"
|
||||
#include "InstructionFilter.hpp"
|
||||
#include "UDIS86.hpp"
|
||||
#include "aluinstr.hpp"
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
#ifndef __L4SYS_EXPERIMENT_INFO_HPP__
|
||||
#define __L4SYS_EXPERIMENT_INFO_HPP__
|
||||
|
||||
// the maximum number of bytes in a Bochs instruction
|
||||
#define MAX_INSTR_BYTES 15
|
||||
|
||||
// the bounds of the program (space, instructions and time)
|
||||
// client
|
||||
#define L4SYS_ADDRESS_SPACE 0x1fd77000
|
||||
// server
|
||||
#define L4SYS_ADDRESS_SPACE_TRACE L4SYS_ADDRESS_SPACE
|
||||
//#define L4SYS_ADDRESS_SPACE_TRACE 0x1fd4c000
|
||||
|
||||
#define L4SYS_exp_start 0x20000216
|
||||
#define L4SYS_exp_end 0x2000029c
|
||||
#define L4SYS_inj_start 0x2000022f
|
||||
#define L4SYS_inj_end 0x20000252
|
||||
|
||||
// FUNC_{ENTRY,EXIT} specifies the range that needs to
|
||||
// be captured to log program output properly
|
||||
#define L4SYS_FUNC_ENTRY L4SYS_exp_start
|
||||
#define L4SYS_FUNC_EXIT L4SYS_exp_end
|
||||
// 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 L4SYS_inj_start
|
||||
#define L4SYS_FILTER_EXIT L4SYS_inj_end
|
||||
|
||||
#define L4SYS_BREAK_BLINK 0xdead
|
||||
#define L4SYS_BREAK_LONGJMP 0xdead
|
||||
#define L4SYS_BREAK_EXIT 0xdead
|
||||
|
||||
// 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
|
||||
|
||||
// kernel: 2377547, userland: 79405472
|
||||
#define L4SYS_NUMINSTR 0x1
|
||||
#define L4SYS_TOTINSTR 0x1
|
||||
#define L4SYS_BOCHS_IPS 5000000
|
||||
|
||||
// several file names used
|
||||
#define L4SYS_STATE_FOLDER "l4sys.state"
|
||||
#define L4SYS_INSTRUCTION_LIST "ip.list"
|
||||
#define L4SYS_ALU_INSTRUCTIONS "alu.list"
|
||||
#define L4SYS_CORRECT_OUTPUT "golden.out"
|
||||
#define L4SYS_FILTER "filter.list"
|
||||
|
||||
// flags
|
||||
// 0 - preparation complete
|
||||
// >0 - next step to execute
|
||||
#define PREPARATION_STEP 0
|
||||
|
||||
#endif // __L4SYS_EXPERIMENT_INFO_HPP__
|
||||
@ -1,23 +1,102 @@
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "experiment.hpp"
|
||||
#include "experimentInfo.hpp"
|
||||
|
||||
#include "util/CommandLine.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace fail;
|
||||
|
||||
#define EXPERIMENT_CONF "experiment.conf"
|
||||
|
||||
|
||||
static void parameterMissing(fail::Logger log, string c) {
|
||||
log << "Error: Missing config parameter (" << c << ")" << endl;
|
||||
simulator.terminate(1);
|
||||
}
|
||||
|
||||
int L4SysExperiment::updateConfig(string parameter, string value) {
|
||||
|
||||
bool replaced = false;
|
||||
|
||||
std::list<std::string> buf;
|
||||
|
||||
ifstream is(EXPERIMENT_CONF);
|
||||
|
||||
if (is) {
|
||||
while(!is.eof()) {
|
||||
string tmp;
|
||||
getline(is, tmp);
|
||||
if( !tmp.compare(0, parameter.length() + 1, string(parameter + "=")) ) {
|
||||
buf.push_back(string(parameter + "=" + value) );
|
||||
replaced = true;
|
||||
} else {
|
||||
buf.push_back(tmp);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cerr << "Open config file failed" << endl;
|
||||
return -1;
|
||||
}
|
||||
is.close();
|
||||
|
||||
ofstream os(EXPERIMENT_CONF);
|
||||
|
||||
if (os) {
|
||||
if(!replaced)
|
||||
os << parameter << "=" << value << endl;
|
||||
|
||||
while(!buf.empty()) {
|
||||
os << buf.front() << endl;
|
||||
buf.pop_front();
|
||||
}
|
||||
} else {
|
||||
cerr << "Open config file for update failed" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void L4SysExperiment::parseOptions(L4SysConfig &conf) {
|
||||
CommandLine &cmd = CommandLine::Inst();
|
||||
|
||||
ifstream fin(EXPERIMENT_CONF);
|
||||
|
||||
//Currently we don't delete the parameterstring to avoid deling ptr in the cmd
|
||||
//Nevertheless, we shouldn't need them, so deleting should be safe
|
||||
|
||||
//We interpret the file content as parameters to our main function, so we don't
|
||||
//need an own parser. Program parameters appear earlier in the parameter list
|
||||
//and will overwrite the parameters from the config file.
|
||||
while(fin.good()) {
|
||||
string buffer;
|
||||
string prefix("--");
|
||||
|
||||
getline(fin, buffer, '\n');
|
||||
|
||||
if( !(strncmp(buffer.c_str(),"#",1) == 0) &&
|
||||
!(strncmp(buffer.c_str()," ",1) == 0 ) &&
|
||||
!(strncmp(buffer.c_str(),"",1) == 0 ) ) {
|
||||
string t(prefix + buffer);
|
||||
//Workarround, if we just alloc t.length some of the arguments values
|
||||
//disappear
|
||||
char *c = (char *) malloc(t.length() * 2);
|
||||
strcpy(c, t.c_str());
|
||||
cmd.add_args( c );
|
||||
}
|
||||
}
|
||||
|
||||
cout << "end of config file" << endl;
|
||||
|
||||
cmd.addOption("", "", Arg::None, "USAGE: fail-client -Wf,[option] -Wf,[option] ... <BochsOptions...>");
|
||||
CommandLine::option_handle HELP =
|
||||
cmd.addOption("h", "help", Arg::None, "-h,--help \tPrint usage and exit");
|
||||
CommandLine::option_handle STEP =
|
||||
cmd.addOption("s", "step", Arg::Optional, "-s,--step \tSpecify preparation step, without this argumnt fail-client start in experiment mode (cr3: get CR3, cc: Create Checkpoint, it: collect instruction trace, gr: golden run, all: do the whole preparation)");
|
||||
|
||||
|
||||
CommandLine::option_handle OPT_MAX_INSTR_BYTES =
|
||||
cmd.addOption("", "max_instr_bytes", Arg::Optional, "--max_instr_bytes \t define MAX_INSTR_BYTES");
|
||||
CommandLine::option_handle OPT_ADDRESS_SPACE =
|
||||
@ -38,26 +117,23 @@ void L4SysExperiment::parseOptions(L4SysConfig &conf) {
|
||||
cmd.addOption("", "break_longjmp", Arg::Optional, "--break_longjmp \t define L4SYS_BREAK_LONGJMP");
|
||||
CommandLine::option_handle OPT_BREAK_EXIT =
|
||||
cmd.addOption("", "break_exit", Arg::Optional, "--break_exit \t define L4SYS_BREAK_EXIT");
|
||||
CommandLine::option_handle OPT_FILTER_INSTRUCTIONS =
|
||||
cmd.addOption("", "filter_instructions", Arg::Optional, "--filter_instructions \t define L4SYS_FILTER_INSTRUCTIONS");
|
||||
CommandLine::option_handle OPT_NUMINSTR =
|
||||
cmd.addOption("", "numinstr", Arg::Optional, "--numinstr \t define L4SYS_NUMINSTR");
|
||||
CommandLine::option_handle OPT_TOTINSTR =
|
||||
cmd.addOption("", "totinstr", Arg::Optional, "--totinstr \t define L4SYS_TOTINSTR");
|
||||
CommandLine::option_handle OPT_EMUL_IPS =
|
||||
cmd.addOption("", "bochs_ips", Arg::Optional, "--bochs_ips \t define L4SYS_BOCHS_IPS");
|
||||
cmd.addOption("", "emul_ips", Arg::Optional, "--emul_ips \t define L4SYS_BOCHS_IPS");
|
||||
CommandLine::option_handle OPT_STATE_FOLDER =
|
||||
cmd.addOption("", "state_folder", Arg::Optional, "--state_folder \t define L4SYS_STATE_FOLDER");
|
||||
CommandLine::option_handle OPT_INSTRUCTION_LIST =
|
||||
cmd.addOption("", "instruction_list", Arg::Optional, "--instruction_list \t define L4SYS_INSTRUCTION_LIST");
|
||||
CommandLine::option_handle OPT_ALU_INSTRUCTIONS =
|
||||
cmd.addOption("", "alu_instructions", Arg::Optional, "--alu_instructions \t define L4SYS_ALU_INSTRUCTIONS");
|
||||
CommandLine::option_handle OPT_CORRECT_OUTPUT =
|
||||
cmd.addOption("", "golden_run", Arg::Optional, "--correct_output \t define L4SYS_CORRECT_OUTPUT");
|
||||
CommandLine::option_handle OPT_FILTER =
|
||||
cmd.addOption("", "filter", Arg::Optional, "--filter \t define L4SYS_FILTER");
|
||||
CommandLine::option_handle OPT_TRACE =
|
||||
cmd.addOption("", "trace", Arg::Optional, "--trace \t define outputfile for trace (default trace.pb)");
|
||||
|
||||
|
||||
if (!cmd.parse()) {
|
||||
cerr << "Error parsing arguments." << endl;
|
||||
@ -68,123 +144,133 @@ void L4SysExperiment::parseOptions(L4SysConfig &conf) {
|
||||
}
|
||||
|
||||
if (cmd[OPT_MAX_INSTR_BYTES]) {
|
||||
conf.max_instr_bytes = strtol(cmd[OPT_MAX_INSTR_BYTES].arg, NULL, 16);
|
||||
conf.max_instr_bytes = strtol(cmd[OPT_MAX_INSTR_BYTES].arg, NULL, 10);
|
||||
log << "max_instr_bytes: "<< dec << conf.max_instr_bytes << endl;
|
||||
} else {
|
||||
conf.max_instr_bytes = MAX_INSTR_BYTES;
|
||||
parameterMissing(log, "max_instr_bytes");
|
||||
}
|
||||
|
||||
if (cmd[OPT_ADDRESS_SPACE]) {
|
||||
conf.address_space = strtol(cmd[OPT_ADDRESS_SPACE].arg, NULL, 16);
|
||||
conf.address_space = strtol(cmd[OPT_ADDRESS_SPACE].arg, NULL, 16);
|
||||
log << "address_space: "<< hex << conf.address_space << endl;
|
||||
} else {
|
||||
conf.address_space = L4SYS_ADDRESS_SPACE;
|
||||
parameterMissing(log, "adress_space");
|
||||
}
|
||||
|
||||
if (cmd[OPT_ADDRESS_SPACE_TRACE]) {
|
||||
conf.address_space_trace = strtol(cmd[OPT_ADDRESS_SPACE_TRACE].arg, NULL, 16);
|
||||
conf.address_space_trace = strtol(cmd[OPT_ADDRESS_SPACE_TRACE].arg, NULL, 16);
|
||||
if( conf.address_space_trace == 0 )
|
||||
conf.address_space_trace = conf.address_space;
|
||||
else
|
||||
log << "address_space_trace: "<< hex << conf.address_space_trace << endl;
|
||||
|
||||
} else {
|
||||
conf.address_space_trace = L4SYS_ADDRESS_SPACE_TRACE;
|
||||
conf.address_space_trace = conf.address_space;
|
||||
}
|
||||
|
||||
if (cmd[OPT_FUNC_ENTRY]) {
|
||||
conf.func_entry = strtol(cmd[OPT_FUNC_ENTRY].arg, NULL, 16);
|
||||
} else {
|
||||
conf.func_entry = L4SYS_FUNC_ENTRY;
|
||||
conf.func_entry = strtol(cmd[OPT_FUNC_ENTRY].arg, NULL, 16);
|
||||
log << "func_entry: "<< hex << conf.func_entry << endl;
|
||||
} else{
|
||||
parameterMissing(log, "filter_entry");
|
||||
}
|
||||
|
||||
if (cmd[OPT_FUNC_EXIT]) {
|
||||
conf.func_exit = strtol(cmd[OPT_FUNC_EXIT].arg, NULL, 16);
|
||||
conf.func_exit = strtol(cmd[OPT_FUNC_EXIT].arg, NULL, 16);
|
||||
log << "func_exit: "<< hex << conf.func_exit << endl;
|
||||
} else {
|
||||
conf.func_exit = L4SYS_FUNC_EXIT;
|
||||
parameterMissing(log, "filter_exit");
|
||||
}
|
||||
|
||||
if (cmd[OPT_FILTER_ENTRY]) {
|
||||
conf.filter_entry = strtol(cmd[OPT_FILTER_ENTRY].arg, NULL, 16);
|
||||
conf.filter_entry = strtol(cmd[OPT_FILTER_ENTRY].arg, NULL, 16);
|
||||
log << "filter_entry: "<< hex << conf.filter_entry << endl;
|
||||
} else {
|
||||
conf.filter_entry = L4SYS_FILTER_ENTRY;
|
||||
conf.filter_entry = conf.func_entry;
|
||||
}
|
||||
|
||||
if (cmd[OPT_FILTER_EXIT]) {
|
||||
conf.filter_exit = strtol(cmd[OPT_FILTER_EXIT].arg, NULL, 16);
|
||||
conf.filter_exit = strtol(cmd[OPT_FILTER_EXIT].arg, NULL, 16);
|
||||
log << "filter_exit: "<< hex << conf.filter_exit << endl;
|
||||
} else {
|
||||
conf.filter_exit = L4SYS_FILTER_EXIT;
|
||||
conf.filter_exit = conf.func_exit;
|
||||
}
|
||||
|
||||
if (cmd[OPT_BREAK_BLINK]) {
|
||||
conf.break_blink = strtol(cmd[OPT_BREAK_BLINK].arg, NULL, 16);
|
||||
conf.break_blink = strtol(cmd[OPT_BREAK_BLINK].arg, NULL, 16);
|
||||
log << "break_blink: "<< hex << conf.break_blink << endl;
|
||||
} else {
|
||||
conf.break_blink = L4SYS_BREAK_BLINK;
|
||||
conf.break_blink = 0;
|
||||
}
|
||||
|
||||
if (cmd[OPT_BREAK_LONGJMP]) {
|
||||
conf.break_longjmp = strtol(cmd[OPT_BREAK_LONGJMP].arg, NULL, 16);
|
||||
conf.break_longjmp = strtol(cmd[OPT_BREAK_LONGJMP].arg, NULL, 16);
|
||||
log << "break_longjmp: "<< hex << conf.break_longjmp << endl;
|
||||
} else {
|
||||
conf.break_longjmp = L4SYS_BREAK_LONGJMP;
|
||||
conf.break_longjmp = 0;
|
||||
}
|
||||
|
||||
if (cmd[OPT_BREAK_EXIT]) {
|
||||
conf.break_exit = strtol(cmd[OPT_BREAK_EXIT].arg, NULL, 16);
|
||||
conf.break_exit = strtol(cmd[OPT_BREAK_EXIT].arg, NULL, 16);
|
||||
log << "break_exit: "<< hex << conf.break_exit << endl;
|
||||
} else {
|
||||
conf.break_exit = L4SYS_BREAK_EXIT;
|
||||
}
|
||||
|
||||
if (cmd[OPT_FILTER_INSTRUCTIONS]) {
|
||||
conf.filter_instructions = strtol(cmd[OPT_FILTER_INSTRUCTIONS].arg, NULL, 16);
|
||||
} else {
|
||||
conf.filter_instructions = L4SYS_FILTER_INSTRUCTIONS;
|
||||
conf.break_exit = 0;
|
||||
}
|
||||
|
||||
if (cmd[OPT_NUMINSTR]) {
|
||||
conf.numinstr = strtol(cmd[OPT_NUMINSTR].arg, NULL, 16);
|
||||
conf.numinstr = strtol(cmd[OPT_NUMINSTR].arg, NULL, 10);
|
||||
log << "numinstr: "<< dec << conf.numinstr << endl;
|
||||
} else {
|
||||
conf.numinstr = L4SYS_NUMINSTR;
|
||||
parameterMissing(log, "numinstr");
|
||||
}
|
||||
|
||||
if (cmd[OPT_TOTINSTR]) {
|
||||
conf.totinstr = strtol(cmd[OPT_TOTINSTR].arg, NULL, 16);
|
||||
conf.totinstr = strtol(cmd[OPT_TOTINSTR].arg, NULL, 10);
|
||||
log << "totinstr: "<< dec << conf.totinstr << endl;
|
||||
} else {
|
||||
conf.totinstr = L4SYS_TOTINSTR;
|
||||
parameterMissing(log, "totinstr");
|
||||
}
|
||||
|
||||
if (cmd[OPT_EMUL_IPS]) {
|
||||
conf.emul_ips = strtol(cmd[OPT_EMUL_IPS].arg, NULL, 16);
|
||||
conf.emul_ips = strtol(cmd[OPT_EMUL_IPS].arg, NULL, 10);
|
||||
log << "emul_ips = " << dec << conf.emul_ips << endl;
|
||||
} else {
|
||||
conf.emul_ips = L4SYS_BOCHS_IPS;
|
||||
parameterMissing(log, "emul_ips");
|
||||
}
|
||||
|
||||
if (cmd[OPT_STATE_FOLDER]) {
|
||||
conf.state_folder = std::string(cmd[OPT_STATE_FOLDER].arg);
|
||||
conf.state_folder = std::string(cmd[OPT_STATE_FOLDER].arg);
|
||||
log << "state_folder: "<< conf.state_folder << endl;
|
||||
} else {
|
||||
conf.state_folder = L4SYS_STATE_FOLDER;
|
||||
conf.state_folder = "l4sys.state";
|
||||
}
|
||||
|
||||
if (cmd[OPT_INSTRUCTION_LIST]) {
|
||||
conf.instruction_list = std::string(cmd[OPT_INSTRUCTION_LIST].arg);
|
||||
conf.instruction_list = std::string(cmd[OPT_INSTRUCTION_LIST].arg);
|
||||
log << "instruction_list: "<< conf.instruction_list << endl;
|
||||
} else {
|
||||
conf.instruction_list = L4SYS_INSTRUCTION_LIST;
|
||||
}
|
||||
|
||||
if (cmd[OPT_ALU_INSTRUCTIONS]) {
|
||||
conf.alu_instructions = std::string(cmd[OPT_ALU_INSTRUCTIONS].arg);
|
||||
} else {
|
||||
conf.alu_instructions = L4SYS_ALU_INSTRUCTIONS;
|
||||
conf.instruction_list = "ip.list";
|
||||
}
|
||||
|
||||
if (cmd[OPT_CORRECT_OUTPUT]) {
|
||||
conf.golden_run = std::string(cmd[OPT_CORRECT_OUTPUT].arg);
|
||||
conf.golden_run = std::string(cmd[OPT_CORRECT_OUTPUT].arg);
|
||||
log << "golden_run: "<< conf.golden_run << endl;
|
||||
} else {
|
||||
conf.golden_run = L4SYS_CORRECT_OUTPUT;
|
||||
conf.golden_run = "golden.out";
|
||||
}
|
||||
|
||||
if (cmd[OPT_FILTER]) {
|
||||
conf.filter = std::string(cmd[OPT_FILTER].arg);
|
||||
conf.filter = std::string(cmd[OPT_FILTER].arg);
|
||||
log << "filter: "<< conf.filter << endl;
|
||||
} else {
|
||||
conf.filter = L4SYS_FILTER;
|
||||
conf.filter = "filter.list";
|
||||
}
|
||||
|
||||
if (cmd[OPT_TRACE]) {
|
||||
conf.trace = std::string(cmd[OPT_TRACE].arg);
|
||||
conf.trace = std::string(cmd[OPT_TRACE].arg);
|
||||
log << "trace: "<< conf.trace << endl;
|
||||
} else {
|
||||
conf.trace = std::string("trace.pb");
|
||||
conf.trace = "trace.pb";
|
||||
}
|
||||
|
||||
if (cmd[STEP]) {
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "experiment.hpp"
|
||||
#include "experimentInfo.hpp"
|
||||
#include "InstructionFilter.hpp"
|
||||
#include "aluinstr.hpp"
|
||||
|
||||
@ -47,7 +49,11 @@ void L4SysExperiment::runToStart(fail::BPSingleListener *bp)
|
||||
conf.address_space_trace = BX_CPU(0)->cr3;
|
||||
}
|
||||
|
||||
conf.address_space = BX_CPU(0)->cr3;
|
||||
conf.address_space = BX_CPU(0)->cr3;
|
||||
|
||||
char tmp[20];
|
||||
sprintf(tmp, "0x%lx", BX_CPU(0)->cr3);
|
||||
updateConfig("address_space", tmp );
|
||||
}
|
||||
|
||||
|
||||
@ -189,6 +195,16 @@ void L4SysExperiment::collectInstructionTrace(fail::BPSingleListener* bp)
|
||||
conf.numinstr = inst_accepted;
|
||||
conf.totinstr = count;
|
||||
|
||||
//Write new values into config file
|
||||
char numimstr_str[20];
|
||||
|
||||
sprintf(numimstr_str, "%li", inst_accepted);
|
||||
updateConfig("numinstr", numimstr_str );
|
||||
|
||||
char totinstr_str[20];
|
||||
sprintf(totinstr_str, "%li", count);
|
||||
updateConfig("totinstr", totinstr_str);
|
||||
|
||||
delete bp;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user