All of lore.kernel.org
 help / color / mirror / Atom feed
* perf record and intel_cqm/llc_occupancy
@ 2016-06-22 15:42 Omar Awile
  2016-06-23 20:53 ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Omar Awile @ 2016-06-22 15:42 UTC (permalink / raw)
  To: linux-perf-users; +Cc: Aram Santogidis

Dear perf users,

I have a question regarding perf’s support for Intel Cache Monitoring Technology. For the event intel_cqm/llc_occupancy, ‘perf stat’ works fine but ‘perf record’ does not. For example when I execute:

> perf record -e intel_cqm/llc_occupancy/ sleep 1

I get  

Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (intel_cqm/llc_occupancy/).
/bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?

but when I execute:

> perf stat -e intel_cqm/llc_occupancy/ sleep 1

I get

Performance counter stats for 'sleep 1':

   40,960.00 Bytes intel_cqm/llc_occupancy/
   
   1.001455067 seconds time elapsed


* My perf and kernel version is 4.6.2-1.el7.elrepo.x86_64.
* cat /proc/sys/kernel/perf_event_paranoid returns -1
* The CPU is the E5-2630 v4 2.20GHz “Broadwell”.

Is it possible that for intel_cqm/llc_occupancy interrupts are not supported? In that case it wouldn’t be more appropriate to return ENOTSUP instead of EINVAL?

Thanks a lot in advance,

Omar

--
Omar Awile, Ph.D.
Systems Performance Engineer
CERN - 513/R-046



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

* Re: perf record and intel_cqm/llc_occupancy
  2016-06-22 15:42 perf record and intel_cqm/llc_occupancy Omar Awile
@ 2016-06-23 20:53 ` Andi Kleen
  2016-06-24 12:27   ` Omar Awile
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2016-06-23 20:53 UTC (permalink / raw)
  To: Omar Awile; +Cc: linux-perf-users, Aram Santogidis

Omar Awile <omar.awile@cern.ch> writes:
>
> Is it possible that for intel_cqm/llc_occupancy interrupts are not
> supported?5A

Interrupts wouldn't be meaningful on these counters because they
don't count continuous events, but just report the current cache
occupancy. So yes.

You can use perf stat -I ... instead to get a time series.

-Andi

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

* Re: perf record and intel_cqm/llc_occupancy
  2016-06-23 20:53 ` Andi Kleen
@ 2016-06-24 12:27   ` Omar Awile
  2016-06-24 16:43     ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Omar Awile @ 2016-06-24 12:27 UTC (permalink / raw)
  To: linux-perf-users; +Cc: Andi Kleen, Aram Santogidis

Hi Andi,

Thanks, I see your point. I’ve seen tried perf stat for these events, which is quite nice. However, we would like to be able to correlate the cache occupancy with the current call stack. I don’t see how this could be done with perf stat. Is there a way to do this?

Alternatively, since perf record already keeps track of the call stack, is it feasible to extend it to allow recording cache occupancy, or is this inherently impossible?

Finally, if none of the two alternatives work, do you have an idea how else this could be achieved?

Thanks!

Omar

PS. sorry for repost...

On 23 June 2016 at 22:53:43, Andi Kleen (andi@firstfloor.org(mailto:andi@firstfloor.org)) wrote:

> Omar Awile writes:
> >
> > Is it possible that for intel_cqm/llc_occupancy interrupts are not
> > supported?5A
>  
> Interrupts wouldn't be meaningful on these counters because they
> don't count continuous events, but just report the current cache
> occupancy. So yes.
>  
> You can use perf stat -I ... instead to get a time series.
>  
> -Andi

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

* Re: perf record and intel_cqm/llc_occupancy
  2016-06-24 12:27   ` Omar Awile
@ 2016-06-24 16:43     ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2016-06-24 16:43 UTC (permalink / raw)
  To: Omar Awile; +Cc: linux-perf-users, Andi Kleen, Aram Santogidis, kan.liang

On Fri, Jun 24, 2016 at 12:27:27PM +0000, Omar Awile wrote:
> Hi Andi,
> 
> Thanks, I see your point. I’ve seen tried perf stat for these events, which is quite nice. However, we would like to be able to correlate the cache occupancy with the current call stack. I don’t see how this could be done with perf stat. Is there a way to do this?

perf stat cannot collect call graphs.

> 
> Alternatively, since perf record already keeps track of the call stack, is it feasible to extend it to allow recording cache occupancy, or is this inherently impossible?

perf can collect counts while sampling another event (called leader
sampling using :S). Unfortunately this does not work with events from
different PMUs, which would be needed here. Kan looked into this
some time ago, but there were too many problems with it.

> 
> Finally, if none of the two alternatives work, do you have an idea how else this could be achieved?

For now the only way would be to sample and perf stat record in parallel
and then merge the data based on the time stamps. It likely will not
be very accurate.

-Andi

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-22 15:42 perf record and intel_cqm/llc_occupancy Omar Awile
2016-06-23 20:53 ` Andi Kleen
2016-06-24 12:27   ` Omar Awile
2016-06-24 16:43     ` Andi Kleen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.