56 lines
1.6 KiB
Perl
56 lines
1.6 KiB
Perl
package ResultsDataWriteGroups;
|
|
|
|
use strict;
|
|
use warnings;
|
|
use diagnostics;
|
|
|
|
use FindBin;
|
|
use lib "$FindBin::Bin/../Modules";
|
|
use Filters;
|
|
|
|
use feature 'say';
|
|
|
|
sub query {
|
|
my ( $experiment, $experiment_dir, @filter_config_names ) = @_;
|
|
|
|
my $extra =
|
|
Filters::build_filter_clause( $experiment_dir, @filter_config_names );
|
|
|
|
# This query asks the same question as ResultsData.pm: How much faultspace
|
|
# area ended up in each possible outcome?
|
|
#
|
|
# The difference is how the write equivalence classes are treated.
|
|
# BasicPruner's write-group INSERT maps every 'W' trace entry to the single
|
|
# known_outcome=1 write pilot, but fspgroup has PRIMARY KEY (pilot_id), so
|
|
# only the first row lands in the table.
|
|
# This query fixes that.
|
|
my $querystring = "SELECT
|
|
benchmark, resulttype, SUM(g.time2 - g.time1 + 1) AS faults
|
|
FROM variant v
|
|
JOIN trace g ON v.id = g.variant_id
|
|
JOIN fsppilot p ON p.variant_id = g.variant_id
|
|
AND ( (p.known_outcome = 1 AND g.accesstype = 'W')
|
|
OR (p.known_outcome = 0 AND p.instr2 = g.instr2 AND p.data_physical_address = g.data_physical_address) )
|
|
JOIN result_GenericExperimentMessage r ON r.pilot_id = p.id
|
|
WHERE v.variant = '$experiment'$extra
|
|
GROUP BY v.id, resulttype
|
|
ORDER BY variant, benchmark, resulttype;";
|
|
|
|
say $querystring;
|
|
|
|
return $querystring;
|
|
}
|
|
|
|
sub args { return "--batch --raw"; }
|
|
|
|
sub filename {
|
|
my @filter_config_names = grep { defined && length } @_;
|
|
my $suffix =
|
|
@filter_config_names ? "_" . join( "+", sort @filter_config_names ) : "";
|
|
return "resultsdata_writegroups${suffix}.csv";
|
|
}
|
|
|
|
sub postprocess { $_[0] =~ s/\t/,/g; }
|
|
|
|
1;
|