mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Stop profiling metrics in the same step as other profiles in runsc.
This is part of a series of changes to add metric charts in performance benchmarks. This change stops profiling metrics whenever we also stop CPU/heap/mutex profiles, rather than at `runsc boot` exit. This helps flushing the metrics data at the right time. PiperOrigin-RevId: 633287428
This commit is contained in:
committed by
gVisor bot
parent
a67dd10623
commit
222de612f4
@@ -50,6 +50,7 @@ go_library(
|
||||
"//pkg/hostos",
|
||||
"//pkg/log",
|
||||
"//pkg/memutil",
|
||||
"//pkg/metric",
|
||||
"//pkg/rand",
|
||||
"//pkg/refs",
|
||||
"//pkg/sentry/arch",
|
||||
|
||||
@@ -36,6 +36,7 @@ import (
|
||||
"gvisor.dev/gvisor/pkg/fd"
|
||||
"gvisor.dev/gvisor/pkg/log"
|
||||
"gvisor.dev/gvisor/pkg/memutil"
|
||||
"gvisor.dev/gvisor/pkg/metric"
|
||||
"gvisor.dev/gvisor/pkg/rand"
|
||||
"gvisor.dev/gvisor/pkg/refs"
|
||||
"gvisor.dev/gvisor/pkg/sentry/control"
|
||||
@@ -372,7 +373,11 @@ func getRootCredentials(spec *specs.Spec, conf *config.Config, userNs *auth.User
|
||||
// New initializes a new kernel loader configured by spec.
|
||||
// New also handles setting up a kernel for restoring a container.
|
||||
func New(args Args) (*Loader, error) {
|
||||
stopProfiling := profile.Start(args.ProfileOpts)
|
||||
stopProfilingRuntime := profile.Start(args.ProfileOpts)
|
||||
stopProfiling := func() {
|
||||
stopProfilingRuntime()
|
||||
metric.StopProfilingMetrics()
|
||||
}
|
||||
|
||||
// Initialize seccheck points.
|
||||
seccheck.Initialize()
|
||||
|
||||
Reference in New Issue
Block a user