go - 无法使用 go pprof 查看所有方法

标签 go pprof

我正在使用 go pprof 来分析我的应用程序,我已遵循下一个教程 - http://saml.rilspace.org/profiling-and-creating-call-graphs-for-go-programs-with-go-tool-pprof

我的分析的“--text”结果是 -

Total: 48 samples 48 100.0% 100.0% 48 100.0% runtime.mach_semaphore_wait 0 0.0% 100.0% 48 100.0% System

为了获得应用程序的完整分析结果,我应该做什么? (一般来说,我的应用程序使用 go-imap 和 json)

最佳答案

pprof 定期拍摄程序快照。如果 pprof 拍摄快照时某些方法当前不在堆栈中,它们将不会出现在结果中。

这意味着您的方法不会在堆栈上出现很长时间 - 因此它们不是瓶颈。或者您运行分析的时间不够长,因此无法生成足够的样本。

关于go - 无法使用 go pprof 查看所有方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20023365/

相关文章:

google-app-engine - 从 AppEngine 上的上下文获取 *http.Request

oop - 导入的结构方法不起作用

go - 探查器不显示函数调用(/pgk/profile with pprof)

profiling - 将 pprof 与 gperftools 一起使用会导致 curl 错误

go - 通过 "go tool pprof"获取配置文件时指定 jwt token

golang 的失败似乎出乎意料

xml - go中将数组编码为base64

Google Sheet API 问题 Golang

go - exec.Command 没有注册来自 Go 自己的 pprof 工具的错误

go - 解释 pprof 堆图