Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a --verbose option to analyze, and support it in bench
  • Loading branch information
Geoffrey Broadwell committed Oct 29, 2014
1 parent 9c8ef17 commit 7ded32e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
33 changes: 27 additions & 6 deletions analyze
Expand Up @@ -59,7 +59,7 @@ sub MAIN {
sub process_options_and_arguments {
my %opt;
GetOptions(\%opt, 'help|h|?!', 'man!', 'format=s', 'style=s', 'outfile=s',
'min-time|min_time|mintime=f',
'verbose!', 'min-time|min_time|mintime=f',
'ignore-startup|ignore_startup|ignorestartup!',
'ignore-compile|ignore_compile|ignorecompile!',
'skip-incomplete|skip_incomplete|skipincomplete!',
Expand Down Expand Up @@ -509,10 +509,25 @@ sub summarize_results_text {
my $len = $longest_comp + 2;
for my $comp (@comps) {
my $key = $comp->{key} || $comp->{name};
my $diag = $test->{diagnoses}{$key}{sorted};
my @icons = map { $DIAGNOSIS_ICON{$_}
// $DIAGNOSIS_ICON{unknown} } @$diag;
$output .= sprintf "$spacer%${len}s", join '' => @icons;
my $diags = $test->{diagnoses}{$key};
if ($opt->{verbose}) {
my $by_scale = $diags->{by_scale};
my @scales = sort { $a <=> $b } keys %$by_scale;
my @out;
for my $scale (@scales) {
my $diag = $by_scale->{$scale};
my @icons = map { $DIAGNOSIS_ICON{$_}
// $DIAGNOSIS_ICON{unknown} } @$diag;
push @out, join '' => @icons;
}
$output .= sprintf "$spacer%${len}s", join ',' => @out;
}
else {
my $diag = $diags->{sorted};
my @icons = map { $DIAGNOSIS_ICON{$_}
// $DIAGNOSIS_ICON{unknown} } @$diag;
$output .= sprintf "$spacer%${len}s", join '' => @icons;
}
}
$output .= "\n";
}
Expand Down Expand Up @@ -1437,7 +1452,7 @@ analyze -- Analyze benchmark data produced by timeall
[--style=0|1|auto] [--outfile=path/to/file.ext]
[--min-time=0.01]
[--ignore-startup] [--ignore-compile] [--skip-incomplete]
[--show-rates] [--show-failures]
[--show-rates] [--show-failures] [--verbose]
[--compare] [--history]
path/to/timing_file.json [path/to/second_timing_file.json ...]
Expand Down Expand Up @@ -1537,6 +1552,12 @@ to turn this off.
Show information about test failures. Used especially when performing
stress testing, to show the failure modes exhibited by a failing compiler.
=item --verbose
Show more detailed information about test failures, especially useful when
a compiler has mixed failure modes on a single test (e.g. sometimes giving
wrong results, sometimes dying with an error, sometimes segfaulting).
=item --history
Format the data in a way that emphasizes the collective history of a
Expand Down
4 changes: 2 additions & 2 deletions bench
Expand Up @@ -429,12 +429,12 @@ multi MAIN ('stress', *@components, :$variants?, :$tests?,
multi MAIN ('diagnose', *@timings, :$format?, :$style?, :$outfile?,
Numeric :$min-time,
Bool :$ignore-startup = True, Bool :$ignore-compile = True,
Bool :$skip-incomplete = True) {
Bool :$skip-incomplete = True, Bool :$verbose?) {
needs-timings('diagnose failures');

my @options = as-options(:show-failures, :!show-rates, :$min-time,
:$ignore-startup, :$ignore-compile,
:$skip-incomplete,
:$skip-incomplete, :$verbose,
:$format, :$style, :$outfile);

my @timings-files;
Expand Down

0 comments on commit 7ded32e

Please sign in to comment.