2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
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;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
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.
28 * Authors: Nathan Binkert
37 #include "base/cprintf.hh"
38 #include "base/misc.hh"
39 #include "base/statistics.hh"
40 #include "base/stats/text.hh"
41 #include "base/stats/mysql.hh"
42 #include "sim/host.hh"
45 using namespace Stats
;
48 Tick ticksPerSecond
= ULL(2000000000);
58 StandardDeviation
<> s9
;
59 AverageDeviation
<> s10
;
62 VectorDistribution
<> s13
;
63 VectorStandardDeviation
<> s14
;
64 VectorAverageDeviation
<> s15
;
75 ostream
*outputStream
= &cout
;
85 double operator()() { return 9.7; }
93 panic("incorrect usage.\n"
95 "\t%s [-t [-c] [-d]]\n", progname
);
99 main(int argc
, char *argv
[])
101 bool descriptions
= false;
106 string mysql_user
= "binkertn";
111 while ((c
= getopt(argc
, argv
, "cdh:P:p:s:tu:")) != -1) {
123 mysql_passwd
= optarg
;
139 if (!text
&& (compat
|| descriptions
))
146 s12
.init(1, 100, 13);
147 s13
.init(4, 0, 99, 10);
154 .desc("this is statistic 1")
159 .desc("this is statistic 2")
165 .desc("this is statistic 3")
171 .desc("this is statistic 4")
177 .desc("this is statistic 5")
188 .desc("this is statistic 6")
194 .desc("this is statistic 7")
202 .desc("this is statistic 8")
210 .desc("this is statistic 9")
217 .desc("this is statistic 10")
223 .desc("this is statistic 12")
228 .desc("this is statistic 13")
233 .desc("this is statistic 14")
238 .desc("this is statistic 15")
243 .desc("this is statistic 16")
253 .desc("this is formula 1")
259 .desc("this is formula 2")
266 .desc("this is formula 3")
278 .desc("this is formula 4")
285 .desc("this is formula 5")
290 .desc("this is formula 6")
294 f2
= (-s1
) / (-s2
) * (-s3
+ ULL(100) + s4
);
296 f6
+= constant(10.0);
328 s10
.sample(1000000000);
329 curTick
+= ULL(1000000);
404 curTick
+= ULL(1000000);
406 curTick
+= ULL(1000000);
408 curTick
+= ULL(1000000);
410 curTick
+= ULL(1000000);
412 curTick
+= ULL(1000000);
419 curTick
+= ULL(1000000);
421 curTick
+= ULL(1000000);
423 curTick
+= ULL(1000000);
425 curTick
+= ULL(1000000);
428 curTick
+= ULL(1000000);
430 curTick
+= ULL(1000000);
432 curTick
+= ULL(1000000);
434 curTick
+= ULL(1000000);
440 curTick
+= ULL(1000000);
447 curTick
+= ULL(1000000);
543 out
.descriptions
= descriptions
;
548 if (!mysql_name
.empty()) {
550 out
.connect(mysql_host
, mysql_user
, mysql_passwd
, "m5stats",