Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5255 讨论

Is the clock ticks of sub function always counted in as part of its parent function?

mfcking
初学者
847 次查看
Hello,
Supposefunction A called its child functions A1, A2 and A3 respectively, and VTune reports the clock ticks for A, A1, A2 and A3. Is the clock ticks of those sub functions always counted in as part of its parent function?
Thanks,
L.Y.
0 项奖励
3 回复数
David_A_Intel1
847 次查看

Good question, L.Y.!

If you are talking about sampling data, and not callgraph data, then, no, the clockticks of subfunctions are not included in the calling function. Sampling has no concept of caller/callee functions, that is, it has no information about what function called which other function(s).

Sampling simply associates instruction addresses where events occurred, and aggregates them at the function, module, and process level.

Callgraph, on the other hand, does understand calling relationships and displays both accumulated and non-accumulated numbers. A function's Self-time is the amount of time spent just inside the function's code. While the function's Total Time is the function's Self-time plus all called function's Self-time, including functions called by those functions, down to the last level.

For example, if function A() called A1(), A2(), and A3(), then A()'s Total Time includes the Total Times (of Self-time, in this case) of A1(), A2(), A3() and A()'s Self-time. Then, if B() called A(), B()'s Total Timewould include B()'s Self-time plus A()'s Total Time.

Hope that helps.

0 项奖励
mfcking
初学者
846 次查看

Hi Dave,

Thanks a lot for your precise answer. It is clearto me now.

L.Y.

0 项奖励
jeffrey-gallagher
初学者
847 次查看

Great discussion, guys!

Cheers,

jdg

0 项奖励
回复