1
0
mirror of https://github.com/DataDog/go-profiler-notes.git synced 2025-07-12 23:50:13 +02:00
Files
Felix Geisendörfer ca63f541c3 examples
2021-05-24 11:50:26 +02:00

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)
}