public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* perf_counters issue with PERF_SAMPLE_GROUP
@ 2009-08-11 15:41 stephane eranian
  2009-08-11 16:05 ` Peter Zijlstra
  0 siblings, 1 reply; 13+ messages in thread
From: stephane eranian @ 2009-08-11 15:41 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Andrew Morton, Thomas Gleixner, Robert Richter,
	Peter Zijlstra, Paul Mackerras, Andi Kleen, Maynard Johnson,
	Carl Love, Corey J Ashford, Philip Mucci, Dan Terpstra,
	perfmon2-devel

Hi,

It seems to me there is a problem with the group counter values
when you use PERF_SAMPLE_GROUP. The counts are bogus
for all events.

Test case is pretty simple:
    - single group, 2 events
    - sampling on PERF_COUNT_HW_CYCLES
    - other event is PERF_COUNT_HW_CYCLES
    - leader has SAMPLE_IP|SAMPLE_GROUP
    - no inheritance
    - single thread
    - using sampling in one shot mode with PERF_COUNTER_IOC_REFRESH
    - all events but leader start with disabled = 0 (i.e., enabled)
    - sampling period is 240000000 (cycles)

Notification 1: ip=0x401300  39100608 PERF_COUNT_HW_CPU_CYCLES (12)
Notification 2: ip=0x401300  17991616 PERF_COUNT_HW_CPU_CYCLES (12)
Notification 3: ip=0x401300  17981248 PERF_COUNT_HW_CPU_CYCLES (12)
Notification 4: ip=0x401300  9409478912 PERF_COUNT_HW_CPU_CYCLES (12)

I would expect the value for the 2nd event to be close to 240000000.
But instead,
it is going up and down. The IP, nr and id (12) fields are correct, so
the parsing of
the buffer is correct. This is with the latest from Linus's 2.6.31-rc5.


Related to PERF_SAMPLE_GROUP, I believe there is some information missing.
You need to provide the TIMING information because in the case of SAMPLE_GROUP
you'd like to be able to scale the values of the counters you are
collecting. And you
need the timing at the moment, the sample was recorded not later.

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

end of thread, other threads:[~2009-08-13 23:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11 15:41 perf_counters issue with PERF_SAMPLE_GROUP stephane eranian
2009-08-11 16:05 ` Peter Zijlstra
2009-08-11 19:40   ` stephane eranian
2009-08-11 20:55     ` Peter Zijlstra
2009-08-11 21:08       ` stephane eranian
2009-08-12  8:32         ` Peter Zijlstra
2009-08-12  9:02           ` Ingo Molnar
2009-08-12 12:22             ` stephane eranian
2009-08-13  9:46               ` Ingo Molnar
2009-08-13 19:15                 ` stephane eranian
2009-08-13 23:13                   ` Corey Ashford
2009-08-13 23:49           ` Paul Mackerras
2009-08-12 20:54       ` stephane eranian

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