From e0f425bb94a5b67c1128cc05c490dc78f0841290 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sun, 15 Feb 2009 20:39:12 -0800 Subject: [PATCH] traceflags: fix --trace-help --- src/python/m5/main.py | 13 ------------- src/python/m5/trace.py | 11 ++++++----- src/python/m5/util/__init__.py | 13 +++++++++++++ 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 -- 2.30.2