Question

Is it possible to get back traces with the profiling output from Callgrind?

If it is, would you be able to explain how that's done?

[update] It could be my terminology. What is the backtrace/callstack called and where does it reside when using Kcachegrind to view Callgrind profiling results?

Was it helpful?

Solution

When you launch Kcachegrind for the first time, you have three areas : At left, you have a DockWidget entitled "Flat profile", there is the list of the functions sorted by the percentage of cost in the application, including all sub-calls. (that's why the main usualy cost almost 100%). Then in the bottom-right area, you have another dockwidget which have a "call graph" tab, there is here you have the tree of all the calls, and maybe what you are looking for ;)

But if you want a backtrace at a specific point, with more informations about the context, I advise you to use gdb with a breakpoint here, and continue the execution until you reached the context you want. Profiling is mainly used to locate what function cost the most in your application, and then see if you can optimize it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top