#include "mem/ruby/eventqueue/RubyEventQueue.hh"
#include "mem/ruby/system/MemoryVector.hh"
#include "mem/ruby/common/Address.hh"
+#include "mem/ruby/recorder/Tracer.hh"
string RubyRequestType_to_string(const RubyRequestType& obj)
{
{
RubySystem::printStats(out);
}
+void libruby_playback_trace(char * trace_filename)
+{
+ RubySystem::getTracer()->playbackTrace(trace_filename);
+}
+
+void libruby_start_tracing(char * record_filename) {
+ // start the trace
+ RubySystem::getTracer()->startTrace(record_filename);
+}
+
+void libruby_stop_tracing() {
+ // start the trace
+ RubySystem::getTracer()->stopTrace();
+}
uint64_t libruby_get_time() {
return RubySystem::getCycleCount(0);
*/
void libruby_print_stats(std::ostream & out);
+/**
+ * does not return until done
+ */
+void libruby_playback_trace(char * trace_filename);
+
+/*
+ * enables the tracer and opens the trace file
+ */
+void libruby_start_tracing(char * record_filename);
+
+/*
+ * closes the trace file
+ */
+void libruby_stop_tracing();
/**
* get time
void Tracer::stopTrace()
{
- assert(m_enabled == true);
- m_trace_file.close();
- cout << "Request trace file closed." << endl;
- m_enabled = false;
+ if (m_enabled == true) {
+ m_trace_file.close();
+ cout << "Request trace file closed." << endl;
+ m_enabled = false;
+ }
}
void Tracer::traceRequest(const string & sequencer_name, const Address& data_addr, const Address& pc_addr, RubyRequestType type, Time time)
static int getNumberOfSequencers() { return m_sequencers.size(); }
Profiler* getProfiler() {assert(m_profiler_ptr != NULL); return m_profiler_ptr; }
- Tracer* getTracer() { assert(m_tracer_ptr != NULL); return m_tracer_ptr; }
+ static Tracer* getTracer() { assert(m_tracer_ptr != NULL); return m_tracer_ptr; }
static MemoryVector* getMemoryVector() { assert(m_mem_vec_ptr != NULL); return m_mem_vec_ptr;}
void recordCacheContents(CacheRecorder& tr) const;