You've already forked go-profiler-notes
mirror of
https://github.com/DataDog/go-profiler-notes.git
synced 2025-07-12 23:50:13 +02:00
22 lines
281 B
Go
22 lines
281 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"runtime/pprof"
|
|
)
|
|
|
|
func main() {
|
|
foo()
|
|
}
|
|
|
|
func foo() {
|
|
bar()
|
|
}
|
|
func bar() {
|
|
debug2, _ := os.Create("frames.txt")
|
|
debug0, _ := os.Create("frames.pb.gz")
|
|
|
|
pprof.Lookup("goroutine").WriteTo(debug2, 2)
|
|
pprof.Lookup("goroutine").WriteTo(debug0, 0)
|
|
}
|