changeset 41550bb10e08 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=41550bb10e08
description:
        stats: get rid of the never-really-used event stuff

diffstat:

 src/arch/alpha/ev5.cc             |    1 -
 src/base/SConscript               |    1 -
 src/base/stats/events.cc          |   62 ---------------------
 src/base/stats/events.hh          |   62 ---------------------
 src/base/stats/mysql.cc           |  111 +-------------------------------------
 src/base/stats/mysql.hh           |   25 --------
 src/base/stats/output.hh          |    1 -
 src/base/stats/text.hh            |    3 -
 src/cpu/ozone/back_end.hh         |    8 --
 src/cpu/ozone/inorder_back_end.hh |   16 -----
 src/cpu/simple/base.cc            |    1 -
 src/sim/faults.cc                 |    1 -
 src/sim/sim_object.cc             |    7 --
 src/sim/sim_object.hh             |    3 -
 14 files changed, 1 insertions(+), 301 deletions(-)

diffs (truncated from 500 to 300 lines):

diff -r da32c2b05648 -r 41550bb10e08 src/arch/alpha/ev5.cc
--- a/src/arch/alpha/ev5.cc     Mon Jun 14 23:24:46 2010 -0700
+++ b/src/arch/alpha/ev5.cc     Mon Jun 14 23:24:46 2010 -0700
@@ -36,7 +36,6 @@
 #include "arch/alpha/tlb.hh"
 #include "base/cp_annotate.hh"
 #include "base/debug.hh"
-#include "base/stats/events.hh"
 #include "config/full_system.hh"
 #include "cpu/base.hh"
 #include "cpu/simple_thread.hh"
diff -r da32c2b05648 -r 41550bb10e08 src/base/SConscript
--- a/src/base/SConscript       Mon Jun 14 23:24:46 2010 -0700
+++ b/src/base/SConscript       Mon Jun 14 23:24:46 2010 -0700
@@ -75,7 +75,6 @@
 Source('loader/raw_object.cc')
 Source('loader/symtab.cc')
 
-Source('stats/events.cc')
 Source('stats/output.cc')
 Source('stats/text.cc')
 Source('stats/visit.cc')
diff -r da32c2b05648 -r 41550bb10e08 src/base/stats/events.cc
--- a/src/base/stats/events.cc  Mon Jun 14 23:24:46 2010 -0700
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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 <vector>
-
-#include "base/stats/events.hh"
-#include "base/stats/output.hh"
-#include "base/types.hh"
-
-using namespace std;
-
-namespace Stats {
-
-Tick EventStart = MaxTick;
-
-extern list<Output *> OutputList;
-
-#if USE_MYSQL
-void
-__event(const string &event)
-{
-    list<Output *>::iterator i = OutputList.begin();
-    list<Output *>::iterator end = OutputList.end();
-    for (; i != end; ++i) {
-        Output *output = *i;
-        if (!output->valid())
-            continue;
-
-        output->event(event);
-    }
-}
-
-#endif
-
-/* namespace Stats */ }
diff -r da32c2b05648 -r 41550bb10e08 src/base/stats/events.hh
--- a/src/base/stats/events.hh  Mon Jun 14 23:24:46 2010 -0700
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +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_STATS_EVENTS_HH__
-#define __BASE_STATS_EVENTS_HH__
-
-#include <string>
-
-#include "base/trace.hh"
-#include "config/use_mysql.hh"
-
-namespace Stats {
-
-extern Tick EventStart;
-
-#if USE_MYSQL
-void __event(const std::string &stat);
-#else
-inline void __event(const std::string &stat) {}
-#endif
-
-inline void
-recordEvent(const std::string &stat)
-{
-    if (EventStart > curTick)
-        return;
-
-    DPRINTF(StatEvents, "Statistics Event: %s\n", stat);
-
-    __event(stat);
-}
-
-/* namespace Stats */ }
-
-#endif // __BASE_STATS_EVENTS_HH__
diff -r da32c2b05648 -r 41550bb10e08 src/base/stats/mysql.cc
--- a/src/base/stats/mysql.cc   Mon Jun 14 23:24:46 2010 -0700
+++ b/src/base/stats/mysql.cc   Mon Jun 14 23:24:46 2010 -0700
@@ -150,22 +150,6 @@
 
     if (mysql.commit())
         panic("could not commit transaction\n%s\n", mysql.error);
