aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-05-31 10:18:58 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-06-03 15:04:36 +0000
commitf0e94da92f1381e56ecd1c28575aaac54cdfc79d (patch)
treedf18acb69e83ac114eb0306751b52beaeb2446e9 /tools
parent463135dcfa641612fbcc002f3a764880389628f2 (diff)
tools/syz-testbed: allow to view unaligned records
This is useful if instances run for different amount of time. It's hard to make any sense out of aligned records in that case.
Diffstat (limited to 'tools')
-rw-r--r--tools/syz-testbed/html.go3
-rw-r--r--tools/syz-testbed/stats.go24
2 files changed, 23 insertions, 4 deletions
diff --git a/tools/syz-testbed/html.go b/tools/syz-testbed/html.go
index 679099a8a..c28020df3 100644
--- a/tools/syz-testbed/html.go
+++ b/tools/syz-testbed/html.go
@@ -203,9 +203,6 @@ func (ctx *TestbedContext) genSimpleTableController(method func(view StatView) (
func (ctx *TestbedContext) httpMainStatsTable(urlPrefix string, view StatView, r *http.Request) (*uiTable, error) {
alignBy := r.FormValue("align")
- if alignBy == "" {
- alignBy = "fuzzing"
- }
table, err := view.AlignedStatsTable(alignBy)
if err != nil {
return nil, fmt.Errorf("stat table generation failed: %w", err)
diff --git a/tools/syz-testbed/stats.go b/tools/syz-testbed/stats.go
index 8a3a368eb..8c20d495e 100644
--- a/tools/syz-testbed/stats.go
+++ b/tools/syz-testbed/stats.go
@@ -251,12 +251,35 @@ func (group RunResultGroup) groupNthRecord(i int) map[string]*stats.Sample {
return groupSamples(records)
}
+func (group RunResultGroup) groupLastRecord() map[string]*stats.Sample {
+ records := []StatRecord{}
+ for _, result := range group.SyzManagerResults() {
+ n := len(result.StatRecords)
+ if n == 0 {
+ continue
+ }
+ records = append(records, result.StatRecords[n-1])
+ }
+ return groupSamples(records)
+}
+
func (view StatView) StatsTable() (*Table, error) {
return view.AlignedStatsTable("uptime")
}
func (view StatView) AlignedStatsTable(field string) (*Table, error) {
// We assume that the stats values are nonnegative.
+ table := NewTable("Property")
+ if field == "" {
+ // Unaligned last records.
+ for _, group := range view.Groups {
+ table.AddColumn(group.Name)
+ for key, sample := range group.groupLastRecord() {
+ table.Set(key, group.Name, NewValueCell(sample))
+ }
+ }
+ return table, nil
+ }
var commonValue float64
for _, group := range view.Groups {
minLen := group.minResultLength()
@@ -273,7 +296,6 @@ func (view StatView) AlignedStatsTable(field string) (*Table, error) {
commonValue = currValue
}
}
- table := NewTable("Property")
for _, group := range view.Groups {
table.AddColumn(group.Name)
minLen := group.minResultLength()