changeset d57afdcf38f5 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=d57afdcf38f5
description:
        stats: delete mysql support
        we can add it back within python in some future changeset

diffstat:

 SConstruct                      |   39 +-
 src/base/SConscript             |    4 -
 src/base/mysql.cc               |  113 -----
 src/base/mysql.hh               |  426 --------------------
 src/base/stats/mysql.cc         |  852 ----------------------------------------
 src/base/stats/mysql.hh         |  190 --------
 src/base/stats/mysql_run.hh     |   67 ---
 src/python/m5/stats/__init__.py |   10 -
 src/python/swig/stats.i         |    4 -
 9 files changed, 1 insertions(+), 1704 deletions(-)

diffs (truncated from 1793 to 300 lines):

diff -r be7f03723412 -r d57afdcf38f5 SConstruct
--- a/SConstruct        Thu May 12 11:19:35 2011 -0700
+++ b/SConstruct        Thu May 12 11:19:35 2011 -0700
@@ -710,32 +710,6 @@
 
 ######################################################################
 #
-# Check for mysql.
-#
-mysql_config = WhereIs('mysql_config')
-have_mysql = bool(mysql_config)
-
-# Check MySQL version.
-if have_mysql:
-    mysql_version = readCommand(mysql_config + ' --version')
-    min_mysql_version = '4.1'
-    if compareVersions(mysql_version, min_mysql_version) < 0:
-        print 'Warning: MySQL', min_mysql_version, 'or newer required.'
-        print '         Version', mysql_version, 'detected.'
-        have_mysql = False
-
-# Set up mysql_config commands.
-if have_mysql:
-    mysql_config_include = mysql_config + ' --include'
-    if os.system(mysql_config_include + ' > /dev/null') != 0:
-        # older mysql_config versions don't support --include, use
-        # --cflags instead
-        mysql_config_include = mysql_config + ' --cflags | sed s/\\\'//g'
-    # This seems to work in all versions
-    mysql_config_libs = mysql_config + ' --libs'
-
-######################################################################
-#
 # Finish the configuration
 #
 main = conf.Finish()
@@ -820,7 +794,6 @@
     BoolVariable('USE_SSE2',
                  'Compile for SSE2 (-msse2) to get IEEE FP on x86 hosts',
                  False),
-    BoolVariable('USE_MYSQL', 'Use MySQL for stats output', have_mysql),
     BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks', have_posix_clock),
     BoolVariable('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
     BoolVariable('USE_CHECKER', 'Use checker for detailed CPU models', False),
@@ -829,7 +802,7 @@
     )
 
 # These variables get exported to #defines in config/*.hh (see src/SConscript).
