formatting, typos, comments, details
Change-Id: Iae5f1acb653a694622e9ac2bad93efcfca588f3a
This commit is contained in:
@ -29,9 +29,9 @@ bool DatabaseCampaign::run() {
|
||||
if (!cb_commandline_init()) return false;
|
||||
|
||||
CommandLine::option_handle VARIANT = cmd.addOption("v", "variant", Arg::Required,
|
||||
"-v/--variant \tVariant label (default: \"none\")");
|
||||
"-v/--variant \tVariant label (default: \"none\"; use % and _ as wildcard characters)");
|
||||
CommandLine::option_handle BENCHMARK = cmd.addOption("b", "benchmark", Arg::Required,
|
||||
"-b/--benchmark \tBenchmark label (default: \"none\")\n");
|
||||
"-b/--benchmark \tBenchmark label (default: \"none\"; use % and _ as wildcard characters)\n");
|
||||
CommandLine::option_handle PRUNER = cmd.addOption("p", "prune-method", Arg::Required,
|
||||
"-p/--prune-method \tWhich import method to use (default: basic)");
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ public:
|
||||
virtual bool cb_commandline_init() { return true; }
|
||||
|
||||
/**
|
||||
* Callback to the campagin to get the result message descriptor
|
||||
* Callback to the campaign to get the result message descriptor
|
||||
*/
|
||||
virtual const google::protobuf::Descriptor * cb_result_message() = 0;
|
||||
|
||||
|
||||
@ -15,7 +15,9 @@ JobClient::JobClient(const std::string& server, int port)
|
||||
{
|
||||
SocketComm::init();
|
||||
m_server_ent = gethostbyname(m_server.c_str());
|
||||
|
||||
cout << "JobServer: " << m_server.c_str() << endl;
|
||||
|
||||
if (m_server_ent == NULL) {
|
||||
perror("[Client@gethostbyname()]");
|
||||
// TODO: Log-level?
|
||||
@ -109,7 +111,6 @@ bool JobClient::getParam(ExperimentData& exp)
|
||||
|
||||
FailControlMessage_Command JobClient::tryToGetExperimentData(ExperimentData& exp)
|
||||
{
|
||||
|
||||
FailControlMessage ctrlmsg;
|
||||
|
||||
//Are there other jobs for the experiment
|
||||
@ -187,8 +188,6 @@ FailControlMessage_Command JobClient::tryToGetExperimentData(ExperimentData& exp
|
||||
} else {
|
||||
return ctrlmsg.command();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool JobClient::sendResult(ExperimentData& result)
|
||||
|
||||
@ -112,5 +112,4 @@ namespace fail {
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -24,11 +24,8 @@ namespace fail {
|
||||
};
|
||||
|
||||
bool eval(address_t opcode, MemoryInstruction & result);
|
||||
|
||||
};
|
||||
|
||||
} //end of namespace fail
|
||||
|
||||
|
||||
#endif // __ARMMEMORYINSTRUCITON_HPP__
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
namespace fail {
|
||||
|
||||
namespace T32 {
|
||||
|
||||
//!< Breakpoint configuration
|
||||
struct BP {
|
||||
enum {
|
||||
|
||||
@ -24,7 +24,8 @@ namespace fail {
|
||||
}
|
||||
}
|
||||
|
||||
CommandLine::option_handle CommandLine::addOption(const std::string &shortopt,
|
||||
CommandLine::option_handle CommandLine::addOption(
|
||||
const std::string &shortopt,
|
||||
const std::string &longopt,
|
||||
const option::CheckArg & check_arg,
|
||||
const std::string &help) {
|
||||
@ -65,5 +66,4 @@ namespace fail {
|
||||
return !m_parser->error();
|
||||
}
|
||||
|
||||
|
||||
} // end of namespace
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
namespace fail {
|
||||
|
||||
/**
|
||||
* @class CommandLine
|
||||
* @brief Implements a command line interface, that filters the
|
||||
|
||||
@ -107,6 +107,5 @@ namespace fail {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // end of namespace
|
||||
|
||||
|
||||
@ -250,6 +250,4 @@ void ElfReader::printSections() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // end-of-namespace fail
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ namespace fail {
|
||||
public:
|
||||
enum { SECTION = 1, SYMBOL = 2, UNDEF = 3, };
|
||||
|
||||
ElfSymbol(const std::string & name = ELF::NOTFOUND, guest_address_t addr = ADDR_INV, size_t size = -1, int type = UNDEF,
|
||||
int symbol_type = 0)
|
||||
ElfSymbol(const std::string & name = ELF::NOTFOUND, guest_address_t addr = ADDR_INV,
|
||||
size_t size = -1, int type = UNDEF, int symbol_type = 0)
|
||||
: name(name), address(addr), size(size), m_type(type), m_symbol_type(symbol_type) {};
|
||||
|
||||
const std::string& getName() const { return name; };
|
||||
@ -172,4 +172,3 @@ namespace fail {
|
||||
} // end-of-namespace fail
|
||||
|
||||
#endif //__ELFREADER_HPP__
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ using namespace fail;
|
||||
|
||||
void GenericTracing::parseOptions() {
|
||||
CommandLine &cmd = CommandLine::Inst();
|
||||
CommandLine::option_handle IGNORE = cmd.addOption("", "", Arg::None, "USAGE: fail-client -Wf,[option] -Wf,[option] ... <BochsOptions...>\n\n");
|
||||
cmd.addOption("", "", Arg::None, "USAGE: fail-client -Wf,[option] -Wf,[option] ... <BochsOptions...>\n\n");
|
||||
CommandLine::option_handle HELP = cmd.addOption("h", "help", Arg::None, "-h,--help \tPrint usage and exit");
|
||||
|
||||
|
||||
@ -35,16 +35,16 @@ void GenericTracing::parseOptions() {
|
||||
CommandLine::option_handle SAVE_SYMBOL = cmd.addOption("S", "save-symbol", Arg::Required,
|
||||
"-S,--save-symbol \tELF symbol to save the state of the machine (default: main)\n");
|
||||
CommandLine::option_handle STATE_FILE = cmd.addOption("f", "state-file", Arg::Required,
|
||||
"-f,--state-file \tFile/dir to save the state to (default state)");
|
||||
"-f,--state-file \tFile/dir to save the state to (default: state)");
|
||||
CommandLine::option_handle TRACE_FILE = cmd.addOption("t", "trace-file", Arg::Required,
|
||||
"-t,--trace-file \tFile to save the execution trace to\n");
|
||||
"-t,--trace-file \tFile to save the execution trace to (default: trace.pb)\n");
|
||||
|
||||
CommandLine::option_handle FULL_TRACE = cmd.addOption("", "full-trace", Arg::None, "--full-trace \tDo a full trace (more data, default: off)");
|
||||
CommandLine::option_handle MEM_SYMBOL = cmd.addOption("m", "memory-symbol", Arg::Required,
|
||||
"-m,--memory-symbol \tELF symbol(s) to trace accesses (default: all mem read/writes are traced)");
|
||||
CommandLine::option_handle MEM_REGION = cmd.addOption("M", "memory-region", Arg::Required,
|
||||
"-M,--memory-region \trestrict memory region which is traced"
|
||||
" Possible formats: 0x<address>, 0x<address>:0x<address>, 0x<address>:<length>");
|
||||
" (Possible formats: 0x<address>, 0x<address>:0x<address>, 0x<address>:<length>)");
|
||||
|
||||
if (!cmd.parse()) {
|
||||
cerr << "Error parsing arguments." << endl;
|
||||
|
||||
@ -43,7 +43,6 @@ private:
|
||||
* Handle the memory event
|
||||
*/
|
||||
void handleEvent(fail::simtime_t simtime, uint32_t value);
|
||||
|
||||
};
|
||||
|
||||
#endif // __REALTIMELOGGER_HPP__
|
||||
|
||||
@ -62,4 +62,3 @@ double Sine::calculate() const
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
@ -31,8 +31,6 @@
|
||||
* FIXME: more explicit startup/shutdown; listener-based event interface needed?
|
||||
* -> should simulator.removeFlow make sure all remaining active events
|
||||
* are delivered?
|
||||
* FIXME: trace a sequence of pb messages, not a giant single one (pb weren't
|
||||
* made for huge messages)
|
||||
* FIXME: destructor -> removeFlow?
|
||||
*/
|
||||
class TracingPlugin : public fail::ExperimentFlow
|
||||
|
||||
@ -88,7 +88,7 @@ bool Importer::copy_to_database(fail::ProtoIStream &ps) {
|
||||
curtime += ev.time_delta();
|
||||
}
|
||||
|
||||
// instruction events just get counted
|
||||
// instruction event?
|
||||
if (!ev.has_memaddr()) {
|
||||
// new instruction
|
||||
// sanity check for overflow
|
||||
|
||||
@ -146,7 +146,7 @@ int main(int argc, char *argv[]) {
|
||||
importer = new ElfImporter();
|
||||
#endif
|
||||
} else {
|
||||
LOG << "Unkown import method: " << imp << endl;
|
||||
LOG << "Unknown import method: " << imp << endl;
|
||||
exit(-1);
|
||||
}
|
||||
LOG << "Using " << imp << endl;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
class BasicPruner : public Pruner {
|
||||
bool use_instr1;
|
||||
public:
|
||||
BasicPruner(bool use_instr1 = false) : Pruner(), use_instr1(use_instr1) {}
|
||||
BasicPruner(bool use_instr1 = false) : use_instr1(use_instr1) {}
|
||||
virtual std::string method_name() { return std::string("basic") + (use_instr1 ? "-left" : ""); }
|
||||
virtual bool prune_all();
|
||||
};
|
||||
|
||||
@ -17,8 +17,9 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
// Manually fill the command line option parser
|
||||
CommandLine &cmd = CommandLine::Inst();
|
||||
for (int i = 1; i < argc; ++i)
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
cmd.add_args(argv[i]);
|
||||
}
|
||||
|
||||
cmd.addOption("", "", Arg::None, "USAGE: import-trace [options]");
|
||||
CommandLine::option_handle HELP = cmd.addOption("h", "help", Arg::None, "-h,--help \tPrint usage and exit");
|
||||
@ -50,17 +51,17 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
Pruner *pruner;
|
||||
if (cmd[PRUNER].count() > 0) {
|
||||
if (cmd[PRUNER]) {
|
||||
std::string imp(cmd[PRUNER].first()->arg);
|
||||
if (imp == "basic") {
|
||||
if (imp == "BasicPruner" || imp == "basic") {
|
||||
LOG << "Using BasicPruner" << endl;
|
||||
pruner = new BasicPruner();
|
||||
} else if (imp == "basic-left") {
|
||||
} else if (imp == "BasicPrunerLeft" || imp == "basic-left") {
|
||||
LOG << "Using BasicPruner (use left border, instr1)" << endl;
|
||||
pruner = new BasicPruner(true);
|
||||
|
||||
} else {
|
||||
LOG << "Unkown import method: " << imp << endl;
|
||||
LOG << "Unknown pruning method: " << imp << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@ -77,7 +78,7 @@ int main(int argc, char *argv[]) {
|
||||
Database *db = Database::cmdline_connect();
|
||||
|
||||
std::vector<std::string> variants, benchmarks, variants_exclude, benchmarks_exclude;
|
||||
if (cmd[VARIANT].count() > 0) {
|
||||
if (cmd[VARIANT]) {
|
||||
for (option::Option *o = cmd[VARIANT]; o; o = o->next()) {
|
||||
variants.push_back(std::string(o->arg));
|
||||
}
|
||||
@ -85,13 +86,13 @@ int main(int argc, char *argv[]) {
|
||||
variants.push_back(std::string("none"));
|
||||
}
|
||||
|
||||
if (cmd[VARIANT_EXCLUDE].count() > 0) {
|
||||
if (cmd[VARIANT_EXCLUDE]) {
|
||||
for (option::Option *o = cmd[VARIANT_EXCLUDE]; o; o = o->next()) {
|
||||
variants_exclude.push_back(std::string(o->arg));
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd[BENCHMARK].count() > 0) {
|
||||
if (cmd[BENCHMARK]) {
|
||||
for (option::Option *o = cmd[BENCHMARK]; o; o = o->next()) {
|
||||
benchmarks.push_back(std::string(o->arg));
|
||||
}
|
||||
@ -99,7 +100,7 @@ int main(int argc, char *argv[]) {
|
||||
benchmarks.push_back(std::string("none"));
|
||||
}
|
||||
|
||||
if (cmd[BENCHMARK_EXCLUDE].count() > 0) {
|
||||
if (cmd[BENCHMARK_EXCLUDE]) {
|
||||
for (option::Option *o = cmd[BENCHMARK_EXCLUDE]; o; o = o->next()) {
|
||||
benchmarks_exclude.push_back(std::string(o->arg));
|
||||
}
|
||||
@ -118,7 +119,7 @@ int main(int argc, char *argv[]) {
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (cmd[NO_DELETE].count() == 0 && !pruner->clear_database()) {
|
||||
if (!cmd[NO_DELETE] && !pruner->clear_database()) {
|
||||
LOG << "clear_database() failed" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user