From 9bc82119f890ecaa556935301dc721f90100d2dd Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 26 Nov 2021 16:15:37 +0000 Subject: tools/syz-testbed: show diffs and p-values Enable the user to specify the pivot column for the stats table. If such a column is set, calculate and print the relative difference between checkouts and p-values for the estimation of statistical significance of the experimental data. For the p-value calculation use the existing implementation from the go-benchstat tool. --- pkg/html/html.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pkg/html') diff --git a/pkg/html/html.go b/pkg/html/html.go index 6d24ba7e7..0b6fdaa75 100644 --- a/pkg/html/html.go +++ b/pkg/html/html.go @@ -8,6 +8,7 @@ package html import ( "fmt" "html/template" + "reflect" "strings" texttemplate "text/template" "time" @@ -46,6 +47,7 @@ var Funcs = template.FuncMap{ "formatCommitTableTitle": formatCommitTableTitle, "formatList": formatStringList, "selectBisect": selectBisect, + "dereference": dereferencePointer, } func selectBisect(rep *dashapi.BugReport) *dashapi.BisectResult { @@ -180,3 +182,14 @@ func formatCommitTableTitle(v string) string { func formatStringList(list []string) string { return strings.Join(list, ", ") } + +func dereferencePointer(v interface{}) interface{} { + reflectValue := reflect.ValueOf(v) + if !reflectValue.IsNil() && reflectValue.Kind() == reflect.Ptr { + elem := reflectValue.Elem() + if elem.CanInterface() { + return elem.Interface() + } + } + return v +} -- cgit mrf-deployment