summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2005-01-18 13:35:04 -0500
committerAli Saidi <saidi@eecs.umich.edu>2005-01-18 13:35:04 -0500
commitcae9210dce7d325c9612a7484d749ebb1666401c (patch)
treeceae61eb92bd5ea4068d6d50e820dca3a6f28a28
parent783f701247a1013a32d7caab324660c211215a11 (diff)
parentcbbbc9c57d3eed46cfa6c2c3b69a6acf02a62e1a (diff)
downloadgem5-cae9210dce7d325c9612a7484d749ebb1666401c.tar.xz
Merge zizzer:/bk/m5 into zeep.eecs.umich.edu:/z/saidi/work/m5
--HG-- extra : convert_revision : a799d615ab5a3d3447b24b1b1ce24cffcde361cd
-rwxr-xr-xutil/stats/stats.py37
1 files changed, 28 insertions, 9 deletions
diff --git a/util/stats/stats.py b/util/stats/stats.py
index 7f3761a92..62819c397 100755
--- a/util/stats/stats.py
+++ b/util/stats/stats.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
from __future__ import division
-import re, sys
+import re, sys, math
def usage():
print '''\
@@ -255,28 +255,47 @@ def commands(options, command, args):
#loop through all the stats selected
for stat in stats:
- avg = float(stat)
+ print "%s:" % stat.name
+ print "%-30s %12s %12s %4s %5s %5s %5s" % \
+ ("run name", "average", "stdev", ">10%", ">1SDV", ">2SDV", "SAMP")
+ print "%-30s %12s %12s %4s %5s %5s %5s" % \
+ ("------------------------------", "------------",
+ "------------", "----", "-----", "-----", "-----")
#loop through all the selected runs
for run in runs:
info.display_run = run.run;
- #print run.name
- #print avg
runTicks = info.source.retTicks([ run ])
#throw away the first one, it's 0
runTicks.pop(0)
+ stat.ticks = runTicks
+ avg = float(stat)
+ stdev = 0
+ numoutsideavg = 0
+ numoutside1std = 0
+ numoutside2std = 0
#loop through all the various ticks for each run
for tick in runTicks:
stat.ticks = str(tick)
val = float(stat)
if (val < (avg * .9)) or (val > (avg * 1.1)):
- print '%s:%s is %f, which is more than 10%% of the'\
- 'mean %f' % (run.name, stat.name, stat, avg)
-
-
-
+ numoutsideavg += 1
+ stdev += pow((val-avg),2)
+ stdev = math.sqrt(stdev / len(runTicks))
+ for tick in runTicks:
+ stat.ticks = str(tick)
+ val = float(stat)
+ if (val < (avg - stdev)) or (val > (avg + stdev)):
+ numoutside1std += 1
+ if (val < (avg - (2*stdev))) or (val > (avg + (2*stdev))):
+ numoutside2std += 1
+
+ print "%-30s %12s %12s %4s %5s %5s %5s" % \
+ (run.name, "%.1f" % avg, "%.1f" % stdev,
+ "%d" % numoutsideavg, "%d" % numoutside1std,
+ "%d" % numoutside2std, "%d" % len(runTicks))
return