mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* perf: rdpmc mmap page time_enabled issue
@ 2017-03-15  3:41 Vince Weaver
  2017-03-17 14:37 ` perf: negative " Vince Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Vince Weaver @ 2017-03-15  3:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo


So another obscure rdpmc problem, turned up by the PAPI regression tests.

If you use rdpmc, and your event is attached measuring another process,
and then you ENABLE/DISABLE/ENABLE/rdpmc the event

somehow the userpg->time_enabled field gets a weird value and that 
completely confuses code expecting enabled!=running to mean multiplexing 
is happening.

Example:

Trying attach:
	* RDPMC 1 Event 0 -- count: 1058381 enabled ffe6935332c70240 running: 9d14f
	* RDPMC 1 Event 1 -- count: 623980 enabled ffe6935332c829b3 running: 9d350

the rdpmc count and running values are expected, but the enabled value is way 
off, it should match the running value.

If you want to test this out, I have a test case in perf_event_tests, 
(github.com/deater/perf_event_tests.git)
	tests/rdpmc/rdpmc_multiattach_papi

Vince

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

* Re: perf: negative time_enabled issue
  2017-03-15  3:41 perf: rdpmc mmap page time_enabled issue Vince Weaver
@ 2017-03-17 14:37 ` Vince Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Vince Weaver @ 2017-03-17 14:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo

On Tue, 14 Mar 2017, Vince Weaver wrote:

> So another obscure rdpmc problem, turned up by the PAPI regression tests.
> 
> If you use rdpmc, and your event is attached measuring another process,
> and then you ENABLE/DISABLE/ENABLE/rdpmc the event
> 
> somehow the userpg->time_enabled field gets a weird value and that 
> completely confuses code expecting enabled!=running to mean multiplexing 
> is happening.

Still working on this issue.  It turns out it's not rdpmc specific, you 
can see it with a regular read() too.

So far I've traced it back far enough to see that shadow_ctx_time is 
ending up negative for some reason if you do an enable/disable/enable on 
an event attached to another process.  I'm trying to trace it back further 
but it's a slow process.

Vince

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

end of thread, other threads:[~2017-03-17 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15  3:41 perf: rdpmc mmap page time_enabled issue Vince Weaver
2017-03-17 14:37 ` perf: negative " Vince Weaver

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

all inboxes | Powered by JetHome®