From 30deac90507841ea0ad46f3c49c4026f47356b80 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sun, 6 Jun 2010 01:22:14 -0400 Subject: stats: fix stats diff script Previously the return value ignored missing/added stats, making the regressions not tell you when you needed to update the reference stats because of these changes. Also stop filtering distributions when reporting these; not sure why we did that in the first place. Also get rid of obsolete hacks for the "fetch-loss" stats that have been gone for a long time. --- tests/diff-out | 69 +++++++++++++++------------------------------------------- 1 file changed, 17 insertions(+), 52 deletions(-) (limited to 'tests') diff --git a/tests/diff-out b/tests/diff-out index 1308eccfb..cdff94e09 100755 --- a/tests/diff-out +++ b/tests/diff-out @@ -36,7 +36,6 @@ use Getopt::Std; # # -t thresh sets threshold for ignoring differences (in %) # -p sorts differences by % chg (default is alphabetic) -# -f ignores fetch-loss statistics # -d ignores all distributions # @@ -46,7 +45,6 @@ if ($#ARGV < 1) { print "\nError: need two file arguments ( ).\n"; print " Options: -d = Ignore distributions\n"; - print " -f = Ignore fetch-loss stats\n"; print " -p = Sort errors by percentage\n"; print " -h = Diff header info separately from stats\n"; print " -n = Print top errors (default 20)\n"; @@ -130,7 +128,6 @@ sub parse_file while (<$stathandle>) { next if /^\s*$/; # skip blank lines - next if /^\*\*Ignore/; # temporary, to make totaling scripts easy for ISCA 03 last if /End Simulation Statistics/; s/ *#.*//; # strip comments @@ -140,39 +137,20 @@ sub parse_file $value = $1; } elsif ($in_dist) { - if ($in_dist =~ /^fetch_loss_counters/) { - if (/^fetch_loss_counters_\d+\.end/) { - # end line of distribution: clear $in_dist flag - $in_dist = undef; - next; - } - else { - next if $opt_f; - - ($stat, $value) = /^(\S+)\s+(.*)/; - } + if (/(.*)\.end_dist/) { + # end line of distribution: clear $in_dist flag + $in_dist = undef; + next; } - else { - if (/(.*)\.end_dist/) { - # end line of distribution: clear $in_dist flag - $in_dist = undef; - next; - } - if ($opt_d) { - next; # bail out if we are ignoring dists... - } - elsif (/(.*)\.(min|max)_value/) { - # treat these like normal stats - ($stat, $value) = /^(\S+)\s+(.*)/; - } - else { - # this is ugly because labels in the distribution - # buckets don't start in column 0 and may include - # embedded spaces - ($stat, $value) = - /^\s*(\S+(?:.*\S)?)\s+(\d+)\s+\d+\.\d+%/; - $stat = $in_dist . '::' . $stat; - } + if ($opt_d) { + next; # bail out if we are ignoring dists... + } elsif (/(.*)\.(min|max)_value/) { + # treat these like normal stats + ($stat, $value) = /^(\S+)\s+(.*)/; + } else { + ($stat, $value) = + /^(\S+(?:.*\S)?)\s+(\d+)\s+\d+\.\d+%/; + $stat = $in_dist . '::' . $stat; } } else { @@ -183,12 +161,6 @@ sub parse_file $stat = $1; $value = 0; } - elsif (/^(fetch_loss_counters_\d+)\.start/) { - # treat fetch loss counters like distribution, sort of - $in_dist = $1; - $stat = $1; - $value = 0; - } else { ($stat, $value) = /^(\S+)\s+(.*)/; } @@ -354,11 +326,8 @@ foreach $err (@errs) } # -# Report missing stats, but first filter out distribution buckets: -# these are mostly noise - -@missing_stats = grep { !/::(\d+|overflows)?$/ } @missing_stats; - +# Report missing stats +# # get count $missing_stats = scalar(@missing_stats); @@ -379,10 +348,6 @@ if ($missing_stats) @added_stats = keys %$newhash; -# first filter out distribution buckets: mostly noise - -@added_stats = grep { !/::(\d+|overflows)?$/ } @added_stats; - # get count $added_stats = scalar(@added_stats); @@ -398,8 +363,8 @@ if ($added_stats) } cleanup(); -# Exit code is 0 if some stats found & no stats error, 1 otherwise -$status = ($#key_stats >= 0 && $max_err_mag == 0.0) ? 0 : 1; +# Exit code is 0 if all stats are found (with no extras) & no stats error, 1 otherwise +$status = ($missing_stats == 0 && $added_stats == 0 && $max_err_mag == 0.0) ? 0 : 1; exit $status; sub cleanup -- cgit v1.2.3