Search code examples
performanceintel-vtuneperformance-measuring

Function CPU time additivity in the vtune measurements


Suppose I have the following call structure:

funcA() -> funcB() -> funcC()

funcB() -> funcC(), funcD()

In the VTune results (uarch-exploration with hotspots results), the CPU times of individual functions are shown. My question is whether the cpu times are "additive" in nature? That is, the time of A in results also includes the execution time of B and C in the first line, and also whether the time of B in results also includes the execution time of C and D in the second line?

If not, then please confirm whether the hotspots analysis reports the execution time of B = execution time of the first line B + execution time of the second line B?


Solution

  • Intel VTune, Intel Advisor and some other profilers (eg Crhome profiler) report BOTH inclusive (including B, C, D) and exclusive (A, except B, C,D, thus additive) time metrics. Inclusive is called "Total-Time" and exclusive is called "Self-Time". Read more at: https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top/reference/cpu-metrics-reference/self-time-and-total-time.html