douan4347 2015-03-08 08:34
浏览 74
已采纳

与pprof的golang配置文件,如何获取点击计数而不是持续时间?

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)
  • 写回答

1条回答 默认 最新

  • duan_2000 2016-01-27 13:20
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助