aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-benchcmp
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-08-10 13:24:11 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-08-10 19:31:15 +0200
commitab0ced187d8b1149add18aa6aedd37a0feb7d489 (patch)
tree6b031d32d9b8af44d4ac00dfa9c03a57a557b78e /tools/syz-benchcmp
parent0327584e9904f4b7ecda8b9787ee34e9a7b03731 (diff)
tools/syz-benchcmp: add execution speed
Exec total is affected by initial triage/minimize phase, so two experiments can have the same execution speed in the stable mode, but have constant diff due to the initial phase. The one that is higher looks better, but that's not very important. Provide execution speed characteristic that is not affected by initial phase. It is not displayed by default.
Diffstat (limited to 'tools/syz-benchcmp')
-rw-r--r--tools/syz-benchcmp/benchcmp.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/syz-benchcmp/benchcmp.go b/tools/syz-benchcmp/benchcmp.go
index bdfed9e6e..b319b51d2 100644
--- a/tools/syz-benchcmp/benchcmp.go
+++ b/tools/syz-benchcmp/benchcmp.go
@@ -51,6 +51,7 @@ func main() {
}
for i, fname := range flag.Args() {
data := readFile(fname)
+ addExecSpeed(data)
for _, g := range graphs {
g.Headers = append(g.Headers, filepath.Base(fname))
for _, v := range data {
@@ -92,6 +93,21 @@ func readFile(fname string) (data []map[string]uint64) {
return
}
+func addExecSpeed(data []map[string]uint64) {
+ // Speed between consecutive samples is very unstable.
+ const (
+ window = 100
+ step = 10
+ )
+ for i := window; i < len(data); i += step {
+ cur := data[i]
+ prev := data[i-window]
+ dx := cur["exec total"] - prev["exec total"]
+ dt := cur["fuzzing"] - prev["fuzzing"]
+ cur["exec speed"] = dx * 1000 / dt
+ }
+}
+
func skipStart(g *Graph) {
skipTime := uint64(*flagSkip)
if *flagSkip < 0 {