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 <string> |
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 |
45Scalar<> s1; 46Scalar<> s2; 47Average<> s3; 48Scalar<> s4; 49Vector<> s5; 50Distribution<> s6; 51Vector<> s7; 52AverageVector<> s8; --- 9 unchanged lines hidden (view full) --- 62Formula f1; 63Formula f2; 64Formula f3; 65Value f4; 66Value f5; 67Formula f6; 68Formula f7; 69 |
70double 71testfunc() 72{ 73 return 9.8; 74} 75 76class TestClass { 77 public: 78 double operator()() { return 9.7; } 79}; 80 |
81const char *progname = ""; |
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 |
99 string mysql_name; |
100 string mysql_db; |
101 string mysql_host; 102 string mysql_user = "binkertn"; 103 string mysql_passwd; |
104#endif |
105 106 char c; 107 progname = argv[0]; |
108 while ((c = getopt(argc, argv, "cD:dh:P:p:s:tu:")) != -1) { |
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; |
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; |
132 case 'u': 133 mysql_user = optarg; 134 break; |
135#endif |
136 default: 137 usage(); 138 } 139 } 140 141 if (!text && (compat || descriptions)) 142 usage(); 143 --- 398 unchanged lines hidden (view full) --- 542 543 if (text) { 544 Text out(cout); 545 out.descriptions = descriptions; 546 out.compat = compat; 547 out(); 548 } 549 |
550#if USE_MYSQL |
551 if (!mysql_name.empty()) { 552 MySql out; |
553 out.connect(mysql_host, mysql_db, mysql_user, mysql_passwd, "test", |
554 mysql_name, "test"); 555 out(); 556 } |
557#endif |
558 559 return 0; 560} |