Deleted Added
sdiff udiff text old ( 8295:221013f9fd2f ) new ( 8296:be7f03723412 )
full compact
1# Copyright (c) 2007 The Regents of The University of Michigan
2# Copyright (c) 2010 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 13 unchanged lines hidden (view full) ---

22# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# Authors: Nathan Binkert
29
30from m5 import internal
31from m5.internal.stats import schedStatEvent as schedEvent
32from m5.objects import Root
33from m5.util import attrdict
34
35def initText(filename, desc=True):
36 internal.stats.initText(filename, desc)
37
38def initMySQL(host, database, user='', passwd='', project='test', name='test',
39 sample='0'):
40 if not user:
41 import getpass
42 user = getpass.getuser()
43
44 internal.stats.initMySQL(host, database, user, passwd, project, name,
45 sample)
46
47def initSimStats():
48 internal.stats.initSimStats()
49
50names = []
51stats_dict = {}
52stats_list = []
53raw_stats_list = []

--- 11 unchanged lines hidden (view full) ---

65 val = cast(stat)
66 if val is not None:
67 stats_list.append(val)
68 raw_stats_list.append(val)
69 break
70 else:
71 fatal("unknown stat type %s", stat)
72
73 def less(stat1, stat2):
74 v1 = stat1.name.split('.')
75 v2 = stat2.name.split('.')
76 return v1 < v2
77
78 stats_list.sort(less)
79 for stat in stats_list:
80 stats_dict[stat.name] = stat
81
82 internal.stats.enable()
83
84def dump():
85 # Currently prepare happens in the dump, but we should maybe move
86 # that out.
87
88 #internal.stats.prepare()
89 internal.stats.dump()
90
91def reset():
92 # call reset stats on all SimObjects
93 root = Root.getInstance()
94 if root:
95 for obj in root.descendants(): obj.resetStats()
96
97 # call any other registered stats reset callbacks
98 internal.stats.reset()
99
100flags = attrdict({
101 'none' : 0x0000,
102 'init' : 0x0001,
103 'display' : 0x0002,
104 'total' : 0x0010,
105 'pdf' : 0x0020,
106 'cdf' : 0x0040,
107 'dist' : 0x0080,
108 'nozero' : 0x0100,
109 'nonan' : 0x0200,
110})