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.
35 #include "base/cprintf.hh"
36 #include "base/misc.hh"
37 #include "base/statistics.hh"
38 #include "base/stats/text.hh"
39 #include "base/stats/mysql.hh"
40 #include "sim/host.hh"
43 using namespace Stats
;
46 Tick ticksPerSecond
= ULL(2000000000);
53 Distribution
<MainBin
> s6
;
56 StandardDeviation
<> s9
;
57 AverageDeviation
<> s10
;
60 VectorDistribution
<> s13
;
61 VectorStandardDeviation
<> s14
;
62 VectorAverageDeviation
<> s15
;
76 ostream
*outputStream
= &cout
;
86 double operator()() { return 9.7; }
94 panic("incorrect usage.\n"
96 "\t%s [-t [-c] [-d]]\n", progname
);
100 main(int argc
, char *argv
[])
102 bool descriptions
= false;
107 string mysql_user
= "binkertn";
112 while ((c
= getopt(argc
, argv
, "cdh:P:p:s:tu:")) != -1) {
124 mysql_passwd
= optarg
;
140 if (!text
&& (compat
|| descriptions
))
147 s12
.init(1, 100, 13);
148 s13
.init(4, 0, 99, 10);
155 .desc("this is statistic 1")
160 .desc("this is statistic 2")
166 .desc("this is statistic 3")
172 .desc("this is statistic 4")
178 .desc("this is statistic 5")
189 .desc("this is statistic 6")
195 .desc("this is statistic 7")
203 .desc("this is statistic 8")
211 .desc("this is statistic 9")
218 .desc("this is statistic 10")
224 .desc("this is statistic 12")
229 .desc("this is statistic 13")
234 .desc("this is statistic 14")
239 .desc("this is statistic 15")
244 .desc("this is statistic 16")
254 .desc("this is formula 1")
260 .desc("this is formula 2")
267 .desc("this is formula 3")
279 .desc("this is formula 4")
286 .desc("this is formula 5")
291 .desc("this is formula 6")
295 f2
= (-s1
) / (-s2
) * (-s3
+ ULL(100) + s4
);
297 f6
+= constant(10.0);
331 s10
.sample(1000000000);
332 curTick
+= ULL(1000000);
407 curTick
+= ULL(1000000);
409 curTick
+= ULL(1000000);
411 curTick
+= ULL(1000000);
413 curTick
+= ULL(1000000);
415 curTick
+= ULL(1000000);
422 curTick
+= ULL(1000000);
424 curTick
+= ULL(1000000);
426 curTick
+= ULL(1000000);
428 curTick
+= ULL(1000000);
431 curTick
+= ULL(1000000);
433 curTick
+= ULL(1000000);
435 curTick
+= ULL(1000000);
437 curTick
+= ULL(1000000);
443 curTick
+= ULL(1000000);
450 curTick
+= ULL(1000000);
547 out
.descriptions
= descriptions
;
552 if (!mysql_name
.empty()) {
554 out
.connect(mysql_host
, mysql_user
, mysql_passwd
, "m5stats",