diff --git a/src/plugins/realtimelogger/RealtimeLogger.cc b/src/plugins/realtimelogger/RealtimeLogger.cc index c0bbee21..29660e10 100644 --- a/src/plugins/realtimelogger/RealtimeLogger.cc +++ b/src/plugins/realtimelogger/RealtimeLogger.cc @@ -7,7 +7,6 @@ using namespace fail; bool RealtimeLogger::run() { - MemoryManager& mm = simulator.getMemoryManager(); uint32_t value; //! @todo more generic datatype @@ -16,35 +15,27 @@ bool RealtimeLogger::run() MemAccessListener ev_mem(m_symbol.getAddress()); if(m_ostream.is_open()) { - m_log << "Writing output to: " << m_outputfile << std::endl; - while (true) { - simulator.addListenerAndResume(&ev_mem); - - /* A Memory Accesses happend: Get simulation time and log it */ - fail::simtime_t simtime = simulator.getTimerTicks(); - - mm.getBytes(m_symbol.getAddress(), m_symbol.getSize(), &value); - - handleEvent(simtime, value); - } + m_log << "Writing output to: " << m_outputfile << std::endl; + while (true) { + simulator.addListenerAndResume(&ev_mem); + /* A Memory Accesses happend: Get simulation time and log it */ + fail::simtime_t simtime = simulator.getTimerTicks(); + mm.getBytes(m_symbol.getAddress(), m_symbol.getSize(), &value); + handleEvent(simtime, value); + } } else { - m_log << "No output file." << std::endl; + m_log << "No output file." << std::endl; } return true; } void RealtimeLogger::handleEvent(fail::simtime_t simtime, uint32_t value) { - simtime_t per_second = simulator.getTimerTicksPerSecond(); - double sec = (double)simtime / per_second; - double msec = sec*1000; - if(m_ostream.is_open()){ m_ostream << std::dec << msec << ";" << value << std::endl; } } - diff --git a/src/plugins/realtimelogger/RealtimeLogger.hpp b/src/plugins/realtimelogger/RealtimeLogger.hpp index 50942f5c..50ca7e81 100644 --- a/src/plugins/realtimelogger/RealtimeLogger.hpp +++ b/src/plugins/realtimelogger/RealtimeLogger.hpp @@ -31,10 +31,10 @@ public: * @param outputfile The path to the file to write the output to */ RealtimeLogger( const fail::ElfSymbol & symbol, const std::string& outputfile ) : m_symbol(symbol), m_outputfile(outputfile) , m_log("RTLogger", false) { - m_ostream.open(m_outputfile.c_str() ); - if(!m_ostream.is_open()){ - m_log << "Could not open " << m_outputfile.c_str() << " for writing." << std::endl; - } + m_ostream.open(m_outputfile.c_str() ); + if(!m_ostream.is_open()){ + m_log << "Could not open " << m_outputfile.c_str() << " for writing." << std::endl; + } } bool run();