Default to tracing being disabled in C++, it will be turned
authorNathan Binkert <binkertn@umich.edu>
Sun, 18 Feb 2007 04:32:39 +0000 (20:32 -0800)
committerNathan Binkert <binkertn@umich.edu>
Sun, 18 Feb 2007 04:32:39 +0000 (20:32 -0800)
on in python.  Fix the trace start code so it actually starts
when it is suppsed to.  Make the Exec tracing stuff obey the
trace enabled flag.

--HG--
extra : convert_revision : 634ba0b4f52345d4bf40d43e239cef7ef43e7691

src/base/trace.cc
src/cpu/exetrace.hh
src/python/m5/main.py

index 7afb038be540cee0834952f2fe47a951a2da8057..2dde1f6886c54ca20e0cb515270b3ab6362ce70a 100644 (file)
@@ -47,7 +47,7 @@ using namespace std;
 namespace Trace {
 const string DefaultName("global");
 FlagVec flags(NumFlags, false);
-bool enabled = true;
+bool enabled = false;
 
 //
 // This variable holds the output stream for debug information.  Other
index be10b4a6a33fdf7df25ece9943210b59f04be178..0f642c08ead96642181bae964a77054343468009 100644 (file)
@@ -157,6 +157,9 @@ getInstRecord(Tick when, ThreadContext *tc, const StaticInstPtr staticInst,
     if (!IsOn(ExecEnable))
         return NULL;
 
+    if (!Trace::enabled)
+        return NULL;
+
     if (!IsOn(ExecSpeculative) && tc->misspeculating())
         return NULL;
 
index 25b52e83019dce7e87c68f4de7bc1baec568baf3..98dc829d4a83ad628266f1bb03baf0c8a16de630 100644 (file)
@@ -292,11 +292,12 @@ def main():
     for flag in off_flags:
         internal.trace.clear(flag)
 
-    if options.trace_start is not None:
-        internal.trace.enabled = False
+    if options.trace_start:
         def enable_trace():
-            internal.event.enabled = True
-        internal.event.create(enable_trace, options.trace_start)
+            internal.trace.cvar.enabled = True
+        internal.event.create(enable_trace, int(options.trace_start))
+    else:
+        internal.trace.enabled = True
 
     internal.trace.output(options.trace_file)