summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-02-15 20:39:12 -0800
committerNathan Binkert <nate@binkert.org>2009-02-15 20:39:12 -0800
commite0f425bb94a5b67c1128cc05c490dc78f0841290 (patch)
treefb749b74c49827b4a1119004a7b5ca690c926098 /src
parentde720838053d30defcb3b5d07b76ea599b9c05ea (diff)
downloadgem5-e0f425bb94a5b67c1128cc05c490dc78f0841290.tar.xz
traceflags: fix --trace-help
Diffstat (limited to 'src')
-rw-r--r--src/python/m5/main.py13
-rw-r--r--src/python/m5/trace.py11
-rw-r--r--src/python/m5/util/__init__.py13
3 files changed, 19 insertions, 18 deletions
diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index 3edeccc10..09847c093 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -38,19 +38,6 @@ from options import OptionParser
__all__ = [ 'options', 'arguments', 'main' ]
-def print_list(items, indent=4):
- line = ' ' * indent
- for i,item in enumerate(items):
- if len(line) + len(item) > 76:
- print line
- line = ' ' * indent
-
- if i < len(items) - 1:
- line += '%s, ' % item
- else:
- line += item
- print line
-
usage="%prog [m5 options] script.py [script options]"
version="%prog 2.0"
brief_copyright='''
diff --git a/src/python/m5/trace.py b/src/python/m5/trace.py
index c97263c9b..14bab77a3 100644
--- a/src/python/m5/trace.py
+++ b/src/python/m5/trace.py
@@ -28,6 +28,7 @@
import internal
import traceflags as flags
+import util
from internal.trace import clear, output, set, ignore
@@ -36,13 +37,13 @@ def enable():
def help():
print "Base Flags:"
- for flag in trace.flags.basic:
- print " %s: %s" % (flag, trace.flags.descriptions[flag])
+ for flag in flags.basic:
+ print " %s: %s" % (flag, flags.descriptions[flag])
print
print "Compound Flags:"
- for flag in trace.flags.compound:
+ for flag in flags.compound:
if flag == 'All':
continue
- print " %s: %s" % (flag, trace.flags.descriptions[flag])
- print_list(trace.flags.compoundMap[flag], indent=8)
+ print " %s: %s" % (flag, flags.descriptions[flag])
+ util.print_list(flags.compoundMap[flag], indent=8)
print
diff --git a/src/python/m5/util/__init__.py b/src/python/m5/util/__init__.py
index f82de696a..5c4a066c6 100644
--- a/src/python/m5/util/__init__.py
+++ b/src/python/m5/util/__init__.py
@@ -30,3 +30,16 @@ from attrdict import attrdict, optiondict
from misc import *
from multidict import multidict
import jobfile
+
+def print_list(items, indent=4):
+ line = ' ' * indent
+ for i,item in enumerate(items):
+ if len(line) + len(item) > 76:
+ print line
+ line = ' ' * indent
+
+ if i < len(items) - 1:
+ line += '%s, ' % item
+ else:
+ line += item
+ print line