ruby: profiler: statically allocate stats variable
authorNilay Vaish <nilay@cs.wisc.edu>
Sun, 2 Mar 2014 05:35:21 +0000 (23:35 -0600)
committerNilay Vaish <nilay@cs.wisc.edu>
Sun, 2 Mar 2014 05:35:21 +0000 (23:35 -0600)
Couple of users observed segmentation fault when the simulator tries to
register the statistical variable m_IncompleteTimes.  It seems that there
is some problem with the initialization of these variables when allocated
in the constructor.

src/mem/ruby/profiler/Profiler.cc
src/mem/ruby/profiler/Profiler.hh

index 6f7da1eda889803e86a68efe67e8b352b7d135fc..f078ef2c1a461d0e3fe4e59877278130f352d29f 100644 (file)
@@ -62,7 +62,6 @@ using namespace std;
 using m5::stl_helpers::operator<<;
 
 Profiler::Profiler(const RubySystemParams *p)
-    : m_IncompleteTimes(MachineType_NUM)
 {
     m_hot_lines = p->hot_lines;
     m_all_instructions = p->all_instructions;
index 247c705b01a4c1ac1570313e2948ad3019de7f9d..2a0ff71b21b998aea5d9b67055231fdfaa37b7ea 100644 (file)
@@ -125,7 +125,7 @@ class Profiler
     std::vector<Stats::Histogram *> m_InitialToForwardDelayHist;
     std::vector<Stats::Histogram *> m_ForwardToFirstResponseDelayHist;
     std::vector<Stats::Histogram *> m_FirstResponseToCompletionDelayHist;
-    std::vector<Stats::Scalar> m_IncompleteTimes;
+    Stats::Scalar m_IncompleteTimes[MachineType_NUM];
 
     //added by SS
     bool m_hot_lines;