Re: perf: rdpmc and PERF_EVENT_IOC_RESET

2016-08-17 Thread Vince Weaver
On Wed, 17 Aug 2016, Peter Zijlstra wrote: > Hurm.. I never considered using RESET with rdpmc(). The typical usage of > rdpmc() I considered is something like: I'm finally trying to hook up PAPI to properly use rdpmc and PAPI likes to use IOC_RESET in various places. I can just special case to

Re: perf: rdpmc and PERF_EVENT_IOC_RESET

2016-08-17 Thread Vince Weaver
On Wed, 17 Aug 2016, Peter Zijlstra wrote: > Hurm.. I never considered using RESET with rdpmc(). The typical usage of > rdpmc() I considered is something like: I'm finally trying to hook up PAPI to properly use rdpmc and PAPI likes to use IOC_RESET in various places. I can just special case to

Re: perf: rdpmc and PERF_EVENT_IOC_RESET

2016-08-17 Thread Peter Zijlstra
On Wed, Aug 17, 2016 at 12:53:01AM -0400, Vince Weaver wrote: > Hello > > so using rdpmc() and the mmap page to do fast perf_event reads seems to > interact poorly with the PERF_EVENT_IOC_RESET ioctl. Hurm.. I never considered using RESET with rdpmc(). The typical usage of rdpmc() I considered

Re: perf: rdpmc and PERF_EVENT_IOC_RESET

2016-08-17 Thread Peter Zijlstra
On Wed, Aug 17, 2016 at 12:53:01AM -0400, Vince Weaver wrote: > Hello > > so using rdpmc() and the mmap page to do fast perf_event reads seems to > interact poorly with the PERF_EVENT_IOC_RESET ioctl. Hurm.. I never considered using RESET with rdpmc(). The typical usage of rdpmc() I considered

perf: rdpmc and PERF_EVENT_IOC_RESET

2016-08-16 Thread Vince Weaver
Hello so using rdpmc() and the mmap page to do fast perf_event reads seems to interact poorly with the PERF_EVENT_IOC_RESET ioctl. >From what I can tell, on reset event->count is set to zero, but event->hw.prev_count is not, so the userpg->offset field ends up negative and weird things

perf: rdpmc and PERF_EVENT_IOC_RESET

2016-08-16 Thread Vince Weaver
Hello so using rdpmc() and the mmap page to do fast perf_event reads seems to interact poorly with the PERF_EVENT_IOC_RESET ioctl. >From what I can tell, on reset event->count is set to zero, but event->hw.prev_count is not, so the userpg->offset field ends up negative and weird things