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

huangapple go评论72阅读模式
英文:

Can't see all methods with go pprof

问题

我正在使用go pprof来对我的应用程序进行性能分析,我已经按照下面的教程进行了操作 -
http://saml.rilspace.org/profiling-and-creating-call-graphs-for-go-programs-with-go-tool-pprof

我的性能分析的"--text"结果如下 -

总共: 48个样本
48 100.0% 100.0% 48 100.0% runtime.mach_semaphore_wait
0 0.0% 100.0% 48 100.0% System

为了获取应用程序的完整性能分析结果,我应该怎么做?
(通常情况下,我的应用程序使用go-imap和json)

英文:

I am using go pprof to profile my application, I have followed the next tutorial -
http://saml.rilspace.org/profiling-and-creating-call-graphs-for-go-programs-with-go-tool-pprof

And my "--text" result of my profiling is -

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

What should I do in order to get the full profiling result of the application?
(Generaly my application works with go-imap and json)

答案1

得分: 2

pprof会定期对你的程序进行快照。如果在pprof进行快照时,某些方法不在堆栈上,它们将不会出现在结果中。

这意味着你的方法在堆栈上的时间很短,因此它们不是瓶颈。或者你没有运行足够长时间的性能分析,所以它没有产生足够的样本。

英文:

pprof takes snapshots of your program at regular interval. If some methods aren't currently on the stack when pprof takes the snapshot, they won't appear in the results.

Which means that your methods don't appear for very long on the stack - thus they aren't a bottleneck. Or you don't run your profiling for long enough, so it doesn't produce enough samples.

答案2

得分: 0

也许你的问题类似于https://code.google.com/p/go/issues/detail?id=6047

Alex

英文:

Perhaps your problem is similar to https://code.google.com/p/go/issues/detail?id=6047

Alex

huangapple
  • 本文由 发表于 2013年11月17日 04:18:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/20023365.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定