diff options
author | Thomas Grass <Thomas.Grass@ARM.com> | 2011-08-19 15:08:05 -0500 |
---|---|---|
committer | Thomas Grass <Thomas.Grass@ARM.com> | 2011-08-19 15:08:05 -0500 |
commit | 3f1ae35c6db3321b5f7e0ef4a90e2610a468692b (patch) | |
tree | 0ff0c7143bf8331182f254930e7a944575acc0ca /src/unittest | |
parent | 676a530b776ca3468a4c318bbe5bbf8b473bc5f2 (diff) | |
download | gem5-3f1ae35c6db3321b5f7e0ef4a90e2610a468692b.tar.xz |
Stats: Add a sparse histogram stat object.
Diffstat (limited to 'src/unittest')
-rw-r--r-- | src/unittest/stattest.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/unittest/stattest.cc b/src/unittest/stattest.cc index c5e39888d..ccce2173b 100644 --- a/src/unittest/stattest.cc +++ b/src/unittest/stattest.cc @@ -92,6 +92,7 @@ struct StatTest Histogram h10; Histogram h11; Histogram h12; + SparseHistogram sh1; Formula f1; Formula f2; @@ -316,6 +317,12 @@ StatTest::init() .desc("this is histogram 12") ; + sh1 + .init(0) + .name("SparseHistogram1") + .desc("this is sparse histogram 1") + ; + f1 .name("Formula1") .desc("this is formula 1") @@ -623,4 +630,8 @@ StatTest::run() h11.sample(i); h12.sample(i); } + + for (int i = 0; i < 1000; i++) { + sh1.sample(random() % 10000); + } } |