Stats updates.

dev/ide_disk.cc:
dev/ide_disk.hh:
    Add in stats.
sim/stat_control.cc:
sim/stat_control.hh:
    Allow setup event to be called with a specific queue.

--HG--
extra : convert_revision : 9310b132b70f967a198cb2e646433f3a5332671e
This commit is contained in:
Kevin Lim
2006-08-24 17:51:35 -04:00
parent f9f2f8fbd0
commit 9ef831eeef
4 changed files with 48 additions and 6 deletions

View File

@@ -158,13 +158,13 @@ class StatEvent : public Event
Tick repeat;
public:
StatEvent(int _flags, Tick _when, Tick _repeat);
StatEvent(EventQueue *queue, int _flags, Tick _when, Tick _repeat);
virtual void process();
virtual const char *description();
};
StatEvent::StatEvent(int _flags, Tick _when, Tick _repeat)
: Event(&mainEventQueue, Stat_Event_Pri),
StatEvent::StatEvent(EventQueue *queue, int _flags, Tick _when, Tick _repeat)
: Event(queue, Stat_Event_Pri),
flags(_flags), repeat(_repeat)
{
setFlags(AutoDelete);
@@ -214,9 +214,12 @@ DumpNow()
}
void
SetupEvent(int flags, Tick when, Tick repeat)
SetupEvent(int flags, Tick when, Tick repeat, EventQueue *queue)
{
new StatEvent(flags, when, repeat);
if (queue == NULL)
queue = &mainEventQueue;
new StatEvent(queue, flags, when, repeat);
}
/* namespace Stats */ }

View File

@@ -32,6 +32,8 @@
#include <fstream>
#include <list>
class EventQueue;
namespace Stats {
enum {
@@ -43,7 +45,7 @@ class Output;
extern std::list<Output *> OutputList;
void DumpNow();
void SetupEvent(int flags, Tick when, Tick repeat = 0);
void SetupEvent(int flags, Tick when, Tick repeat = 0, EventQueue *queue = NULL);
void InitSimStats();