github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/dashboard/app/dashboard.go (about) 1 // Copyright 2019 syzkaller project authors. All rights reserved. 2 // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 package main 5 6 import ( 7 "cloud.google.com/go/profiler" 8 "github.com/google/syzkaller/pkg/log" 9 "google.golang.org/appengine/v2" 10 ) 11 12 // Doc on https://cloud.google.com/profiler/docs/profiling-go#using-profiler 13 func enableProfiling() { 14 // Profiler initialization, best done as early as possible. 15 if err := profiler.Start(profiler.Config{ 16 // Service and ServiceVersion can be automatically inferred when running 17 // on App Engine. 18 // ProjectID must be set if not running on GCP. 19 // ProjectID: "my-project", 20 }); err != nil { 21 log.Logf(0, "failed to start profiler: %v", err) 22 } 23 } 24 25 func main() { 26 enableProfiling() 27 installConfig(mainConfig) 28 appengine.Main() 29 }