Implement reset for stats.

base/statistics.cc:
base/statistics.hh:
    Implement a reset for for the statistics package.
    This will cause all stats to be set to their default value.
    Only the currently enabled bin will be reset.
test/Makefile:
    Make tests work again now that we're naming include dirs
    explicitly
test/stattest.cc:
    test reset

--HG--
extra : convert_revision : 8d21cedf6ee91ed0a2412042ea5cb12f79b90eb3
This commit is contained in:
Nathan Binkert
2003-10-20 23:08:27 -04:00
parent df488c0e70
commit 02bacb2dfd
4 changed files with 209 additions and 20 deletions

View File

@@ -4,15 +4,15 @@ CC= gcc
CXX= g++
CURDIR?= $(shell /bin/pwd)
SRCDIR?= .
SRCDIR?= ..
TARGET?= alpha
TEST_SRCDIR?= $(SRCDIR)
ARCH_SRCDIR?= $(SRCDIR)/../arch/$(TARGET)
BASE_SRCDIR?= $(SRCDIR)/../base
SIM_SRCDIR?= $(SRCDIR)/../sim
CACHE_SRCDIR?= $(SRCDIR)/../sim/cache
OLD_SRCDIR= $(SRCDIR)/../old
TEST_SRCDIR?= $(SRCDIR)/test
ARCH_SRCDIR?= $(SRCDIR)/arch/$(TARGET)
BASE_SRCDIR?= $(SRCDIR)/base
SIM_SRCDIR?= $(SRCDIR)/sim
CACHE_SRCDIR?= $(SRCDIR)/sim/cache
OLD_SRCDIR= $(SRCDIR)/old
vpath % $(TEST_SRCDIR)
vpath % $(BASE_SRCDIR)
@@ -20,13 +20,14 @@ vpath % $(SIM_SRCDIR)
vpath % $(CACHE_SRCDIR)
vpath % $(OLD_SRCDIR)
INCLDIRS= -I$(ARCH_SRCDIR) -I$(BASE_SRCDIR) -I$(SIM_SRCDIR) \
-I$(CACHE_SRCDIR) -I$(OLD_SRCDIR)
CCFLAGS= -g -O0 -MMD -I. $(INCLDIRS) -I- -DTRACING_ON=0
CCFLAGS= -g -O0 -MMD -I. -I$(SRCDIR) -I- -DTRACING_ON=0
default:
@echo "You must specify a target"
targetarch:
ln -s ../arch/$(TARGET) targetarch
bitvectest: bitvectest.o
$(CXX) $(LFLAGS) -o $@ $^
@@ -51,7 +52,8 @@ offtest: offtest.o
rangetest: rangetest.o str.o
$(CXX) $(LFLAGS) -o $@ $^
stattest: statistics.o stattest.o cprintf.o misc.o omisc.o str.o
stattest: cprintf.o hostinfo.o misc.o sim_stats.o sim_time.o \
statistics.o stattest.o str.o
$(CXX) $(LFLAGS) -o $@ $^
strnumtest: strnumtest.o str.o
@@ -63,7 +65,7 @@ symtest: misc.o symtest.o symtab.o str.o
tokentest: tokentest.o str.o
$(CXX) $(LFLAGS) -o $@ $^
tracetest: tracetest.o trace.o trace_flags.o cprintf.o str.o misc.o omisc.o
tracetest: tracetest.o trace.o trace_flags.o cprintf.o str.o misc.o
$(CXX) $(LFLAGS) -o $@ $^
clean:

View File

@@ -32,15 +32,16 @@
#include <unistd.h>
#include "base/cprintf.hh"
#include "sim/host.hh"
#include "base/misc.hh"
#include "base/statistics.hh"
#include "sim/host.hh"
#include "sim/sim_stats.hh"
using namespace std;
using namespace Statistics;
Tick curTick = 0;
//Tick ticksPerSecond = ULL(2000000000);
Tick ticksPerSecond = ULL(2000000000);
Scalar<> s1;
Scalar<> s2;
@@ -493,10 +494,17 @@ main(int argc, char *argv[])
s12.sample(100);
MainBin::activate(bin1);
cout << "dump 1" << endl;
dump(cout);
cout << endl << endl;
MainBin::activate(bin2);
cout << "dump 2" << endl;
dump(cout);
cout << endl << endl;
cout << "dump 3" << endl;
reset();
dump(cout);
cout << endl << endl;