Deleted Added
sdiff udiff text old ( 2716:b9114064d77a ) new ( 5584:e08e65fd0f76 )
full compact
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;

--- 16 unchanged lines hidden (view full) ---

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>
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
47Tick curTick = 0;
48Tick ticksPerSecond = ULL(2000000000);
49
50Scalar<> s1;
51Scalar<> s2;
52Average<> s3;
53Scalar<> s4;
54Vector<> s5;
55Distribution<> s6;
56Vector<> s7;
57AverageVector<> s8;

--- 9 unchanged lines hidden (view full) ---

67Formula f1;
68Formula f2;
69Formula f3;
70Value f4;
71Value f5;
72Formula f6;
73Formula f7;
74
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
88char *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;
104 string mysql_name;
105 string mysql_host;
106 string mysql_user = "binkertn";
107 string mysql_passwd;
108
109 char c;
110 progname = argv[0];
111 while ((c = getopt(argc, argv, "cdh:P:p:s:tu:")) != -1) {
112 switch (c) {
113 case 'c':
114 compat = true;
115 break;
116 case 'd':
117 descriptions = true;
118 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;
128 case 't':
129 text = true;
130 break;
131 case 'u':
132 mysql_user = optarg;
133 break;
134 default:
135 usage();
136 }
137 }
138
139 if (!text && (compat || descriptions))
140 usage();
141

--- 398 unchanged lines hidden (view full) ---

540
541 if (text) {
542 Text out(cout);
543 out.descriptions = descriptions;
544 out.compat = compat;
545 out();
546 }
547
548 if (!mysql_name.empty()) {
549 MySql out;
550 out.connect(mysql_host, mysql_user, mysql_passwd, "m5stats",
551 mysql_name, "test");
552 out();
553 }
554
555 return 0;
556}