summaryrefslogtreecommitdiff
path: root/src/python/m5
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-02-18 10:00:15 -0800
committerNathan Binkert <nate@binkert.org>2009-02-18 10:00:15 -0800
commitc41c9cf3a68bbda47b2304daeb145555dd63e5d3 (patch)
tree686b43d2d78839fea881b47352d60f7cd2977988 /src/python/m5
parent6cfff91d43885f60cbe30a7b237c69fcc85e31a2 (diff)
downloadgem5-c41c9cf3a68bbda47b2304daeb145555dd63e5d3.tar.xz
events: Make trace events happen at the right priority.
Also, while we're at it, remember that priorities are in the Event class and add a disable method to disable tracing.
Diffstat (limited to 'src/python/m5')
-rw-r--r--src/python/m5/event.py7
-rw-r--r--src/python/m5/main.py2
-rw-r--r--src/python/m5/trace.py3
3 files changed, 9 insertions, 3 deletions
diff --git a/src/python/m5/event.py b/src/python/m5/event.py
index ce003defb..35095599d 100644
--- a/src/python/m5/event.py
+++ b/src/python/m5/event.py
@@ -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):
diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index 09847c093..f562835da 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -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()
diff --git a/src/python/m5/trace.py b/src/python/m5/trace.py
index 14bab77a3..17aa6196c 100644
--- a/src/python/m5/trace.py
+++ b/src/python/m5/trace.py
@@ -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