public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* question regarding -D flag in perf stat
@ 2015-01-14 22:50 Aravind Gopalakrishnan
  0 siblings, 0 replies; only message in thread
From: Aravind Gopalakrishnan @ 2015-01-14 22:50 UTC (permalink / raw)
  To: a.p.zijlstra, paulus, Ingo Molnar, acme, LKML

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-14 22:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-14 22:50 question regarding -D flag in perf stat Aravind Gopalakrishnan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox