diff options
Diffstat (limited to 'cpu/profile.cc')
-rw-r--r-- | cpu/profile.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cpu/profile.cc b/cpu/profile.cc index f4aa81c2b..1a38792a0 100644 --- a/cpu/profile.cc +++ b/cpu/profile.cc @@ -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 * |