From 04487d5612cd3adc7dde217e736b73fb37af1ee5 Mon Sep 17 00:00:00 2001 From: Rémy Oudompheng Date: Thu, 21 Aug 2014 08:07:42 +0200 Subject: runtime: convert MemProfile, BlockProfile, ThreadCreateProfile to Go. LGTM=khr R=golang-codereviews, bradfitz, khr CC=golang-codereviews https://golang.org/cl/123680043 --- src/pkg/runtime/debug.go | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'src/pkg/runtime/debug.go') diff --git a/src/pkg/runtime/debug.go b/src/pkg/runtime/debug.go index d82afb08ec..393598c28a 100644 --- a/src/pkg/runtime/debug.go +++ b/src/pkg/runtime/debug.go @@ -75,20 +75,6 @@ func (r *MemProfileRecord) Stack() []uintptr { return r.Stack0[0:] } -// MemProfile returns n, the number of records in the current memory profile. -// If len(p) >= n, MemProfile copies the profile into p and returns n, true. -// If len(p) < n, MemProfile does not change p and returns n, false. -// -// If inuseZero is true, the profile includes allocation records -// where r.AllocBytes > 0 but r.AllocBytes == r.FreeBytes. -// These are sites where memory was allocated, but it has all -// been released back to the runtime. -// -// Most clients should use the runtime/pprof package or -// the testing package's -test.memprofile flag instead -// of calling MemProfile directly. -func MemProfile(p []MemProfileRecord, inuseZero bool) (n int, ok bool) - // A StackRecord describes a single execution stack. type StackRecord struct { Stack0 [32]uintptr // stack trace for this record; ends at first 0 entry @@ -105,14 +91,6 @@ func (r *StackRecord) Stack() []uintptr { return r.Stack0[0:] } -// ThreadCreateProfile returns n, the number of records in the thread creation profile. -// If len(p) >= n, ThreadCreateProfile copies the profile into p and returns n, true. -// If len(p) < n, ThreadCreateProfile does not change p and returns n, false. -// -// Most clients should use the runtime/pprof package instead -// of calling ThreadCreateProfile directly. -func ThreadCreateProfile(p []StackRecord) (n int, ok bool) - // GoroutineProfile returns n, the number of records in the active goroutine stack profile. // If len(p) >= n, GoroutineProfile copies the profile into p and returns n, true. // If len(p) < n, GoroutineProfile does not change p and returns n, false. @@ -156,15 +134,6 @@ type BlockProfileRecord struct { StackRecord } -// BlockProfile returns n, the number of records in the current blocking profile. -// If len(p) >= n, BlockProfile copies the profile into p and returns n, true. -// If len(p) < n, BlockProfile does not change p and returns n, false. -// -// Most clients should use the runtime/pprof package or -// the testing package's -test.blockprofile flag instead -// of calling BlockProfile directly. -func BlockProfile(p []BlockProfileRecord) (n int, ok bool) - // Stack formats a stack trace of the calling goroutine into buf // and returns the number of bytes written to buf. // If all is true, Stack formats stack traces of all other goroutines -- cgit v1.3