Ashwin
Ashwin

Reputation: 1960

How to understand the output of callgrind using Kcachegrind

When profiling the log Kcachegrind shows %of inclusive as 13.92%. Should it not be close to 100% as mentioned in the FAQ Q:1??

Here is the screenshot of the profile log

enter image description here

Upvotes: 6

Views: 2688

Answers (1)

Matthieu M.
Matthieu M.

Reputation: 299730

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).

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.

Upvotes: 4

Related Questions