From 51aa7e4a0392d5e8f98bd7a4d09f4026dd21bd0a Mon Sep 17 00:00:00 2001 From: Prakash Ramrakhyani Date: Mon, 9 Jan 2012 18:08:20 -0600 Subject: sim: Enable sampling of run-time for code-sections marked using pseudo insts. This patch adds a mechanism to collect run time samples for specific portions of a benchmark, using work_begin and work_end pseudo instructions.It also enhances the histogram stat to report geometric mean. --- src/base/stats/info.hh | 1 + src/base/stats/text.cc | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'src/base/stats') diff --git a/src/base/stats/info.hh b/src/base/stats/info.hh index 2c5b44a38..98e811747 100644 --- a/src/base/stats/info.hh +++ b/src/base/stats/info.hh @@ -183,6 +183,7 @@ struct DistData VCounter cvec; Counter sum; Counter squares; + Counter logs; Counter samples; }; diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc index 683ba7fe4..4cf98ca9e 100644 --- a/src/base/stats/text.cc +++ b/src/base/stats/text.cc @@ -367,6 +367,12 @@ DistPrint::operator()(ostream &stream) const print.value = data.samples ? data.sum / data.samples : NAN; print(stream); + if (data.type == Hist) { + print.name = base + "gmean"; + print.value = data.samples ? exp(data.logs / data.samples) : NAN; + print(stream); + } + Result stdev = NAN; if (data.samples) stdev = sqrt((data.samples * data.squares - data.sum * data.sum) / -- cgit v1.2.3