aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/pprof/pprof.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2015-07-22 13:09:26 +0200
committerRuss Cox <rsc@golang.org>2015-07-22 15:47:16 +0000
commitae1ea2aa94b366107f4f92a591d102fd32ad86ae (patch)
tree762c1f7f9399e385088feff953f271f44809ca30 /src/runtime/pprof/pprof.go
parent1a99ba55df902a2657d1ccfc52a60024c22dba98 (diff)
downloadgo-ae1ea2aa94b366107f4f92a591d102fd32ad86ae.tar.xz
runtime/trace: add new package
Move tracing functions from runtime/pprof to the new runtime/trace package. Fixes #9710 Change-Id: I718bcb2ae3e5959d9f72cab5e6708289e5c8ebd5 Reviewed-on: https://go-review.googlesource.com/12511 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/runtime/pprof/pprof.go')
-rw-r--r--src/runtime/pprof/pprof.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/runtime/pprof/pprof.go b/src/runtime/pprof/pprof.go
index 43fe6e85a1..7d888e4ab0 100644
--- a/src/runtime/pprof/pprof.go
+++ b/src/runtime/pprof/pprof.go
@@ -613,33 +613,6 @@ func StopCPUProfile() {
<-cpu.done
}
-// TODO(rsc): Decide if StartTrace belongs in this package.
-// See golang.org/issue/9710.
-// StartTrace enables tracing for the current process.
-// While tracing, the trace will be buffered and written to w.
-// StartTrace returns an error if profiling is tracing enabled.
-func StartTrace(w io.Writer) error {
- if err := runtime.StartTrace(); err != nil {
- return err
- }
- go func() {
- for {
- data := runtime.ReadTrace()
- if data == nil {
- break
- }
- w.Write(data)
- }
- }()
- return nil
-}
-
-// StopTrace stops the current tracing, if any.
-// StopTrace only returns after all the writes for the trace have completed.
-func StopTrace() {
- runtime.StopTrace()
-}
-
type byCycles []runtime.BlockProfileRecord
func (x byCycles) Len() int { return len(x) }