带有堆分析的 google-perftools/pprof 格式
google-perftools 包中有一个 pprof 实用程序。它是将配置文件从 google-perftools cpuprofiler 和 heapprofiler 转换为漂亮图像的实用程序:如 https://github.com/gperftools/gperftools/tree/master/doc/pprof-test-big.gif 和 https://github.com/gperftools/gperftools/tree/master /doc/heap-example1.png
pprof 输入文件的格式在此处针对 cpu 配置文件进行了描述:https://github.com/gperftools/gperftools/tree/master/doc /cpuprofile-fileformat.html
但是 svn 中没有描述 heap profile
输入文件的格式。
什么是“heapprofiling”格式以及如何从我的代码生成此类文件?我已经可以生成 cpuprofiler 格式,所以我感兴趣两种格式之间的区别。
There is a pprof utility in google-perftools package. It is utility to convert profile files from google-perftools cpuprofiler and heapprofiler into beautiful images: like https://github.com/gperftools/gperftools/tree/master/doc/pprof-test-big.gif and
https://github.com/gperftools/gperftools/tree/master/doc/heap-example1.png
The format of pprof's input file is described for cpu profiles here: https://github.com/gperftools/gperftools/tree/master/doc/cpuprofile-fileformat.html
but the format of heap profile
input files is not described in the svn.
What is the "heapprofiling" format and how can I generate such file from my code? I already can generate cpuprofiler format, so I interested what are the difference between two formats.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 cpu profiler 来说,格式似乎不是二进制的,而是文本的:
第一行:
正则表达式(不完整),
其中
然后配置文件本身包含很多行:
其中“1: 2”和“3: 4”与第一行中的含义相同;但仅从给定的调用站点分配; 0x00001 0x00002 是调用站点的调用堆栈。
然后是空行和“MAPPED_LIBRARIES:”。从下一行开始,接下来的内容非常类似于 /proc/pid/maps 的副本。
Seems the format is not binary as for cpu profiler, but textual:
First line:
Regex (not full)
where
Then a profile itself follows in lot of lines:
where "1: 2" and "3: 4" is of the same meaning as in first line; but only malloced from given callsite; 0x00001 0x00002 is callstack of the callsite.
Then empty line and "MAPPED_LIBRARIES:". From the next line something very like copy of the /proc/pid/maps follows.