-
-    mysql.query("DELETE events"
-                "FROM events"
-                "LEFT JOIN runs ON ev_run=rn_id"
-                "WHERE rn_id IS NULL");
-
-    if (mysql.commit())
-        panic("could not commit transaction\n%s\n", mysql.error);
-
-    mysql.query("DELETE event_names"
-                "FROM event_names"
-                "LEFT JOIN events ON en_id=ev_event"
-                "WHERE ev_event IS NULL");
-
-    if (mysql.commit())
-        panic("could not commit transaction\n%s\n", mysql.error);
 }
 
 void
@@ -347,93 +331,6 @@
                     data);
 }
 
-InsertEvent::InsertEvent(MySqlRun *_run)
-    : run(_run)
-{
-    query = new char[maxsize + 1];
-    size = 0;
-    first = true;
-    flush();
-}
-
-InsertEvent::~InsertEvent()
-{
-    flush();
-}
-
-void
-InsertEvent::insert(const string &stat)
-{
-    MySQL::Connection &mysql = run->conn();
-    assert(mysql.connected());
-
-    event_map_t::iterator i = events.find(stat);
-    uint32_t event;
-    if (i == events.end()) {
-        mysql.query(
-            csprintf("SELECT en_id "
-                     "from event_names "
-                     "where en_name=\"%s\"",
-                     stat));
-
-        MySQL::Result result = mysql.store_result();
-        if (!result)
-            panic("could not get a run\n%s\n", mysql.error);
-
-        assert(result.num_fields() == 1);
-        MySQL::Row row = result.fetch_row();
-        if (row) {
-            if (!to_number(row[0], event))
-                panic("invalid event id: %s\n", row[0]);
-        } else {
-            mysql.query(
-                csprintf("INSERT INTO "
-                         "event_names(en_name)"
-                         "values(\"%s\")",
-                         stat));
-
-            if (mysql.error)
-                panic("could not get a run\n%s\n", mysql.error);
-
-            event = mysql.insert_id();
-        }
-    } else {
-        event = (*i).second;
-    }
-
-    if (size + 1024 > maxsize)
-        flush();
-
-    if (!first) {
-        query[size++] = ',';
-        query[size] = '\0';
-    }
-
-    first = false;
-
-    size += sprintf(query + size, "(%u,%u,%llu)",
-                    event, run->run(), (unsigned long long)curTick);
-}
-
-void
-InsertEvent::flush()
-{
-    static const char query_header[] = "INSERT INTO "
-        "events(ev_event, ev_run, ev_tick)"
-        "values";
-
-    MySQL::Connection &mysql = run->conn();
-    assert(mysql.connected());
-
-    if (size)
-        mysql.query(query);
-
-    query[0] = '\0';
-    size = sizeof(query_header);
-    first = true;
-    memcpy(query, query_header, size);
-}
-
 struct InsertSubData
 {
     uint16_t stat;
@@ -465,7 +362,7 @@
 }
 
 MySql::MySql()
-    : run(new MySqlRun), newdata(run), newevent(run)
+    : run(new MySqlRun), newdata(run)
 {}
 
 MySql::~MySql()
@@ -730,12 +627,6 @@
 }
 
 void
-MySql::event(const std::string &event)
-{
-    newevent.insert(event);
-}
-
-void
 MySql::output(const ScalarInfo &info)
 {
     if (!(info.flags & print))
diff -r da32c2b05648 -r 41550bb10e08 src/base/stats/mysql.hh
--- a/src/base/stats/mysql.hh   Mon Jun 14 23:24:46 2010 -0700
+++ b/src/base/stats/mysql.hh   Mon Jun 14 23:24:46 2010 -0700
@@ -92,27 +92,6 @@
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to