-export_vars += ['FULL_SYSTEM', 'USE_FENV', 'USE_MYSQL',
+export_vars += ['FULL_SYSTEM', 'USE_FENV',
                 'NO_FAST_ALLOC', 'FORCE_FAST_ALLOC', 'FAST_ALLOC_STATS',
                 'SS_COMPATIBLE_FP', 'USE_CHECKER', 'TARGET_ISA', 'CP_ANNOTATE',
                 'USE_POSIX_CLOCK' ]
@@ -994,16 +967,6 @@
     if env['EFENCE']:
         env.Append(LIBS=['efence'])
 
-    if env['USE_MYSQL']:
-        if not have_mysql:
-            print "Warning: MySQL not available; " \
-                  "forcing USE_MYSQL to False in", variant_dir + "."
-            env['USE_MYSQL'] = False
-        else:
-            print "Compiling in", variant_dir, "with MySQL support."
-            env.ParseConfig(mysql_config_libs)
-            env.ParseConfig(mysql_config_include)
-
     # Save sticky variable settings back to current variables file
     sticky_vars.Save(current_vars_file, env)
 
diff -r be7f03723412 -r d57afdcf38f5 src/base/SConscript
--- a/src/base/SConscript       Thu May 12 11:19:35 2011 -0700
+++ b/src/base/SConscript       Thu May 12 11:19:35 2011 -0700
@@ -73,10 +73,6 @@
 
 Source('stats/text.cc')
 
-if env['USE_MYSQL']:
-    Source('mysql.cc')
-    Source('stats/mysql.cc')
-
 TraceFlag('Annotate', "State machine annotation debugging")
 TraceFlag('AnnotateQ', "State machine annotation queue debugging")
 TraceFlag('AnnotateVerbose', "Dump all state machine annotation details")
diff -r be7f03723412 -r d57afdcf38f5 src/base/mysql.cc
--- a/src/base/mysql.cc Thu May 12 11:19:35 2011 -0700
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2004-2005 The Regents of The University of Michigan
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Nathan Binkert
- */
-
-#include <iostream>
-
-#include "base/mysql.hh"
-#include "base/trace.hh"
-#include "debug/SQL.hh"
-
-using namespace std;
-
-namespace MySQL {
-
-inline const char *
-charstar(const string &string)
-{
-    return string.empty() ? NULL : string.c_str();
-}
-
-ostream &
-operator<<(ostream &stream, const Error &error)
-{
-    stream << error.string();
-    return stream;
-}
-
-/*
- * The connection class
- */
-Connection::Connection()
-    : valid(false)
-{
-}
-
-Connection::~Connection()
-{
-    if (valid)
-        close();
-}
-
-
-bool
-Connection::connect(const string &xhost, const string &xuser,
-                    const string &xpasswd, const string &xdatabase)
-{
-    if (connected())
-        return error.set("Already Connected");
-
-    _host = xhost;
-    _user = xuser;
-    _passwd = xpasswd;
-    _database = xdatabase;
-
-    error.clear();
-
-    mysql_init(&mysql);
-    mysql_options(&mysql, MYSQL_OPT_COMPRESS, 0); // might want to be 1
-    mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "odbc");
-    if (!mysql_real_connect(&mysql, charstar(_host), charstar(_user),
-                            charstar(_passwd), charstar(_database),
-                            0, NULL, 0))
-        return error.set(mysql_error(&mysql));
-
-    valid = true;
-    return false;
-}
-
-void
-Connection::close()
-{
-    mysql_close(&mysql);
-}
-
-bool
-Connection::query(const string &sql)
-{
-    DPRINTF(SQL, "Sending SQL query to server:\n%s", sql);
-    error.clear();
-    if (mysql_real_query(&mysql, sql.c_str(), sql.size()))
-        error.set(mysql_error(&mysql));
-
-    return error;
-}
-
-
-} // namespace MySQL
diff -r be7f03723412 -r d57afdcf38f5 src/base/mysql.hh
--- a/src/base/mysql.hh Thu May 12 11:19:35 2011 -0700
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,426 +0,0 @@
-/*
- * Copyright (c) 2004-2005 The Regents of The University of Michigan
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met: redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer;
- * redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution;
- * neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Nathan Binkert
- */
-
-#ifndef __BASE_MYSQL_HH__
-#define __BASE_MYSQL_HH__
-
-#define TO_BE_INCLUDED_LATER 0
-
-#include <mysql.h>
-#include <mysql_version.h>
-
-#include <cassert>
-#include <iosfwd>
-#include <sstream>
-#include <string>
-
-namespace MySQL {
-
-class Error
-{
-  protected:
-    const char *error;
-
-  public:
-    Error() : error(NULL) {}
-
-    Error &clear() { error = NULL; return *this; }
-    Error &set(const char *err) { error = err; return *this; }
-
-    const char *string() const { return error; }
-
-    operator bool() const { return error != NULL; }
-    bool operator!() const { return error == NULL; }
-};
-
-std::ostream &operator<<(std::ostream &stream, const Error &error);
-
-class Result
-{
-  private:
-    MYSQL_RES *result;
-    int *refcount;
-
-    void
-    decref()
-    {
-        if (!refcount)
-            return;
-
-        *refcount -= 1;
-        if (*refcount == 0) {
-            mysql_free_result(result);
-            delete refcount;
-        }
-
-        refcount = NULL;
-    }
-
-  public:
-    Result()
-        : result(0), refcount(NULL)
-    { }
-
-    Result(MYSQL_RES *res)
-        : result(res)
-    {
-        if (result)
-            refcount = new int(1);
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to