简体   繁体   English

如何使用Kcachegrind理解callgrind的输出

[英]How to understand the output of callgrind using Kcachegrind

When profiling the log Kcachegrind shows %of inclusive as 13.92%. 在分析日志时,Kcachegrind显示包含百分比为13.92%。 Should it not be close to 100% as mentioned in the FAQ Q:1 ?? 它应该不会接近100%,如常见问题解答中提到的那样:1

Here is the screenshot of the profile log 以下是配置文件日志的屏幕截图

在此输入图像描述

Not necessarily. 不必要。

main is not the "real" entry point of your program, there is lot of stuff going on before and after, for example loading/unloading DLLs and the construction/destruction of globals (those which are dynamically initialized). main不是程序的“真正”入口点,前后有很多东西,例如加载/卸载DLL和全局变量的构造/破坏(动态初始化的那些)。

Those things take time, although normally negligible. 这些事情需要时间,尽管通常可以忽略不计。

Note that there are flags for callgrind that allow to start the collection of statistics at the start of a function (for example main ) depending on what you are really interested in. 请注意,callgrind有一些标志,允许在函数开头(例如main )开始统计信息的收集,具体取决于您真正感兴趣的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM