Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(196)

Side by Side Diff: src/pkg/runtime/debug.go

Issue 132440043: code review 132440043: runtime: convert cpuprof from C to Go (Closed)
Patch Set: diff -r 17b5fc2aa130ef7c32cbbdf95620862610d7773e https://code.google.com/p/go Created 10 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/runtime/cpuprof.go ('k') | src/pkg/runtime/proc.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package runtime 5 package runtime
6 6
7 import "unsafe" 7 import "unsafe"
8 8
9 // Breakpoint executes a breakpoint trap. 9 // Breakpoint executes a breakpoint trap.
10 func Breakpoint() 10 func Breakpoint()
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 return n 43 return n
44 } 44 }
45 45
46 // NumGoroutine returns the number of goroutines that currently exist. 46 // NumGoroutine returns the number of goroutines that currently exist.
47 func NumGoroutine() int { 47 func NumGoroutine() int {
48 return int(gcount()) 48 return int(gcount())
49 } 49 }
50 50
51 func gcount() int32 51 func gcount() int32
52
53 // CPUProfile returns the next chunk of binary CPU profiling stack trace data,
54 // blocking until data is available. If profiling is turned off and all the pro file
55 // data accumulated while it was on has been returned, CPUProfile returns nil.
56 // The caller must save the returned data before calling CPUProfile again.
57 //
58 // Most clients should use the runtime/pprof package or
59 // the testing package's -test.cpuprofile flag instead of calling
60 // CPUProfile directly.
61 func CPUProfile() []byte
62
63 // SetCPUProfileRate sets the CPU profiling rate to hz samples per second.
64 // If hz <= 0, SetCPUProfileRate turns off profiling.
65 // If the profiler is on, the rate cannot be changed without first turning it of f.
66 //
67 // Most clients should use the runtime/pprof package or
68 // the testing package's -test.cpuprofile flag instead of calling
69 // SetCPUProfileRate directly.
70 func SetCPUProfileRate(hz int)
OLDNEW
« no previous file with comments | « src/pkg/runtime/cpuprof.go ('k') | src/pkg/runtime/proc.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b