Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4995 Discussions

Profiling particular functions?

qinlz
Beginner
387 Views
Hi,

I am new to Intel VTune / Amplifer XE.

I would like to profile a particular function in my code, but when using amplifer xe, hot spot mode, it only shows the top N functions,
which are all the data preparation function during the init phase of my program.

I played with Amplifier, could find a way to see my target function though. I was using valgrind in Linux, which can do target function analysis easily.

Please give advice / help.

Thanks!

Frank
0 Kudos
5 Replies
Peter_W_Intel
Employee
387 Views
Hi Frank,

Hotspots analysis can collect performance data and can display ALL hot functions.

Is it possible that your interest of function executed extra short time? If so, samples in this function cannot be captured because interrupt interval is 10ms. Please increase call count so samples in this function can be captured.

Back to your question, if you want to profile a specific function ONLY. Please use Pause/Resume API (in your code) from the tool, read this article.

Regards, Peter

0 Kudos
qinlz
Beginner
387 Views
Peter, thanks for the reply.
Using pause / resume API is a good idea, and can be used to profile some target code segment.

The function I am trying to optimize only take around 100 micrseonc (0.1ms), so 10ms sampling rate is too coarse. Any other better way to profile this kind of quick functions?

Thanks,

Frank
0 Kudos
Peter_W_Intel
Employee
387 Views
Frank,

0.1ms is too small interval, I suggest to call this function many times in loop.

Another way is to create a new "New User-mode Sampling and Tracing Analysis"on GUI by clicking "New..." button. Thus, you can adjust "CPU sampling interval, ms:" to "1" (minimal value) - note it will increase overheads when reducing interval value.

Regards, Peter

0 Kudos
stefanego
Beginner
387 Views
Wouldn't user created events via __itt_event_start / __itt_event_end ensure that the timing are collected, too (even if they are below the sampling interval)?
0 Kudos
Peter_W_Intel
Employee
387 Views
In general speaking, profiling tool monitors event(s)then collects performance data in specific time range, but the timing of __itt_event_start / _itt_event_end are not calculated in.
0 Kudos
Reply