clear the function profile on a stats reset
cpu/profile.hh:
Add a placeholder for a reset callback
--HG--
extra : convert_revision : 7fa13e5d04daf1cf93eb35c8fdaf67a40ce3ef73
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/bitfield.hh"
|
||||
#include "base/callback.hh"
|
||||
#include "base/statistics.hh"
|
||||
#include "base/trace.hh"
|
||||
#include "cpu/base.hh"
|
||||
#include "cpu/exec_context.hh"
|
||||
@@ -80,12 +82,16 @@ ProfileNode::clear()
|
||||
}
|
||||
|
||||
FunctionProfile::FunctionProfile(const SymbolTable *_symtab)
|
||||
: symtab(_symtab)
|
||||
: reset(0), symtab(_symtab)
|
||||
{
|
||||
reset = new MakeCallback<FunctionProfile, &FunctionProfile::clear>(this);
|
||||
Stats::registerResetCallback(reset);
|
||||
}
|
||||
|
||||
FunctionProfile::~FunctionProfile()
|
||||
{
|
||||
if (reset)
|
||||
delete reset;
|
||||
}
|
||||
|
||||
ProfileNode *
|
||||
|
||||
@@ -54,9 +54,11 @@ class ProfileNode
|
||||
void clear();
|
||||
};
|
||||
|
||||
class Callback;
|
||||
class FunctionProfile
|
||||
{
|
||||
private:
|
||||
Callback *reset;
|
||||
const SymbolTable *symtab;
|
||||
ProfileNode top;
|
||||
std::map<Addr, Counter> pc_count;
|
||||
|
||||
Reference in New Issue
Block a user