linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* IPC sampling
@ 2016-06-03 11:54 Jose
  2016-06-03 14:43 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Jose @ 2016-06-03 11:54 UTC (permalink / raw)
  To: linux-perf-users

Hi all,

I need lot of IPC values for a given program execution. I can use "perf stat":

perf stat -I 10 -e cycles,instructions <program>   

and I can calculate IPC from cycles and instructions.

           time             counts unit events
     0.100137436        163.924.770      cycles
     0.100137436         77.957.069      instructions
     0.200370555        250.248.467      cycles
     0.200370555        124.686.255      instructions
     0.300493502        260.316.390      cycles
     0.300493502        467.691.086      instructions
     0.400623447        260.334.219      cycles
     0.400623447        467.711.817      instructions
     0.500922368        389.205.220      cycles
     0.500922368        689.460.813      instructions
     0.601220080      3.229.694.697      cycles
     0.601220080      6.415.412.796      instructions
      .....

The problem is that the frequency is very limited for my purposes (interval
must be >= 100ms)

It seems that "perf record" can help me:

perf record -F 10000 -e cycles,instructions <ejecutable>    (-F allows
greater frequencies)

My problem now is that I don't know how to obtain "cycles" and
"instructions" from perf.data file. I have tried several options using "perf
report" and "perf script" but I don't achieve it.

Thanks

Jose

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: IPC sampling
  2016-06-03 11:54 IPC sampling Jose
@ 2016-06-03 14:43 ` Andi Kleen
  2016-06-03 15:23   ` Jose
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2016-06-03 14:43 UTC (permalink / raw)
  To: Jose; +Cc: linux-perf-users

Jose <jose.sgarcia.aldonza@gmail.com> writes:
>
> My problem now is that I don't know how to obtain "cycles" and
> "instructions" from perf.data file. I have tried several options using "perf
> report" and "perf script" but I don't achieve it.

perf record -e '{instructions,cycles}:S' ...
perf script

This means sample on cycles, but always read instructions too during the sample.
Then match up the values with the same time stamp from perf script and
calculate ipc, or use a perf script interpreted script to do so.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: IPC sampling
  2016-06-03 14:43 ` Andi Kleen
@ 2016-06-03 15:23   ` Jose
  0 siblings, 0 replies; 3+ messages in thread
From: Jose @ 2016-06-03 15:23 UTC (permalink / raw)
  To: linux-perf-users

Andi Kleen <andi <at> firstfloor.org> writes:

> 
> Jose <jose.sgarcia.aldonza <at> gmail.com> writes:
> >
> > My problem now is that I don't know how to obtain "cycles" and
> > "instructions" from perf.data file. I have tried several options using "perf
> > report" and "perf script" but I don't achieve it.
> 
> perf record -e '{instructions,cycles}:S' ...
> perf script
> 
> This means sample on cycles, but always read instructions too during the
sample.
> Then match up the values with the same time stamp from perf script and
> calculate ipc, or use a perf script interpreted script to do so.
> 
> -Andi
> 


Good! 

Two additional questions:

- If using '{cycles,instructions}:S', is sampling on instructions? Sometimes
I'm interested to sample on number of instructions.

I don't find information about option :S from man pages. Is there a manual
with much more information?

- Could you provide more information (links, an example, ...) on "perf
script interpreted script"

Thanks
Jose

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-03 15:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-03 11:54 IPC sampling Jose
2016-06-03 14:43 ` Andi Kleen
2016-06-03 15:23   ` Jose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).