diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-04-04 10:52:44 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-04-04 11:15:43 +0200 |
| commit | fd331b6d85b45e990c4037d3f6d76dbad0a69eb8 (patch) | |
| tree | d8bb1b7d7b1d70e381c58cda4fe6f6f0edcfddfc | |
| parent | 928dd177264f8af8ab4058bd6abec604a6b6b886 (diff) | |
dashboard: log subsystem changes
It will help evaluate the results of bug inference logic updates.
| -rw-r--r-- | dashboard/app/subsystem.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/dashboard/app/subsystem.go b/dashboard/app/subsystem.go index 34cbd0547..db649b525 100644 --- a/dashboard/app/subsystem.go +++ b/dashboard/app/subsystem.go @@ -5,6 +5,8 @@ package main import ( "fmt" + "reflect" + "sort" "time" "github.com/google/syzkaller/pkg/subsystem" @@ -112,6 +114,7 @@ func updateBugSubsystems(c context.Context, bugKey *db.Key, switch v := info.(type) { case autoInference: bug.SetAutoSubsystems(list, now, int(v)) + logSubsystemChange(c, bug, list) case userAssignment: bug.SetUserSubsystems(list, now, string(v)) case updateRevision: @@ -126,6 +129,22 @@ func updateBugSubsystems(c context.Context, bugKey *db.Key, return db.RunInTransaction(c, tx, &db.TransactionOptions{Attempts: 10}) } +func logSubsystemChange(c context.Context, bug *Bug, new []*subsystem.Subsystem) { + var oldNames, newNames []string + for _, item := range bug.Tags.Subsystems { + oldNames = append(oldNames, item.Name) + } + for _, item := range new { + newNames = append(newNames, item.Name) + } + sort.Strings(oldNames) + sort.Strings(newNames) + if !reflect.DeepEqual(oldNames, newNames) { + log.Infof(c, "bug %s: subsystems set from %v to %v", + bug.keyHash(), oldNames, newNames) + } +} + const ( // We load the top crashesForInference crashes to determine the bug subsystem(s). crashesForInference = 7 |
