summaryrefslogtreecommitdiff
path: root/src/mem/ruby/common/Histogram.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/common/Histogram.cc')
-rw-r--r--src/mem/ruby/common/Histogram.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mem/ruby/common/Histogram.cc b/src/mem/ruby/common/Histogram.cc
index 0558e5198..e377bc253 100644
--- a/src/mem/ruby/common/Histogram.cc
+++ b/src/mem/ruby/common/Histogram.cc
@@ -124,7 +124,12 @@ Histogram::add(Histogram& hist)
uint32_t t_bins = m_data.size();
if (hist.getBins() != t_bins) {
- fatal("Histograms with different number of bins cannot be combined!");
+ if (m_count == 0) {
+ m_data.resize(hist.getBins());
+ } else {
+ fatal("Histograms with different number of bins "
+ "cannot be combined!");
+ }
}
m_max = max(m_max, hist.getMax());