trace.py revision 5860
15860Snate@binkert.org# Copyright (c) 2008 The Hewlett-Packard Development Company 25860Snate@binkert.org# All rights reserved. 35860Snate@binkert.org# 45860Snate@binkert.org# Redistribution and use in source and binary forms, with or without 55860Snate@binkert.org# modification, are permitted provided that the following conditions are 65860Snate@binkert.org# met: redistributions of source code must retain the above copyright 75860Snate@binkert.org# notice, this list of conditions and the following disclaimer; 85860Snate@binkert.org# redistributions in binary form must reproduce the above copyright 95860Snate@binkert.org# notice, this list of conditions and the following disclaimer in the 105860Snate@binkert.org# documentation and/or other materials provided with the distribution; 115860Snate@binkert.org# neither the name of the copyright holders nor the names of its 125860Snate@binkert.org# contributors may be used to endorse or promote products derived from 135860Snate@binkert.org# this software without specific prior written permission. 145860Snate@binkert.org# 155860Snate@binkert.org# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 165860Snate@binkert.org# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 175860Snate@binkert.org# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 185860Snate@binkert.org# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 195860Snate@binkert.org# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 205860Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 215860Snate@binkert.org# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 225860Snate@binkert.org# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 235860Snate@binkert.org# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 245860Snate@binkert.org# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 255860Snate@binkert.org# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 265860Snate@binkert.org# 275860Snate@binkert.org# Authors: Nathan Binkert 285860Snate@binkert.org 295799Snate@binkert.orgimport internal 305799Snate@binkert.orgimport traceflags as flags 315799Snate@binkert.org 325799Snate@binkert.orgfrom internal.trace import clear, output, set, ignore 335799Snate@binkert.org 345799Snate@binkert.orgdef enable(): 355799Snate@binkert.org internal.trace.cvar.enabled = True 365799Snate@binkert.org 375799Snate@binkert.orgdef help(): 385799Snate@binkert.org print "Base Flags:" 395799Snate@binkert.org for flag in trace.flags.basic: 405799Snate@binkert.org print " %s: %s" % (flag, trace.flags.descriptions[flag]) 415799Snate@binkert.org print 425799Snate@binkert.org print "Compound Flags:" 435799Snate@binkert.org for flag in trace.flags.compound: 445799Snate@binkert.org if flag == 'All': 455799Snate@binkert.org continue 465799Snate@binkert.org print " %s: %s" % (flag, trace.flags.descriptions[flag]) 475799Snate@binkert.org print_list(trace.flags.compoundMap[flag], indent=8) 485799Snate@binkert.org print 49