diff options
| -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 |
