Understanding KCachegrind/callgrind

291 Views Asked by At

How should I interpret the percentages attached to the boxes representing function calls in KCachegrind? There are similar questions here but none of them actually answer the question for any non-trivial call graph.

For example, I have three functions that I'm analyzing in my program (there are many more too):

  • A (21.07%) - calls C 1167 times
  • B (25.68%) - calls C 709 times
  • C (33.87%) [Selected]

The common profiling questions are:

  • How long does C execute relative to the overall runtime?
  • How long does C execute when called from A relative to the overall runtime?
  • how long does C execute when called from B relative to the overall runtime?
  • How long does C execute per call (all calls counted)?

"How long" in terms of either cycles estimation or instruction count estimation.

0

There are 0 best solutions below