From 2ae4cce3934873908afacc81b65d4093731a3e93 Mon Sep 17 00:00:00 2001 From: Michael LeBeane Date: Sat, 13 Feb 2016 12:36:43 -0500 Subject: [PATCH] configs: add command-line option to stop debug output This patch adds a --debug-end flag to main.py so that debug output can be stoped at a specified tick, while allowing the simulation to continue. It is useful in situations where you would like to produce a trace for a region of interest while still collecting stats for the entire run. This is in contrast to the currently existing --debug-break flag, which terminates the simulation at the tick. --- src/python/m5/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/python/m5/main.py b/src/python/m5/main.py index 4b3bf410c..deb4725ac 100644 --- a/src/python/m5/main.py +++ b/src/python/m5/main.py @@ -103,6 +103,8 @@ def parse_options(): help="Sets the flags for debug output (-FLAG disables a flag)") option("--debug-start", metavar="TICK", type='int', help="Start debug output at TICK") + option("--debug-end", metavar="TICK", type='int', + help="End debug output at TICK") option("--debug-file", metavar="FILE", default="cout", help="Sets the output file for debug [Default: %default]") option("--debug-ignore", metavar="EXPR", action='append', split=':', @@ -348,6 +350,11 @@ def main(*args): else: trace.enable() + if options.debug_end: + check_tracing() + e = event.create(trace.disable, event.Event.Debug_Enable_Pri) + event.mainq.schedule(e, options.debug_end) + trace.output(options.debug_file) for ignore in options.debug_ignore: