]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/pprof/pprof.go
runtime: add available godoc link
[gostls13.git] / src / runtime / pprof / pprof.go
index 17a490efeda35a96deaec6409fb562af5e8049cd..d3a3c788b1c07e2d23bcd18e6f5019fea0366a68 100644 (file)
@@ -107,7 +107,7 @@ import (
 //     mutex        - stack traces of holders of contended mutexes
 //
 // These predefined profiles maintain themselves and panic on an explicit
-// Add or Remove method call.
+// [Profile.Add] or [Profile.Remove] method call.
 //
 // The heap profile reports statistics as of the most recently completed
 // garbage collection; it elides more recent allocation to avoid skewing
@@ -127,7 +127,7 @@ import (
 // the program began (including garbage-collected bytes).
 //
 // The CPU profile is not available as a Profile. It has a special API,
-// the StartCPUProfile and StopCPUProfile functions, because it streams
+// the [StartCPUProfile] and [StopCPUProfile] functions, because it streams
 // output to a writer during profiling.
 type Profile struct {
        name  string
@@ -242,7 +242,7 @@ func Profiles() []*Profile {
        return all
 }
 
-// Name returns this profile's name, which can be passed to Lookup to reobtain the profile.
+// Name returns this profile's name, which can be passed to [Lookup] to reobtain the profile.
 func (p *Profile) Name() string {
        return p.name
 }
@@ -260,9 +260,9 @@ func (p *Profile) Count() int {
 // Add adds the current execution stack to the profile, associated with value.
 // Add stores value in an internal map, so value must be suitable for use as
 // a map key and will not be garbage collected until the corresponding
-// call to Remove. Add panics if the profile already contains a stack for value.
+// call to [Profile.Remove]. Add panics if the profile already contains a stack for value.
 //
-// The skip parameter has the same meaning as runtime.Caller's skip
+// The skip parameter has the same meaning as [runtime.Caller]'s skip
 // and controls where the stack trace begins. Passing skip=0 begins the
 // trace in the function calling Add. For example, given this
 // execution stack:
@@ -515,7 +515,7 @@ func printStackRecord(w io.Writer, stk []uintptr, allFrames bool) {
 
 // Interface to system profiles.
 
-// WriteHeapProfile is shorthand for Lookup("heap").WriteTo(w, 0).
+// WriteHeapProfile is shorthand for [Lookup]("heap").WriteTo(w, 0).
 // It is preserved for backwards compatibility.
 func WriteHeapProfile(w io.Writer) error {
        return writeHeap(w, 0)
@@ -765,8 +765,8 @@ var cpu struct {
 // Go code built with -buildmode=c-archive or -buildmode=c-shared.
 // StartCPUProfile relies on the SIGPROF signal, but that signal will
 // be delivered to the main program's SIGPROF signal handler (if any)
-// not to the one used by Go. To make it work, call os/signal.Notify
-// for syscall.SIGPROF, but note that doing so may break any profiling
+// not to the one used by Go. To make it work, call [os/signal.Notify]
+// for [syscall.SIGPROF], but note that doing so may break any profiling
 // being done by the main program.
 func StartCPUProfile(w io.Writer) error {
        // The runtime routines allow a variable profiling rate,