~ubuntu-branches/ubuntu/utopic/golang/utopic

« back to all changes in this revision

Viewing changes to src/pkg/runtime/debug.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
package runtime
6
6
 
7
 
// Breakpoint() executes a breakpoint trap.
 
7
// Breakpoint executes a breakpoint trap.
8
8
func Breakpoint()
9
9
 
10
10
// LockOSThread wires the calling goroutine to its current operating system thread.
125
125
// blocking until data is available.  If profiling is turned off and all the profile
126
126
// data accumulated while it was on has been returned, CPUProfile returns nil.
127
127
// The caller must save the returned data before calling CPUProfile again.
 
128
//
128
129
// Most clients should use the runtime/pprof package or
129
130
// the testing package's -test.cpuprofile flag instead of calling
130
131
// CPUProfile directly.
133
134
// SetCPUProfileRate sets the CPU profiling rate to hz samples per second.
134
135
// If hz <= 0, SetCPUProfileRate turns off profiling.
135
136
// If the profiler is on, the rate cannot be changed without first turning it off.
 
137
//
136
138
// Most clients should use the runtime/pprof package or
137
139
// the testing package's -test.cpuprofile flag instead of calling
138
140
// SetCPUProfileRate directly.
139
141
func SetCPUProfileRate(hz int)
140
142
 
 
143
// SetBlockProfileRate controls the fraction of goroutine blocking events
 
144
// that are reported in the blocking profile.  The profiler aims to sample
 
145
// an average of one blocking event per rate nanoseconds spent blocked.
 
146
//
 
147
// To include every blocking event in the profile, pass rate = 1.
 
148
// To turn off profiling entirely, pass rate <= 0.
 
149
func SetBlockProfileRate(rate int)
 
150
 
 
151
// BlockProfileRecord describes blocking events originated
 
152
// at a particular call sequence (stack trace).
 
153
type BlockProfileRecord struct {
 
154
        Count  int64
 
155
        Cycles int64
 
156
        StackRecord
 
157
}
 
158
 
 
159
// BlockProfile returns n, the number of records in the current blocking profile.
 
160
// If len(p) >= n, BlockProfile copies the profile into p and returns n, true.
 
161
// If len(p) < n, BlockProfile does not change p and returns n, false.
 
162
//
 
163
// Most clients should use the runtime/pprof package or
 
164
// the testing package's -test.blockprofile flag instead
 
165
// of calling BlockProfile directly.
 
166
func BlockProfile(p []BlockProfileRecord) (n int, ok bool)
 
167
 
141
168
// Stack formats a stack trace of the calling goroutine into buf
142
169
// and returns the number of bytes written to buf.
143
170
// If all is true, Stack formats stack traces of all other goroutines