stattest.cc (2716:b9114064d77a) stattest.cc (5584:e08e65fd0f76)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
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.
15 *
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.
27 *
28 * Authors: Nathan Binkert
29 */
30
31#include <iomanip>
32#include <iostream>
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
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.
15 *
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.
27 *
28 * Authors: Nathan Binkert
29 */
30
31#include <iomanip>
32#include <iostream>
33#include <fstream>
34#include <string>
33#include <string>
35#include <unistd.h>
36
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"
43
44using namespace std;
45using namespace Stats;
46
34
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"
41
42using namespace std;
43using namespace Stats;
44
47Tick curTick = 0;
48Tick ticksPerSecond = ULL(2000000000);
49
50Scalar<> s1;
51Scalar<> s2;
52Average<> s3;
53Scalar<> s4;
54Vector<> s5;
55Distribution<> s6;
56Vector<> s7;
57AverageVector<> s8;
58StandardDeviation<> s9;
59AverageDeviation<> s10;
60Scalar<> s11;
61Distribution<> s12;
62VectorDistribution<> s13;
63VectorStandardDeviation<> s14;
64VectorAverageDeviation<> s15;
65Vector2d<> s16;
66
67Formula f1;
68Formula f2;
69Formula f3;
70Value f4;
71Value f5;
72Formula f6;
73Formula f7;
74
45Scalar<> s1;
46Scalar<> s2;
47Average<> s3;
48Scalar<> s4;
49Vector<> s5;
50Distribution<> s6;
51Vector<> s7;
52AverageVector<> s8;
53StandardDeviation<> s9;
54AverageDeviation<> s10;
55Scalar<> s11;
56Distribution<> s12;
57VectorDistribution<> s13;
58VectorStandardDeviation<> s14;
59VectorAverageDeviation<> s15;
60Vector2d<> s16;
61
62Formula f1;
63Formula f2;
64Formula f3;
65Value f4;
66Value f5;
67Formula f6;
68Formula f7;
69
75ostream *outputStream = &cout;
76
77double
78testfunc()
79{
80 return 9.8;
81}
82
83class TestClass {
84 public:
85 double operator()() { return 9.7; }
86};
87
70double
71testfunc()
72{
73 return 9.8;
74}
75
76class TestClass {
77 public:
78 double operator()() { return 9.7; }
79};
80
88char *progname = "";
81const char *progname = "";
89
90void
91usage()
92{
93 panic("incorrect usage.\n"
94 "usage:\n"
95 "\t%s [-t [-c] [-d]]\n", progname);
96}
97
98int
99main(int argc, char *argv[])
100{
101 bool descriptions = false;
102 bool compat = false;
103 bool text = false;
82
83void
84usage()
85{
86 panic("incorrect usage.\n"
87 "usage:\n"
88 "\t%s [-t [-c] [-d]]\n", progname);
89}
90
91int
92main(int argc, char *argv[])
93{
94 bool descriptions = false;
95 bool compat = false;
96 bool text = false;
97
98#if USE_MYSQL
104 string mysql_name;
99 string mysql_name;
100 string mysql_db;
105 string mysql_host;
106 string mysql_user = "binkertn";
107 string mysql_passwd;
101 string mysql_host;
102 string mysql_user = "binkertn";
103 string mysql_passwd;
104#endif
108
109 char c;
110 progname = argv[0];
105
106 char c;
107 progname = argv[0];
111 while ((c = getopt(argc, argv, "cdh:P:p:s:tu:")) != -1) {
108 while ((c = getopt(argc, argv, "cD:dh:P:p:s:tu:")) != -1) {
112 switch (c) {
113 case 'c':
114 compat = true;
115 break;
116 case 'd':
117 descriptions = true;
118 break;
109 switch (c) {
110 case 'c':
111 compat = true;
112 break;
113 case 'd':
114 descriptions = true;
115 break;
116 case 't':
117 text = true;
118 break;
119#if USE_MYSQL
120 case 'D':
121 mysql_db = optarg;
122 break;
119 case 'h':
120 mysql_host = optarg;
121 break;
122 case 'P':
123 mysql_passwd = optarg;
124 break;
125 case 's':
126 mysql_name = optarg;
127 break;
123 case 'h':
124 mysql_host = optarg;
125 break;
126 case 'P':
127 mysql_passwd = optarg;
128 break;
129 case 's':
130 mysql_name = optarg;
131 break;
128 case 't':
129 text = true;
130 break;
131 case 'u':
132 mysql_user = optarg;
133 break;
132 case 'u':
133 mysql_user = optarg;
134 break;
135#endif
134 default:
135 usage();
136 }
137 }
138
139 if (!text && (compat || descriptions))
140 usage();
141
142 s5.init(5);
143 s6.init(1, 100, 13);
144 s7.init(7);
145 s8.init(10);
146 s12.init(1, 100, 13);
147 s13.init(4, 0, 99, 10);
148 s14.init(9);
149 s15.init(10);
150 s16.init(2, 9);
151
152 s1
153 .name("Stat01")
154 .desc("this is statistic 1")
155 ;
156
157 s2
158 .name("Stat02")
159 .desc("this is statistic 2")
160 .prereq(s11)
161 ;
162
163 s3
164 .name("Stat03")
165 .desc("this is statistic 3")
166 .prereq(f7)
167 ;
168
169 s4
170 .name("Stat04")
171 .desc("this is statistic 4")
172 .prereq(s11)
173 ;
174
175 s5
176 .name("Stat05")
177 .desc("this is statistic 5")
178 .prereq(s11)
179 .subname(0, "foo1")
180 .subname(1, "foo2")
181 .subname(2, "foo3")
182 .subname(3, "foo4")
183 .subname(4, "foo5")
184 ;
185
186 s6
187 .name("Stat06")
188 .desc("this is statistic 6")
189 .prereq(s11)
190 ;
191
192 s7
193 .name("Stat07")
194 .desc("this is statistic 7")
195 .precision(1)
196 .flags(pdf | total)
197 .prereq(s11)
198 ;
199
200 s8
201 .name("Stat08")
202 .desc("this is statistic 8")
203 .precision(2)
204 .prereq(s11)
205 .subname(4, "blarg")
206 ;
207
208 s9
209 .name("Stat09")
210 .desc("this is statistic 9")
211 .precision(4)
212 .prereq(s11)
213 ;
214
215 s10
216 .name("Stat10")
217 .desc("this is statistic 10")
218 .prereq(s11)
219 ;
220
221 s12
222 .name("Stat12")
223 .desc("this is statistic 12")
224 ;
225
226 s13
227 .name("Stat13")
228 .desc("this is statistic 13")
229 ;
230
231 s14
232 .name("Stat14")
233 .desc("this is statistic 14")
234 ;
235
236 s15
237 .name("Stat15")
238 .desc("this is statistic 15")
239 ;
240
241 s16
242 .name("Stat16")
243 .desc("this is statistic 16")
244 .flags(total)
245 .subname(0, "sub0")
246 .subname(1, "sub1")
247 .ysubname(0, "y0")
248 .ysubname(1, "y1")
249 ;
250
251 f1
252 .name("Formula1")
253 .desc("this is formula 1")
254 .prereq(s11)
255 ;
256
257 f2
258 .name("Formula2")
259 .desc("this is formula 2")
260 .prereq(s11)
261 .precision(1)
262 ;
263
264 f3
265 .name("Formula3")
266 .desc("this is formula 3")
267 .prereq(s11)
268 .subname(0, "bar1")
269 .subname(1, "bar2")
270 .subname(2, "bar3")
271 .subname(3, "bar4")
272 .subname(4, "bar5")
273 ;
274
275 f4
276 .functor(testfunc)
277 .name("Formula4")
278 .desc("this is formula 4")
279 ;
280
281 TestClass testclass;
282 f5
283 .functor(testclass)
284 .name("Formula5")
285 .desc("this is formula 5")
286 ;
287
288 f6
289 .name("Formula6")
290 .desc("this is formula 6")
291 ;
292
293 f1 = s1 + s2;
294 f2 = (-s1) / (-s2) * (-s3 + ULL(100) + s4);
295 f3 = sum(s5) * s7;
296 f6 += constant(10.0);
297 f6 += s5[3];
298 f7 = constant(1);
299
300 check();
301 reset();
302
303 s16[1][0] = 1;
304 s16[0][1] = 3;
305 s16[0][0] = 2;
306 s16[1][1] = 9;
307 s16[1][1] += 9;
308 s16[1][8] += 8;
309 s16[1][7] += 7;
310 s16[1][6] += 6;
311 s16[1][5] += 5;
312 s16[1][4] += 4;
313
314 s11 = 1;
315 s3 = 9;
316 s8[3] = 9;
317 s15[0].sample(1234);
318 s15[1].sample(1234);
319 s15[2].sample(1234);
320 s15[3].sample(1234);
321 s15[4].sample(1234);
322 s15[5].sample(1234);
323 s15[6].sample(1234);
324 s15[7].sample(1234);
325 s15[8].sample(1234);
326 s15[9].sample(1234);
327
328 s10.sample(1000000000);
329 curTick += ULL(1000000);
330 s10.sample(100000);
331 s10.sample(100000);
332 s10.sample(100000);
333 s10.sample(100000);
334 s10.sample(100000);
335 s10.sample(100000);
336 s10.sample(100000);
337 s10.sample(100000);
338 s10.sample(100000);
339 s10.sample(100000);
340 s10.sample(100000);
341 s10.sample(100000);
342 s10.sample(100000);
343 s13[0].sample(12);
344 s13[1].sample(29);
345 s13[2].sample(12);
346 s13[3].sample(29);
347 s13[0].sample(42);
348 s13[1].sample(29);
349 s13[2].sample(42);
350 s13[3].sample(32);
351 s13[0].sample(52);
352 s13[1].sample(49);
353 s13[2].sample(42);
354 s13[3].sample(25);
355 s13[0].sample(32);
356 s13[1].sample(49);
357 s13[2].sample(22);
358 s13[3].sample(49);
359 s13[0].sample(62);
360 s13[1].sample(99);
361 s13[2].sample(72);
362 s13[3].sample(23);
363 s13[0].sample(52);
364 s13[1].sample(78);
365 s13[2].sample(69);
366 s13[3].sample(49);
367
368 s14[0].sample(1234);
369 s14[1].sample(4134);
370 s14[4].sample(1213);
371 s14[3].sample(1124);
372 s14[2].sample(1243);
373 s14[7].sample(1244);
374 s14[4].sample(7234);
375 s14[2].sample(9234);
376 s14[3].sample(1764);
377 s14[7].sample(1564);
378 s14[3].sample(3234);
379 s14[1].sample(2234);
380 s14[5].sample(1234);
381 s14[2].sample(4334);
382 s14[2].sample(1234);
383 s14[4].sample(4334);
384 s14[6].sample(1234);
385 s14[8].sample(8734);
386 s14[1].sample(5234);
387 s14[3].sample(8234);
388 s14[7].sample(5234);
389 s14[4].sample(4434);
390 s14[3].sample(7234);
391 s14[2].sample(1934);
392 s14[1].sample(9234);
393 s14[5].sample(5634);
394 s14[3].sample(1264);
395 s14[7].sample(5223);
396 s14[0].sample(1234);
397 s14[0].sample(5434);
398 s14[3].sample(8634);
399 s14[1].sample(1234);
400
401
402 s15[0].sample(1234);
403 s15[1].sample(4134);
404 curTick += ULL(1000000);
405 s15[4].sample(1213);
406 curTick += ULL(1000000);
407 s15[3].sample(1124);
408 curTick += ULL(1000000);
409 s15[2].sample(1243);
410 curTick += ULL(1000000);
411 s15[7].sample(1244);
412 curTick += ULL(1000000);
413 s15[4].sample(7234);
414 s15[2].sample(9234);
415 s15[3].sample(1764);
416 s15[7].sample(1564);
417 s15[3].sample(3234);
418 s15[1].sample(2234);
419 curTick += ULL(1000000);
420 s15[5].sample(1234);
421 curTick += ULL(1000000);
422 s15[9].sample(4334);
423 curTick += ULL(1000000);
424 s15[2].sample(1234);
425 curTick += ULL(1000000);
426 s15[4].sample(4334);
427 s15[6].sample(1234);
428 curTick += ULL(1000000);
429 s15[8].sample(8734);
430 curTick += ULL(1000000);
431 s15[1].sample(5234);
432 curTick += ULL(1000000);
433 s15[3].sample(8234);
434 curTick += ULL(1000000);
435 s15[7].sample(5234);
436 s15[4].sample(4434);
437 s15[3].sample(7234);
438 s15[2].sample(1934);
439 s15[1].sample(9234);
440 curTick += ULL(1000000);
441 s15[5].sample(5634);
442 s15[3].sample(1264);
443 s15[7].sample(5223);
444 s15[0].sample(1234);
445 s15[0].sample(5434);
446 s15[3].sample(8634);
447 curTick += ULL(1000000);
448 s15[1].sample(1234);
449
450 s4 = curTick;
451
452 s8[3] = 99999;
453
454 s3 = 12;
455 s3++;
456 curTick += 9;
457
458 s1 = 9;
459 s1 += 9;
460 s1 -= 11;
461 s1++;
462 ++s1;
463 s1--;
464 --s1;
465
466 s2 = 9;
467
468 s5[0] += 1;
469 s5[1] += 2;
470 s5[2] += 3;
471 s5[3] += 4;
472 s5[4] += 5;
473
474 s7[0] = 10;
475 s7[1] = 20;
476 s7[2] = 30;
477 s7[3] = 40;
478 s7[4] = 50;
479 s7[5] = 60;
480 s7[6] = 70;
481
482 s6.sample(0);
483 s6.sample(1);
484 s6.sample(2);
485 s6.sample(3);
486 s6.sample(4);
487 s6.sample(5);
488 s6.sample(6);
489 s6.sample(7);
490 s6.sample(8);
491 s6.sample(9);
492
493 s6.sample(10);
494 s6.sample(10);
495 s6.sample(10);
496 s6.sample(10);
497 s6.sample(10);
498 s6.sample(10);
499 s6.sample(10);
500 s6.sample(10);
501 s6.sample(11);
502 s6.sample(19);
503 s6.sample(20);
504 s6.sample(20);
505 s6.sample(21);
506 s6.sample(21);
507 s6.sample(31);
508 s6.sample(98);
509 s6.sample(99);
510 s6.sample(99);
511 s6.sample(99);
512
513 s7[0] = 700;
514 s7[1] = 600;
515 s7[2] = 500;
516 s7[3] = 400;
517 s7[4] = 300;
518 s7[5] = 200;
519 s7[6] = 100;
520
521 s9.sample(100);
522 s9.sample(100);
523 s9.sample(100);
524 s9.sample(100);
525 s9.sample(10);
526 s9.sample(10);
527 s9.sample(10);
528 s9.sample(10);
529 s9.sample(10);
530
531 curTick += 9;
532 s4 = curTick;
533 s6.sample(100);
534 s6.sample(100);
535 s6.sample(100);
536 s6.sample(101);
537 s6.sample(102);
538
539 s12.sample(100);
540
541 if (text) {
542 Text out(cout);
543 out.descriptions = descriptions;
544 out.compat = compat;
545 out();
546 }
547
136 default:
137 usage();
138 }
139 }
140
141 if (!text && (compat || descriptions))
142 usage();
143
144 s5.init(5);
145 s6.init(1, 100, 13);
146 s7.init(7);
147 s8.init(10);
148 s12.init(1, 100, 13);
149 s13.init(4, 0, 99, 10);
150 s14.init(9);
151 s15.init(10);
152 s16.init(2, 9);
153
154 s1
155 .name("Stat01")
156 .desc("this is statistic 1")
157 ;
158
159 s2
160 .name("Stat02")
161 .desc("this is statistic 2")
162 .prereq(s11)
163 ;
164
165 s3
166 .name("Stat03")
167 .desc("this is statistic 3")
168 .prereq(f7)
169 ;
170
171 s4
172 .name("Stat04")
173 .desc("this is statistic 4")
174 .prereq(s11)
175 ;
176
177 s5
178 .name("Stat05")
179 .desc("this is statistic 5")
180 .prereq(s11)
181 .subname(0, "foo1")
182 .subname(1, "foo2")
183 .subname(2, "foo3")
184 .subname(3, "foo4")
185 .subname(4, "foo5")
186 ;
187
188 s6
189 .name("Stat06")
190 .desc("this is statistic 6")
191 .prereq(s11)
192 ;
193
194 s7
195 .name("Stat07")
196 .desc("this is statistic 7")
197 .precision(1)
198 .flags(pdf | total)
199 .prereq(s11)
200 ;
201
202 s8
203 .name("Stat08")
204 .desc("this is statistic 8")
205 .precision(2)
206 .prereq(s11)
207 .subname(4, "blarg")
208 ;
209
210 s9
211 .name("Stat09")
212 .desc("this is statistic 9")
213 .precision(4)
214 .prereq(s11)
215 ;
216
217 s10
218 .name("Stat10")
219 .desc("this is statistic 10")
220 .prereq(s11)
221 ;
222
223 s12
224 .name("Stat12")
225 .desc("this is statistic 12")
226 ;
227
228 s13
229 .name("Stat13")
230 .desc("this is statistic 13")
231 ;
232
233 s14
234 .name("Stat14")
235 .desc("this is statistic 14")
236 ;
237
238 s15
239 .name("Stat15")
240 .desc("this is statistic 15")
241 ;
242
243 s16
244 .name("Stat16")
245 .desc("this is statistic 16")
246 .flags(total)
247 .subname(0, "sub0")
248 .subname(1, "sub1")
249 .ysubname(0, "y0")
250 .ysubname(1, "y1")
251 ;
252
253 f1
254 .name("Formula1")
255 .desc("this is formula 1")
256 .prereq(s11)
257 ;
258
259 f2
260 .name("Formula2")
261 .desc("this is formula 2")
262 .prereq(s11)
263 .precision(1)
264 ;
265
266 f3
267 .name("Formula3")
268 .desc("this is formula 3")
269 .prereq(s11)
270 .subname(0, "bar1")
271 .subname(1, "bar2")
272 .subname(2, "bar3")
273 .subname(3, "bar4")
274 .subname(4, "bar5")
275 ;
276
277 f4
278 .functor(testfunc)
279 .name("Formula4")
280 .desc("this is formula 4")
281 ;
282
283 TestClass testclass;
284 f5
285 .functor(testclass)
286 .name("Formula5")
287 .desc("this is formula 5")
288 ;
289
290 f6
291 .name("Formula6")
292 .desc("this is formula 6")
293 ;
294
295 f1 = s1 + s2;
296 f2 = (-s1) / (-s2) * (-s3 + ULL(100) + s4);
297 f3 = sum(s5) * s7;
298 f6 += constant(10.0);
299 f6 += s5[3];
300 f7 = constant(1);
301
302 check();
303 reset();
304
305 s16[1][0] = 1;
306 s16[0][1] = 3;
307 s16[0][0] = 2;
308 s16[1][1] = 9;
309 s16[1][1] += 9;
310 s16[1][8] += 8;
311 s16[1][7] += 7;
312 s16[1][6] += 6;
313 s16[1][5] += 5;
314 s16[1][4] += 4;
315
316 s11 = 1;
317 s3 = 9;
318 s8[3] = 9;
319 s15[0].sample(1234);
320 s15[1].sample(1234);
321 s15[2].sample(1234);
322 s15[3].sample(1234);
323 s15[4].sample(1234);
324 s15[5].sample(1234);
325 s15[6].sample(1234);
326 s15[7].sample(1234);
327 s15[8].sample(1234);
328 s15[9].sample(1234);
329
330 s10.sample(1000000000);
331 curTick += ULL(1000000);
332 s10.sample(100000);
333 s10.sample(100000);
334 s10.sample(100000);
335 s10.sample(100000);
336 s10.sample(100000);
337 s10.sample(100000);
338 s10.sample(100000);
339 s10.sample(100000);
340 s10.sample(100000);
341 s10.sample(100000);
342 s10.sample(100000);
343 s10.sample(100000);
344 s10.sample(100000);
345 s13[0].sample(12);
346 s13[1].sample(29);
347 s13[2].sample(12);
348 s13[3].sample(29);
349 s13[0].sample(42);
350 s13[1].sample(29);
351 s13[2].sample(42);
352 s13[3].sample(32);
353 s13[0].sample(52);
354 s13[1].sample(49);
355 s13[2].sample(42);
356 s13[3].sample(25);
357 s13[0].sample(32);
358 s13[1].sample(49);
359 s13[2].sample(22);
360 s13[3].sample(49);
361 s13[0].sample(62);
362 s13[1].sample(99);
363 s13[2].sample(72);
364 s13[3].sample(23);
365 s13[0].sample(52);
366 s13[1].sample(78);
367 s13[2].sample(69);
368 s13[3].sample(49);
369
370 s14[0].sample(1234);
371 s14[1].sample(4134);
372 s14[4].sample(1213);
373 s14[3].sample(1124);
374 s14[2].sample(1243);
375 s14[7].sample(1244);
376 s14[4].sample(7234);
377 s14[2].sample(9234);
378 s14[3].sample(1764);
379 s14[7].sample(1564);
380 s14[3].sample(3234);
381 s14[1].sample(2234);
382 s14[5].sample(1234);
383 s14[2].sample(4334);
384 s14[2].sample(1234);
385 s14[4].sample(4334);
386 s14[6].sample(1234);
387 s14[8].sample(8734);
388 s14[1].sample(5234);
389 s14[3].sample(8234);
390 s14[7].sample(5234);
391 s14[4].sample(4434);
392 s14[3].sample(7234);
393 s14[2].sample(1934);
394 s14[1].sample(9234);
395 s14[5].sample(5634);
396 s14[3].sample(1264);
397 s14[7].sample(5223);
398 s14[0].sample(1234);
399 s14[0].sample(5434);
400 s14[3].sample(8634);
401 s14[1].sample(1234);
402
403
404 s15[0].sample(1234);
405 s15[1].sample(4134);
406 curTick += ULL(1000000);
407 s15[4].sample(1213);
408 curTick += ULL(1000000);
409 s15[3].sample(1124);
410 curTick += ULL(1000000);
411 s15[2].sample(1243);
412 curTick += ULL(1000000);
413 s15[7].sample(1244);
414 curTick += ULL(1000000);
415 s15[4].sample(7234);
416 s15[2].sample(9234);
417 s15[3].sample(1764);
418 s15[7].sample(1564);
419 s15[3].sample(3234);
420 s15[1].sample(2234);
421 curTick += ULL(1000000);
422 s15[5].sample(1234);
423 curTick += ULL(1000000);
424 s15[9].sample(4334);
425 curTick += ULL(1000000);
426 s15[2].sample(1234);
427 curTick += ULL(1000000);
428 s15[4].sample(4334);
429 s15[6].sample(1234);
430 curTick += ULL(1000000);
431 s15[8].sample(8734);
432 curTick += ULL(1000000);
433 s15[1].sample(5234);
434 curTick += ULL(1000000);
435 s15[3].sample(8234);
436 curTick += ULL(1000000);
437 s15[7].sample(5234);
438 s15[4].sample(4434);
439 s15[3].sample(7234);
440 s15[2].sample(1934);
441 s15[1].sample(9234);
442 curTick += ULL(1000000);
443 s15[5].sample(5634);
444 s15[3].sample(1264);
445 s15[7].sample(5223);
446 s15[0].sample(1234);
447 s15[0].sample(5434);
448 s15[3].sample(8634);
449 curTick += ULL(1000000);
450 s15[1].sample(1234);
451
452 s4 = curTick;
453
454 s8[3] = 99999;
455
456 s3 = 12;
457 s3++;
458 curTick += 9;
459
460 s1 = 9;
461 s1 += 9;
462 s1 -= 11;
463 s1++;
464 ++s1;
465 s1--;
466 --s1;
467
468 s2 = 9;
469
470 s5[0] += 1;
471 s5[1] += 2;
472 s5[2] += 3;
473 s5[3] += 4;
474 s5[4] += 5;
475
476 s7[0] = 10;
477 s7[1] = 20;
478 s7[2] = 30;
479 s7[3] = 40;
480 s7[4] = 50;
481 s7[5] = 60;
482 s7[6] = 70;
483
484 s6.sample(0);
485 s6.sample(1);
486 s6.sample(2);
487 s6.sample(3);
488 s6.sample(4);
489 s6.sample(5);
490 s6.sample(6);
491 s6.sample(7);
492 s6.sample(8);
493 s6.sample(9);
494
495 s6.sample(10);
496 s6.sample(10);
497 s6.sample(10);
498 s6.sample(10);
499 s6.sample(10);
500 s6.sample(10);
501 s6.sample(10);
502 s6.sample(10);
503 s6.sample(11);
504 s6.sample(19);
505 s6.sample(20);
506 s6.sample(20);
507 s6.sample(21);
508 s6.sample(21);
509 s6.sample(31);
510 s6.sample(98);
511 s6.sample(99);
512 s6.sample(99);
513 s6.sample(99);
514
515 s7[0] = 700;
516 s7[1] = 600;
517 s7[2] = 500;
518 s7[3] = 400;
519 s7[4] = 300;
520 s7[5] = 200;
521 s7[6] = 100;
522
523 s9.sample(100);
524 s9.sample(100);
525 s9.sample(100);
526 s9.sample(100);
527 s9.sample(10);
528 s9.sample(10);
529 s9.sample(10);
530 s9.sample(10);
531 s9.sample(10);
532
533 curTick += 9;
534 s4 = curTick;
535 s6.sample(100);
536 s6.sample(100);
537 s6.sample(100);
538 s6.sample(101);
539 s6.sample(102);
540
541 s12.sample(100);
542
543 if (text) {
544 Text out(cout);
545 out.descriptions = descriptions;
546 out.compat = compat;
547 out();
548 }
549
550#if USE_MYSQL
548 if (!mysql_name.empty()) {
549 MySql out;
551 if (!mysql_name.empty()) {
552 MySql out;
550 out.connect(mysql_host, mysql_user, mysql_passwd, "m5stats",
553 out.connect(mysql_host, mysql_db, mysql_user, mysql_passwd, "test",
551 mysql_name, "test");
552 out();
553 }
554 mysql_name, "test");
555 out();
556 }
557#endif
554
555 return 0;
556}
558
559 return 0;
560}