lkml.org 
[lkml]   [2015]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectquestion regarding -D flag in perf stat
Hi all,

I had a question regarding the intention of the -D flag after looking at
perf stat numbers of the following workload:

main(){

int a=5, b=6;

int i;

#pragma omp for schedule(dynamic)

for (i=0; i<10000000; i++){

b=b+a;

}

return 0;

}

_Stats without delay:_

# perf stat -e cycles,instructions,cpu-clock,task-clock ../../test/a.out

Performance counter stats for '../../test/a.out':

203,581,363,567 cycles # 1.500 GHz

7,563,983,198 instructions # 0.04 insns per cycle

135721.617844 cpu-clock (msec)

135721.600586 task-clock (msec) # *5.985 CPUs utilized*

22.678577620 seconds time elapsed (run time)

_Stats with delay of 10 seconds:_

# perf stat -D 10000 -e cycles,instructions,cpu-clock,task-clock
../../test/a.out

b=363264281

Performance counter stats for '../../test/a.out':

112,134,813,161 cycles # 1.500 GHz

4,461,136,761 instructions # 0.04 insns per cycle

74757.386789 cpu-clock (msec)

74757.317781 task-clock (msec) # *3.324 CPUs utilized*

22.490237094 seconds time elapsed**(run time)*(delay time is not
excluded here)*

The issue is that CPU utilization is calculated as
task-clock/total-runtime which in the case of no delay is fine.
But for the delay case, the total run time should exclude the delay
time. Right?
(and as a consequence, utilization would be calculated exclusive of the
delay time which would give us CPU utilization only for the period
during which perf actually collects info)

Or is this the way -D flag is intended to work?

Thanks for the clarifications,
-Aravind.


\
 
 \ /
  Last update: 2015-01-15 00:21    [W:0.047 / U:1.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site