__init__.py (14206:9cd30cd80145) __init__.py (14209:7efe1c187149)
1# Copyright (c) 2017, 2019 Arm Limited
1# Copyright (c) 2017-2019 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license
9# terms below provided that you ensure that this notice is replicated

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

114 disabled by setting the desc parameter to False.
115
116 Example: text://stats.txt?desc=False
117
118 """
119
120 return _m5.stats.initText(fn, desc)
121
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license
9# terms below provided that you ensure that this notice is replicated

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

114 disabled by setting the desc parameter to False.
115
116 Example: text://stats.txt?desc=False
117
118 """
119
120 return _m5.stats.initText(fn, desc)
121
122@_url_factory
123def _hdf5Factory(fn, chunking=10, desc=True, formulas=True):
124 """Output stats in HDF5 format.
125
126 The HDF5 file format is a structured binary file format. It has
127 the multiple benefits over traditional text stat files:
128
129 * Efficient storage of time series (multiple stat dumps)
130 * Fast lookup of stats
131 * Plenty of existing tooling (e.g., Python libraries and graphical
132 viewers)
133 * File format can be used to store frame buffers together with
134 normal stats.
135
136 There are some drawbacks compared to the default text format:
137 * Large startup cost (single stat dump larger than text equivalent)
138 * Stat dumps are slower than text
139
140
141 Known limitations:
142 * Distributions and histograms currently unsupported.
143 * No support for forking.
144
145
146 Parameters:
147 * chunking (unsigned): Number of time steps to pre-allocate (default: 10)
148 * desc (bool): Output stat descriptions (default: True)
149 * formulas (bool): Output derived stats (default: True)
150
151 Example:
152 h5://stats.h5?desc=False;chunking=100;formulas=False
153
154 """
155
156 if hasattr(_m5.stats, "initHDF5"):
157 return _m5.stats.initHDF5(fn, chunking, desc, formulas)
158 else:
159 fatal("HDF5 support not enabled at compile time")
160
122factories = {
123 # Default to the text factory if we're given a naked path
124 "" : _textFactory,
125 "file" : _textFactory,
126 "text" : _textFactory,
161factories = {
162 # Default to the text factory if we're given a naked path
163 "" : _textFactory,
164 "file" : _textFactory,
165 "text" : _textFactory,
166 "h5" : _hdf5Factory,
127}
128
167}
168
169
129def addStatVisitor(url):
130 """Add a stat visitor specified using a URL string
131
132 Stat visitors are specified using URLs on the following format:
133 format://path[?param=value[;param=value]]
134
135 The available formats are listed in the factories list. Factories
136 are called with the path as the first positional parameter and the

--- 172 unchanged lines hidden ---
170def addStatVisitor(url):
171 """Add a stat visitor specified using a URL string
172
173 Stat visitors are specified using URLs on the following format:
174 format://path[?param=value[;param=value]]
175
176 The available formats are listed in the factories list. Factories
177 are called with the path as the first positional parameter and the

--- 172 unchanged lines hidden ---