From ab0ced187d8b1149add18aa6aedd37a0feb7d489 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 10 Aug 2017 13:24:11 +0200 Subject: 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. --- tools/syz-benchcmp/benchcmp.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tools') 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 { -- cgit mrf-deployment