cosmetics

Change-Id: Ifae805ae1e2dac95324e054af09a7b70f5d5b60c
This commit is contained in:
Horst Schirmeier
2013-04-22 14:24:02 +02:00
parent 2d45a2c52c
commit 0f16f18d75
19 changed files with 101 additions and 103 deletions

View File

@ -1 +1 @@
TracePlugin_pb2.py{,c}
TracePlugin_pb2.py

View File

@ -14,13 +14,13 @@ using std::cerr;
using std::hex;
using std::dec;
Logger log("dump-trace", true);
Logger LOG("dump-trace", true);
std::istream& openStream(const char *input_file,
std::ifstream& normal_stream, igzstream& gz_stream) {
normal_stream.open(input_file);
if (!normal_stream) {
log << "couldn't open " << input_file << endl;
LOG << "couldn't open " << input_file << endl;
exit(-1);
}
unsigned char b1, b2;
@ -30,16 +30,16 @@ std::istream& openStream(const char *input_file,
normal_stream.close();
gz_stream.open(input_file);
if (!gz_stream) {
log << "couldn't open " << input_file << endl;
LOG << "couldn't open " << input_file << endl;
exit(-1);
}
//log << "opened file " << input_file << " in GZip mode" << endl;
//LOG << "opened file " << input_file << " in GZip mode" << endl;
return gz_stream;
}
normal_stream.seekg(0);
//log << "opened file " << input_file << " in normal mode" << endl;
//LOG << "opened file " << input_file << " in normal mode" << endl;
return normal_stream;
}

View File

@ -4,7 +4,6 @@ set(SRCS
DCiAOKernelImporter.cc
)
## This is the example's campaign server distributing experiment parameters
add_executable(import-trace main.cc ${SRCS} ${PROTO_SRCS} ${PROTO_HDRS})
add_executable(import-trace main.cc ${SRCS})
target_link_libraries(import-trace ${PROTOBUF_LIBRARY} -lmysqlclient fail-util fail-sal fail-comm)
install(TARGETS import-trace RUNTIME DESTINATION bin)

View File

@ -14,7 +14,7 @@ class Importer {
protected:
int m_variant_id;
fail::ElfReader *m_elf;
fail::Database *db;
fail::Database *db;
public:
typedef unsigned instruction_count_t;
@ -27,7 +27,7 @@ public:
virtual bool add_trace_event(instruction_count_t begin, instruction_count_t end,
const Trace_Event &event, bool is_fake = false) = 0;
void set_elf_file(fail::ElfReader *elf) {m_elf = elf;};
void set_elf_file(fail::ElfReader *elf) { m_elf = elf; }
protected:
private:
typedef std::map<fail::address_t, instruction_count_t> AddrLastaccessMap;

View File

@ -55,7 +55,7 @@ int main(int argc, char *argv[]) {
for (int i = 1; i < argc; ++i)
cmd.add_args(argv[i]);
CommandLine::option_handle IGNORE = cmd.addOption("", "", Arg::None, "USAGE: import-trace [options]");
cmd.addOption("", "", Arg::None, "USAGE: import-trace [options]");
CommandLine::option_handle HELP = cmd.addOption("h", "help", Arg::None, "-h/--help\t Print usage and exit");
CommandLine::option_handle TRACE_FILE = cmd.addOption("t", "trace-file", Arg::Required,
"-t/--trace-file\t File to load the execution trace from\n");
@ -75,7 +75,7 @@ int main(int argc, char *argv[]) {
"-e/--elf-file\t ELF File (default: UNSET)");
if(!cmd.parse()) {
if (!cmd.parse()) {
std::cerr << "Error parsing arguments." << std::endl;
exit(-1);
}

View File

@ -20,17 +20,17 @@ int main(int argc, char *argv[]) {
for (int i = 1; i < argc; ++i)
cmd.add_args(argv[i]);
CommandLine::option_handle IGNORE = cmd.addOption("", "", Arg::None, "USAGE: import-trace [options]");
CommandLine::option_handle HELP = cmd.addOption("h", "help", Arg::None, "-h,--help\t Print usage and exit");
cmd.addOption("", "", Arg::None, "USAGE: import-trace [options]");
CommandLine::option_handle HELP = cmd.addOption("h", "help", Arg::None, "-h,--help \tPrint usage and exit");
Database::cmdline_setup();
CommandLine::option_handle VARIANT = cmd.addOption("v", "variant", Arg::Required,
"-v/--variant\t Variant label (default: \"none\")");
"-v/--variant \tVariant label (default: \"none\")");
CommandLine::option_handle BENCHMARK = cmd.addOption("b", "benchmark", Arg::Required,
"-b/--benchmark\t Benchmark label (default: \"none\")\n");
"-b/--benchmark \tBenchmark label (default: \"none\")\n");
CommandLine::option_handle PRUNER = cmd.addOption("p", "prune-method", Arg::Required,
"-p/--prune-method\t Which import method to use (default: basic)");
"-p/--prune-method \tWhich import method to use (default: basic)");
if(!cmd.parse()) {
std::cerr << "Error parsing arguments." << std::endl;