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
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 "base/types.hh"
43 using namespace Stats
;
53 double operator()() { return 9.7; }
56 const char *progname
= "";
61 panic("incorrect usage.\n"
63 "\t%s [-t [-c] [-d]]\n", progname
);
67 main(int argc
, char *argv
[])
69 bool descriptions
= false;
77 string mysql_user
= "binkertn";
83 while ((c
= getopt(argc
, argv
, "cD:dh:P:p:s:tu:")) != -1) {
102 mysql_passwd
= optarg
;
116 if (!text
&& (compat
|| descriptions
))
127 StandardDeviation s9
;
128 AverageDeviation s10
;
131 VectorDistribution s13
;
132 VectorStandardDeviation s14
;
133 VectorAverageDeviation s15
;
144 cprintf("sizeof(Scalar) = %d\n", sizeof(Scalar
));
145 cprintf("sizeof(Vector) = %d\n", sizeof(Vector
));
146 cprintf("sizeof(Distribution) = %d\n", sizeof(Distribution
));
150 .desc("this is statistic 1")
155 .desc("this is statistic 2")
161 .desc("this is statistic 3")
167 .desc("this is statistic 4")
174 .desc("this is statistic 5")
186 .desc("this is statistic 6")
193 .desc("this is statistic 7")
202 .desc("this is statistic 8")
210 .desc("this is statistic 9")
217 .desc("this is statistic 10")
224 .desc("this is statistic 12")
230 .desc("this is statistic 13")
236 .desc("this is statistic 14")
242 .desc("this is statistic 15")
248 .desc("this is statistic 16")
259 .desc("this is stat 17")
266 .desc("this is stat 18")
272 .desc("this is formula 1")
278 .desc("this is formula 2")
285 .desc("this is formula 3")
296 .desc("this is formula 4")
301 f2
= (-s1
) / (-s2
) * (-s3
+ ULL(100) + s4
);
303 f4
+= constant(10.0);
335 s10
.sample(1000000000);
336 curTick
+= ULL(1000000);
411 curTick
+= ULL(1000000);
413 curTick
+= ULL(1000000);
415 curTick
+= ULL(1000000);
417 curTick
+= ULL(1000000);
419 curTick
+= ULL(1000000);
426 curTick
+= ULL(1000000);
428 curTick
+= ULL(1000000);
430 curTick
+= ULL(1000000);
432 curTick
+= ULL(1000000);
435 curTick
+= ULL(1000000);
437 curTick
+= ULL(1000000);
439 curTick
+= ULL(1000000);
441 curTick
+= ULL(1000000);
447 curTick
+= ULL(1000000);
454 curTick
+= ULL(1000000);
550 out
.descriptions
= descriptions
;
556 if (!mysql_name
.empty()) {
558 out
.connect(mysql_host
, mysql_db
, mysql_user
, mysql_passwd
, "test",