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);
55 Distribution
<MainBin
> s6
;
58 StandardDeviation
<> s9
;
59 AverageDeviation
<> s10
;
62 VectorDistribution
<> s13
;
63 VectorStandardDeviation
<> s14
;
64 VectorAverageDeviation
<> s15
;
78 ostream
*outputStream
= &cout
;
88 double operator()() { return 9.7; }
96 panic("incorrect usage.\n"
98 "\t%s [-t [-c] [-d]]\n", progname
);
102 main(int argc
, char *argv
[])
104 bool descriptions
= false;
109 string mysql_user
= "binkertn";
114 while ((c
= getopt(argc
, argv
, "cdh:P:p:s:tu:")) != -1) {
126 mysql_passwd
= optarg
;
142 if (!text
&& (compat
|| descriptions
))
149 s12
.init(1, 100, 13);
150 s13
.init(4, 0, 99, 10);
157 .desc("this is statistic 1")
162 .desc("this is statistic 2")
168 .desc("this is statistic 3")
174 .desc("this is statistic 4")
180 .desc("this is statistic 5")
191 .desc("this is statistic 6")
197 .desc("this is statistic 7")
205 .desc("this is statistic 8")
213 .desc("this is statistic 9")
220 .desc("this is statistic 10")
226 .desc("this is statistic 12")
231 .desc("this is statistic 13")
236 .desc("this is statistic 14")
241 .desc("this is statistic 15")
246 .desc("this is statistic 16")
256 .desc("this is formula 1")
262 .desc("this is formula 2")
269 .desc("this is formula 3")
281 .desc("this is formula 4")
288 .desc("this is formula 5")
293 .desc("this is formula 6")
297 f2
= (-s1
) / (-s2
) * (-s3
+ ULL(100) + s4
);
299 f6
+= constant(10.0);
333 s10
.sample(1000000000);
334 curTick
+= ULL(1000000);
409 curTick
+= ULL(1000000);
411 curTick
+= ULL(1000000);
413 curTick
+= ULL(1000000);
415 curTick
+= ULL(1000000);
417 curTick
+= ULL(1000000);
424 curTick
+= ULL(1000000);
426 curTick
+= ULL(1000000);
428 curTick
+= ULL(1000000);
430 curTick
+= ULL(1000000);
433 curTick
+= ULL(1000000);
435 curTick
+= ULL(1000000);
437 curTick
+= ULL(1000000);
439 curTick
+= ULL(1000000);
445 curTick
+= ULL(1000000);
452 curTick
+= ULL(1000000);
549 out
.descriptions
= descriptions
;
554 if (!mysql_name
.empty()) {
556 out
.connect(mysql_host
, mysql_user
, mysql_passwd
, "m5stats",