golang profile with pprof, how to get hit count no

2019-05-06 23:53发布

how to get hit count like:

(pprof) top
Total: 2525 samples
     298  11.8%  11.8%      345  13.7% runtime.mapaccess1_fast64
     268  10.6%  22.4%     2124  84.1% main.FindLoops

not, durations like:

(pprof) top
2220ms of 3080ms total (72.08%)
Dropped 72 nodes (cum <= 15.40ms)
Showing top 10 nodes out of 111 (cum >= 60ms)
      flat  flat%   sum%        cum   cum%
    1340ms 43.51% 43.51%     1410ms 45.78%  runtime.cgocall_errno

env: I using golang1.4, add below codes.

defer pprof.StopCPUProfile()
f, err := os.Create("innercpu.pprof")
if err != nil {
    fmt.Println("Error: ", err)
}
pprof.StartCPUProfile(f)

标签: go profile pprof
1条回答
男人必须洒脱
2楼-- · 2019-05-07 00:31

You can use go tool pprof -callgrind -output callgrind.out innercpu.pprof to generate callgrind data out of your collected profiling data. Which you can then visualise with qcachegrind/kcachegrind. It'll display call counts.

查看更多
登录 后发表回答