From f3090e5b704a2b7a02a736ec8601cd961fe3a865 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 23 Feb 2009 12:22:19 -0800 Subject: stats: reorganize how parameters are stored and accessed. --- src/base/statistics.cc | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/base/statistics.cc') diff --git a/src/base/statistics.cc b/src/base/statistics.cc index 63741d4c6..032cbf689 100644 --- a/src/base/statistics.cc +++ b/src/base/statistics.cc @@ -36,6 +36,7 @@ #include "base/callback.hh" #include "base/cprintf.hh" +#include "base/debug.hh" #include "base/hostinfo.hh" #include "base/misc.hh" #include "base/statistics.hh" @@ -80,6 +81,12 @@ InfoAccess::setInfo(Info *info) assert(statsMap().find(this) != statsMap().end()); } +void +InfoAccess::setParams(const StorageParams *params) +{ + info()->storageParams = params; +} + void InfoAccess::setInit() { @@ -102,11 +109,20 @@ InfoAccess::info() const return (*i).second; } +StorageParams::~StorageParams() +{ +} + +int Info::id_count = 0; + +int debug_break_id = -1; + Info::Info() - : flags(none), precision(-1), prereq(0) + : flags(none), precision(-1), prereq(0), storageParams(NULL) { - static int count = 0; - id = count++; + id = id_count++; + if (debug_break_id >= 0 and debug_break_id == id) + debug_break(); } Info::~Info() @@ -249,7 +265,7 @@ check() Info *info = *i; assert(info); if (!info->check() || !info->baseCheck()) - panic("stat check failed for %s\n", info->name); + panic("stat check failed for '%s' %d\n", info->name, info->id); } off_t j = 0; -- cgit v1.2.3