events: Make trace events happen at the right priority.
authorNathan Binkert <nate@binkert.org>
Wed, 18 Feb 2009 18:00:15 +0000 (10:00 -0800)
committerNathan Binkert <nate@binkert.org>
Wed, 18 Feb 2009 18:00:15 +0000 (10:00 -0800)
Also, while we're at it, remember that priorities are in the Event class
and add a disable method to disable tracing.

src/python/m5/event.py
src/python/m5/main.py
src/python/m5/trace.py

index ce003defb194eb375d957165dbf00a6d70d3b8dd..35095599d7f8b78f2f9768fbaa2310e018442ad7 100644 (file)
@@ -35,13 +35,16 @@ mainq = internal.event.cvar.mainEventQueue
 
 def create(obj, priority=None):
     if priority is None:
-        priority = internal.event.Event.Default_Pri
+        priority = Event.Default_Pri
     return PythonEvent(obj, priority)
 
+
+# As a reminder, priorities found in sim/eventq.hh are stuck into the
+# Event class by swig
 class Event(PythonEvent):
     def __init__(self, priority=None):
         if priority is None:
-            priority = internal.event.Event.Default_Pri
+            priority = Event.Default_Pri
         super(Event, self).__init__(self, priority)
 
 class ProgressEvent(Event):
index 09847c09364827af0c7582068d0ad3e435a8c708..f562835da7c3f4db5ad4f5e80a01a5433636e2f2 100644 (file)
@@ -312,7 +312,7 @@ def main():
 
     if options.trace_start:
         check_tracing()
-        e = event.create(trace.enable)
+        e = event.create(trace.enable, Event.Trace_Enable_Pri)
         event.mainq.schedule(e, options.trace_start)
     else:
         trace.enable()
index 14bab77a33e9240f87ab583fbb626175280a493e..17aa6196c8764bdb29af90277dea63599c64c8ef 100644 (file)
@@ -32,6 +32,9 @@ import util
 
 from internal.trace import clear, output, set, ignore
 
+def disable():
+    internal.trace.cvar.enabled = False
+
 def enable():
     internal.trace.cvar.enabled = True