pm100
pm100

Reputation: 50210

what exactly does callgrind collect

Is it sampling or is it recording every instruction executed?

Does it just capture the executing function or does it also have the line number?

Upvotes: 1

Views: 503

Answers (1)

Sachin Shanbhag
Sachin Shanbhag

Reputation: 55519

Taken from the official documentation article:

Cachegrind collects flat profile data: event counts (data reads, cache misses, etc.) are attributed directly to the function they occurred in. This cost attribution mechanism is called self or exclusive attribution.

Callgrind extends this functionality by propagating costs across function call boundaries. If function foo calls bar, the costs from bar are added into foo's costs. When applied to the program as a whole, this builds up a picture of so called inclusive costs, that is, where the cost of each function includes the costs of all functions it called, directly or indirectly.

Upvotes: 1

Related Questions