mirror of
https://github.com/restic/restic.git
synced 2026-04-19 19:29:25 +00:00
Update dependencies
This commit is contained in:
5
vendor/github.com/pkg/profile/.travis.yml
generated
vendored
5
vendor/github.com/pkg/profile/.travis.yml
generated
vendored
@@ -1,9 +1,8 @@
|
||||
language: go
|
||||
go_import_path: github.com/pkg/profile
|
||||
go:
|
||||
- 1.4.3
|
||||
- 1.5.2
|
||||
- 1.6.3
|
||||
- 1.10.x
|
||||
- 1.12.x
|
||||
- tip
|
||||
|
||||
script:
|
||||
|
||||
25
vendor/github.com/pkg/profile/profile.go
generated
vendored
25
vendor/github.com/pkg/profile/profile.go
generated
vendored
@@ -19,6 +19,7 @@ const (
|
||||
mutexMode
|
||||
blockMode
|
||||
traceMode
|
||||
threadCreateMode
|
||||
)
|
||||
|
||||
// Profile represents an active profiling session.
|
||||
@@ -83,17 +84,20 @@ func MemProfileRate(rate int) func(*Profile) {
|
||||
|
||||
// MutexProfile enables mutex profiling.
|
||||
// It disables any previous profiling settings.
|
||||
//
|
||||
// Mutex profiling is a no-op before go1.8.
|
||||
func MutexProfile(p *Profile) { p.mode = mutexMode }
|
||||
|
||||
// BlockProfile enables block (contention) profiling.
|
||||
// It disables any previous profiling settings.
|
||||
func BlockProfile(p *Profile) { p.mode = blockMode }
|
||||
|
||||
// Trace profile controls if execution tracing will be enabled. It disables any previous profiling settings.
|
||||
// Trace profile enables execution tracing.
|
||||
// It disables any previous profiling settings.
|
||||
func TraceProfile(p *Profile) { p.mode = traceMode }
|
||||
|
||||
// ThreadcreationProfile enables thread creation profiling..
|
||||
// It disables any previous profiling settings.
|
||||
func ThreadcreationProfile(p *Profile) { p.mode = threadCreateMode }
|
||||
|
||||
// ProfilePath controls the base path where various profiling
|
||||
// files are written. If blank, the base path will be generated
|
||||
// by ioutil.TempDir.
|
||||
@@ -211,6 +215,21 @@ func Start(options ...func(*Profile)) interface {
|
||||
logf("profile: block profiling disabled, %s", fn)
|
||||
}
|
||||
|
||||
case threadCreateMode:
|
||||
fn := filepath.Join(path, "threadcreation.pprof")
|
||||
f, err := os.Create(fn)
|
||||
if err != nil {
|
||||
log.Fatalf("profile: could not create thread creation profile %q: %v", fn, err)
|
||||
}
|
||||
logf("profile: thread creation profiling enabled, %s", fn)
|
||||
prof.closer = func() {
|
||||
if mp := pprof.Lookup("threadcreate"); mp != nil {
|
||||
mp.WriteTo(f, 0)
|
||||
}
|
||||
f.Close()
|
||||
logf("profile: thread creation profiling disabled, %s", fn)
|
||||
}
|
||||
|
||||
case traceMode:
|
||||
fn := filepath.Join(path, "trace.out")
|
||||
f, err := os.Create(fn)
|
||||
|
||||
Reference in New Issue
Block a user