Analyzers
Support for Analyzers (Intel VTune™ Profiler, Intel Advisor, Intel Inspector)
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
4751 Discussions

Determine CPU utilization(%) from CPU time given by VTune

Rupinder__V_
Beginner
209 Views

Currently i am working with Vtune. I am trying to calculate CPU% utilization give the "CPU seconds used" and the elapsed time.

Is this write :  CPU% = cpu time(secs) / elapsed time. ?

e.g. in 2 core machine

cpu sec =5.6 , elapsed time = 8.4

cpu% = 5.6 / 8.4 .

Also how to map cpu time and utilization in multicore environment.

Thanks,

rupinder

0 Kudos
2 Replies
Peter_W_Intel
Employee
209 Views

No. They are total differenr concepts. Let me explain more -

1. Elapsed time = end time - start time (profiling)

2. CPU time of function : captured samples of function * interval . For example, if you got 100 samples in f1(), and interval is 10ms as default. So CPU time of f1() = 100 * 10ms = 1s

3. CPU Utilization : time period from function's entry & exit, it lasts 2s. As I said f1() took 1s in one core, so CPU utilization is 50% (probably instruction was suspended, IO waits, etc)

4. Same situation for multicore, if the system is 2 cores, Full utilization is 200%, follow the point 3, meanwhile if 

a) Other function ran 2s on another core, so CPU utilization is 3s / 2s = 150%

b) Other function ran 1s on another core, so CPU utilization is 2s / 2s = 100%

c) No other function run on another core, so CPU utilization is 1s / 2s = 50%. 

Please observe timeline report to view these data. 

Bernard
Black Belt
209 Views

>>>3. CPU Utilization : time period from function's entry & exit, it lasts 2s. As I said f1() took 1s in one core, so CPU utilization is 50% (probably instruction was suspended, IO waits>>>, etc)

I would like to know what is time scale granularity of CPU utilization measurement?What happens for example when current executting function's thread is swapped out and other thread is scheduled to run?

Reply