changeset 390fefc98e2b in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=390fefc98e2b
description:
        Changes to add tracing and replaying command-line options
        Trace is automatically ended upon a manual checkpoint

diffstat:

4 files changed, 35 insertions(+), 5 deletions(-)
src/mem/ruby/libruby.cc         |   15 +++++++++++++++
src/mem/ruby/libruby.hh         |   14 ++++++++++++++
src/mem/ruby/recorder/Tracer.cc |    9 +++++----
src/mem/ruby/system/System.hh   |    2 +-

diffs (87 lines):

diff -r 979add6f6fb7 -r 390fefc98e2b src/mem/ruby/libruby.cc
--- a/src/mem/ruby/libruby.cc   Mon Jul 13 12:11:17 2009 -0500
+++ b/src/mem/ruby/libruby.cc   Mon Jul 13 12:50:10 2009 -0500
@@ -9,6 +9,7 @@
 #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)
 {
@@ -204,6 +205,20 @@
 {
   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);
diff -r 979add6f6fb7 -r 390fefc98e2b src/mem/ruby/libruby.hh
--- a/src/mem/ruby/libruby.hh   Mon Jul 13 12:11:17 2009 -0500
+++ b/src/mem/ruby/libruby.hh   Mon Jul 13 12:50:10 2009 -0500
@@ -102,6 +102,20 @@
  */
 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
diff -r 979add6f6fb7 -r 390fefc98e2b src/mem/ruby/recorder/Tracer.cc
--- a/src/mem/ruby/recorder/Tracer.cc   Mon Jul 13 12:11:17 2009 -0500
+++ b/src/mem/ruby/recorder/Tracer.cc   Mon Jul 13 12:50:10 2009 -0500
@@ -92,10 +92,11 @@
 
 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)
diff -r 979add6f6fb7 -r 390fefc98e2b src/mem/ruby/system/System.hh
--- a/src/mem/ruby/system/System.hh     Mon Jul 13 12:11:17 2009 -0500
+++ b/src/mem/ruby/system/System.hh     Mon Jul 13 12:50:10 2009 -0500
@@ -106,7 +106,7 @@
   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;
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to