Remove all binning stuff

--HG--
extra : convert_revision : 6da2b3b0b6c2824f2064d42670fd8383edb7c718
This commit is contained in:
Nathan Binkert 2006-06-10 13:08:43 -04:00
parent f1fab2a446
commit 7af93dbdf6
29 changed files with 672 additions and 1268 deletions

View file

@ -253,7 +253,6 @@ full_system_sources = Split('''
dev/uart.cc dev/uart.cc
dev/uart8250.cc dev/uart8250.cc
kern/kernel_binning.cc
kern/kernel_stats.cc kern/kernel_stats.cc
kern/system_events.cc kern/system_events.cc
kern/linux/events.cc kern/linux/events.cc

View file

@ -116,10 +116,6 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(FreebsdAlphaSystem)
Param<uint64_t> system_type; Param<uint64_t> system_type;
Param<uint64_t> system_rev; Param<uint64_t> system_rev;
Param<bool> bin;
VectorParam<string> binned_fns;
Param<bool> bin_int;
END_DECLARE_SIM_OBJECT_PARAMS(FreebsdAlphaSystem) END_DECLARE_SIM_OBJECT_PARAMS(FreebsdAlphaSystem)
BEGIN_INIT_SIM_OBJECT_PARAMS(FreebsdAlphaSystem) BEGIN_INIT_SIM_OBJECT_PARAMS(FreebsdAlphaSystem)
@ -135,10 +131,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(FreebsdAlphaSystem)
INIT_PARAM_DFLT(readfile, "file to read startup script from", ""), INIT_PARAM_DFLT(readfile, "file to read startup script from", ""),
INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0), INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0),
INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 34), INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 34),
INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 1<<10), INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 1<<10)
INIT_PARAM_DFLT(bin, "is this system to be binned", false),
INIT_PARAM(binned_fns, "functions to be broken down and binned"),
INIT_PARAM_DFLT(bin_int, "is interrupt code binned seperately?", true)
END_INIT_SIM_OBJECT_PARAMS(FreebsdAlphaSystem) END_INIT_SIM_OBJECT_PARAMS(FreebsdAlphaSystem)
@ -157,9 +150,6 @@ CREATE_SIM_OBJECT(FreebsdAlphaSystem)
p->readfile = readfile; p->readfile = readfile;
p->system_type = system_type; p->system_type = system_type;
p->system_rev = system_rev; p->system_rev = system_rev;
p->bin = bin;
p->binned_fns = binned_fns;
p->bin_int = bin_int;
return new FreebsdAlphaSystem(p); return new FreebsdAlphaSystem(p);
} }

View file

@ -148,24 +148,6 @@ LinuxAlphaSystem::LinuxAlphaSystem(Params *p)
} else { } else {
printThreadEvent = NULL; printThreadEvent = NULL;
} }
if (params()->bin_int) {
intStartEvent = addPalFuncEvent<InterruptStartEvent>("sys_int_21");
if (!intStartEvent)
panic("could not find symbol: sys_int_21\n");
intEndEvent = addPalFuncEvent<InterruptEndEvent>("rti_to_kern");
if (!intEndEvent)
panic("could not find symbol: rti_to_kern\n");
intEndEvent2 = addPalFuncEvent<InterruptEndEvent>("rti_to_user");
if (!intEndEvent2)
panic("could not find symbol: rti_to_user\n");
intEndEvent3 = addKernelFuncEvent<InterruptEndEvent>("do_softirq");
if (!intEndEvent3)
panic("could not find symbol: do_softirq\n");
}
} }
LinuxAlphaSystem::~LinuxAlphaSystem() LinuxAlphaSystem::~LinuxAlphaSystem()
@ -238,10 +220,6 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxAlphaSystem)
Param<uint64_t> system_type; Param<uint64_t> system_type;
Param<uint64_t> system_rev; Param<uint64_t> system_rev;
Param<bool> bin;
VectorParam<string> binned_fns;
Param<bool> bin_int;
END_DECLARE_SIM_OBJECT_PARAMS(LinuxAlphaSystem) END_DECLARE_SIM_OBJECT_PARAMS(LinuxAlphaSystem)
BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxAlphaSystem) BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxAlphaSystem)
@ -257,10 +235,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxAlphaSystem)
INIT_PARAM_DFLT(readfile, "file to read startup script from", ""), INIT_PARAM_DFLT(readfile, "file to read startup script from", ""),
INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0), INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0),
INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 34), INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 34),
INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 1<<10), INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 1<<10)
INIT_PARAM_DFLT(bin, "is this system to be binned", false),
INIT_PARAM(binned_fns, "functions to be broken down and binned"),
INIT_PARAM_DFLT(bin_int, "is interrupt code binned seperately?", true)
END_INIT_SIM_OBJECT_PARAMS(LinuxAlphaSystem) END_INIT_SIM_OBJECT_PARAMS(LinuxAlphaSystem)
@ -279,9 +254,6 @@ CREATE_SIM_OBJECT(LinuxAlphaSystem)
p->readfile = readfile; p->readfile = readfile;
p->system_type = system_type; p->system_type = system_type;
p->system_rev = system_rev; p->system_rev = system_rev;
p->bin = bin;
p->binned_fns = binned_fns;
p->bin_int = bin_int;
return new LinuxAlphaSystem(p); return new LinuxAlphaSystem(p);
} }

View file

@ -42,7 +42,7 @@ using namespace Linux;
using namespace std; using namespace std;
/** /**
* This class contains linux specific system code (Loading, Events, Binning). * This class contains linux specific system code (Loading, Events).
* It points to objects that are the system binaries to load and patches them * It points to objects that are the system binaries to load and patches them
* appropriately to work in simulator. * appropriately to work in simulator.
*/ */
@ -121,18 +121,6 @@ class LinuxAlphaSystem : public AlphaSystem
*/ */
PrintThreadInfo *printThreadEvent; PrintThreadInfo *printThreadEvent;
/**
* Event to bin Interrupts seperately from kernel code
*/
InterruptStartEvent *intStartEvent;
/**
* Event to bin Interrupts seperately from kernel code
*/
InterruptEndEvent *intEndEvent;
InterruptEndEvent *intEndEvent2;
InterruptEndEvent *intEndEvent3;
/** Grab the PCBB of the idle process when it starts */ /** Grab the PCBB of the idle process when it starts */
IdleStartEvent *idleStartEvent; IdleStartEvent *idleStartEvent;

View file

@ -247,10 +247,6 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(AlphaSystem)
Param<uint64_t> system_type; Param<uint64_t> system_type;
Param<uint64_t> system_rev; Param<uint64_t> system_rev;
Param<bool> bin;
VectorParam<std::string> binned_fns;
Param<bool> bin_int;
END_DECLARE_SIM_OBJECT_PARAMS(AlphaSystem) END_DECLARE_SIM_OBJECT_PARAMS(AlphaSystem)
BEGIN_INIT_SIM_OBJECT_PARAMS(AlphaSystem) BEGIN_INIT_SIM_OBJECT_PARAMS(AlphaSystem)
@ -266,10 +262,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(AlphaSystem)
INIT_PARAM_DFLT(readfile, "file to read startup script from", ""), INIT_PARAM_DFLT(readfile, "file to read startup script from", ""),
INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0), INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0),
INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 34), INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 34),
INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 1<<10), INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 1<<10)
INIT_PARAM_DFLT(bin, "is this system to be binned", false),
INIT_PARAM(binned_fns, "functions to be broken down and binned"),
INIT_PARAM_DFLT(bin_int, "is interrupt code binned seperately?", true)
END_INIT_SIM_OBJECT_PARAMS(AlphaSystem) END_INIT_SIM_OBJECT_PARAMS(AlphaSystem)
@ -288,9 +281,6 @@ CREATE_SIM_OBJECT(AlphaSystem)
p->readfile = readfile; p->readfile = readfile;
p->system_type = system_type; p->system_type = system_type;
p->system_rev = system_rev; p->system_rev = system_rev;
p->bin = bin;
p->binned_fns = binned_fns;
p->bin_int = bin_int;
return new AlphaSystem(p); return new AlphaSystem(p);
} }

View file

@ -110,9 +110,6 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64AlphaSystem)
Param<uint64_t> system_type; Param<uint64_t> system_type;
Param<uint64_t> system_rev; Param<uint64_t> system_rev;
Param<bool> bin;
VectorParam<string> binned_fns;
END_DECLARE_SIM_OBJECT_PARAMS(Tru64AlphaSystem) END_DECLARE_SIM_OBJECT_PARAMS(Tru64AlphaSystem)
BEGIN_INIT_SIM_OBJECT_PARAMS(Tru64AlphaSystem) BEGIN_INIT_SIM_OBJECT_PARAMS(Tru64AlphaSystem)
@ -128,9 +125,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(Tru64AlphaSystem)
INIT_PARAM_DFLT(readfile, "file to read startup script from", ""), INIT_PARAM_DFLT(readfile, "file to read startup script from", ""),
INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0), INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0),
INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 12), INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 12),
INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 2<<1), INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 2<<1)
INIT_PARAM_DFLT(bin, "is this system to be binned", false),
INIT_PARAM(binned_fns, "functions to be broken down and binned")
END_INIT_SIM_OBJECT_PARAMS(Tru64AlphaSystem) END_INIT_SIM_OBJECT_PARAMS(Tru64AlphaSystem)
@ -149,9 +144,6 @@ CREATE_SIM_OBJECT(Tru64AlphaSystem)
p->readfile = readfile; p->readfile = readfile;
p->system_type = system_type; p->system_type = system_type;
p->system_rev = system_rev; p->system_rev = system_rev;
p->bin = bin;
p->binned_fns = binned_fns;
p->bin_int = false;
return new Tru64AlphaSystem(p); return new Tru64AlphaSystem(p);
} }

View file

@ -42,7 +42,6 @@
#include "base/time.hh" #include "base/time.hh"
#include "base/trace.hh" #include "base/trace.hh"
#include "base/stats/statdb.hh" #include "base/stats/statdb.hh"
#include "config/stats_binning.hh"
using namespace std; using namespace std;
@ -173,12 +172,6 @@ FormulaBase::size() const
return root->size(); return root->size();
} }
bool
FormulaBase::binned() const
{
return root && root->binned();
}
void void
FormulaBase::reset() FormulaBase::reset()
{ {
@ -237,33 +230,6 @@ Formula::operator+=(Temp r)
return *this; return *this;
} }
MainBin::MainBin(const string &name)
: _name(name), mem(NULL), memsize(-1)
{
Database::regBin(this, name);
}
MainBin::~MainBin()
{
if (mem)
delete [] mem;
}
char *
MainBin::memory(off_t off)
{
if (memsize == -1)
memsize = ceilPow2((size_t) offset());
if (!mem) {
mem = new char[memsize];
memset(mem, 0, memsize);
}
assert(offset() <= size());
return mem + off;
}
void void
check() check()
{ {
@ -286,13 +252,6 @@ check()
Database::stats().sort(StatData::less); Database::stats().sort(StatData::less);
#if STATS_BINNING
if (MainBin::curBin() == NULL) {
static MainBin mainBin("main bin");
mainBin.activate();
}
#endif
if (i == end) if (i == end)
return; return;
@ -312,39 +271,14 @@ CallbackQueue resetQueue;
void void
reset() reset()
{ {
// reset non-binned stats
Database::stat_list_t::iterator i = Database::stats().begin(); Database::stat_list_t::iterator i = Database::stats().begin();
Database::stat_list_t::iterator end = Database::stats().end(); Database::stat_list_t::iterator end = Database::stats().end();
while (i != end) { while (i != end) {
StatData *data = *i; StatData *data = *i;
if (!data->binned()) data->reset();
data->reset();
++i; ++i;
} }
// save the bin so we can go back to where we were
MainBin *orig = MainBin::curBin();
// reset binned stats
Database::bin_list_t::iterator bi = Database::bins().begin();
Database::bin_list_t::iterator be = Database::bins().end();
while (bi != be) {
MainBin *bin = *bi;
bin->activate();
i = Database::stats().begin();
while (i != end) {
StatData *data = *i;
if (data->binned())
data->reset();
++i;
}
++bi;
}
// restore bin
MainBin::curBin() = orig;
resetQueue.process(); resetQueue.process();
} }

File diff suppressed because it is too large Load diff

View file

@ -156,14 +156,6 @@ MySqlRun::cleanup()
if (mysql.commit()) if (mysql.commit())
panic("could not commit transaction\n%s\n", mysql.error); panic("could not commit transaction\n%s\n", mysql.error);
mysql.query("DELETE bins "
"FROM bins "
"LEFT JOIN data ON bn_id=dt_bin "
"WHERE dt_bin IS NULL");
if (mysql.commit())
panic("could not commit transaction\n%s\n", mysql.error);
mysql.query("DELETE events" mysql.query("DELETE events"
"FROM events" "FROM events"
"LEFT JOIN runs ON ev_run=rn_id" "LEFT JOIN runs ON ev_run=rn_id"
@ -307,52 +299,6 @@ SetupStat::setup()
return statid; return statid;
} }
unsigned
SetupBin(const string &bin)
{
static map<string, int> binmap;
using namespace MySQL;
map<string,int>::const_iterator i = binmap.find(bin);
if (i != binmap.end())
return (*i).second;
Connection &mysql = MySqlDB.conn();
assert(mysql.connected());
uint16_t bin_id;
stringstream select;
stringstream insert;
ccprintf(select, "SELECT bn_id FROM bins WHERE bn_name=\"%s\"", bin);
mysql.query(select);
MySQL::Result result = mysql.store_result();
if (result) {
assert(result.num_fields() == 1);
MySQL::Row row = result.fetch_row();
if (row) {
to_number(row[0], bin_id);
goto exit;
}
}
ccprintf(insert, "INSERT INTO bins(bn_name) values(\"%s\")", bin);
mysql.query(insert);
if (mysql.error)
panic("could not get a bin\n%s\n", mysql.error);
bin_id = mysql.insert_id();
if (mysql.commit())
panic("could not commit transaction\n%s\n", mysql.error);
binmap.insert(make_pair(bin, bin_id));
exit:
return bin_id;
}
InsertData::InsertData() InsertData::InsertData()
{ {
query = new char[maxsize + 1]; query = new char[maxsize + 1];
@ -382,7 +328,7 @@ InsertData::flush()
size = 0; size = 0;
first = true; first = true;
strcpy(query, "INSERT INTO " strcpy(query, "INSERT INTO "
"data(dt_stat,dt_x,dt_y,dt_run,dt_tick,dt_bin,dt_data) " "data(dt_stat,dt_x,dt_y,dt_run,dt_tick,dt_data) "
"values"); "values");
size = strlen(query); size = strlen(query);
} }
@ -400,9 +346,9 @@ InsertData::insert()
first = false; first = false;
size += sprintf(query + size, "(%u,%d,%d,%u,%llu,%u,\"%f\")", size += sprintf(query + size, "(%u,%d,%d,%u,%llu,\"%f\")",
stat, x, y, MySqlDB.run(), (unsigned long long)tick, stat, x, y, MySqlDB.run(), (unsigned long long)tick,
bin, data); data);
} }
struct InsertSubData struct InsertSubData
@ -654,29 +600,6 @@ MySql::configure(const FormulaData &data)
InsertFormula(find(data.id), data.str()); InsertFormula(find(data.id), data.str());
} }
void
MySql::output(MainBin *bin)
{
MySQL::Connection &mysql = MySqlDB.conn();
if (bin) {
bin->activate();
newdata.bin = SetupBin(bin->name());
} else {
newdata.bin = 0;
}
Database::stat_list_t::const_iterator i, end = Database::stats().end();
for (i = Database::stats().begin(); i != end; ++i) {
StatData *stat = *i;
if (bin && stat->binned() || !bin && !stat->binned()) {
stat->visit(*this);
if (mysql.commit())
panic("could not commit transaction\n%s\n", mysql.error);
}
}
}
bool bool
MySql::valid() const MySql::valid() const
{ {
@ -695,11 +618,14 @@ MySql::output()
// store sample # // store sample #
newdata.tick = curTick; newdata.tick = curTick;
output(NULL); MySQL::Connection &mysql = MySqlDB.conn();
if (!bins().empty()) {
bin_list_t::iterator i, end = bins().end(); Database::stat_list_t::const_iterator i, end = Database::stats().end();
for (i = bins().begin(); i != end; ++i) for (i = Database::stats().begin(); i != end; ++i) {
output(*i); StatData *stat = *i;
stat->visit(*this);
if (mysql.commit())
panic("could not commit transaction\n%s\n", mysql.error);
} }
newdata.flush(); newdata.flush();

View file

@ -37,7 +37,6 @@
namespace MySQL { class Connection; } namespace MySQL { class Connection; }
namespace Stats { namespace Stats {
class MainBin;
class DistDataData; class DistDataData;
class MySqlRun; class MySqlRun;
bool MySqlConnected(); bool MySqlConnected();
@ -80,7 +79,6 @@ class InsertData
uint64_t tick; uint64_t tick;
double data; double data;
uint16_t stat; uint16_t stat;
uint16_t bin;
int16_t x; int16_t x;
int16_t y; int16_t y;
@ -131,7 +129,6 @@ class MySql : public Output
protected: protected:
// Output helper // Output helper
void output(MainBin *bin);
void output(const DistDataData &data); void output(const DistDataData &data);
void output(const ScalarData &data); void output(const ScalarData &data);
void output(const VectorData &data); void output(const VectorData &data);

View file

@ -29,7 +29,6 @@
#include "base/misc.hh" #include "base/misc.hh"
#include "base/trace.hh" #include "base/trace.hh"
#include "base/statistics.hh" #include "base/statistics.hh"
#include "base/stats/bin.hh"
#include "base/stats/statdb.hh" #include "base/stats/statdb.hh"
using namespace std; using namespace std;
@ -48,17 +47,6 @@ find(void *stat)
return (*i).second; return (*i).second;
} }
void
regBin(MainBin *bin, const std::string &_name)
{
bin_list_t::iterator i, end = bins().end();
for (i = bins().begin(); i != end; ++i)
if ((*i)->name() == _name)
panic("re-registering bin %s", _name);
bins().push_back(bin);
DPRINTF(Stats, "registering %s\n", _name);
}
void void
regStat(void *stat, StatData *data) regStat(void *stat, StatData *data)
{ {

View file

@ -38,31 +38,25 @@ class Python;
namespace Stats { namespace Stats {
class MainBin;
class StatData; class StatData;
namespace Database { namespace Database {
typedef std::map<void *, StatData *> stat_map_t; typedef std::map<void *, StatData *> stat_map_t;
typedef std::list<StatData *> stat_list_t; typedef std::list<StatData *> stat_list_t;
typedef std::list<MainBin *> bin_list_t;
// We wrap the database in a struct to make sure it is built in time. // We wrap the database in a struct to make sure it is built in time.
struct TheDatabase struct TheDatabase
{ {
stat_map_t map; stat_map_t map;
stat_list_t stats; stat_list_t stats;
bin_list_t bins;
}; };
TheDatabase &db(); TheDatabase &db();
inline stat_map_t &map() { return db().map; } inline stat_map_t &map() { return db().map; }
inline stat_list_t &stats() { return db().stats; } inline stat_list_t &stats() { return db().stats; }
inline bin_list_t &bins() { return db().bins; }
StatData *find(void *stat); StatData *find(void *stat);
void regBin(MainBin *bin, const std::string &name);
void regStat(void *stat, StatData *data); void regStat(void *stat, StatData *data);
void regPrint(void *stat); void regPrint(void *stat);

View file

@ -126,23 +126,9 @@ Text::output()
using namespace Database; using namespace Database;
ccprintf(*stream, "\n---------- Begin Simulation Statistics ----------\n"); ccprintf(*stream, "\n---------- Begin Simulation Statistics ----------\n");
if (bins().empty() || bins().size() == 1) { stat_list_t::const_iterator i, end = stats().end();
stat_list_t::const_iterator i, end = stats().end(); for (i = stats().begin(); i != end; ++i)
for (i = stats().begin(); i != end; ++i) (*i)->visit(*this);
(*i)->visit(*this);
} else {
ccprintf(*stream, "PRINTING BINNED STATS\n");
bin_list_t::iterator i, end = bins().end();
for (i = bins().begin(); i != end; ++i) {
MainBin *bin = *i;
bin->activate();
ccprintf(*stream,"---%s Bin------------\n", bin->name());
stat_list_t::const_iterator i, end = stats().end();
for (i = stats().begin(); i != end; ++i)
(*i)->visit(*this);
ccprintf(*stream, "---------------------------------\n");
}
}
ccprintf(*stream, "\n---------- End Simulation Statistics ----------\n"); ccprintf(*stream, "\n---------- End Simulation Statistics ----------\n");
stream->flush(); stream->flush();
} }

View file

@ -44,7 +44,6 @@ class Text : public Output
protected: protected:
bool noOutput(const StatData &data); bool noOutput(const StatData &data);
void binout();
public: public:
bool compat; bool compat;

View file

@ -244,7 +244,6 @@ sticky_opts.AddOptions(
BoolOption('USE_SSE2', BoolOption('USE_SSE2',
'Compile for SSE2 (-msse2) to get IEEE FP on x86 hosts', 'Compile for SSE2 (-msse2) to get IEEE FP on x86 hosts',
False), False),
BoolOption('STATS_BINNING', 'Bin statistics by CPU mode', have_mysql),
BoolOption('USE_MYSQL', 'Use MySQL for stats output', have_mysql), BoolOption('USE_MYSQL', 'Use MySQL for stats output', have_mysql),
BoolOption('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv), BoolOption('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
('CC', 'C compiler', os.environ.get('CC', env['CC'])), ('CC', 'C compiler', os.environ.get('CC', env['CC'])),
@ -267,8 +266,7 @@ nonsticky_opts.AddOptions(
# These options get exported to #defines in config/*.hh (see m5/SConscript). # These options get exported to #defines in config/*.hh (see m5/SConscript).
env.ExportOptions = ['FULL_SYSTEM', 'ALPHA_TLASER', 'USE_FENV', \ env.ExportOptions = ['FULL_SYSTEM', 'ALPHA_TLASER', 'USE_FENV', \
'USE_MYSQL', 'NO_FAST_ALLOC', 'SS_COMPATIBLE_FP', \ 'USE_MYSQL', 'NO_FAST_ALLOC', 'SS_COMPATIBLE_FP']
'STATS_BINNING']
# Define a handy 'no-op' action # Define a handy 'no-op' action
def no_action(target, source, env): def no_action(target, source, env):

View file

@ -781,11 +781,6 @@ SimpleCPU::tick()
fault = curStaticInst->execute(this, traceData); fault = curStaticInst->execute(this, traceData);
#if FULL_SYSTEM #if FULL_SYSTEM
if (system->kernelBinning->fnbin) {
assert(cpuXC->getKernelStats());
system->kernelBinning->execute(xcProxy, inst);
}
if (cpuXC->profile) { if (cpuXC->profile) {
bool usermode = bool usermode =
(cpuXC->readMiscReg(AlphaISA::IPR_DTB_CM) & 0x18) != 0; (cpuXC->readMiscReg(AlphaISA::IPR_DTB_CM) & 0x18) != 0;

View file

@ -42,13 +42,12 @@ using namespace Stats;
namespace Kernel { namespace Kernel {
const char *modestr[] = { "kernel", "user", "idle", "interrupt" }; const char *modestr[] = { "kernel", "user", "idle" };
Statistics::Statistics(System *system) Statistics::Statistics(System *system)
: idleProcess((Addr)-1), themode(kernel), lastModeTick(0), : idleProcess((Addr)-1), themode(kernel), lastModeTick(0),
iplLast(0), iplLastTick(0) iplLast(0), iplLastTick(0)
{ {
bin_int = system->params()->bin_int;
} }
void void
@ -183,7 +182,7 @@ Statistics::regStats(const string &_name)
void void
Statistics::setIdleProcess(Addr idlepcbb, ExecContext *xc) Statistics::setIdleProcess(Addr idlepcbb, ExecContext *xc)
{ {
assert(themode == kernel || themode == interrupt); assert(themode == kernel);
idleProcess = idlepcbb; idleProcess = idlepcbb;
themode = idle; themode = idle;
changeMode(themode, xc); changeMode(themode, xc);
@ -203,8 +202,6 @@ Statistics::changeMode(cpu_mode newmode, ExecContext *xc)
_modeGood[newmode]++; _modeGood[newmode]++;
_modeTicks[themode] += curTick - lastModeTick; _modeTicks[themode] += curTick - lastModeTick;
xc->getSystemPtr()->kernelBinning->changeMode(newmode);
lastModeTick = curTick; lastModeTick = curTick;
themode = newmode; themode = newmode;
} }
@ -230,13 +227,9 @@ Statistics::mode(cpu_mode newmode, ExecContext *xc)
{ {
Addr pcbb = xc->readMiscReg(AlphaISA::IPR_PALtemp23); Addr pcbb = xc->readMiscReg(AlphaISA::IPR_PALtemp23);
if ((newmode == kernel || newmode == interrupt) && if (newmode == kernel && pcbb == idleProcess)
pcbb == idleProcess)
newmode = idle; newmode = idle;
if (bin_int == false && newmode == interrupt)
newmode = kernel;
changeMode(newmode, xc); changeMode(newmode, xc);
} }
@ -265,11 +258,6 @@ Statistics::callpal(int code, ExecContext *xc)
_syscall[cvtnum]++; _syscall[cvtnum]++;
} }
} break; } break;
case PAL::swpctx:
if (xc->getSystemPtr()->kernelBinning)
xc->getSystemPtr()->kernelBinning->palSwapContext(xc);
break;
} }
} }

View file

@ -44,95 +44,17 @@ class System;
namespace Kernel { namespace Kernel {
enum cpu_mode { kernel, user, idle, interrupt, cpu_mode_num }; enum cpu_mode { kernel, user, idle, cpu_mode_num };
extern const char *modestr[]; extern const char *modestr[];
class Binning
{
private:
std::string myname;
System *system;
private:
// lisa's binning stuff
struct fnCall
{
Stats::MainBin *myBin;
std::string name;
};
struct SWContext
{
Counter calls;
std::stack<fnCall *> callStack;
};
std::map<const std::string, Stats::MainBin *> fnBins;
std::map<const Addr, SWContext *> swCtxMap;
std::multimap<const std::string, std::string> callerMap;
void populateMap(std::string caller, std::string callee);
std::vector<FnEvent *> fnEvents;
Stats::Scalar<> fnCalls;
Stats::MainBin *getBin(const std::string &name);
bool findCaller(std::string, std::string) const;
SWContext *findContext(Addr pcb);
bool addContext(Addr pcb, SWContext *ctx)
{
return (swCtxMap.insert(std::make_pair(pcb, ctx))).second;
}
void remContext(Addr pcb)
{
swCtxMap.erase(pcb);
}
void dumpState() const;
SWContext *swctx;
std::vector<std::string> binned_fns;
private:
Stats::MainBin *modeBin[cpu_mode_num];
public:
const bool bin;
const bool fnbin;
cpu_mode themode;
void palSwapContext(ExecContext *xc);
void execute(ExecContext *xc, StaticInstPtr inst);
void call(ExecContext *xc, Stats::MainBin *myBin);
void changeMode(cpu_mode mode);
public:
Binning(System *sys);
virtual ~Binning();
const std::string name() const { return myname; }
void regStats(const std::string &name);
public:
virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string &section);
};
class Statistics : public Serializable class Statistics : public Serializable
{ {
private:
friend class Binning;
private: private:
std::string myname; std::string myname;
Addr idleProcess; Addr idleProcess;
cpu_mode themode; cpu_mode themode;
Tick lastModeTick; Tick lastModeTick;
bool bin_int;
void changeMode(cpu_mode newmode, ExecContext *xc); void changeMode(cpu_mode newmode, ExecContext *xc);

View file

@ -48,22 +48,6 @@ SkipFuncEvent::process(ExecContext *xc)
} }
} }
FnEvent::FnEvent(PCEventQueue *q, const std::string &desc, Addr addr,
Stats::MainBin *bin)
: PCEvent(q, desc, addr), _name(desc), mybin(bin)
{
}
void
FnEvent::process(ExecContext *xc)
{
if (xc->misspeculating())
return;
xc->getSystemPtr()->kernelBinning->call(xc, mybin);
}
void void
IdleStartEvent::process(ExecContext *xc) IdleStartEvent::process(ExecContext *xc)
{ {
@ -72,19 +56,3 @@ IdleStartEvent::process(ExecContext *xc)
xc->readMiscReg(AlphaISA::IPR_PALtemp23), xc); xc->readMiscReg(AlphaISA::IPR_PALtemp23), xc);
remove(); remove();
} }
void
InterruptStartEvent::process(ExecContext *xc)
{
if (xc->getKernelStats())
xc->getKernelStats()->mode(Kernel::interrupt, xc);
}
void
InterruptEndEvent::process(ExecContext *xc)
{
// We go back to kernel, if we are user, inside the rti
// pal code we will get switched to user because of the ICM write
if (xc->getKernelStats())
xc->getKernelStats()->mode(Kernel::kernel, xc);
}

View file

@ -42,19 +42,6 @@ class SkipFuncEvent : public PCEvent
virtual void process(ExecContext *xc); virtual void process(ExecContext *xc);
}; };
class FnEvent : public PCEvent
{
public:
FnEvent(PCEventQueue *q, const std::string &desc, Addr addr,
Stats::MainBin *bin);
virtual void process(ExecContext *xc);
std::string myname() const { return _name; }
private:
std::string _name;
Stats::MainBin *mybin;
};
class IdleStartEvent : public PCEvent class IdleStartEvent : public PCEvent
{ {
public: public:
@ -64,23 +51,4 @@ class IdleStartEvent : public PCEvent
virtual void process(ExecContext *xc); virtual void process(ExecContext *xc);
}; };
class InterruptStartEvent : public PCEvent
{
public:
InterruptStartEvent(PCEventQueue *q, const std::string &desc, Addr addr)
: PCEvent(q, desc, addr)
{}
virtual void process(ExecContext *xc);
};
class InterruptEndEvent : public PCEvent
{
public:
InterruptEndEvent(PCEventQueue *q, const std::string &desc, Addr addr)
: PCEvent(q, desc, addr)
{}
virtual void process(ExecContext *xc);
};
#endif // __SYSTEM_EVENTS_HH__ #endif // __SYSTEM_EVENTS_HH__

View file

@ -7,8 +7,6 @@ class System(SimObject):
memctrl = Param.MemoryController(Parent.any, "memory controller") memctrl = Param.MemoryController(Parent.any, "memory controller")
physmem = Param.PhysicalMemory(Parent.any, "phsyical memory") physmem = Param.PhysicalMemory(Parent.any, "phsyical memory")
init_param = Param.UInt64(0, "numerical value to pass into simulator") init_param = Param.UInt64(0, "numerical value to pass into simulator")
bin = Param.Bool(False, "is this system binned")
binned_fns = VectorParam.String([], "functions broken down and binned")
kernel = Param.String("file that contains the kernel code") kernel = Param.String("file that contains the kernel code")
readfile = Param.String("", "file to read startup script from") readfile = Param.String("", "file to read startup script from")

View file

@ -65,16 +65,12 @@ System::System(Params *p)
// increment the number of running systms // increment the number of running systms
numSystemsRunning++; numSystemsRunning++;
kernelBinning = new Kernel::Binning(this);
} }
System::~System() System::~System()
{ {
delete kernelSymtab; delete kernelSymtab;
delete kernel; delete kernel;
delete kernelBinning;
} }
@ -140,17 +136,9 @@ System::replaceExecContext(ExecContext *xc, int id)
remoteGDB[id]->replaceExecContext(xc); remoteGDB[id]->replaceExecContext(xc);
} }
void
System::regStats()
{
kernelBinning->regStats(name() + ".kern");
}
void void
System::serialize(ostream &os) System::serialize(ostream &os)
{ {
kernelBinning->serialize(os);
kernelSymtab->serialize("kernel_symtab", os); kernelSymtab->serialize("kernel_symtab", os);
} }
@ -158,8 +146,6 @@ System::serialize(ostream &os)
void void
System::unserialize(Checkpoint *cp, const string &section) System::unserialize(Checkpoint *cp, const string &section)
{ {
kernelBinning->unserialize(cp, section);
kernelSymtab->unserialize("kernel_symtab", cp, section); kernelSymtab->unserialize("kernel_symtab", cp, section);
} }

View file

@ -46,7 +46,6 @@ class ObjectFile;
class PhysicalMemory; class PhysicalMemory;
class Platform; class Platform;
class RemoteGDB; class RemoteGDB;
namespace Kernel { class Binning; }
class System : public SimObject class System : public SimObject
{ {
@ -83,8 +82,6 @@ class System : public SimObject
/** Entry point in the kernel to start at */ /** Entry point in the kernel to start at */
Addr kernelEntry; Addr kernelEntry;
Kernel::Binning *kernelBinning;
protected: protected:
/** /**
@ -131,9 +128,6 @@ class System : public SimObject
MemoryController *memctrl; MemoryController *memctrl;
PhysicalMemory *physmem; PhysicalMemory *physmem;
uint64_t init_param; uint64_t init_param;
bool bin;
std::vector<std::string> binned_fns;
bool bin_int;
std::string kernel_path; std::string kernel_path;
std::string readfile; std::string readfile;
@ -172,7 +166,6 @@ class System : public SimObject
int registerExecContext(ExecContext *xc, int xcIndex); int registerExecContext(ExecContext *xc, int xcIndex);
void replaceExecContext(ExecContext *xc, int xcIndex); void replaceExecContext(ExecContext *xc, int xcIndex);
void regStats();
void serialize(std::ostream &os); void serialize(std::ostream &os);
void unserialize(Checkpoint *cp, const std::string &section); void unserialize(Checkpoint *cp, const std::string &section);

View file

@ -48,10 +48,10 @@ Tick ticksPerSecond = ULL(2000000000);
Scalar<> s1; Scalar<> s1;
Scalar<> s2; Scalar<> s2;
Average<> s3; Average<> s3;
Scalar<MainBin> s4; Scalar<> s4;
Vector<MainBin> s5; Vector<> s5;
Distribution<MainBin> s6; Distribution<> s6;
Vector<MainBin> s7; Vector<> s7;
AverageVector<> s8; AverageVector<> s8;
StandardDeviation<> s9; StandardDeviation<> s9;
AverageDeviation<> s10; AverageDeviation<> s10;
@ -70,9 +70,6 @@ Value f5;
Formula f6; Formula f6;
Formula f7; Formula f7;
MainBin bin1("bin1");
MainBin bin2("bin2");
ostream *outputStream = &cout; ostream *outputStream = &cout;
double double
@ -301,8 +298,6 @@ main(int argc, char *argv[])
check(); check();
reset(); reset();
bin1.activate();
s16[1][0] = 1; s16[1][0] = 1;
s16[0][1] = 3; s16[0][1] = 3;
s16[0][0] = 2; s16[0][0] = 2;
@ -493,7 +488,6 @@ main(int argc, char *argv[])
s6.sample(8); s6.sample(8);
s6.sample(9); s6.sample(9);
bin2.activate();
s6.sample(10); s6.sample(10);
s6.sample(10); s6.sample(10);
s6.sample(10); s6.sample(10);

View file

@ -135,10 +135,6 @@ class Database(object):
self.allRunIds = {} self.allRunIds = {}
self.allRunNames = {} self.allRunNames = {}
self.allBins = []
self.allBinIds = {}
self.allBinNames = {}
self.allFormulas = {} self.allFormulas = {}
self.stattop = {} self.stattop = {}
@ -147,7 +143,6 @@ class Database(object):
self.mode = 'sum'; self.mode = 'sum';
self.runs = None self.runs = None
self.bins = None
self.ticks = None self.ticks = None
self.method = 'sum' self.method = 'sum'
self._method = type(self).sum self._method = type(self).sum
@ -218,11 +213,6 @@ class Database(object):
self.allRunIds[run.run] = run self.allRunIds[run.run] = run
self.allRunNames[run.name] = run self.allRunNames[run.name] = run
self.query('select * from bins')
for id,name in self.cursor.fetchall():
self.allBinIds[int(id)] = name
self.allBinNames[name] = int(id)
self.query('select sd_stat,sd_x,sd_y,sd_name,sd_descr from subdata') self.query('select sd_stat,sd_x,sd_y,sd_name,sd_descr from subdata')
for result in self.cursor.fetchall(): for result in self.cursor.fetchall():
subdata = SubData(result) subdata = SubData(result)
@ -245,18 +235,6 @@ class Database(object):
self.allStatIds[stat.stat] = stat self.allStatIds[stat.stat] = stat
self.allStatNames[stat.name] = stat self.allStatNames[stat.name] = stat
# Name: listbins
# Desc: Prints all bins matching regex argument, if no argument
# is given all bins are returned
def listBins(self, regex='.*'):
print '%-50s %-10s' % ('bin name', 'id')
print '-' * 61
names = self.allBinNames.keys()
names.sort()
for name in names:
id = self.allBinNames[name]
print '%-50s %-10d' % (name, id)
# Name: listruns # Name: listruns
# Desc: Prints all runs matching a given user, if no argument # Desc: Prints all runs matching a given user, if no argument
# is given all runs are returned # is given all runs are returned
@ -360,39 +338,10 @@ class Database(object):
ret.append(stat) ret.append(stat)
return ret return ret
def getBin(self, bins):
if type(bins) is not list:
bins = [ bins ]
ret = []
for bin in bins:
if type(bin) is int:
ret.append(bin)
elif type(bin) is str:
ret.append(self.allBinNames[bin])
else:
for name,id in self.allBinNames.items():
if bin.match(name):
ret.append(id)
return ret
def getNotBin(self, bin):
map = {}
for bin in getBin(bin):
map[bin] = 1
ret = []
for bin in self.allBinIds.keys():
if not map.has_key(bin):
ret.append(bin)
return ret
######################################### #########################################
# get the data # get the data
# #
def inner(self, op, stat, bins, ticks, group=False): def query(self, op, stat, ticks, group=False):
sql = 'select ' sql = 'select '
sql += 'dt_stat as stat, ' sql += 'dt_stat as stat, '
sql += 'dt_run as run, ' sql += 'dt_run as run, '
@ -414,10 +363,6 @@ class Database(object):
val = ' or '.join([ 'dt_run=%d' % r for r in self.runs ]) val = ' or '.join([ 'dt_run=%d' % r for r in self.runs ])
sql += ' and (%s)' % val sql += ' and (%s)' % val
if bins != None and len(bins):
val = ' or '.join([ 'dt_bin=%d' % b for b in bins ])
sql += ' and (%s)' % val
if ticks != None and len(ticks): if ticks != None and len(ticks):
val = ' or '.join([ 'dt_tick=%d' % s for s in ticks ]) val = ' or '.join([ 'dt_tick=%d' % s for s in ticks ])
sql += ' and (%s)' % val sql += ' and (%s)' % val
@ -427,35 +372,21 @@ class Database(object):
sql += ',dt_tick' sql += ',dt_tick'
return sql return sql
def outer(self, op_out, op_in, stat, bins, ticks):
sql = self.inner(op_in, stat, bins, ticks, True)
sql = 'select stat,run,x,y,%s(data) from (%s) as tb ' % (op_out, sql)
sql += 'group by stat,run,x,y'
return sql
# Name: sum # Name: sum
# Desc: given a run, a stat and an array of samples and bins, # Desc: given a run, a stat and an array of samples, total the samples
# sum all the bins and then get the standard deviation of the def sum(self, *args, **kwargs):
# samples for non-binned runs. This will just return the average return self.query('sum', *args, **kwargs)
# of samples, however a bin array still must be passed
def sum(self, stat, bins, ticks):
return self.inner('sum', stat, bins, ticks)
# Name: avg # Name: avg
# Desc: given a run, a stat and an array of samples and bins, # Desc: given a run, a stat and an array of samples, average the samples
# sum all the bins and then average the samples for non-binned def avg(self, stat, ticks):
# runs this will just return the average of samples, however return self.query('avg', *args, **kwargs)
# a bin array still must be passed
def avg(self, stat, bins, ticks):
return self.outer('avg', 'sum', stat, bins, ticks)
# Name: stdev # Name: stdev
# Desc: given a run, a stat and an array of samples and bins, # Desc: given a run, a stat and an array of samples, get the standard
# sum all the bins and then get the standard deviation of the # deviation
# samples for non-binned runs. This will just return the average def stdev(self, stat, ticks):
# of samples, however a bin array still must be passed return self.query('stddev', *args, **kwargs)
def stdev(self, stat, bins, ticks):
return self.outer('stddev', 'sum', stat, bins, ticks)
def __setattr__(self, attr, value): def __setattr__(self, attr, value):
super(Database, self).__setattr__(attr, value) super(Database, self).__setattr__(attr, value)
@ -471,12 +402,10 @@ class Database(object):
else: else:
raise AttributeError, "can only set get to: sum | avg | stdev" raise AttributeError, "can only set get to: sum | avg | stdev"
def data(self, stat, bins=None, ticks=None): def data(self, stat, ticks=None):
if bins is None:
bins = self.bins
if ticks is None: if ticks is None:
ticks = self.ticks ticks = self.ticks
sql = self._method(self, stat, bins, ticks) sql = self._method(self, stat, ticks)
self.query(sql) self.query(sql)
runs = {} runs = {}

View file

@ -97,28 +97,6 @@ class MyDB(object):
UNIQUE (rn_name,rn_sample) UNIQUE (rn_name,rn_sample)
) TYPE=InnoDB''') ) TYPE=InnoDB''')
#
# We keep the bin names separate so that the data table doesn't get
# huge since bin names are frequently repeated.
#
# COLUMNS:
# 'id' is the unique bin identifer.
# 'name' is the string name for the bin.
#
# INDEXES:
# 'bin' is indexed to get the name of a bin when data is retrieved
# via the data table.
# 'name' is indexed to get the bin id for a named bin when you want
# to search the data table based on a specific bin.
#
self.query('''
CREATE TABLE bins(
bn_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
bn_name VARCHAR(255) NOT NULL,
PRIMARY KEY(bn_id),
UNIQUE (bn_name)
) TYPE=InnoDB''')
# #
# The stat table gives us all of the data for a particular stat. # The stat table gives us all of the data for a particular stat.
# #
@ -220,14 +198,12 @@ class MyDB(object):
# 'run' is the run that the data was generated from. Details up in # 'run' is the run that the data was generated from. Details up in
# the run table # the run table
# 'tick' is a timestamp generated by the simulator. # 'tick' is a timestamp generated by the simulator.
# 'bin' is the name of the bin that the data was generated in, if
# any.
# 'data' is the actual stat value. # 'data' is the actual stat value.
# #
# INDEXES: # INDEXES:
# 'stat' is indexed so that a user can find all of the data for a # 'stat' is indexed so that a user can find all of the data for a
# particular stat. It is not unique, because that specific stat # particular stat. It is not unique, because that specific stat
# can be found in many runs, bins, and samples, in addition to # can be found in many runs and samples, in addition to
# having entries for the mulidimensional cases. # having entries for the mulidimensional cases.
# 'run' is indexed to allow a user to remove all of the data for a # 'run' is indexed to allow a user to remove all of the data for a
# particular execution run. It can also be used to allow the # particular execution run. It can also be used to allow the
@ -240,11 +216,10 @@ class MyDB(object):
dt_y SMALLINT NOT NULL, dt_y SMALLINT NOT NULL,
dt_run SMALLINT UNSIGNED NOT NULL, dt_run SMALLINT UNSIGNED NOT NULL,
dt_tick BIGINT UNSIGNED NOT NULL, dt_tick BIGINT UNSIGNED NOT NULL,
dt_bin SMALLINT UNSIGNED NOT NULL,
dt_data DOUBLE NOT NULL, dt_data DOUBLE NOT NULL,
INDEX (dt_stat), INDEX (dt_stat),
INDEX (dt_run), INDEX (dt_run),
UNIQUE (dt_stat,dt_x,dt_y,dt_run,dt_tick,dt_bin) UNIQUE (dt_stat,dt_x,dt_y,dt_run,dt_tick)
) TYPE=InnoDB;''') ) TYPE=InnoDB;''')
# #
@ -395,12 +370,6 @@ class MyDB(object):
LEFT JOIN data ON sd_stat=dt_stat LEFT JOIN data ON sd_stat=dt_stat
WHERE dt_stat IS NULL''') WHERE dt_stat IS NULL''')
self.query('''
DELETE bins
FROM bins
LEFT JOIN data ON bn_id=dt_bin
WHERE dt_bin IS NULL''')
self.query(''' self.query('''
DELETE events DELETE events
FROM events FROM events

View file

@ -174,7 +174,7 @@ def WrapValue(value):
class Statistic(object): class Statistic(object):
def __getattr__(self, attr): def __getattr__(self, attr):
if attr in ('data', 'x', 'y'): if attr in ('data', 'x', 'y'):
result = self.source.data(self, self.bins, self.ticks) result = self.source.data(self, self.ticks)
self.data = result.data self.data = result.data
self.x = result.x self.x = result.x
self.y = result.y self.y = result.y
@ -183,7 +183,7 @@ class Statistic(object):
def __setattr__(self, attr, value): def __setattr__(self, attr, value):
if attr == 'stat': if attr == 'stat':
raise AttributeError, '%s is read only' % stat raise AttributeError, '%s is read only' % stat
if attr in ('source', 'bins', 'ticks'): if attr in ('source', 'ticks'):
if getattr(self, attr) != value: if getattr(self, attr) != value:
if hasattr(self, 'data'): if hasattr(self, 'data'):
delattr(self, 'data') delattr(self, 'data')
@ -759,7 +759,6 @@ def NewStat(source, data):
stat = Formula() stat = Formula()
stat.__dict__['source'] = source stat.__dict__['source'] = source
stat.__dict__['bins'] = None
stat.__dict__['ticks'] = None stat.__dict__['ticks'] = None
stat.__dict__.update(data.__dict__) stat.__dict__.update(data.__dict__)

View file

@ -29,24 +29,16 @@
from chart import ChartOptions from chart import ChartOptions
class StatOutput(ChartOptions): class StatOutput(ChartOptions):
def __init__(self, jobfile, info, stat=None, binstats=None): def __init__(self, jobfile, info, stat=None):
super(StatOutput, self).__init__() super(StatOutput, self).__init__()
self.jobfile = jobfile self.jobfile = jobfile
self.stat = stat self.stat = stat
self.binstats = None
self.invert = False self.invert = False
self.info = info self.info = info
def printdata(self, name, bin = None, printmode = 'G'): def display(self, name, printmode = 'G'):
import info import info
if bin:
print '%s %s stats' % (name, bin)
if self.binstats:
for stat in self.binstats:
stat.bins = bin
if printmode == 'G': if printmode == 'G':
valformat = '%g' valformat = '%g'
elif printmode != 'F' and value > 1e6: elif printmode != 'F' and value > 1e6:
@ -70,16 +62,6 @@ class StatOutput(ChartOptions):
valstring = ', '.join([ valformat % val for val in value ]) valstring = ', '.join([ valformat % val for val in value ])
print '%-50s %s' % (job.name + ':', valstring) print '%-50s %s' % (job.name + ':', valstring)
def display(self, name, binned = False, printmode = 'G'):
if binned and self.binstats:
self.printdata(name, 'kernel', printmode)
self.printdata(name, 'idle', printmode)
self.printdata(name, 'user', printmode)
self.printdata(name, 'interrupt', printmode)
print '%s total stats' % name
self.printdata(name, printmode=printmode)
def graph(self, name, graphdir, proxy=None): def graph(self, name, graphdir, proxy=None):
from os.path import expanduser, isdir, join as joinpath from os.path import expanduser, isdir, join as joinpath
from barchart import BarChart from barchart import BarChart

View file

@ -37,7 +37,6 @@ Usage: %s [-E] [-F] [ -G <get> ] [-d <db> ] [-g <graphdir> ] [-h <host>] [-p]
commands extra parameters description commands extra parameters description
----------- ------------------ --------------------------------------- ----------- ------------------ ---------------------------------------
bins [regex] List bins (only matching regex)
formula <formula> Evaluated formula specified formula <formula> Evaluated formula specified
formulas [regex] List formulas (only matching regex) formulas [regex] List formulas (only matching regex)
runs none List all runs in database runs none List all runs in database
@ -140,16 +139,6 @@ def commands(options, command, args):
return return
if command == 'bins':
if len(args) == 0:
source.listBins()
elif len(args) == 1:
source.listBins(args[0])
else:
raise CommandException
return
if command == 'formulas': if command == 'formulas':
if len(args) == 0: if len(args) == 0:
source.listFormulas() source.listFormulas()
@ -279,7 +268,7 @@ def commands(options, command, args):
if options.graph: if options.graph:
output.graph(stat.name, options.graphdir) output.graph(stat.name, options.graphdir)
else: else:
output.display(stat.name, options.binned, options.printmode) output.display(stat.name, options.printmode)
return return
@ -299,22 +288,10 @@ def commands(options, command, args):
if options.graph: if options.graph:
output.graph(command, options.graphdir, proxy) output.graph(command, options.graphdir, proxy)
else: else:
output.display(command, options.binned, options.printmode) output.display(command, options.printmode)
if command == 'usertime':
import copy
user = copy.copy(system.run0.numCycles)
user.bins = 'user'
output.stat = user / system.run0.numCycles
output.ylabel = 'User Fraction'
display()
return
if command == 'ticks': if command == 'ticks':
output.stat = system.run0.numCycles output.stat = system.run0.numCycles
output.binstats = [ system.run0.numCycles ]
display() display()
return return
@ -401,7 +378,6 @@ def commands(options, command, args):
if command == 'mpkb': if command == 'mpkb':
output.stat = misses / (bytes / 1024) output.stat = misses / (bytes / 1024)
output.binstats = [ misses ]
output.ylabel = 'Misses / KB' output.ylabel = 'Misses / KB'
display() display()
return return
@ -409,7 +385,6 @@ def commands(options, command, args):
if command == 'ipkb': if command == 'ipkb':
interrupts = system.run0.kern.faults[4] interrupts = system.run0.kern.faults[4]
output.stat = interrupts / kbytes output.stat = interrupts / kbytes
output.binstats = [ interrupts ]
output.ylabel = 'Interrupts / KB' output.ylabel = 'Interrupts / KB'
display() display()
return return
@ -446,7 +421,6 @@ if __name__ == '__main__':
options.runs = None options.runs = None
options.system = 'client' options.system = 'client'
options.method = None options.method = None
options.binned = False
options.graph = False options.graph = False
options.ticks = False options.ticks = False
options.printmode = 'G' options.printmode = 'G'
@ -454,10 +428,8 @@ if __name__ == '__main__':
options.jobfile = None options.jobfile = None
options.all = False options.all = False
opts, args = getopts(sys.argv[1:], '-BEFJad:g:h:j:m:pr:s:u:T:') opts, args = getopts(sys.argv[1:], '-EFJad:g:h:j:m:pr:s:u:T:')
for o,a in opts: for o,a in opts:
if o == '-B':
options.binned = True
if o == '-E': if o == '-E':
options.printmode = 'E' options.printmode = 'E'
if o == '-F': if o == '-F':