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
Callgrind records the count of instructions, not the actual time spent in a function. If you have a program where the bottleneck is file I/O, the costs associated with reading and writing files won't show up in the profile, as those are not CPU-intensive tasks.
Overview. Callgrind is a Valgrind tool for profiling programs. The collected data consists of the number of instructions executed on a run, their relationship to source lines, and call relationship among functions together with call counts.
1.1 What is the difference between 'Incl. These are cost attributes for functions regarding some event type. As functions can call each other, it makes sense to distinguish the cost of the function itself ('Self Cost') and the cost including all called functions ('Inclusive Cost').
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With