Permalink
Browse files

havlak3

1 parent 58ac27b commit b78dac106bea1eb3be6bb3ca5dba57c130268232 @rsc committed Feb 3, 2017
Showing with 10 additions and 0 deletions.
  1. +10 −0 havlak/havlak.go
View
@@ -671,6 +671,7 @@ func buildBaseLoop(cfgraph *CFG, from int) int {
}
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile to this file")
+var memprofile = flag.String("memprofile", "", "write memory profile to this file")
func main() {
flag.Parse()
@@ -716,6 +717,15 @@ func main() {
}
FindHavlakLoops(cfgraph, lsgraph)
+ if *memprofile != "" {
+ f, err := os.Create(*memprofile)
+ if err != nil {
+ log.Fatal(err)
+ }
+ pprof.WriteHeapProfile(f)
+ f.Close()
+ return
+ }
for i := 0; i < 50; i++ {
FindHavlakLoops(cfgraph, NewLSG())

0 comments on commit b78dac1

Please sign in to comment.