Files
fail/tools/analysis/data-aggregator/global-coverage-onwrite.sh
Horst Schirmeier 3abdc51043 data-aggregator: more script renamings
The terms "occurrences" and "coverage" contradict each other.

Change-Id: I2c3b3a2fa046f9ab77ea4bec9a13eafa2ebfba58
2018-07-24 09:16:33 +02:00

61 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
show_description() {
cat >&2 <<EOT
This script calculates the fault-coverage factor for the "inject-on-write"
fault model, which assumes that writes to memory can get corrupted, and
completely disregards storage duration (e.g. time between write and subsequent
read). The metric is calculated from the results of a normal "inject-on-read"
campaign, only using the FI results from memory accesses that directly follow a
"write" access.
EOT
}
source $(dirname $0)/fail-analysis-common.inc.sh
# Currently does not take into account right-margin writes, i.e. those
# that are not followed by *any* memory access. This is mostly OK as
# import-trace creates synthetic 'write' events at the right margin for
# all but those memory accesses that are exactly on the right margin
# already.
$MYSQL << EOT
SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';
SELECT v.benchmark, v.variant, r.resulttype,
SUM(t.width)
/
(SELECT SUM(t.width)
FROM result_GenericExperimentMessage r
INNER JOIN fspgroup g
ON g.pilot_id = r.pilot_id
AND g.fspmethod_id = (SELECT id FROM fspmethod WHERE method = 'basic')
INNER JOIN trace t
ON g.instr2 = t.instr2
AND g.data_address = t.data_address
AND g.variant_id = t.variant_id
INNER JOIN trace tw
ON t.instr1 = tw.instr2 + 1
AND t.data_address = tw.data_address
AND t.variant_id = tw.variant_id
AND tw.accesstype = 'W'
WHERE t.variant_id = v.id -- refers to parent query
) AS coverage
FROM result_GenericExperimentMessage r
INNER JOIN fspgroup g
ON g.pilot_id = r.pilot_id
AND g.fspmethod_id = (SELECT id FROM fspmethod WHERE method = 'basic')
INNER JOIN trace t
ON g.instr2 = t.instr2
AND g.data_address = t.data_address
AND g.variant_id = t.variant_id
INNER JOIN trace tw
ON t.instr1 = tw.instr2 + 1
AND t.data_address = tw.data_address
AND t.variant_id = tw.variant_id
AND tw.accesstype = 'W'
INNER JOIN variant v
ON t.variant_id = v.id
WHERE $FILTER
GROUP BY v.id, r.resulttype
ORDER BY v.benchmark, v.variant, CONCAT(r.resulttype)
;
EOT